Utilities for parsing time strings
Project description
Chronos
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
Requirements
Python 2.7 and Python 3 are currently supported.
The basic third-party dependencies are isoweek and pytz. These libraries are automatically installed during the setup.
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
Basic methods
Chronos offers the following main functions:
-
With parse you can parse a date. You can specify a format name with
format_name, a list of possible format names withformat_namesor not specify any format. In the last case,parsewill try all the possible formats until it finds the correct one:from chronos import chronos chronos.parse("1969-W29-1", format_name="week-date")
from chronos import chronos chronos.parse("1969-W29-1", format_names=["week-date", "week-date-time"])
from chronos import chronos chronos.parse("7-14-1969 5:36 PM")
-
You can also find the format_name from a date with find_format:
from chronos import parser chronos.find_format("1969-07-14Z")
If both format_name and format_names are passed, it will try all the
possible formats in format_names and format_name.
You can find all the supported formats, and an example for each one of them inside the test file.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bigml-chronos-0.3.5.tar.gz.
File metadata
- Download URL: bigml-chronos-0.3.5.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e2375a8827ed8f6741c9d8dc238f91effcddbd6b0976e9eb0ace64f1ceb7762
|
|
| MD5 |
932f89bcd294b7183bb9b89b281120d0
|
|
| BLAKE2b-256 |
3d85b1756426de109f7b6c6ad3b652a1afd67efa472bbcdd03247637d551b74b
|
File details
Details for the file bigml_chronos-0.3.5-py2.py3-none-any.whl.
File metadata
- Download URL: bigml_chronos-0.3.5-py2.py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2bc9559cdf46254b1ce5a4eb8766fcd2c9a7718a9729c98aef8c7a1fa56c93a
|
|
| MD5 |
5bd21209e581bfe6cddae6ce976928cd
|
|
| BLAKE2b-256 |
c3be72b6a0d0f4fd289ee059dda61c8af6504e84953d764906aeca264aa3880f
|