Base library for card game logic
Project description
Aces High: Core Python Library
A Python library for modeling playing cards, decks, and core logic for traditional card games. Built with clean, testable design principles and designed to serve as the foundation for more complex gameplay logic.
🧠 Built to teach — this library powers the examples in the companion eBook:
Building Systems Like a Senior Engineer
Features
- 🎴 Card and Deck modeling using Pythonic, enum-safe data structures
- 🔁 Standard shuffling, dealing, and deck state management
- 🧪 Fully tested with
pytest, using a test-first design process - 🧹 Enforced code quality via
blackandruff - 📦 Easy-to-install package, published to PyPI
Installation
pip install aces-high-core-py
Usage
from aces_high import StandardDeck
deck = StandardDeck()
deck.shuffle()
hand = deck.deal(5)
for card in hand:
print(card)
Development
Clone the repo and install dependencies with uv:
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
Run tests:
pytest
Format and lint:
black src/ tests/
ruff check src/ tests/
Publishing
We use uv publish and workflow_dispatch in GitHub Actions for controlled PyPI deploys. See the Publish to PyPI workflow for more.
License
MIT License © Aaron Smith
See Also
📘 Aces High eBook — Learn how this library was designed and built from scratch, with a focus on practical system design and senior engineering practices.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aces_high_core_py-0.1.1.tar.gz.
File metadata
- Download URL: aces_high_core_py-0.1.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6cc501f58ccfb73802c369c8d0fd607b0ae4cafd7c478e480a5e408b8ec1cb1
|
|
| MD5 |
bec5da9839f60c8f0c350238e598bd13
|
|
| BLAKE2b-256 |
e9b4c7ebb52975232bca7413e91d474ee72899ac4cbaed8d62d9f01927732d59
|
File details
Details for the file aces_high_core_py-0.1.1-py3-none-any.whl.
File metadata
- Download URL: aces_high_core_py-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7adf620ca5a7d3e0f4a210b901963df2548b8c0b580ec5913ae3d0e9bf05c6be
|
|
| MD5 |
12ddcaf643a9cf49611590845fa6657e
|
|
| BLAKE2b-256 |
d86c85ca820fe06136f3c47f52be9037469872442c41830b9f262d276bd2902b
|