wttime - A fuzzy time parser
Tired of figuring out what this timestamp means? Done with format strings? Cannot be bothered to care about all the seconds, millis, and jiffies?
You don't have to! wttime is a fuzzy parser that can recover and disambiguate virtually any time specification you can throw at it.
Getting Started
Installation
pip install wttime
Examples
Guessing the most likely meaning:
$ wttime -t 'America/Los_Angeles' 20200101
UTC: 2020-01-01 08:00:00 (+0000)
$ wttime 1231231233000000
UTC: 2009-01-06 08:40:33 (+0000)
$ wttime 1231231233000
UTC: 2009-01-06 08:40:33 (+0000)
$ wttime 'Tuesday 10pm'
UTC: 2020-05-26 20:00:00 (+0000)
Variety of output formats:
$ wttime -l -r --remote-timezone 'America/Chicago' -f '%Y-%m-%d %H:%M' -umy 1231231233000000
UTC: 2009-01-06 08:40
Local: 2009-01-06 09:40
Remote: 2009-01-06 02:40
Seconds: 1231231233
Millis: 1231231233000
Micros: 1231231233000000
$ wttime -nx 20200810 -ns -y
1597010400000000
Help
wttime --help
TODOs
- get more data about format frequency in the wild
- figure out how to get feedback
Development
Add pre-commit hooks:
ln -sf $(pwd)/misc/hooks/pre-commit .git/hooks
Run tests
pytest
Publish to PyPI
rm -rf sdist
python setup.py sdist
twine upload dist/*
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Metadata
Release files for wttime 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wttime-0.2.1.tar.gz | 5.8 kB | Without provenance | Details for wttime-0.2.1.tar.gz |
Release files / wttime-0.2.1.tar.gz
| Download URL | wttime-0.2.1.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c674d65bbaabf4a4ba07b1485c48bb806b06be48c77645b1a5db97d383102d8d
|
|
BLAKE2b-256 checksum How to use checksums |
b75029dfb57001ad39705e7931cc9952d4947d3e44e6e229b6652454d9b16bbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Security for wttime 0.2.1
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.