Skip to content

Resource CountryResource

CrucifiedPain edited this page Jun 26, 2026 · 9 revisions

CountryResource (client.country)

Endpoints: • country.getCountryById • country.getAllCountries

.find_by_name()

Client-side helper: return the country matching name (case-insensitive).

Returns None if no country with that name exists.

Signature

await client.country.find_by_name(name: 'str') -> 'Country | None'

Parameters

Name Type Default
name str *Required*

Return Models

Country

Field Type Required Description
_id string \| null
__v integer \| null
name string \| null
code string \| null
money number \| null
scheme string \| null
mapAccent string \| null
discordUrl string \| null
specializedItem string \| null
pinnedArticle string \| null
currentBattleOrder string \| null
rulingParty string \| null
allianceId string \| null
enemy string \| null
allies array[string] \| null
warsWith array[string] \| null
defensivePacts array[string] \| null
orgs array[string] \| null
nonAggressionUntil object \| null
development number \| null
currentDevelopment number \| null
averageDevelopment number \| null
coreDevelopment number \| null
currentPopulation integer \| null
taxes CountryTaxes \| null
unrest CountryUnrest \| null
strategicResources CountryStrategicResources \| null
rankings CountryRankings \| null
createdAt string \| null
updatedAt string \| null

CountryRankings

Field Type Required Description
_id string \| null
__v integer \| null
countryRegionDiff RankingDetail \| null
countryDamages RankingDetail \| null
weeklyCountryDamages RankingDetail \| null
weeklyCountryDamagesPerCitizen RankingDetail \| null
countryDevelopment RankingDetail \| null
countryActivePopulation RankingDetail \| null
countryWealth RankingDetail \| null
countryBounty RankingDetail \| null
countryProductionBonus RankingDetail \| null

CountryStrategicBonuses

Field Type Required Description
_id string \| null
__v integer \| null
productionPercent number \| null
developmentPercent number \| null

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id string \| null
__v integer \| null
coal array[string] \| null
diamonds array[string] \| null
gold array[string] \| null
lithium array[string] \| null
rareEarths array[string] \| null
uranium array[string] \| null

CountryStrategicResources

Field Type Required Description
_id string \| null
__v integer \| null
resources CountryStrategicResourceMap \| null
bonuses CountryStrategicBonuses \| null

CountryTaxes

Field Type Required Description
_id string \| null
__v integer \| null
income number \| null
market number \| null
selfWork number \| null

CountryUnrest

Field Type Required Description
_id string \| null
__v integer \| null
bar number \| null
barMax number \| null
lastContributionAt string \| null

RankingDetail

Field Type Required Description
_id string \| null
__v integer \| null
value number \| null
rank integer \| null
tier string \| null
country string \| null

.get()

Get a single country by ID.

Signature

await client.country.get(country_id: 'str') -> 'Country'

Parameters

Name Type Default
country_id str *Required*

Return Models

Country

Field Type Required Description
_id string \| null
__v integer \| null
name string \| null
code string \| null
money number \| null
scheme string \| null
mapAccent string \| null
discordUrl string \| null
specializedItem string \| null
pinnedArticle string \| null
currentBattleOrder string \| null
rulingParty string \| null
allianceId string \| null
enemy string \| null
allies array[string] \| null
warsWith array[string] \| null
defensivePacts array[string] \| null
orgs array[string] \| null
nonAggressionUntil object \| null
development number \| null
currentDevelopment number \| null
averageDevelopment number \| null
coreDevelopment number \| null
currentPopulation integer \| null
taxes CountryTaxes \| null
unrest CountryUnrest \| null
strategicResources CountryStrategicResources \| null
rankings CountryRankings \| null
createdAt string \| null
updatedAt string \| null

CountryRankings

Field Type Required Description
_id string \| null
__v integer \| null
countryRegionDiff RankingDetail \| null
countryDamages RankingDetail \| null
weeklyCountryDamages RankingDetail \| null
weeklyCountryDamagesPerCitizen RankingDetail \| null
countryDevelopment RankingDetail \| null
countryActivePopulation RankingDetail \| null
countryWealth RankingDetail \| null
countryBounty RankingDetail \| null
countryProductionBonus RankingDetail \| null

CountryStrategicBonuses

Field Type Required Description
_id string \| null
__v integer \| null
productionPercent number \| null
developmentPercent number \| null

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id string \| null
__v integer \| null
coal array[string] \| null
diamonds array[string] \| null
gold array[string] \| null
lithium array[string] \| null
rareEarths array[string] \| null
uranium array[string] \| null

CountryStrategicResources

Field Type Required Description
_id string \| null
__v integer \| null
resources CountryStrategicResourceMap \| null
bonuses CountryStrategicBonuses \| null

CountryTaxes

Field Type Required Description
_id string \| null
__v integer \| null
income number \| null
market number \| null
selfWork number \| null

CountryUnrest

Field Type Required Description
_id string \| null
__v integer \| null
bar number \| null
barMax number \| null
lastContributionAt string \| null

RankingDetail

Field Type Required Description
_id string \| null
__v integer \| null
value number \| null
rank integer \| null
tier string \| null
country string \| null

.get_all()

Get all countries. Returns a dict keyed by country ID for O(1) lookups.

Signature

await client.country.get_all() -> 'dict[str, Country]'

Return Models

Country

Field Type Required Description
_id string \| null
__v integer \| null
name string \| null
code string \| null
money number \| null
scheme string \| null
mapAccent string \| null
discordUrl string \| null
specializedItem string \| null
pinnedArticle string \| null
currentBattleOrder string \| null
rulingParty string \| null
allianceId string \| null
enemy string \| null
allies array[string] \| null
warsWith array[string] \| null
defensivePacts array[string] \| null
orgs array[string] \| null
nonAggressionUntil object \| null
development number \| null
currentDevelopment number \| null
averageDevelopment number \| null
coreDevelopment number \| null
currentPopulation integer \| null
taxes CountryTaxes \| null
unrest CountryUnrest \| null
strategicResources CountryStrategicResources \| null
rankings CountryRankings \| null
createdAt string \| null
updatedAt string \| null

CountryRankings

Field Type Required Description
_id string \| null
__v integer \| null
countryRegionDiff RankingDetail \| null
countryDamages RankingDetail \| null
weeklyCountryDamages RankingDetail \| null
weeklyCountryDamagesPerCitizen RankingDetail \| null
countryDevelopment RankingDetail \| null
countryActivePopulation RankingDetail \| null
countryWealth RankingDetail \| null
countryBounty RankingDetail \| null
countryProductionBonus RankingDetail \| null

CountryStrategicBonuses

Field Type Required Description
_id string \| null
__v integer \| null
productionPercent number \| null
developmentPercent number \| null

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id string \| null
__v integer \| null
coal array[string] \| null
diamonds array[string] \| null
gold array[string] \| null
lithium array[string] \| null
rareEarths array[string] \| null
uranium array[string] \| null

CountryStrategicResources

Field Type Required Description
_id string \| null
__v integer \| null
resources CountryStrategicResourceMap \| null
bonuses CountryStrategicBonuses \| null

CountryTaxes

Field Type Required Description
_id string \| null
__v integer \| null
income number \| null
market number \| null
selfWork number \| null

CountryUnrest

Field Type Required Description
_id string \| null
__v integer \| null
bar number \| null
barMax number \| null
lastContributionAt string \| null

RankingDetail

Field Type Required Description
_id string \| null
__v integer \| null
value number \| null
rank integer \| null
tier string \| null
country string \| null

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

await client.country.invalidate_cache() -> 'None'

Clone this wiki locally