yearfrac
Daycount methods to compute date differences in year units
Decision gist · record as of 2026-08-14
Yes, if you need standard daycount methods and can accept an unmaintained package. The library is stable for its narrow use case (no runtime dependencies, simple math), and the code is small enough to audit or fork if needed. No, if you require active maintenance, security updates, or integration with a modern financial library ecosystem. Consider alternatives if this is for production financial systems.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later.
- High install friction: the package is abandoned (last release 1285 days ago, last commit 2023-05-09) with no active maintenance.
- It has no runtime dependencies, so installation itself is straightforward, but you are adopting unmaintained code with no path to bug fixes or security updates.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.
last release 2023-02-06 (1285 days) · last repo commit 2023-05-09 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 153,928 downloads/mo, #10,866 on PyPI
Alternatives
Verify before relying
pip install yearfrac
from yearfrac import yearfrac
frac = yearfrac(start_date, end_date, method='act_isda')
print(frac)- Whether the daycount implementations conform to current financial industry standards (ISDA, AFB) or have known deviations.
- Whether the package handles edge cases (leap seconds, calendar transitions, invalid dates) as expected for financial use.
- Real-world accuracy and test coverage of Easter date and Julian Day conversions.
- Specific date ranges and scenarios the package has been tested against.
What it is and what it does
yearfrac is a Python library for computing the fractional number of years between two dates using standard financial daycount conventions. It implements methods like Actual/Actual ISDA, Actual/Actual AFB, 30E/360, and 30/365, which are commonly used in bond pricing, interest accrual, and other financial calculations. The package also provides utility functions for leap year detection, Easter Sunday calculation, and Julian Day number conversion.
The library has no external runtime dependencies and supports Python 3.6 and later. However, it has been abandoned since its latest release on 2023-02-06 with no active maintenance, meaning bugs and compatibility issues will not be addressed. It is suitable for projects that need basic daycount calculations but cannot rely on ongoing support or updates.
Use it for
- Calculate accrued interest on bonds using ISDA or AFB daycount conventions.
- Compute year fractions for financial derivatives pricing and risk calculations.
- Convert between calendar dates and Julian Day numbers for astronomical or historical date work.
- Determine Easter Sunday dates for calendar or scheduling applications.
- Validate leap year status in date processing pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need standard daycount methods and can accept an unmaintained package.
The library is stable for its narrow use case (no runtime dependencies, simple math), and the code is small enough to audit or fork if needed. No, if you require active maintenance, security updates, or integration with a modern financial library ecosystem. Consider alternatives if this is for production financial systems.
Install
yearfrac on PyPI
Before you install
High install friction: the package is abandoned (last release 1285 days ago, last commit 2023-05-09) with no active maintenance. It has no runtime dependencies, so installation itself is straightforward, but you are adopting unmaintained code with no path to bug fixes or security updates.
Requires Python 3.6 or later.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install yearfrac
from yearfrac import yearfrac
frac = yearfrac(start_date, end_date, method='act_isda')
print(frac)
Verify before relying
- Whether the daycount implementations conform to current financial industry standards (ISDA, AFB) or have known deviations.
- Whether the package handles edge cases (leap seconds, calendar transitions, invalid dates) as expected for financial use.
- Real-world accuracy and test coverage of Easter date and Julian Day conversions.
- Specific date ranges and scenarios the package has been tested against.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,285 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 153,928 / month, #10,866 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: yearfrac-0.4.8.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “daycount methods year fraction”
- yearfracComputes fractional year differences between dates using various…
- cftimeConverts between calendar dates and numeric time values for…
- number-parserConverts numbers written in natural language (e.g., "twenty three")…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also convertdate · jdcal · fiscalyear · dateutils · lunardate · LunarCalendar · datedelta · zhdate · python-dateutil