Releases: allen2c/cachetic
v0.5.0
v0.4.0
🚀 MongoDB Cache Support & Refactor! 🥭
✨ What’s New
-
MongoDB Backend Added!
You can now use MongoDB as a cache backend via a simple connection string.- New
MongoCacheclass incachetic/extensions/mongodb.py - Just use a URL like
mongodb://localhost:27017/dbname?collection=collname!
- New
-
Protocol-Driven Design
Introduced aCacheProtocol(PEP 544) for cache backends, making it easier to extend and type-check. -
Cleaner URL Masking
Moved the password-masking logic tocachetic/utils/hide_url_password.pyfor safe logging. -
Type Safety
AddedDocumentParamTypedDict for MongoDB document structure.
🧪 Tests
- Added
test_mongo_cache.pyfor MongoDB cache integration. - Added
test_redis_cache.pyfor Redis cache integration. - Fixtures for both Redis and MongoDB connection strings in
conftest.py.
🛠️ Dependency Updates
- Added
pymongo,str-or-none, anddnspythonto requirements. - Updated
pyproject.tomlwith optional MongoDB dependencies.
🧹 Refactoring & Housekeeping
- Removed the old
_hide_url_passwordfrom__init__.py. - Added missing
__init__.pyfiles for new submodules.
What's Changed
Full Changelog: v0.3.0...v0.4.0
Enjoy caching with MongoDB, Redis, or DiskCache!
Let’s keep things fast, safe, and extensible! 🚦✨
v0.3.0
🚀 Cachetic v0.3.0: Type-Safe Caching Revolution! ✨
🎯 What's New
This is a major rewrite that transforms Cachetic into a modern, type-safe caching library!
🔥 Breaking Changes & Improvements
🏗️ Complete API Redesign
- 📝 New requirement: All caches now use
pydantic.TypeAdapter[T]for type safety - 🔄 Renamed fields:
cache_ttl→default_ttl,cache_prefix→prefix - 🧹 Simplified serialization: Everything goes through TypeAdapter (no more complex type handling)
📚 Documentation Overhaul
📖 Completely rewritten README with:
- ✨ Clean, modern examples
- 🎯 Focus on type safety and simplicity
- 📋 Better organized sections
- 🛠️ Comprehensive configuration guide
🧪 Test Suite Modernization
🔬 Brand new test suite:
- ✅ Tests for all README examples
- 🧽 Clean, isolated test setup
- 📦 Comprehensive type coverage
- 🚀 Better test organization
📦 Dependency Updates
⬆️ Refreshed dependencies:
- 🔓 Relaxed version constraints
- 📈 Updated to latest compatible versions
- 🛡️ Better security posture
💔 Breaking Changes
Before (v0.2.x):
cache = Cachetic[str](object_type=str, cache_ttl=3600, cache_prefix="app")After (v0.3.0):
cache = Cachetic[str](
object_type=pydantic.TypeAdapter(str),
default_ttl=3600,
prefix="app"
)🎉 Why This Matters
✨ Better Developer Experience:
- 🔒 Full type safety with generics
- 🎯 Simpler, more consistent API
- 📝 Crystal clear documentation
- 🚀 Modern Python patterns
This release sets the foundation for a robust, type-safe caching experience that scales with your applications!
What's Changed
New Contributors
Full Changelog: v0.2.0...v0.3.0
📋 Summary: Major version upgrade with breaking API changes, complete documentation rewrite, modernized test suite, and focus on type safety through pydantic.TypeAdapter.