Skip to main content

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

There are three main methods in the chronos modules that you can use:

  • With parse_with_format you can specify the format_name that 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.

Project details


Download files

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

Source Distribution

bigml-chronos-0.3.2.tar.gz (12.3 kB view details)

Uploaded Source

File details

Details for the file bigml-chronos-0.3.2.tar.gz.

File metadata

  • Download URL: bigml-chronos-0.3.2.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for bigml-chronos-0.3.2.tar.gz
Algorithm Hash digest
SHA256 fe0903cb2316043579021e1a92c3703d2cedd4ccc7ef3c33e2dceef8b76d1c08
MD5 ad13a4aa92642c292cb9328dad95077b
BLAKE2b-256 ca51c8e40be820449cf34bd65e6f4d255cff961f8b1f8821dd315e750fe7b2da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page