Utilities for parsing time strings
Utilities for parsing time strings in Python.
Building and installation
Before installing chronos you will have to generate some of its modules as it is explained in Chronos readme Then, you can simply run
pip install bigml-chronos
Python 2.7 and Python 3 are currently supported.
Running the tests
The tests will be run using nose, that is installed on setup. You can run the test suite simply by issuing
python setup.py nosetests
There are three main methods in the chronos modules that you can use:
With parse_with_format you can specify the
format_namethat you want to use to parse your date:
from chronos import parser parser.parse_with_format("week-date", "1969-W29-1")
With parse, you don't need to specify a
format_name. Chronos will try all the possible formats until it finds the appropiate one:
from chronos import parser parser.parse("7-14-1969 5:36 PM")
You can also find the format_name from a date with find_format:
from chrono import parser parser.find_format("1969-07-14Z")
You can find all the supported formats, and an example for each one of them inside the test file.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size bigml-chronos-0.3.2.tar.gz (12.3 kB)||File type Source||Python version None||Upload date||Hashes View|