Skip to main content

NinjaKiwi API (Open Data) for Python! (My first library)

Project description


NinjaKiwi API

Release Status


This project was born because of the need of an API wrapper for the NinjaKiwi API. (A.K.A. Open Data)
Do note that this is my first ever library and I still have a lot to learn!
The games supported in Open Data are:

Usage

To import the module use:

import ninjakiwi_api

installation

To get the latest release use:

    $ python -m pip install --upgrade ninjakiwi-api

Alternative installation

To get the latest release via a tarball use:
To check which version the library is on go to Releases and search for releases!

    $ python -m pip install --upgrade https://github.com/GustavoSchip/NinjaKiwi-API/releases/download/v{VERSION-NUMBER-HERE}/ninjakiwi_api-{VERSION-NUMBER-HERE}.tar.gz

To get the latest pre-release via a tarball use:
To check which version the library (dev) is on go to Releases and search for pre-releases!

    $ python -m pip install --upgrade --pre https://github.com/GustavoSchip/NinjaKiwi-API/releases/download/v{VERSION-NUMBER-HERE}-dev/ninjakiwi_api-{VERSION-NUMBER-HERE}.tar.gz

Example

In this example we make a request to the api and we want the value of id.

import asyncio
from ninjakiwi_api import fetch


async def start():
    data = await fetch("BTD6", "races")
    if data is not None:
        raw = await data.get_raw_data()
        example = await data.get_data("id")
        print(f"Successfully fetched race data: {raw}")
        if example is not None:
            print(f"Successfully fetched race data: {example}")
    else:
        print("Failed to fetch race data.")


def main():
    asyncio.run(start())


if __name__ == "__main__":
    main()

Documentation

The documentation is available on the project its Wiki!

Additional info

LICENSE
CONTRIBUTING


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

ninjakiwi_api-1.3.2.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

ninjakiwi_api-1.3.2-py3-none-any.whl (12.2 kB view hashes)

Uploaded Python 3

Supported by

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