Skip to main content

Helper library for manipulation of formatted date/datetime values.

Project description

dateint

ci-status Coverage PYPI MIT License Code Style Black

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:

  1. convert the original value to date or datetime
  2. perform the date/datetime operation
  3. 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


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)

Uploaded Source

Built Distribution

dateint-0.1.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page