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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ninjakiwi_api-1.3.2.tar.gz.
File metadata
- Download URL: ninjakiwi_api-1.3.2.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aa9c0bfe7b15ca5f5a49105d29adced3d149fad19f3a025d3581d585b9280aa
|
|
| MD5 |
aa8e2444d9fe31bcebe1a03ba9a13c74
|
|
| BLAKE2b-256 |
02d2e55e3ef59a75429752169079cd5ddd5f97d3c671bc55ca2629022a2c362d
|
File details
Details for the file ninjakiwi_api-1.3.2-py3-none-any.whl.
File metadata
- Download URL: ninjakiwi_api-1.3.2-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daf47e9e5644fd86791657bae949275a3b0d16bee41e86e8933130d5c93d9439
|
|
| MD5 |
43348cbbfafde4e44038f5cbb4a149fb
|
|
| BLAKE2b-256 |
a3370e437fa0ec5c338f739b861d274b862d70686202ff15bd76ac7127e977c7
|