TimePiece
A DSL to assist with writing specifications describing intervals and durations of time with filters.
Why the name?
Because time_spec was uninspiring and a good friend suggested timepiece.
Naming things is difficult!
But why?
Because I wanted to represent when scheduled actions should take place and I was starting to have too many columns in my database representing everything I wanted to be able to do.
Installation
Use pip!:
pip install timepiece
Or if you’re developing it:
pip install -e .
pip install -e ".[tests]"
Usage
Just create the timepiece and give it a specification!
from timepiece.spec import make_timepiece
from datetime import datetime
timepiece = make_timepiece()
obj = timepiece.time_spec_to_object("between(start: now()) & interval(every: amount(num:1 size: hour))")
print("Next time is: ", obj.following(datetime.utcnow()))
See The docs at https://timepiece.readthedocs.io for more information!
Tests
To run the tests in this project, just use the helpful script:
./test.sh
Or run tox:
tox
Metadata
Release files for timepiece 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| timepiece-0.2.6.tar.gz | 9.9 kB | Without provenance | Details for timepiece-0.2.6.tar.gz |
Release files / timepiece-0.2.6.tar.gz
| Download URL | timepiece-0.2.6.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d189157d7af916945278564a3f5c51c5081ab20877c0faffda58af003d52dd08
|
|
BLAKE2b-256 checksum How to use checksums |
6b177a16c9268bba13faaaf946cc375b9f6d5776bff661632e9450969f737527
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for timepiece 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.