Giter Club home page Giter Club logo

nationstates's Introduction

This is a client implementation of the XML API of the game NationStates (https://www.nationstates.net), allowing different queries on the game data.

Installation

System:

sudo python3 setup.py install

User:

python3 setup.py install --user

If you intend to use this client a lot, please consider setting the NATIONSTATES_EMAIL environment variable to your email address.

This will make your requests identifiable in the NationStates server logs, and allow admins to contact you in case of problems.

Usage

The client provides a simple command-line script for getting region and nation data.

usage: nationstates [-h] [--format {json,yaml,txt}]
                    {nation,region} name [fields [fields ...]]

Access the NS API.

positional arguments:
  {nation,region}       The type of entity to access.
  name                  Name of entity.
  fields                Fields to query.

optional arguments:
  -h, --help            show this help message and exit
  --format {json,yaml,txt}
                        Format. Defaults to txt for single scalar values, json
                        otherwise.

Sample:

$ nationstates nation ermarian motto flag population

$ nationstates region the_north_pacific delegate

Features

Aside from a library that allows general queries, this client comes with multiple scripts for specific purposes, such as building a regional map of endorsements.

The client automatically throttles itself to at most fifty queries in thirty seconds. Note that this throttling is only done on a per-thread basis, so only one instance of the client may run simultaneously; your address will otherwise be temporarily blocked by the NationStates server.

License

This code is provided under the MIT License; see LICENSE.txt for more information.

nationstates's People

Contributors

arancaytar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.