Time for humans in Python
Project description
HumanTime
HumanTime
is time for humans in Python.
Sidestep tedious and error-prone code in favor of a simple, English-based DSL for specifying absolute and relative times:
HumanTime.parseTime(Input) | Input
---------------------------+------------------------------------------
2019-05-05 19:32:28.493048 | now
2019-05-05 00:00:00.000000 | today
2019-05-05 12:00:00.000000 | noon
2019-05-04 00:00:00.000000 | yesterday
2019-05-06 00:00:00.000000 | tomorrow
2019-05-05 22:32:28.493048 | 3 hours from now
2019-05-05 22:31:28.493048 | 1 minute before 3 hours from now
2019-04-30 00:00:00.000000 | 3 months after 2019-1-31
2021-02-28 00:00:00.000000 | 1 year after 2020-02-29
Development
Unit Tests
Unit tests can be run with the following command:
> python3 -m unittest discover
..............
----------------------------------------------------------------------
Ran 14 tests in 0.006s
OK
CI
Continuous integration is handled in Gitlab CI via .gitlab-ci.yml
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
HumanTime-0.0.1.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for HumanTime-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df2f3b25b5f0e3a54c8221df494b65d6f104a539b41ca8d44f6174ba5e848bb |
|
MD5 | 0e01c8cfcf216009ec30a657863c32fb |
|
BLAKE2b-256 | 945b52c2267ad26b1ff0169be1ac5d1bd7a2d7b4ade8e736b6319b31022709ee |