Skip to main content

One Pyece

Image generated with Midjourney.

PyPI - Python Version PyPI GitHub Workflow Status PyPI - License GitHub last commit

forthebadge forthebadge

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 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
  • 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 <path_to_archive>

Usage

>>> 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 and more examples here.

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

Remi Jara
Remi Jara

Metadata

Release files for onepyece 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onepyece 2.0.1
File Size Uploaded
onepyece-2.0.1.tar.gz 13.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onepyece 2.0.1
File Interpreter ABI Platform
onepyece-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / onepyece-2.0.1.tar.gz

Download URL onepyece-2.0.1.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1868993e55df27ba367ca05f82b20e412d7ef98ba799e88ace89f3ddd470c876
BLAKE2b-256 checksum
How to use checksums
4c445bb9b04af8a961353c36e9d08748ee862e0f57a75c6c22f8e7db25f7d28b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.4

Release files / onepyece-2.0.1-py3-none-any.whl

Download URL onepyece-2.0.1-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd0e259ace28248cfd85550ec56bf85592097b3f137950c7b8224b8a25552992
BLAKE2b-256 checksum
How to use checksums
5150be2ba3b63f6ea88fc6b0623bb07b9aff069b89eb53ead2759d0448fdae03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.4

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

3 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page