An attempt at proper time management in Python.
Project description
Propertime is an attempt at proper time management in Python.
In a nutshell, it provides two main classes: Time
for representing time (similar to a datetime)
and TimeUnit
for representing units of time (similar to timedelta).
Such classes are implement assuming two strict and opinionated base hypotheses:
-
Time is a floating point number representing the number of seconds passed after the zero on the time axis, which is set to 1st January 1970 UTC, any other representations (as date/hours, time zones, daylight saving times) are built on top of it, and:
-
Time units can be of both fixed and variable length, if defined with calendar time units as days, weeks, months and years. This means that the length (i.e. the duration in seconds) of a one-day time unit is not defined unless it it put in context, which means to know on which time it is applied.
These two assumptions allows Propertime to solve by design many issues in manipulating time that are still present in Python's built-in datetime module as well as in most third-party libraries.
Propertime provides a simple and neat API, and its objects play nice with Python datetimes so that you can mix and match and use it only when needed. Implementing "proper" time comes indeed at a price: it optimizes for consistency over performance and it is quite strict, meaning that its suitability heavily depends on the use-case.
You can get started by having a look at the quickstart notebook, or by reading the reference documentation.
Project details
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
Hashes for propertime-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be57432848e135cac3562fe92648de0edc472ace8c985c6268f4e9adbb87d69b |
|
MD5 | 22b54e889f1d09153bbc923ab4a43150 |
|
BLAKE2b-256 | a7747d0906a20c7ec28acdb21097bb612bbd2fe9472b60173413f07f6bb4c803 |