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.1.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.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dateint-0.1.1.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.1.1.tar.gz
Algorithm Hash digest
SHA256 afe5b889adf4d70c1c8c456eaf980ff07e72784c7d7ab216e339bae06b37bab5
MD5 dda110a550ce321437a1b193bac3cb3d
BLAKE2b-256 7102ef15b4066e312cd536a6d67ea0914b20cd6dc997cfe94b5ff02be6ad9022

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dateint-0.1.1-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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7ab0eaae0bfee2edf95b8614e26effe77a6924936b2924a71beea7264cd47d9
MD5 74e1b22420b027e0a5e0b785c42123db
BLAKE2b-256 8e5523940f7423456917f00c67bc1f7cb905a30e20497f275f879557a7f7ef3b

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