Skip to main content

arbitrary-dateparser

Parses arbitrary strings to get dates or ranges of dates (periods). Some of this behavior, such as whether it always returns periods, is configurable (for now, see the code) -- that defaults to true by the way.

Installation

  • pip install git+https://github.com/nottheswimmer/arbitrary-dateparser@0.0.0
    
    Replacing @0.0.0 with the desired version, or removing it for the latest

Usage

>>> from arbitrary_dateparser import DateParser
>>> parser = DateParser()
>>> parser("jul 1 to jul 7")
<Period [2019-07-01T00:00:00+00:00 -> 2019-07-07T00:00:00+00:00]>
>>> parser("today")
<Period [2019-08-02T00:00:00-04:00 -> 2019-08-02T23:59:59.999999-04:00]>
>>> parser("last week to next friday")
<Period [2019-07-22T00:00:00-04:00 -> 2019-08-09T00:00:00-04:00]>

As mentioned, there are a few custom parameters you can pass to the parser, and a few things you can override that are set in __init__ to customize the behavior as well.

Contributing

  1. Fork it!

  2. Clone it!

    git clone https://github.com/<your-fork>/arbitrary-dateparser
    cd arbitrary-dateparser
    
  3. Install it!

    pip install -e .
    

    This tells pip to find setup.py in the current directory and install it in editable or development mode. Editable mode means that as you make changes to your local code, you’ll only need to re-install if you change the metadata about the project, such as its dependencies.

  4. Change it!

  5. Test it!

    # Assumes you're in the arbitrary-dateparser directory
    python -m tests.test_dateparser
    
  6. Submit a pull request!

Metadata

Release files for arbitrary-dateparser 0.0.2

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

Source distribution (sdist)

Source distribution for arbitrary-dateparser 0.0.2
File Size Uploaded Provenance Actions
arbitrary-dateparser-0.0.2.tar.gz 5.3 kB Without provenance Details for arbitrary-dateparser-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for arbitrary-dateparser 0.0.2
File Interpreter ABI Platform Actions
arbitrary_dateparser-0.0.2-py3-none-any.whl Python 3 none any Details for arbitrary_dateparser-0.0.2-py3-none-any.whl

Total release size: 11.8 kB

Release files / arbitrary-dateparser-0.0.2.tar.gz

Download URL arbitrary-dateparser-0.0.2.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fc20b930a8a84031f3eb777df1579376aebf176ea991bb21cfd494086bd01494
BLAKE2b-256 checksum
How to use checksums
94e4072e5ada280a935aa8cbebe0a216837759214b921836ad737273d4da7260
Upload date
Uploaded using Trusted Publishing?
What is 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/3.6.7

Release files / arbitrary_dateparser-0.0.2-py3-none-any.whl

Download URL arbitrary_dateparser-0.0.2-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9372997cf19f69749a2b4faa3de0eff24b445d232ee4bbb576c949ce06a62663
BLAKE2b-256 checksum
How to use checksums
a78b0ed9a8b15a6ef5b44cf21a5f7a1f3af76edc0473b44872f71b5a038238e9
Upload date
Uploaded using Trusted Publishing?
What is 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/3.6.7

Security for arbitrary-dateparser 0.0.2

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