Data Reference

Note

The following documents every data class modelled by the library and all its potential attributes, it will only have the attributes queried, attempting to access unqueried (and therefore non-existent) attributes will result in it raising an AttributeError or a KeyError depending on the context.

Alliance

class pnwkit.data.Alliance(data: Mapping[str, Any])

Represents an alliance.

id

The alliance ID.

Type

str

name

The alliance name.

Type

str

acronym

The alliance acronym.

Type

str

score

The alliance score.

Type

float

color

The alliance color.

Type

str

nations

The alliance’s members.

Type

Sequence[Nation]

acceptmem

Whether the alliance is accepting members or not.

Type

bool

flag

The alliance flag URL.

Type

str

The alliance forum link.

Type

str

The alliance Discord link.

Type

str

bankrecs

Sequence containing the alliance’s bank records. Will be None if the querying key cannot view the alliance bank.

Type

Sequence[Bankrec]

taxrecs

Sequence containing the alliance’s tax records. Will be None if the querying key cannot view the alliance bank.

Type

Sequence[Bankrec]

money

The current amount of money in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

coal

The current amount of coal in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

oil

The current amount of oil in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

uranium

The current amount of uranium in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

iron

The current amount of iron in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

bauxite

The current amount of bauxite in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

lead

The current amount of lead in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

gasoline

The current amount of gasoline in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

munitions

The current amount of munitions in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

steel

The current amount of steel in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

aluminum

The current amount of aluminum in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

food

The current amount of food in the alliance bank. Will be None if the querying key cannot view the alliance bank.

Type

float

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

Bankrec

class pnwkit.data.Bankrec(data: Mapping[str, Any])

Represents a bank record.

id

The bank record ID.

Type

str

date

The date the transaction was completed.

Type

str

sid

The ID of the sender.

Type

str

stype

The type of the sender. 1 corresponds to a Nation and 2 corresponds to a Alliance.

Type

int

rid

The ID of the receiver.

Type

str

rtype

The type of the receiver. 1 corresponds to a Nation and 2 corresponds to a Alliance

Type

int

pid

The nation ID of the banker.

Type

str

note

The transaction note.

Type

str

money

The money sent in the transaction.

Type

float

coal

The coal sent in the transaction.

Type

float

oil

The oil sent in the transaction.

Type

float

uranium

The uranium sent in the transaction.

Type

float

iron

The iron sent in the transaction.

Type

float

bauxite

The bauxite sent in the transaction.

Type

float

lead

The lead sent in the transaction.

Type

float

gasoline

The gasoline sent in the transaction.

Type

float

munitions

The munitions sent in the transaction.

Type

float

steel

The steel sent in the transaction.

Type

float

aluminum

The aluminum sent in the transaction.

Type

float

food

The food sent in the transaction.

Type

float

tax_id

The ID of the tax bracker.

Type

str

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

City

class pnwkit.data.City(data: Mapping[str, Any])

Represents a city.

id

The city ID.

Type

str

name

The city name.

Type

str

date

The date the city was created.

Type

str

infrastructure

The amount of infrastructure in the city.

Type

float

land

The amount of land in the city.

Type

float

powered

Whether the city is powered or not.

Type

bool

oilpower

The amount of Oil Power Plants in the city.

Type

int

windpower

The amount of Wind Power Plants in the city.

Type

int

coalpower

The amount of Coal Power Plants in the city.

Type

int

nuclearpower

The amount of Nuclear Power Plants in the city.

Type

int

coalmine

The amount of Coal Mines in the city.

Type

int

oilwell

The amount of Oil Wells in the city.

Type

int

uramine

The amount of Uranium Mines in the city.

Type

int

barracks

The amount of Barracks in the city.

Type

int

farm

The amount of Farms in the city.

Type

int

policestation

The amount of Police Stations in the city.

Type

int

hospital

The amount of Hospitals in the city.

Type

int

recyclingcenter

The amount of Recycling Centers in the city.

Type

int

subway

The amount of Subways in the city.

Type

int

supermarket

The amount of Supermarkets in the city.

Type

int

bank

The amount of Banks in the city.

Type

int

mall

The amount of Shopping Malls in the city.

Type

int

stadium

The amount of Stadiums in the city.

Type

int

leadmine

The amount of Lead Mines in the city.

Type

int

ironmine

The amount of Iron Mines in the city.

Type

int

bauxitemine

The amount of Bauxite Mines in the city.

Type

int

gasrefinery

The amount of Oil Refineries in the city.

Type

int

aluminumrefinery

The amount of Aluminum Refineries in the city.

Type

int

steelmill

The amount of Steel Mill in the city.

Type

int

munitionsfactory

The amount of Munitions Factories in the city.

Type

int

factory

The amount of Factories in the city.

Type

int

airforcebase

The amount of Hangars in the city.

Type

int

drydock

The amount of Drydocks in the city.

Type

int

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

Color

Methods
class pnwkit.data.Color(data: Mapping[str, Any])

Represents a color bloc.

color

The color.

Type

str

bloc_name

The color bloc name.

Type

str

turn_bonus

The color turn bonus.

Type

int

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

Nation

class pnwkit.data.Nation(data: Mapping[str, Any])

Represents a nation.

id

The nation ID.

Type

str

alliance_id

The nation’s alliance ID.

Type

str

alliance_position

The nation’s alliance position.

Type

str

alliance

The nation’s alliance.

Type

Alliance

nation_name

The nation name.

Type

str

leader_name

The nation’s leader name.

Type

str

continent

The nation’s continent.

Type

str

warpolicy

The nation’s war policy.

Type

str

dompolicy

The nation’s domestic policy.

Type

str

color

The nation’s color

Type

str

num_cities

The number of cities the nation has.

Type

int

cities

The nation’s cities.

Type

Sequence[City]

score

The nation’s score.

Type

float

population

The nation’s population.

Type

int

flag

The nation’s flag.

Type

str

vmode

The number of turns the nation has in Vacation Mode.

Type

int

beigeturns

The number of turns the nation has on Beige.

Type

int

espionage_available

Whether the nation has espionage available or not.

Type

bool

last_active

When the nation was last active.

Type

str

date

When the nation was created.

Type

str

soldiers

The amount of soldiers the nation has.

Type

int

tanks

The amount of tanks the nation has.

Type

int

aircraft

The amount of aircraft the nation has.

Type

int

ships

The amount of ships the nation has.

Type

int

missiles

The amount of missiles the nation has.

Type

int

nukes

The amount of nukes the nation has.

Type

int

treasures

The treasures a nation has.

Type

Sequence[Treasure]

offensive_wars

The offensive wars the nation is involved in.

Type

Sequence[War]

defensive_wars

The defensive wars the nation is involved in.

Type

Sequence[War]

sent_bankrecs

The sent bank records of the nation.

Type

Sequence[Bankrec]

received_bankrecs

The received bank records of the nation.

Type

Sequence[Bankrec]

money

The amount of money the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

coal

The amount of coal the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

oil

The amount of oil the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

uranium

The amount of uranium the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

iron

The amount of iron the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

bauxite

The amount of bauxite the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

lead

The amount of lead the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

gasoline

The amount of gasoline the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

munitions

The amount of munitions the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

steel

The amount of steel the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

aluminum

The amount of aluminum the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

food

The amount of food the nation has. Will return None if the querying key cannot see the nation’s bank.

Type

float

projects

The number of projects the nation has.

Type

int

ironw

Whether the nation has the Ironworks project or not.

Type

bool

bauxitew

Whether the nation has the Bauxiteworks project or not.

Type

bool

armss

Whether the nation has the Arms Stockpile project or not.

Type

bool

egr

Whether the nation has the Emergency Gasoline Reserve project or not.

Type

bool

massirr

Whether the nation has the Mass Irrigation project or not.

Type

bool

itc

Whether the nation has the International Trade Center project or not.

Type

bool

mlp

Whether the nation has the Missile Launch Pad project or not.

Type

bool

nrf

Whether the nation has the Nuclear Research Facility project or not.

Type

bool

irond

Whether the nation has the Iron Dome project or not.

Type

bool

vds

Whether the nation has the Vital Defense System project or not.

Type

bool

cia

Whether the nation has the Intelligence Agency project or not.

Type

bool

cfce

Whether the nation has the Center for Civil Engineering project or not.

Type

bool

propb

Whether the nation has the Propaganda Bureau project or not.

Type

bool

uap

Whether the nation has the Uranium Enrichment Program project or not.

Type

bool

city_planning

Whether the nation has the Urban Planning project or not.

Type

bool

adv_city_planning

Whether the nation has the Advanced Urban Planning project or not.

Type

bool

space_program

Whether the nation has the Space Program project or not.

Type

bool

spy_satellite

Whether the nation has the Spy Satellite project or not.

Type

bool

moon_landing

Whether the nation has the Moon Landing project or not.

Type

bool

pirate_economy

Whether the nation has the Pirate Economy project or not.

Type

bool

recycling_initiative

Whether the nation has the Recycling Initiative project or not.

Type

bool

telecom_satellite

Whether the nation has the Telecommunication Satellite project or not.

Type

bool

green_tech

Whether the nation has the Green Technologies project or not.

Type

bool

arable_land_agency

Whether the nation has the Arable Land Agency project or not.

Type

bool

clinical_research_center

Whether the nation has the Clinical Research Center project or not.

Type

bool

specialized_police_training

Whether the nation has the Specialized Police Training Program project or not.

Type

bool

adv_engineering_corps

Whether the nation has the Advanced Engineering Corps project or not.

Type

bool

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

Trade

class pnwkit.data.Trade(data: Mapping[str, Any])

Represents a trade

id

The trade ID.

Type

str

date

The date the trade took place.

Type

str

sid

The sender ID.

Type

str

rid

The receiver ID.

Type

str

sender

The sender’s nation.

Type

Nation

receiver

The receiver’s nation.

Type

Nation

offer_resource

The resource being offered.

Type

str

offer_amount

The amount being offered.

Type

int

buy_or_sell

Whether the offer was a buy or sell offer.

Type

str

total

The price per unit of the offer.

Type

int

accepted

Whether or not the offer has been accepted.

Type

bool

date_accepted

The date the offer was accepted.

Type

str

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

Tradeprice

class pnwkit.data.Tradeprice(data: Mapping[str, Any])

Represents a tradeprice.

id

The tradeprice ID.

Type

str

date

The date of the tradeprice.

Type

str

coal

The price of coal.

Type

float

oil

The price of oil.

Type

float

uranium

The price of uranium.

Type

float

iron

The price of iron.

Type

float

bauxite

The price of bauxite.

Type

float

lead

The price of lead.

Type

float

gasoline

The price of gasoline.

Type

float

munitions

The price of munitions.

Type

float

steel

The price of steel.

Type

float

aluminum

The price of aluminum.

Type

float

food

The price of food.

Type

float

credits

The price of credits.

Type

float

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

Treasure

class pnwkit.data.Treasure(data: Mapping[str, Any])

Represents a treasure.

name

The name of the treasure.

Type

str

color

The treasure’s color.

Type

str

continent

The treasure’s continent.

Type

str

bonus

The treasure’s bonus.

Type

int

spawndate

The treasure’s spawndate.

Type

str

nation

The nation that has the treasure.

Type

Nation

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

War

class pnwkit.data.War(data: Mapping[str, Any])

Represents a war.

id

The war ID.

Type

str

date

The date the war was declared.

Type

str

reason

The war reason.

Type

str

war_type

The war type.

Type

str

groundcontrol

The ID of the nation that has Ground Control.

Type

str

airsuperiority

The ID of the nation that has Air Superiority.

Type

str

navalblockade

The ID of the nation that has a Naval Blockade.

Type

str

winner

The ID of the winner of the war.

Type

str

attacks

The attacks in the war.

Type

Sequence[WarAttack]

turnsleft

The turns left in the war.

Type

int

attid

The attacker ID.

Type

str

att_alliance_id

The attacker’s alliance ID.

Type

str

attacker

The attacker’s nation.

Type

Nation

defid

The defender’s ID.

Type

str

def_alliance_id

The defender’s alliance ID.

Type

str

defender

The defender’s nation.

Type

Nation

attpoints

The attacker’s Military Action Points.

Type

int

defpoints

The defender’s Military Action Points.

Type

int

attpeace

Whether the attacker has offered peace or not.

Type

bool

defpeace

Whether the defender has offered peace or not.

Type

bool

att_resistance

The attacker’s resistance.

Type

int

def_resistance

The defender’s resistance.

Type

int

att_fortify

Whether the attacker has fortified or not.

Type

bool

def_fortify

Whether the defender has fortified or not.

Type

bool

att_gas_used

The amount of gasoline used by the attacker.

Type

float

def_gas_used

The amount of gasoline used by the defender.

Type

float

att_mun_used

The amount of munitions used by the attacker.

Type

float

def_mun_used

The amount of munitions used by the defender.

Type

float

att_alum_used

The amount of aluminum used by the attacker.

Type

int

def_alum_used

The amount of aluminum used by the defender.

Type

int

att_steel_used

The amount of steel used by the attacker.

Type

int

def_steel_used

The amount of steel used by the defender.

Type

int

att_infra_destroyed

The amount of infrastructure destroyed by the attacker.

Type

float

def_infra_destroyed

The amount of infrastructure destroyed by the defender.

Type

float

att_money_looted

The amount of money looted by the attacker.

Type

float

def_money_looted

The amount of money looted by the attacker.

Type

float

att_soldiers_killed

The amount of soldiers killed by the attacker.

Type

int

def_soldiers_killed

The amount of soldiers killed by the defender.

Type

int

att_tanks_killed

The amount of tanks killed by the attacker.

Type

int

def_tanks_killed

The amount of tanks killed by the defender.

Type

int

att_aircraft_killed

The amount of aircraft killed by the attacker.

Type

int

def_aircraft_killed

The amount of aircraft killed by the defender.

Type

int

att_ships_killed

The amount of ships killed by the attacker.

Type

int

def_ships_killed

The amount of ships killed by the defender.

Type

int

att_missiles_used

The amount of missiles used by the attacker.

Type

int

def_missiles_used

The amount of missiles killed by the defender.

Type

int

att_nukes_used

The amount of nukes used by the attacker.

Type

int

def_nukes_used

The amount of nukes killed by the defender.

Type

int

att_infra_destroyed_value

The value of infrastructure destroyed by the attacker.

Type

float

def_infra_destroyed_value

The value of infrastructure destroyed by the defender.

Type

float

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

WarAttack

class pnwkit.data.WarAttack(data: Mapping[str, Any])

Represents a war attack.

id

The attack ID.

Type

str

date

The date the attack took place.

Type

str

type

The attack type.

Type

str

victor

The victor of the attack.

Type

str

success

The attack’s level of success.

Type

int

attcas1

A special value depending on the attack.

Type

int

defcas1

A special value depending on the attack.

Type

int

attcas2

A special value depending on the attack.

Type

int

defcas2

A special value depending on the attack.

Type

int

cityid

The ID of the city that was attacked.

Type

str

infradestroyed

The amount of infrastructure destroyed.

Type

float

improvementslost

The amount of improvements destroyed.

Type

int

moneystolen

The amount of money stolen.

Type

float

loot_info

The loot info of the attack.

Type

str

resistance_eliminated

The amount of resistance eliminated.

Type

int

city_infra_before

The city’s infrastructure before the attack

Type

float

infra_destroyed_value

The value of infrastructure destroyed.

Type

float

att_mun_used

The amount of munitions used by the attacker.

Type

float

def_mun_used

The amount of munitions used by the defender.

Type

float

att_gas_used

The amount of gasoline used by the attacker.

Type

float

def_gas_used

The amount of gasoline used by the defender.

Type

float

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]

PaginatorInfo

class pnwkit.data.PaginatorInfo(data: Mapping[str, Any])

Represents paginator info

count

Count of items available on the page.

Type

int

currentPage

The current page number.

Type

int

firstItem

The index of the first item on the page.

Type

int

hasMorePages

Whether there are more pages or not.

Type

bool

lastItem

The index of the last item on the page.

Type

int

lastPage

The page number of the last page.

Type

int

perPage

The number of items per page.

Type

int

total

The total number of items.

Type

int

to_dict()Dict[str, Any]

Get a dict representation of this data.

Returns

A dictionary of the data on the object.

Return type

Dict[str, Any]