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.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dateint-0.2.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file dateint-0.2.0.tar.gz.

File metadata

  • Download URL: dateint-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dateint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 853cab5770832cba6013601a7ca309432098444b678020e7cc4c17cf22d33fb3
MD5 def80bf056188104cf6fd7ad509fa6a3
BLAKE2b-256 01b46c6bed242c0177aabf4e117fb1d95f6017fd225c6fcbddc468724d7e15cb

See more details on using hashes here.

File details

Details for the file dateint-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dateint-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dateint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 056235469a4b6890741380e8e2f62a77a8f063b2ed465f521a35ee74daf50406
MD5 2dc0c30a5618794bb53101e7e6af896f
BLAKE2b-256 d4f4468eca87cb9fc18cc5cac20adf7b9e18a2b1eaca9a640d22acac3e0d9bb2

See more details on using hashes here.

Supported by

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