API Reference

sync

pnwkit.ext.scrape.sync.alliance_bank_withdraw(email: str, password: str, alliance_id: int, receiver: str, receiver_type: Literal[alliance, nation], note: Optional[str] = None, **resources: Union[int, float, str])bool

Send money from an alliance bank.

Parameters
  • email (str) – The email of the account to use.

  • password (str) – The password of the account to use.

  • alliance_id (int) – The alliance ID to send from.

  • receiver (str) – The receiver of the withdrawal, must be a nation or alliance name.

  • receiver_type (Literal["alliance", "nation"]) – The type of receiver, either “alliance” or “nation”.

  • note (Optional[str], optional) – The note to send with the withdrawal, by default no note is sent.

  • **resources (Union[int, float, str]) – The resources to send, specified as kwargs. (i.e. money=100)

Returns

Whether or not the withdrawal was successful.

Return type

bool

pnwkit.ext.scrape.sync.scrape_discord_username(nation_id: int, /)Optional[str]

Scrape a nation page for the discord username

Parameters

nation_id (int) – The nation ID to scrape.

Returns

The discord username, or None if not found.

Return type

Optional[str]

pnwkit.ext.scrape.sync.scrape_treaties(alliance_id: int, /)List[TreatyData]

Scrape the treaties of an alliance.

Parameters

alliance_id (int) – The alliance ID of the alliance to scrape

Returns

A list of treaties, each treaty is a dict with the keys “from_”, “to_”, and “treaty_type”.

Return type

List[TreatyData]

pnwkit.ext.scrape.sync.scrape_treaty_web()List[TreatyData]

Scrape the treaty web

Returns

A list of treaties, each treaty is a dict with the keys “from_”, “to_”, and “treaty_type”.

Return type

List[TreatyData]

async

async pnwkit.ext.scrape.async_.async_alliance_bank_withdraw(email: str, password: str, alliance_id: int, receiver: str, receiver_type: Literal[alliance, nation], note: Optional[str] = None, **resources: Union[int, float, str])bool

Send money from an alliance bank.

Parameters
  • email (str) – The email of the account to use.

  • password (str) – The password of the account to use.

  • alliance_id (int) – The alliance ID to send from.

  • receiver (str) – The receiver of the withdrawal, must be a nation or alliance name.

  • receiver_type (Literal["alliance", "nation"]) – The type of receiver, either “alliance” or “nation”.

  • note (Optional[str], optional) – The note to send with the withdrawal, by default no note is sent.

  • **resources (Union[int, float, str]) – The resources to send, specified as kwargs. (i.e. money=100)

Returns

Whether or not the withdrawal was successful.

Return type

bool

async pnwkit.ext.scrape.async_.async_scrape_discord_username(nation_id: int, /)Optional[str]

Scrape a nation page for the discord username

Parameters

nation_id (int) – The nation ID to scrape.

Returns

The discord username, or None if not found.

Return type

Optional[str]

async pnwkit.ext.scrape.async_.async_scrape_treaties(alliance_id: int, /)List[TreatyData]

Scrape the treaties of an alliance.

Parameters

alliance_id (int) – The alliance ID of the alliance to scrape

Returns

A list of treaties, each treaty is a dict with the keys “from_”, “to_”, and “treaty_type”.

Return type

List[TreatyData]

async pnwkit.ext.scrape.async_.async_scrape_treaty_web()List[TreatyData]

Scrape the treaty web

Returns

A list of treaties, each treaty is a dict with the keys “from_”, “to_”, and “treaty_type”.

Return type

List[TreatyData]