fasti-dates
Python bindings for fasti — dates, calendars, business-day conventions and day-count fractions for financial code, in native Rust with no floating-point arithmetic anywhere.
The distribution is fasti-dates; the import name is fasti, matching
the crate. fasti on PyPI is an unrelated FastAPI project manager, and
fasti-py is refused as too similar to it — PyPI strips a py affix
before comparing names.
That project also installs its own top-level fasti package, so having
both in one environment would leave whichever was installed second. It
has published two 0.0.0.dev releases and nothing since, and matching
the crate name is worth more here than insuring against a collision with
a placeholder — but if you need both, install them in separate
environments.
$ pip install fasti-dates
Wheels are abi3 from CPython 3.10 up, so one wheel per platform covers
every version, and a new CPython needs no new wheel.
The boundary
This is a translation layer, not a second library. Every name maps to one in the crate, with the same method names, the same semantics and the same argument order.
- Dates in and out are
datetime.date, and nothing else. Astris refused, namingdatetime.date.fromisoformat. Adatetime.datetimeis refused too: which day a moment falls on is a time-zone decision, and this library has no time-zone concept — call.date()yourself. - Year fractions come back as
fractions.Fraction. Never a float. The crate is float-free, and that has to survive the boundary. - Errors are
FastiError, aValueError. Type mistakes areTypeError.
>>> import datetime
>>> from fasti.calendars import us
>>> us.SETTLEMENT.is_holiday("2024-07-04")
Traceback (most recent call last):
TypeError: fasti takes a datetime.date, not a str: ...
>>> us.SETTLEMENT.is_holiday(datetime.datetime(2024, 7, 4, 23, 30))
Traceback (most recent call last):
TypeError: fasti takes a datetime.date, not a datetime.datetime: ...
- Values are immutable. Every mutator returns a new value; every value compares, hashes and pickles.
The operators the crate defines are spelled the Python way, and only
those: a date steps by a period, and the two enums the crate orders —
Weekday and Frequency — are the two that sort.
>>> import datetime
>>> from fasti import Frequency, Period, Weekday
>>> datetime.date(2026, 1, 15) + Period.months(6)
datetime.date(2026, 7, 15)
>>> datetime.date(2026, 1, 31) + Period.months(1) # Add clamps; it never snaps
datetime.date(2026, 2, 28)
>>> sorted([Weekday.SUN, Weekday.MON]), Frequency.ANNUAL < Frequency.MONTHLY
([Weekday.MON, Weekday.SUN], True)
End-of-month preservation is Calendar.advance's business, not +'s —
the same split the crate makes between Add and Date::advance. A
BusinessDayConvention refuses < because the crate gives it no order.
Quickstart
>>> import datetime
>>> from fasti import DayCount, Period, Rule, Schedule
>>> from fasti.calendars import us
>>> us.SETTLEMENT.is_business_day(datetime.date(2024, 7, 4))
False
>>> us.SETTLEMENT.adjust(datetime.date(2024, 7, 4), "following")
datetime.date(2024, 7, 5)
>>> us.SETTLEMENT.advance(datetime.date(2025, 1, 31), Period.months(1),
... "modified following", True)
datetime.date(2025, 2, 28)
>>> schedule = Schedule(datetime.date(2025, 1, 15), datetime.date(2026, 1, 15),
... "semiannual", us.GOVERNMENT_BOND)
>>> schedule.dates()
[datetime.date(2025, 1, 15), datetime.date(2025, 7, 15), datetime.date(2026, 1, 15)]
>>> DayCount.act_act_icma("semiannual").bind(schedule).year_fraction(
... datetime.date(2025, 1, 15), datetime.date(2025, 4, 15))
Fraction(45, 181)
A Schedule is its coupon dates: it has a length, indexes, slices,
iterates and reverses, because the crate's schedule derefs to [Date].
Slicing gives you the dates; after and until are what give you back a
schedule, since a bare run of dates names no lattice.
>>> schedule[1:], schedule[-1], len(schedule)
([datetime.date(2025, 7, 15), datetime.date(2026, 1, 15)], datetime.date(2026, 1, 15), 3)
Calendars compose:
>>> from fasti.calendars import france, us
>>> joint = us.SETTLEMENT.union(france.SETTLEMENT)
>>> joint.is_holiday(datetime.date(2026, 7, 14)), joint.is_holiday(datetime.date(2026, 11, 26))
(True, True)
>>> quiet = joint.with_rule(Rule.one_off(datetime.date(2026, 8, 3))).with_name("Acme")
>>> quiet.name
'Acme'
Reading the API
One rule settles what is a property and what is a method: a field in the
crate is a property here, a method there is a method here. So
calendar.name and period.unit are properties, while
day_count.name(), period.length() and frequency.per_year() are
calls. It is not the usual Python instinct — the usual instinct is that
anything cheap is a property — but it means you can read the Rust docs and
know what to type without a second table.
Equality and pickling
Calendar and Rule compare structurally — two values are equal
when they were built the same way. That is not "these two agree on every
date": settling that means walking 1901 through 2199. (Rule cannot
derive equality in the crate at all, since its escape hatch holds a
function pointer.)
Everything pickles. A built-in calendar travels as its registry name,
because it holds those function-pointer rules; a derived one travels as
the operations applied to it; a generated Schedule replays its
generation arguments, because its stub reference grid is not recoverable
from the dates alone.
Typing
The package ships type stubs and py.typed. Date positions are spelled
datetime.date.
A type checker cannot reject a datetime.datetime where a
datetime.date is wanted — datetime subclasses date, so it type-checks.
The runtime rejects it.
What is not here
Rule.Custom. The crate's escape hatch is a barefn(Date) -> boolpointer, which no Python callable can be.Date,Year,Month,Ordinal,Weekend,Fraction. Python already hasdatetime.dateandfractions.Fraction; months, years and ordinals areints; a weekend is a sequence ofWeekday.
Development
See CONTRIBUTING.md. In short:
$ uv sync # or: pip install maturin pytest mypy
$ maturin develop
$ pytest && mypy
License
Apache-2.0 OR MIT, the same as the crate.
Metadata
Release files for fasti-dates 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fasti_dates-0.2.1.tar.gz | 205.5 kB | Details |
Built distributions (wheels)
Total release size: 5.9 MB
Release files / fasti_dates-0.2.1.tar.gz
| Download URL | fasti_dates-0.2.1.tar.gz |
|---|---|
| Size | 205.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e52262add2eee06db1a619882a201d7fdb309d9e1fce07eb07dd9e86c7fbb874
|
|
BLAKE2b-256 checksum How to use checksums |
0ce7de04618eee3247bcd40d1c618636780d9773a61d66ee989d0297b161a509
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp314-cp314t-win_amd64.whl
| Download URL | fasti_dates-0.2.1-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 275.7 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d6269c1be25c48f6982986d580f91a836038ffce7d5075f0be26e3d59a725a00
|
|
BLAKE2b-256 checksum How to use checksums |
253d17f7365e172d4911bf7baa56d11715f38e5d0a8986e48ec74635a6527bf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl
| Download URL | fasti_dates-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 584.2 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
e375eaa5f10c90483ba12c13a2ffb45d044be4cc954d809cf4a815d3759a8e87
|
|
BLAKE2b-256 checksum How to use checksums |
f20f0577a5f09e5e67d9c3b2c04ea887d20d2c642a4d590785dc8a7be3d9b68e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl
| Download URL | fasti_dates-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 536.6 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
c4befe580909215d6228970738927bd1e5398198cc949aafc3504247b22ded5c
|
|
BLAKE2b-256 checksum How to use checksums |
0c8c73be1cddaac3f906084819c5023eb76c69385ac527b90e1d4e1453d9ae55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | fasti_dates-0.2.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 373.9 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4444991decdbb1c5ba788fe477dd6c69ced7dfb51cf627312a34fd25d9699fd5
|
|
BLAKE2b-256 checksum How to use checksums |
bafe81c09ea2bab045bfc6808a6da47d20ee4c18ad2ce8dd97b75c259ed2dac4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | fasti_dates-0.2.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 358.0 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
af3435d840bdb560df8db43576f0f7184572b6a1cbd218d93aa883cd86141f16
|
|
BLAKE2b-256 checksum How to use checksums |
1640f06c0f7fe28a13314f86c82f4753d0ea635333e2451cf86f69e5a0a3b096
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | fasti_dates-0.2.1-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 351.3 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fbee457a2c85feb9ed24c8ed228bf19ff90b77224cf33c03e6c5482a4708181a
|
|
BLAKE2b-256 checksum How to use checksums |
77e2ff377ae9d228f175867d90b03e374930b61d8b8e8beafc8924a74a5fef5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp314-cp314t-macosx_10_12_x86_64.whl
| Download URL | fasti_dates-0.2.1-cp314-cp314t-macosx_10_12_x86_64.whl |
|---|---|
| Size | 362.1 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
54a6eb90bf53756db7cfca4fd545e2afa7da26d868b9c9ee24e4c4f6d4b9c5e8
|
|
BLAKE2b-256 checksum How to use checksums |
2f304b39c1b70726187ff3bf5da7b6617df649de30186e1bebbdf20ca4de0cf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp310-abi3-win_amd64.whl
| Download URL | fasti_dates-0.2.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 285.2 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6d6cec57e57a6410b0ade9a6e2c0f84eb5dffc229b060fd483ba075ef294b474
|
|
BLAKE2b-256 checksum How to use checksums |
fa7ca89f1fa35154aec55c53dd67b94adbc282244fa1077ed14461577b895189
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | fasti_dates-0.2.1-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 595.0 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3f073fc615128eed866f75e94343c3e185752e8dd555f80c3b35d56b8c4ce1d5
|
|
BLAKE2b-256 checksum How to use checksums |
a4ea3202db2c610312174ef834cf143f143dc96e7ca7339c0115c5b8eb680727
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | fasti_dates-0.2.1-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 545.8 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
eaea69deafd30d04b8991e561512bbcb2dba29925ed21632878eb95b251114fa
|
|
BLAKE2b-256 checksum How to use checksums |
8d15a89d0c797945a52a8cee2a1e39c53d2e6477cbb0079d082b3288ac9da9a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | fasti_dates-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 385.5 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
95b3e5eb09757a051576c0df1cba5be1db3775c954183789b15d5ecae6ae0273
|
|
BLAKE2b-256 checksum How to use checksums |
2fc5bff3ddef27fa2779fee96ecb22790b1a69ca62ab9a633db35f574f868f7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | fasti_dates-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 368.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7fae026cd8ae0deb0bc016aaecb41459f8a32513c264a1da86e51f231a095745
|
|
BLAKE2b-256 checksum How to use checksums |
2540c6672a150dfd17ab78b8b74c0ee932d1591bba5b9dd93101e5b33d68744e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | fasti_dates-0.2.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 361.4 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
369d7a5fe5832511a38b4118ee61b254f60548865783c1a1b3bf18a0acada945
|
|
BLAKE2b-256 checksum How to use checksums |
005abbb708e427623f3fff1727fec2bbd09dd1d235b98cdd8d13c5e62fae6290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency logRelease files / fasti_dates-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | fasti_dates-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 359.1 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
f996c2d2e167e9e737a08fda84de4c7b4e5de9b49e06fdcdf540c44558ee0494
|
|
BLAKE2b-256 checksum How to use checksums |
37e3b897c0bc550994d1adb2f3e97702d57ebbfb34363eac9c67b3143abe0463
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.
Transparency log