Installation¶
Requirements¶
- Python 3.10 or higher
Basic Installation¶
Install TypedUUID using pip:
This installs the core library with no additional dependencies.
Optional Dependencies¶
TypedUUID provides optional integrations with popular frameworks. Install them as needed:
SQLAlchemy Support¶
For database integration with SQLAlchemy:
This adds:
TypedUUIDType- SQLAlchemy column type- Automatic serialization/deserialization
Pydantic Support¶
For data validation with Pydantic v2:
This adds:
- Pydantic model field support
- JSON schema generation
- Automatic validation
FastAPI Support¶
For API development with FastAPI:
This adds:
- Path parameter support
- OpenAPI schema integration
- Automatic validation and documentation
All Dependencies¶
Install all optional dependencies at once:
Development Installation¶
For contributing to TypedUUID:
This installs:
- All optional dependencies
- pytest and pytest-cov for testing
- Development tools
Verifying Installation¶
Verify the installation:
>>> from typed_uuid import create_typed_uuid_class, TypedUUID
>>> UserUUID = create_typed_uuid_class('User', 'user')
>>> user_id = UserUUID()
>>> print(user_id)
user-550e8400-e29b-41d4-a716-446655440000
Check installed version:
Upgrading¶
Upgrade to the latest version:
Compatibility¶
| Python Version | Support |
|---|---|
| 3.10 | ✅ |
| 3.11 | ✅ |
| 3.12 | ✅ |
| 3.13 | ✅ |
| 3.9 and below | ❌ |
Python 3.9 Support
Python 3.9 and earlier are not supported due to Pydantic v2 compatibility requirements.