Calculates the days between two dates based on a 360 day year.
Project description
days360
Calculates the days between two dates based on the 360-day year.
- Implementation of Excel's (or Number's)
DAYS360/TAGE360formula in python. - Both EU and US methods of calculation are supported, with optional Excel bug compatibility.
Installation
pip install days360
Usage
from datetime import date
from days360 import days360
date_a = date(2022, 10, 2)
date_b = date(2023, 11, 30)
# supported methods: "US" (default), "US_NASD", "EU"
days = days360(date_a, date_b, method="US")
print(days) # prints 418
Planned
- ISDA and PSA methods.
Notes and credits
- Implementations are based on https://en.wikipedia.org/wiki/360-day_calendar.
- This library started as a port of this ruby gem: https://github.com/tamaloa/days360/tree/master
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
days360-1.0.0.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file days360-1.0.0.tar.gz.
File metadata
- Download URL: days360-1.0.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b76cd6b46c6d725d3f86a1a8ecc65bfeb28a32c6580a34f5e779414e10f3c59
|
|
| MD5 |
2af5260c0a5d49f8d76bcf866e64a91f
|
|
| BLAKE2b-256 |
88ef380a8e0565dd580398c1dbd57ba94e1f71fad7c3dd7e5a1f7ba53e996087
|
File details
Details for the file days360-1.0.0-py3-none-any.whl.
File metadata
- Download URL: days360-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f2ee72dd36249fb3529731bf0810e4a3cb9e1a60d1ee95dbd08bf731b8fe737
|
|
| MD5 |
bbed37f9cef1e86aed48e04ba12aeb01
|
|
| BLAKE2b-256 |
ecd232a9a6bf3cde7b915de63e372456faaa1b9da04e9663bd0e4443078c4db8
|