Helper library for manipulation of formatted date/datetime values.
Project description
dateint
Helper library for manipulation of formatted date/datetime values
It's very common to store date/datetimes as integers or strings using formats
such as YYYYmmdd
or YYYYmm
. In python, to perform date/datetime arithmetic on those
values, one needs to:
- convert the original value to
date
ordatetime
- perform the date/datetime operation
- convert the result back to the original format
With dateint
, we abstract all convertion operations so you can focus on the
arithmetic step:
-
single value:
import dateint as di di.add(20220510, days=15) # 20220525
-
pandas:
import dateint as di import pandas as pd dates = pd.Series([202201, 202202, 202203]) di.add(dates, months=2) ''' 0 202203 1 202204 2 202205 dtype: int64 '''
Documentation
See the documentation page for the complete and detailed documentation.
Installation
pip install dateint
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
dateint-0.1.0.tar.gz
(6.3 kB
view hashes)