--- id: yearfrac version: "0.4.8" license: MIT license_treatment: permissive maintenance: abandoned --- # yearfrac — Daycount methods to compute date differences in year units License: permissive · Maintenance: abandoned · Downloads: 153.9K/mo ## 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 above — verify before relying. Computes fractional year differences between dates using various daycount conventions (Actual/Actual, 30/360, 30/365) and provides calendar utilities like leap year checks and Easter date calculation. 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 pip install yearfrac uv add yearfrac poetry add yearfrac ## Installing yearfrac 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. 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) Requires Python 3.6 or later. 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_current - Install friction: high - Maintenance: abandoned - Downloads: 153.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags daycount methods year fraction, date difference in years, actual actual daycount, 30/360 day count convention, financial date calculations, year fraction calculation, accrued interest date basis, financial-math, date-calculations, unmaintained [View on SkillFed](https://skillfed.io/packages/yearfrac) · [View on PyPI](https://pypi.org/project/yearfrac/)