Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/icepick4/onepyece
π» Python API wrapper for https://api-onepiece.com/ π΄ββ οΈ
https://github.com/icepick4/onepyece
api api-tool api-wrapper flake8 lint linter one-piece onepiece package py pypi python python-package python3 testing wrapper
Last synced: about 1 month ago
JSON representation
π» Python API wrapper for https://api-onepiece.com/ π΄ββ οΈ
- Host: GitHub
- URL: https://github.com/icepick4/onepyece
- Owner: icepick4
- License: mit
- Created: 2023-01-25T21:27:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-14T11:11:51.000Z (9 months ago)
- Last Synced: 2024-10-07T22:54:01.010Z (about 1 month ago)
- Topics: api, api-tool, api-wrapper, flake8, lint, linter, one-piece, onepiece, package, py, pypi, python, python-package, python3, testing, wrapper
- Language: Python
- Homepage: https://pypi.org/project/onepyece/
- Size: 3.36 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# One Pyece
_Image generated with Midjourney._
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/onepyece)
![PyPI](https://img.shields.io/pypi/v/onepyece)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/icepick4/onepyece/python-package.yml)
![PyPI - License](https://img.shields.io/pypi/l/onepyece)
![GitHub last commit](https://img.shields.io/github/last-commit/icepick4/onepyece)[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)## Description
Python **API wrapper** for https://api-onepiece.com/ \
Thank's to this package you can simply get informations about One Piece characters, fruits, crews, etc. The datas provided by the API are in french only for the moment. \
Learn more about possibilities in the [Usage](#usage) section.β οΈ*This package is still in development and it's my very first python package, so it may not be stable.*
## What's New in v2.0
**Multilanguage Support:** One Pyece now supports multiple languages! Starting from version 2.0, you can generate an \`API\` object with a language parameter, making it possible to fetch data in either French or English. English is the default language if the parameter is not set. This enhancement aims to make our API more accessible and user-friendly for our international audience.
## Installation
**There are several solutions :**
- Use this command `pip install onepyece` to get it from [PyPi](https://pypi.org/project/onepyece/)
- Use this command `pip install git+https://github.com/icepick4/onepyece` to download it from this repo.
- Download either the .zip or the tar.gz archive from the last release and then use this command `pip install `## Usage
```py
>>> import onepyece as op>>> sanji = op.character_by_name('sanji') # You can get a character by its name
>>> sanji.size
>>> '180cm'
>>> sanji.crew['roman_name']
>>> 'Mugiwara no Ichimi'>>> nb_fruits = op.count_fruits() # You can get the count of a specific endpoint
>>> nb_fruits.count
>>> 206
>>> nb_fruits.url
>>> 'https://api.api-onepiece.com/v2/fruits/en/count'>>> crews = op.API('crews') # List of all the crews in dict form as you can see below
>>> crews[0]
>>> API(object={'endpoint': None, 'search_term': None, 'resource': None, 'lang': 'en', 'url': None, 'id': 1, 'name': 'The Chapeau de Paille crew', 'description': None, 'status': 'assets', 'roman_name': 'Mugiwara no Ichimi', 'total_prime': '3.161.000.100', 'number': '10', 'is_yonko': True})
>>> crews.count # You can implicitly get the count of an endpoint by getting the whole list of it.
>>> 149
>>> crews[1].name
>>> 'Le Roux crew'# Make a search on a list already fetched
>>> roger_crew = crews.search('name', 'roger')
>>> roger_crew
>>> Total crews found for this search: 1.
>>> roger_crew[0]
{
"endpoint": null,
"search_term": null,
"resource": null,
"lang": "en",
"url": null,
"id": 5,
"name": "The Pirates Roger crew",
"description": null,
"status": "dissolved",
"roman_name": "RojΔ Kaizoku Dan",
"total_prime": "5.564.800.000",
"number": "30",
"is_yonko": true
}
```To learn more about the possibilities, you can check the
detailed **documentation** [here](docs/) and more examples [here](docs/examples.py).## Tests
You can test the application by running `python -m tests`
## Contributing
Pull requests are welcome. Do not hesitate to open an issue if you have any problem or suggestion.
## License
This project is under the MIT License.
## Author