Skip to main content

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 objects
    • ditto analyze: a script to generate a JSON schema of the above data
    • ditto transform: a script to apply a new base url to data in data/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 and limit
  • 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


Download files

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

Source Distribution

pokeapi-ditto-0.3.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

pokeapi_ditto-0.3.1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file pokeapi-ditto-0.3.1.tar.gz.

File metadata

  • Download URL: pokeapi-ditto-0.3.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.6 Linux/4.4.0-17134-Microsoft

File hashes

Hashes for pokeapi-ditto-0.3.1.tar.gz
Algorithm Hash digest
SHA256 23ea9348fc9bef1cddf1716b96cb20f965cee1ae57e3b87f05fd5a000650efff
MD5 eb9a3545b973d1678602408c9afcf31c
BLAKE2b-256 ec27525fabdd745889159a3bc6f08d7216c2182b01f0aa32e94d14be43c0293e

See more details on using hashes here.

File details

Details for the file pokeapi_ditto-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pokeapi_ditto-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.6 Linux/4.4.0-17134-Microsoft

File hashes

Hashes for pokeapi_ditto-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fad42ef7cc53cc1b957cce4385531ec6226590cef9c4769277797f56c39848f3
MD5 2303ea074fe72b7241e3e2d3157ef345
BLAKE2b-256 29fc8976a578b91bd340d86f5a904a90870c8f9f845fb1853179a56dd5e72bf6

See more details on using hashes here.

Supported by

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