Skip to main content

A Python wrapper for the NationStates API

Project description

NaStyAPI - A NationState wrapper

PyPi status Documentation Status
!Note: This package is still highly in development and is really not recommended for public use yet!
A Python wrapper for the NationStates api.
Works with a rate limit so as not to exceed NationState's API's rate limit.
NaStyAPI only handles communication, it does not parse the result in any way! GitHub Link

Table of Contensts:

Installation

The package is available on PyPi! simply write:
pip install NaStyAPI

Documentation

Link to full documentation (in progress)

General Use

The NationState API is divided into parts, and so is the wrapper. The parts are:

  • Nation
  • Region
  • Telegrams
  • TradingCards
  • World
  • WorldAssembly

To use a part, simply write:

from NaStyAPI import Part

Warning

The wrapper is usable already, as you can see by the examples below. That, however, does not mean it's recommended to use. The wrapper is largely undocumented and is not yet great at managing errors. You can use it, but it's not going to be to pleasant.

Examples

Get a public shard on a nation

from NaStyAPI import Nation
Nation.get_shards("NATION_NAME",["SHARDS"])

Log in to your nation

from NaStyAPI import Nation
your_nation = Nation.Nation("NATION_NAME")
your_nation.log_password("YOUR_PASSWORD")

Access to private shards

your_nation.get_shards("YOUR_PRIVATE_SHARDS")

Write a dispatch using the api

new_dispatch = your_nation.do_command("dispatch", additional_params={"dispatch": "add", "title": "YOUR POST TITLE", "text": "DISPATCH TEXT", "category": "CATEGORY_NUM", "subcategory": "SUBCATEGORY_NUM"})

How to contribute

Thank you for looking at this! There isn't all that much to do yet, so the best you can do to help is to use it!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NaStyAPI-0.2.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NaStyAPI-0.2.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file NaStyAPI-0.2.1.tar.gz.

File metadata

  • Download URL: NaStyAPI-0.2.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for NaStyAPI-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fa8209da1c8dcd8abdef89b062ada2909c25cf85db0c5c51ad265ada30495d9b
MD5 c15e6e850b7727f3273e103767e7e329
BLAKE2b-256 06fa0f0a13ed559527614463b85818e2c94d2e55acfea3a24700defbae3a6b79

See more details on using hashes here.

File details

Details for the file NaStyAPI-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: NaStyAPI-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for NaStyAPI-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c88a7eac7b77d4334c1afa540cfcfbd9cb3f5f2703ceebff26056d5bafabde53
MD5 0ceb3ea909a35b953feafd4738233e77
BLAKE2b-256 b1f45c8e9f8f1ce0c22a24528f0a526117fe4158ff3ec5e59aab65e99731de0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page