DateStr Package
DateStr package provide a wrapper object around relativedelta to manage date and datetime strings
Installation :
pip install datestr
Examples :
Example 1:
>>> from datestr import Date
>>> Date('2017-06-04').relativedelta(days=2)
'2017-06-06'
>>> type(Date('2017-06-04').relativedelta(days=2))
<class 'str'>
Example 2:
>>> from datestr import Date
>>> Date('2017-06-04').relativedelta(month=2, day=3)
'2017-02-03'
>>> Date('2017-06-04').relativedelta(last_day=True)
'2017-06-30'
>>> Date('2017-06-04').relativedelta(months=4, last_day=True)
'2017-10-31'
Example 3:
>>> from datestr import Date
>>> Date('2017-06-04').relativedelta(hour=12)
>>> '2017-06-04'
>>> Date('2017-06-04').relativedelta(hour=12, rtype='datetime')
>>> '2017-06-04 12:00:00'
Example 4:
>>> from datestr import Date
>>> Date('2017-06-04 04:30:00').relativedelta(days=4, hour=12)
>>> '2017-06-08 12:30:00'
>>> Date('2017-06-04 04:30:00').relativedelta(days=4, hour=12, rtype='date')
>>> '2017-06-08'
Example 5:
>>> from datestr import Date
>>> from datetime import datetime, date
>>> Date(date(2018, 6, 3)).relativedelta()
>>> '2018-06-03'
>>> Date(datetime(2018, 6, 3, 12, 15, 30)).relativedelta()
>>> '2018-06-03 12:15:30'
Licence
This software is made available under the LGPL v3 license.
Bug Tracker
Please, feel free to report bugs or suggestions in the Bug Tracker!
Credits:
Mohamed Cherkaoui <http://mohamedcherkaoui.com>
News
0.1.0
Release date: 04-Jun-2017
First stable version
Metadata
Release files for datestr 0.1.0
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 |
|---|---|---|---|---|
| datestr-0.1.0.tar.gz | 2.7 kB | Without provenance | Details for datestr-0.1.0.tar.gz |
Release files / datestr-0.1.0.tar.gz
| Download URL | datestr-0.1.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abb67d60918892ad9ab678089a8a079a75a7730e236b9540610f661fd8f6ecd5
|
|
BLAKE2b-256 checksum How to use checksums |
ab92ef6ee1362de0080f8cde35e1e4213e7282a6dec77755c912fc3bdf15126a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for datestr 0.1.0
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.