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.
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.