Ditto is a server that serves a static copy of PokeAPI's data.
Project description
Ditto
https://bulbapedia.bulbagarden.net/wiki/Ditto_(Pokémon)
This repository contains:
- Ditto script:
ditto clone
: a script to crawl an instance of PokeAPI and download all objectsditto analyze
: a script to generate a JSON schema of the above dataditto transform
: a script to apply a new base url to data indata/api
ditto serve
: a script to serve the data in the same form as PokeAPI- with full support for dynamic pagination using GET args
offset
andlimit
- with full support for dynamic pagination using GET args
- Static data:
- data/api: a static copy of the JSON data generated with the above script
- data/schema: a static copy of the PokeAPI schema generated from the above data
- updater: a bot that runs in docker and can update the data stored in this repo
Docker
This project is on Docker Hub. If you just want to serve a PokeApi clone, you just have to run one command.
- Replace
8080
with the port of your choice - Replace
http://localhost:8080
with the base url of your choice
docker run -p 8080:80 -e DITTO_BASE_URL=http://localhost:8080 sargunv/pokeapi-ditto:latest
Usage
If you'd rather use the data for something else, you can generate a copy with the base url of your choice applied. This assumes Poetry is installed and in your PATH.
git clone https://github.com/PokeAPI/ditto.git
cd ditto
poetry install
poetry run ditto transform --base-url http://localhost:8080
For other ditto functionality, run poetry run ditto --help
If you're on Windows, you'll have to adapt the commands above to your platform. The general idea is the same.
Advanced
You can manually update the data if necessary. See the updater bot. You can run the bot in docker, or read and adapt its update script yourself.
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
Hashes for pokeapi_ditto-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5456be9fd3012baf30cb3522eaa1b43e5dee7fa9c0db05cddbab66b53e0d00e2 |
|
MD5 | 2b2f8c33a504e8793df4e0b99e382a6f |
|
BLAKE2b-256 | b213c137f2fd60e63ba5f2d0ee1726d59016dff4a9ada3406b40a84994a202a1 |