Territories
rigour.territories
Political geography
This module provides a set of classes and functions to work with countries, territories and jurisdictions. It is based on the notion that a territory is any political entity that may be referred to by a code, such as a country, a territory or a jurisdiction. Jurisdictions are most countries, but also sub-national entities like states, especially if they have their own legal incorporation regime.
For all territories, mappings to Wikidata QIDs are provided, as well as a set of other codes that may be used to refer to the same territory. The module also provides a set of functions to retrieve territories by their codes or QIDs.
get_ftm_countries()
Get all the countries that were supported by the FtM country
property type.
Returns:
Type | Description |
---|---|
List[Territory]
|
A list of territories. |
Source code in rigour/territories/__init__.py
get_territories()
cached
Get all the territories in the index.
Returns:
Type | Description |
---|---|
List[Territory]
|
A list of territories. |
get_territory(code)
Get a territory object for the given code.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
code
|
str
|
Country, territory or jurisdiction code. |
required |
Returns:
Type | Description |
---|---|
Optional[Territory]
|
A territory object. |
Source code in rigour/territories/__init__.py
get_territory_by_qid(qid)
cached
Get a territory object for the given Wikidata QID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qid
|
str
|
Wikidata QID. |
required |
Returns:
Type | Description |
---|---|
Optional[Territory]
|
A territory object. |