Metadata-Version: 2.1
Name: shorthand_datetime
Version: 0.2.0
Summary: Parse shorthand datetime strings inspired by Grafana
Author-email: Wout Weijtjens <wout.weijtjens@gmail.com>, Pietro D'Antuono <pietro.dantuono@24sea.eu>
Description-Content-Type: text/x-rst
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Requires-Dist: twine ; extra == "build"
Requires-Dist: build ; extra == "build"
Requires-Dist: black==24.* ; extra == "dev"
Requires-Dist: mypy==1.* ; extra == "dev"
Requires-Dist: pycln==2.4.* ; extra == "dev"
Requires-Dist: isort==5.* ; extra == "dev"
Requires-Dist: ruff==0.* ; extra == "dev"
Requires-Dist: commitizen==3.* ; extra == "dev"
Requires-Dist: pre-commit==3.* ; extra == "dev"
Requires-Dist: types-PyYAML ; extra == "dev"
Requires-Dist: types-pytz ; extra == "dev"
Requires-Dist: types-requests ; extra == "dev"
Requires-Dist: sphinx ; extra == "docs"
Requires-Dist: sphinx-rtd-theme ; extra == "docs"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: pytest-mock ; extra == "test"
Requires-Dist: hypothesis ; extra == "test"
Requires-Dist: pytest-cov ; extra == "test"
Project-URL: Bug-Tracker, https://github.com/wweijtje/shorthand-datetime/issues
Project-URL: Documentation, https://pypi.org/project/shorthand-datetime/
Project-URL: Homepage, https://pypi.org/project/shorthand-datetime/
Project-URL: Repository, https://github.com/wweijtje/shorthand-datetime/
Provides-Extra: build
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: test

Shorthand datetime
-----------------------

Simple package to parse shorthand datetime strings

Using the package
------------------

    .. code-block:: python

        from shorthand_datetime.shorthand import parse_shorthand_datetime

        s = 'now-7d'
        dt = parse_shorthand_datetime(s)

Typical examples
----------------
- now-7d : current timestamp minus 7d
- now/d : today, rounded to the start of the day
- now-7d/d: 7 days ago, rounded to the start of the day
- now/M : first day of this month
- now-1M/M : first day of previous month

Acknowledgements
----------------

