A package to use the One-Piece API : https://api-onepiece.com/
Project description
One Pyece
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.
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.results[0]
{'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
To get more basics functions visit that file which contains them, otherwise you can simply create API objects.
Tests
You can test the application by running python -m tests
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
File details
Details for the file onepyece-1.0.1.tar.gz
.
File metadata
- Download URL: onepyece-1.0.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 381ae7adccd4a68d227566003a63e1580822b5a86ff24f171f54c9f7f06f1cbb |
|
MD5 | 7ec6eed2b931ac3b4f66d0383136a576 |
|
BLAKE2b-256 | acf52ce54ff4d407942200838d18d019373cb87c28890fbd6bd2c5accc994091 |
File details
Details for the file onepyece-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: onepyece-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d44f6b05b1c7db5228152f448c54902a517209e0d3dd816b77d2885885fb71 |
|
MD5 | a3502c985a94b195c744b14555b212ca |
|
BLAKE2b-256 | 12d192ab07dd0cb1c7d5e911e16a3bd5cd4436c3e5cdf1538ef56cee88f96a4c |