NinjaKiwi API (Open Data) for Python! (My first library)
Project description
NinjaKiwi API
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ninjakiwi_api-1.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | daf47e9e5644fd86791657bae949275a3b0d16bee41e86e8933130d5c93d9439 |
|
MD5 | 43348cbbfafde4e44038f5cbb4a149fb |
|
BLAKE2b-256 | a3370e437fa0ec5c338f739b861d274b862d70686202ff15bd76ac7127e977c7 |