Attumm / redis-dict

Python dictionary with Redis as backend, built for large datasets. Simplifies Redis operations for large-scale and distributed systems. Supports various data types, namespacing, pipelining, and expiration.
MIT License
51 stars 14 forks source link

Add support for datetime as type #57

Closed Attumm closed 1 week ago

Attumm commented 3 weeks ago

As the title suggests, let's add support for the datetime type.

When implementing this feature, consider timezone handling, as there may be potential edge cases. Add tests that involve timezones to determine if it is as straightforward as the rest of this message suggests.

Encoding and Decoding

We can use the following methods for encoding and decoding datetime objects:

from datetime import datetime

encode = datetime.isoformat
decode = datetime.fromisoformat
Attumm commented 1 week ago

Fixed: https://github.com/Attumm/redis-dict/releases/tag/v2.7.0