ninjakiwi-api


Nameninjakiwi-api JSON
Version 1.3.2 PyPI version JSON
download
home_pagehttps://github.com/GustavoSchip/ninjakiwi-api
SummaryNinjaKiwi API (Open Data) for Python! (My first library)
upload_time2023-08-17 17:23:46
maintainerGustavo Schip
docs_urlNone
authorGustavo Schip
requires_python>=3.11,<4.0.0
licenseMIT
keywords api ninjakiwi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
---

<div align="center">
  <h1>NinjaKiwi API</h1>
</div>

<p align="center">
<a href="https://pypi.python.org/pypi/ninjakiwi_api">
    <img src="https://img.shields.io/pypi/v/ninjakiwi-api.svg"
        alt = "Release Status">
</a>
</p>

<br>

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

- #### [Bloons Tower Defence 6](https://ninjakiwi.com/our-games#bloonstd6)

- #### [Bloons Tower Defence Battles 2](https://ninjakiwi.com/our-games#battles)

# Usage

To import the module use:
<br>

```python
import ninjakiwi_api
```

## installation

To get the latest release use:
<br>

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

## Alternative installation

To get the latest release via a tarball use: <br>
To check which version the library is on go to [Releases](https://github.com/GustavoSchip/NinjaKiwi-API/releases) and search for releases!
<br>

```commandline
    $ 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: <br>
To check which version the library (dev) is on go to [Releases](https://github.com/GustavoSchip/NinjaKiwi-API/releases) and search for pre-releases!
<br>

```commandline
    $ 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`.
<br>

```python
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](https://github.com/GustavoSchip/NinjaKiwi-API/wiki)!

## Additional info

[LICENSE](https://github.com/GustavoSchip/NinjaKiwi-API/blob/master/LICENSE)
<br>
[CONTRIBUTING](https://github.com/GustavoSchip/NinjaKiwi-API/blob/master/CONTRIBUTING.md)

---


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/GustavoSchip/ninjakiwi-api",
    "name": "ninjakiwi-api",
    "maintainer": "Gustavo Schip",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0.0",
    "maintainer_email": "gustavoschip@proton.me",
    "keywords": "API,NinjaKiwi",
    "author": "Gustavo Schip",
    "author_email": "gustavoschip@proton.me",
    "download_url": "https://files.pythonhosted.org/packages/02/d2/e55e3ef59a75429752169079cd5ddd5f97d3c671bc55ca2629022a2c362d/ninjakiwi_api-1.3.2.tar.gz",
    "platform": null,
    "description": "\n---\n\n<div align=\"center\">\n  <h1>NinjaKiwi API</h1>\n</div>\n\n<p align=\"center\">\n<a href=\"https://pypi.python.org/pypi/ninjakiwi_api\">\n    <img src=\"https://img.shields.io/pypi/v/ninjakiwi-api.svg\"\n        alt = \"Release Status\">\n</a>\n</p>\n\n<br>\n\nThis project was born because of the need of an API wrapper for the NinjaKiwi API. (A.K.A. Open Data)\n<br>\nDo note that this is my first ever library and I still have a lot to learn!\n<br>\nThe games supported in [Open Data](https://data.ninjakiwi.com/) are:\n\n- #### [Bloons Tower Defence 6](https://ninjakiwi.com/our-games#bloonstd6)\n\n- #### [Bloons Tower Defence Battles 2](https://ninjakiwi.com/our-games#battles)\n\n# Usage\n\nTo import the module use:\n<br>\n\n```python\nimport ninjakiwi_api\n```\n\n## installation\n\nTo get the latest release use:\n<br>\n\n```commandline\n    $ python -m pip install --upgrade ninjakiwi-api\n```\n\n## Alternative installation\n\nTo get the latest release via a tarball use: <br>\nTo check which version the library is on go to [Releases](https://github.com/GustavoSchip/NinjaKiwi-API/releases) and search for releases!\n<br>\n\n```commandline\n    $ python -m pip install --upgrade https://github.com/GustavoSchip/NinjaKiwi-API/releases/download/v{VERSION-NUMBER-HERE}/ninjakiwi_api-{VERSION-NUMBER-HERE}.tar.gz\n```\n\nTo get the latest pre-release via a tarball use: <br>\nTo check which version the library (dev) is on go to [Releases](https://github.com/GustavoSchip/NinjaKiwi-API/releases) and search for pre-releases!\n<br>\n\n```commandline\n    $ 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\n```\n\n# Example\n\nIn this example we make a request to the api and we want the value of `id`.\n<br>\n\n```python\nimport asyncio\nfrom ninjakiwi_api import fetch\n\n\nasync def start():\n    data = await fetch(\"BTD6\", \"races\")\n    if data is not None:\n        raw = await data.get_raw_data()\n        example = await data.get_data(\"id\")\n        print(f\"Successfully fetched race data: {raw}\")\n        if example is not None:\n            print(f\"Successfully fetched race data: {example}\")\n    else:\n        print(\"Failed to fetch race data.\")\n\n\ndef main():\n    asyncio.run(start())\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n# Documentation\n\nThe documentation is available on the project its [Wiki](https://github.com/GustavoSchip/NinjaKiwi-API/wiki)!\n\n## Additional info\n\n[LICENSE](https://github.com/GustavoSchip/NinjaKiwi-API/blob/master/LICENSE)\n<br>\n[CONTRIBUTING](https://github.com/GustavoSchip/NinjaKiwi-API/blob/master/CONTRIBUTING.md)\n\n---\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "NinjaKiwi API (Open Data) for Python! (My first library)",
    "version": "1.3.2",
    "project_urls": {
        "Homepage": "https://github.com/GustavoSchip/ninjakiwi-api"
    },
    "split_keywords": [
        "api",
        "ninjakiwi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3370e437fa0ec5c338f739b861d274b862d70686202ff15bd76ac7127e977c7",
                "md5": "43348cbbfafde4e44038f5cbb4a149fb",
                "sha256": "daf47e9e5644fd86791657bae949275a3b0d16bee41e86e8933130d5c93d9439"
            },
            "downloads": -1,
            "filename": "ninjakiwi_api-1.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "43348cbbfafde4e44038f5cbb4a149fb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0.0",
            "size": 12167,
            "upload_time": "2023-08-17T17:23:44",
            "upload_time_iso_8601": "2023-08-17T17:23:44.887667Z",
            "url": "https://files.pythonhosted.org/packages/a3/37/0e437fa0ec5c338f739b861d274b862d70686202ff15bd76ac7127e977c7/ninjakiwi_api-1.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "02d2e55e3ef59a75429752169079cd5ddd5f97d3c671bc55ca2629022a2c362d",
                "md5": "aa8e2444d9fe31bcebe1a03ba9a13c74",
                "sha256": "3aa9c0bfe7b15ca5f5a49105d29adced3d149fad19f3a025d3581d585b9280aa"
            },
            "downloads": -1,
            "filename": "ninjakiwi_api-1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "aa8e2444d9fe31bcebe1a03ba9a13c74",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0.0",
            "size": 11825,
            "upload_time": "2023-08-17T17:23:46",
            "upload_time_iso_8601": "2023-08-17T17:23:46.089973Z",
            "url": "https://files.pythonhosted.org/packages/02/d2/e55e3ef59a75429752169079cd5ddd5f97d3c671bc55ca2629022a2c362d/ninjakiwi_api-1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-17 17:23:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GustavoSchip",
    "github_project": "ninjakiwi-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "ninjakiwi-api"
}
        
Elapsed time: 0.11570s