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` No
__v `integer null` No
name `string null` No
code `string null` No
money `number null` No
scheme `string null` No
mapAccent `string null` No
discordUrl `string null` No
specializedItem `string null` No
pinnedArticle `string null` No
currentBattleOrder `string null` No
rulingParty `string null` No
allianceId `string null` No
enemy `string null` No
allies `array null` No
warsWith `array null` No
defensivePacts `array null` No
orgs `array null` No
nonAggressionUntil `object null` No
development `number null` No
currentDevelopment `number null` No
averageDevelopment `number null` No
coreDevelopment `number null` No
currentPopulation `integer null` No
taxes `CountryTaxes null` No
unrest `CountryUnrest null` No
strategicResources `CountryStrategicResources null` No
rankings `CountryRankings null` No
createdAt `string null` No
updatedAt `string null` No

CountryRankings

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

CountryStrategicBonuses

Field Type Required Description
_id `string null` No
__v `integer null` No
productionPercent `number null` No
developmentPercent `number null` No

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id `string null` No
__v `integer null` No
coal `array null` No
diamonds `array null` No
gold `array null` No
lithium `array null` No
rareEarths `array null` No
uranium `array null` No

CountryStrategicResources

Field Type Required Description
_id `string null` No
__v `integer null` No
resources `CountryStrategicResourceMap null` No
bonuses `CountryStrategicBonuses null` No

CountryTaxes

Field Type Required Description
_id `string null` No
__v `integer null` No
income `number null` No
market `number null` No
selfWork `number null` No

CountryUnrest

Field Type Required Description
_id `string null` No
__v `integer null` No
bar `number null` No
barMax `number null` No
lastContributionAt `string null` No

RankingDetail

Field Type Required Description
_id `string null` No
__v `integer null` No
value `number null` No
rank `integer null` No
tier `string null` No
country `string null` No

.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` No
__v `integer null` No
name `string null` No
code `string null` No
money `number null` No
scheme `string null` No
mapAccent `string null` No
discordUrl `string null` No
specializedItem `string null` No
pinnedArticle `string null` No
currentBattleOrder `string null` No
rulingParty `string null` No
allianceId `string null` No
enemy `string null` No
allies `array null` No
warsWith `array null` No
defensivePacts `array null` No
orgs `array null` No
nonAggressionUntil `object null` No
development `number null` No
currentDevelopment `number null` No
averageDevelopment `number null` No
coreDevelopment `number null` No
currentPopulation `integer null` No
taxes `CountryTaxes null` No
unrest `CountryUnrest null` No
strategicResources `CountryStrategicResources null` No
rankings `CountryRankings null` No
createdAt `string null` No
updatedAt `string null` No

CountryRankings

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

CountryStrategicBonuses

Field Type Required Description
_id `string null` No
__v `integer null` No
productionPercent `number null` No
developmentPercent `number null` No

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id `string null` No
__v `integer null` No
coal `array null` No
diamonds `array null` No
gold `array null` No
lithium `array null` No
rareEarths `array null` No
uranium `array null` No

CountryStrategicResources

Field Type Required Description
_id `string null` No
__v `integer null` No
resources `CountryStrategicResourceMap null` No
bonuses `CountryStrategicBonuses null` No

CountryTaxes

Field Type Required Description
_id `string null` No
__v `integer null` No
income `number null` No
market `number null` No
selfWork `number null` No

CountryUnrest

Field Type Required Description
_id `string null` No
__v `integer null` No
bar `number null` No
barMax `number null` No
lastContributionAt `string null` No

RankingDetail

Field Type Required Description
_id `string null` No
__v `integer null` No
value `number null` No
rank `integer null` No
tier `string null` No
country `string null` No

.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` No
__v `integer null` No
name `string null` No
code `string null` No
money `number null` No
scheme `string null` No
mapAccent `string null` No
discordUrl `string null` No
specializedItem `string null` No
pinnedArticle `string null` No
currentBattleOrder `string null` No
rulingParty `string null` No
allianceId `string null` No
enemy `string null` No
allies `array null` No
warsWith `array null` No
defensivePacts `array null` No
orgs `array null` No
nonAggressionUntil `object null` No
development `number null` No
currentDevelopment `number null` No
averageDevelopment `number null` No
coreDevelopment `number null` No
currentPopulation `integer null` No
taxes `CountryTaxes null` No
unrest `CountryUnrest null` No
strategicResources `CountryStrategicResources null` No
rankings `CountryRankings null` No
createdAt `string null` No
updatedAt `string null` No

CountryRankings

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

CountryStrategicBonuses

Field Type Required Description
_id `string null` No
__v `integer null` No
productionPercent `number null` No
developmentPercent `number null` No

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id `string null` No
__v `integer null` No
coal `array null` No
diamonds `array null` No
gold `array null` No
lithium `array null` No
rareEarths `array null` No
uranium `array null` No

CountryStrategicResources

Field Type Required Description
_id `string null` No
__v `integer null` No
resources `CountryStrategicResourceMap null` No
bonuses `CountryStrategicBonuses null` No

CountryTaxes

Field Type Required Description
_id `string null` No
__v `integer null` No
income `number null` No
market `number null` No
selfWork `number null` No

CountryUnrest

Field Type Required Description
_id `string null` No
__v `integer null` No
bar `number null` No
barMax `number null` No
lastContributionAt `string null` No

RankingDetail

Field Type Required Description
_id `string null` No
__v `integer null` No
value `number null` No
rank `integer null` No
tier `string null` No
country `string null` No

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

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

Clone this wiki locally