Skip to main content

A package to use the One-Piece API : https://api-onepiece.com/

Project description

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.

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.birthday
'2000-03-02'
>>> nb_fruits = op.count_fruits() # You can get the count of a specific endpoint
>>> nb_fruits.count
197
>>> nb_fruits.url
https://api.api-onepiece.com/fruits/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, 'object': True, 'id': 1, 'french_name': 'L’équipage du Chapeau de Paille', 'roman_name': 'Mugiwara no Ichimi', 'description': '', 'total_prime': '3.161.000.100', 'number': '10', 'status': 'actif', 'isYonko': True, 'affiliation': ''})
>>> crews.count # You can implicitly get the count of an endpoint by getting the whole list of it.
149
>>>crews[1].french_name
'L’équipage du Roux'

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onepyece-1.3.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

onepyece-1.3.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file onepyece-1.3.1.tar.gz.

File metadata

  • Download URL: onepyece-1.3.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.4

File hashes

Hashes for onepyece-1.3.1.tar.gz
Algorithm Hash digest
SHA256 d203ad8fd5ddf480b87eb4e14d39fb9aa5637c5f4cc7367e126c4dc4e7b19916
MD5 56a52fd18f24b267bf857c1a3c96a442
BLAKE2b-256 c7b579ce83172caef7751905ade5339619f07c9f09e449f3d83d82d97158a179

See more details on using hashes here.

File details

Details for the file onepyece-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: onepyece-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.4

File hashes

Hashes for onepyece-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5682e445d2a669c3ce5b8b2ff6fe99666dab54337341966a01ef0e416f5b359b
MD5 68d74801c274aa07835f08ea97c7eec7
BLAKE2b-256 370cf50a665f423a33cb78d1da0e639c30bd8ba94020f5962c192c12d7fe40c9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page