A minimal Python wrapper for the PokéAPI with Pokémon visualization capabilities.
- Search for any Pokémon by name
- View detailed stats and ASCII art representation
- See additional information like moves and held items
- View different sprite variations (shiny, back view)
- Access to Pokémon endpoints
- Simple and intuitive API with visualization
- Lightweight with minimal dependencies
- Colored ASCII art generation from Pokémon sprites using ascii_magic
- One-line Pokémon visualization with
show_pokemon() - Terminal-based Pokédex application
- Pokémon:
/pokemon/{id or name} - Pokémon List:
/pokemon
The get_ascii_sprite method accepts the following parameters:
width: Width of the ASCII art in columns (default: 40)height: Height of the ASCII art in rows (default: 20)shiny: Whether to use the shiny sprite (default: False)back: Whether to use the back sprite (default: False)colored: Whether to use colored ASCII art (default: True)
The ASCII art generator:
- Uses the ascii_magic library for high-quality ASCII art
- Supports colored output for terminal displays
- Automatically handles transparent backgrounds
- Maintains proper aspect ratio of sprites
The show_pokemon() method provides a complete visualization of a Pokémon:
# Get a Pokémon
pikachu = api.get_pokemon("pikachu")
# Display its information and sprite
pikachu.show_pokemon()
# Display with non-colored ASCII art
pikachu.show_pokemon(colored=False)This displays:
- Pokémon name and ID
- Type(s)
- Height and weight
- Abilities (including hidden abilities)
- Base stats
- ASCII art sprite
The package includes a comprehensive test suite using pytest. To run the tests:
# Install test dependencies
pip install pytest
# Run the tests
pytestOur tests follow these principles:
- Direct Testing: We test functions and methods directly without mocks or fixtures
- Function Existence: We verify that functions exist and have the correct signatures
- Integration Tests: We include optional integration tests that can be run when needed
- Simple and Readable: Tests are straightforward and easy to understand
The test suite covers:
- API client functionality
- Pokemon model and related classes
- ASCII art generation utilities
You can run specific test categories:
# Run all tests
pytest
# Run API tests
pytest tests/test_api.py
# Run model tests
pytest tests/test_models.py
# Run integration tests (normally skipped)
pytest -v tests/test_api.py::TestPokeAPI::test_get_pokemon_integrationThis project is licensed under the MIT License - see the LICENSE file for details.
- PokéAPI for providing the API
- ascii_magic for the ASCII art generation