Date parsing for arbitrary strings!
Project description
# 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
`bash 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
Fork it!
- Clone it!
`bash git clone https://github.com/<your-fork>/arbitrary-dateparser cd arbitrary-dateparser `
- 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.
Change it!
- Test it!
`bash # Assumes you're in the arbitrary-dateparser directory python -m tests.test_dateparser `
Submit a pull request!
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
Built Distributions
Hashes for arbitrary-dateparser-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4714bb098e3c85cecce88c9904bdbde643332321e29b52f0bcd83ce4f39c4cd0 |
|
MD5 | fc2c6fcdf708b7935e3b1f7b309ea1c3 |
|
BLAKE2b-256 | 539e2ac49ec68823933912d540b305aa5c800fe05bdf8e66f3cd7e34d6f295a1 |
Hashes for arbitrary_dateparser-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2826505095e53df24038be4ea0618078265ffba9b3b772d075ef8e0ea60014 |
|
MD5 | 75c2f126bbfefed1a8360bf49ec2dc13 |
|
BLAKE2b-256 | 6ca5c626f99ecf5b8075f6672cd24bd32bfa87690a39af82a4ae706603b7e2d4 |
Hashes for arbitrary_dateparser-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47fa57a12096b4cd8dff770448a604cff623ee5cb3b69cee1658d621d351dbdb |
|
MD5 | b1120a68a61da06796ccccfba3f4c8f7 |
|
BLAKE2b-256 | 7e7771351b84ebccc815a16cfc3ccf562414fbbb83679c2f66cb3da889d54739 |