Skip to main content

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 with format_names or not specify any format. In the last case, parse will try all the possible formats until it finds the correct one:

    from bigml_chronos import chronos
    chronos.parse("1969-W29-1", format_name="week-date")
    from bigml_chronos import chronos
    chronos.parse("1969-W29-1", format_names=["week-date", "week-date-time"])
    from bigml_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 bigml_chronos import parser
    chronos.find_format("1969-07-14Z")

Instead of the name of the format, you can also pass a string containing some Joda-Time directives.

from bigml_chronos import chronos
chronos.parse("1969-01-29", format_name="YYYY-MM-dd")

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.

Metadata

Release files for bigml-chronos 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bigml-chronos 1.0.0
File Size Uploaded Provenance Actions
bigml-chronos-1.0.0.tar.gz 15.3 kB Without provenance Details for bigml-chronos-1.0.0.tar.gz

Release files / bigml-chronos-1.0.0.tar.gz

Download URL bigml-chronos-1.0.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d5dfb358cfdfbc334106336276f56e9a2ce01af988598bbc24e0399afd1da475
BLAKE2b-256 checksum
How to use checksums
2fb09131bfbd94c8b0f401354b250e9c725bd7203a0af0270d2bf35d06fc55b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Security for bigml-chronos 1.0.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page