This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Thin DSL for creating time scheduling specifications

Project Description

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
Release History

Release History

This version
History Node

0.2.6

History Node

0.2.5

History Node

0.2

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
timepiece-0.2.6.tar.gz (9.9 kB) Copy SHA256 Checksum SHA256 Source May 22, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting