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, PSA and SIA 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
Metadata
Release files for days360 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| days360-1.0.2.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| days360-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / days360-1.0.2.tar.gz
| Download URL | days360-1.0.2.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96d0e4dbd2e398fbd1a9b93b618540a1f3894176dfefcdde4e205f4dfdae6832
|
|
BLAKE2b-256 checksum How to use checksums |
97eac9d4bdd10671f97d96c7e700635ac90899be410c454da39ecfbd3ce7e740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
|
Release files / days360-1.0.2-py3-none-any.whl
| Download URL | days360-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3bdcce8f3ca2b046f5e63015a878bf56a560fe6fcaae657a399c3d6342232fc
|
|
BLAKE2b-256 checksum How to use checksums |
fe47ec18e652c92c06d518f75819e4e09f97b841d19d21879d709c49fa53946c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
|