yieldcurves


Nameyieldcurves JSON
Version 0.2.9 PyPI version JSON
download
home_pagehttps://github.com/sonntagsgesicht/yieldcurves
SummaryA Python library for financial yield curves.
upload_time2024-10-28 16:01:23
maintainerNone
docs_urlNone
authorsonntagsgesicht
requires_pythonNone
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

Python library *yieldcurves*
----------------------------

.. image:: https://github.com/sonntagsgesicht/yieldcurves/actions/workflows/python-package.yml/badge.svg
    :target: https://github.com/sonntagsgesicht/yieldcurves/actions/workflows/python-package.yml
    :alt: GitHubWorkflow

.. image:: https://img.shields.io/readthedocs/yieldcurves
   :target: http://yieldcurves.readthedocs.io
   :alt: Read the Docs

.. image:: https://img.shields.io/github/license/sonntagsgesicht/yieldcurves
   :target: https://github.com/sonntagsgesicht/yieldcurves/raw/master/LICENSE
   :alt: GitHub

.. image:: https://img.shields.io/github/release/sonntagsgesicht/yieldcurves?label=github
   :target: https://github.com/sonntagsgesicht/yieldcurves/releases
   :alt: GitHub release

.. image:: https://img.shields.io/pypi/v/yieldcurves
   :target: https://pypi.org/project/yieldcurves/
   :alt: PyPI Version

.. image:: https://img.shields.io/pypi/pyversions/yieldcurves
   :target: https://pypi.org/project/yieldcurves/
   :alt: PyPI - Python Version

.. image:: https://pepy.tech/badge/yieldcurves
   :target: https://pypi.org/project/yieldcurves/
   :alt: PyPI Downloads

A Python library for financial yield curves.
Typical banking business methods are provided like interpolation, compounding,
discounting and fx.


Example Usage
-------------


>>> from curves.interpolation import linear
>>> from yieldcurves import YieldCurve

>>> time_grid = [0, 2]
>>> rate_grid = [.03, .05]
>>> curve = linear(time_grid, rate_grid)
>>> yc = YieldCurve(curve)
>>> yc.zero(0, 1)
0.040000000000000036

>>> yc.df(0, 1)
0.9607894391523232


Or use `datetime <https://docs.python.org/3/library/datetime.html>`_

>>> from yieldcurves import DateCurve
>>> from datetime import date

>>> start = date(2013, 1, 1)
>>> mid = date(2014, 1, 1)
>>> end = date(2015, 1, 1)


>>> dc = DateCurve.from_interpolation([start, end], [.03, .05], origin=start)
>>> dc.zero(start, mid)
0.03999999999999998

>>> dc.df(start, mid)
0.9608157444936446


The framework works fine with native `datetime <https://docs.python.org/3/library/datetime.html>`_
but we recommend `businessdate <https://pypi.org/project/businessdate/>`_ package
for more convenient functionality to roll out date schedules.



>>> from businessdate import BusinessDate, BusinessSchedule

So, build a date schedule.

>>> today = BusinessDate(20201031)
>>> schedule = BusinessSchedule(today, today + "8q", step="1q")
>>> schedule
[BusinessDate(20201031), BusinessDate(20210131), BusinessDate(20210430), BusinessDate(20210731), BusinessDate(20211031), BusinessDate(20220131), BusinessDate(20220430), BusinessDate(20220731), BusinessDate(20221031)]


Documentation
-------------

More documentation available at
`https://yieldcurves.readthedocs.io <https://yieldcurves.readthedocs.io>`_


Install
-------

The latest stable version can always be installed or updated via pip:

.. code-block:: bash

    $ pip install yieldcurves


Development Version
-------------------

The latest development version can be installed directly from GitHub:

.. code-block:: bash

    $ pip install --upgrade git+https://github.com/sonntagsgesicht/yieldcurves.git


Contributions
-------------

.. _issues: https://github.com/sonntagsgesicht/yieldcurves/issues
.. __: https://github.com/sonntagsgesicht/yieldcurves/pulls

Issues_ and `Pull Requests`__ are always welcome.


License
-------

.. __: https://github.com/sonntagsgesicht/yieldcurves/raw/master/LICENSE

Code and documentation are available according to the Apache Software License (see LICENSE__).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sonntagsgesicht/yieldcurves",
    "name": "yieldcurves",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "sonntagsgesicht",
    "author_email": "sonntagsgesicht@icloud.com",
    "download_url": "https://files.pythonhosted.org/packages/90/8a/40c3c59fb3ca2a65a67b1bb7160141305d2f6033c7acc5b7a8af59fa7e07/yieldcurves-0.2.9.zip",
    "platform": "any",
    "description": "\n\nPython library *yieldcurves*\n----------------------------\n\n.. image:: https://github.com/sonntagsgesicht/yieldcurves/actions/workflows/python-package.yml/badge.svg\n    :target: https://github.com/sonntagsgesicht/yieldcurves/actions/workflows/python-package.yml\n    :alt: GitHubWorkflow\n\n.. image:: https://img.shields.io/readthedocs/yieldcurves\n   :target: http://yieldcurves.readthedocs.io\n   :alt: Read the Docs\n\n.. image:: https://img.shields.io/github/license/sonntagsgesicht/yieldcurves\n   :target: https://github.com/sonntagsgesicht/yieldcurves/raw/master/LICENSE\n   :alt: GitHub\n\n.. image:: https://img.shields.io/github/release/sonntagsgesicht/yieldcurves?label=github\n   :target: https://github.com/sonntagsgesicht/yieldcurves/releases\n   :alt: GitHub release\n\n.. image:: https://img.shields.io/pypi/v/yieldcurves\n   :target: https://pypi.org/project/yieldcurves/\n   :alt: PyPI Version\n\n.. image:: https://img.shields.io/pypi/pyversions/yieldcurves\n   :target: https://pypi.org/project/yieldcurves/\n   :alt: PyPI - Python Version\n\n.. image:: https://pepy.tech/badge/yieldcurves\n   :target: https://pypi.org/project/yieldcurves/\n   :alt: PyPI Downloads\n\nA Python library for financial yield curves.\nTypical banking business methods are provided like interpolation, compounding,\ndiscounting and fx.\n\n\nExample Usage\n-------------\n\n\n>>> from curves.interpolation import linear\n>>> from yieldcurves import YieldCurve\n\n>>> time_grid = [0, 2]\n>>> rate_grid = [.03, .05]\n>>> curve = linear(time_grid, rate_grid)\n>>> yc = YieldCurve(curve)\n>>> yc.zero(0, 1)\n0.040000000000000036\n\n>>> yc.df(0, 1)\n0.9607894391523232\n\n\nOr use `datetime <https://docs.python.org/3/library/datetime.html>`_\n\n>>> from yieldcurves import DateCurve\n>>> from datetime import date\n\n>>> start = date(2013, 1, 1)\n>>> mid = date(2014, 1, 1)\n>>> end = date(2015, 1, 1)\n\n\n>>> dc = DateCurve.from_interpolation([start, end], [.03, .05], origin=start)\n>>> dc.zero(start, mid)\n0.03999999999999998\n\n>>> dc.df(start, mid)\n0.9608157444936446\n\n\nThe framework works fine with native `datetime <https://docs.python.org/3/library/datetime.html>`_\nbut we recommend `businessdate <https://pypi.org/project/businessdate/>`_ package\nfor more convenient functionality to roll out date schedules.\n\n\n\n>>> from businessdate import BusinessDate, BusinessSchedule\n\nSo, build a date schedule.\n\n>>> today = BusinessDate(20201031)\n>>> schedule = BusinessSchedule(today, today + \"8q\", step=\"1q\")\n>>> schedule\n[BusinessDate(20201031), BusinessDate(20210131), BusinessDate(20210430), BusinessDate(20210731), BusinessDate(20211031), BusinessDate(20220131), BusinessDate(20220430), BusinessDate(20220731), BusinessDate(20221031)]\n\n\nDocumentation\n-------------\n\nMore documentation available at\n`https://yieldcurves.readthedocs.io <https://yieldcurves.readthedocs.io>`_\n\n\nInstall\n-------\n\nThe latest stable version can always be installed or updated via pip:\n\n.. code-block:: bash\n\n    $ pip install yieldcurves\n\n\nDevelopment Version\n-------------------\n\nThe latest development version can be installed directly from GitHub:\n\n.. code-block:: bash\n\n    $ pip install --upgrade git+https://github.com/sonntagsgesicht/yieldcurves.git\n\n\nContributions\n-------------\n\n.. _issues: https://github.com/sonntagsgesicht/yieldcurves/issues\n.. __: https://github.com/sonntagsgesicht/yieldcurves/pulls\n\nIssues_ and `Pull Requests`__ are always welcome.\n\n\nLicense\n-------\n\n.. __: https://github.com/sonntagsgesicht/yieldcurves/raw/master/LICENSE\n\nCode and documentation are available according to the Apache Software License (see LICENSE__).\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "A Python library for financial yield curves.",
    "version": "0.2.9",
    "project_urls": {
        "Homepage": "https://github.com/sonntagsgesicht/yieldcurves"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "908a40c3c59fb3ca2a65a67b1bb7160141305d2f6033c7acc5b7a8af59fa7e07",
                "md5": "58d02d665e252ca89c59fcdecf6c3c84",
                "sha256": "aac6d42e5f3ef4c3181fb41bc60b8c919555297adad33f1ee61f2b1b16cf2470"
            },
            "downloads": -1,
            "filename": "yieldcurves-0.2.9.zip",
            "has_sig": false,
            "md5_digest": "58d02d665e252ca89c59fcdecf6c3c84",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 45319,
            "upload_time": "2024-10-28T16:01:23",
            "upload_time_iso_8601": "2024-10-28T16:01:23.070899Z",
            "url": "https://files.pythonhosted.org/packages/90/8a/40c3c59fb3ca2a65a67b1bb7160141305d2f6033c7acc5b7a8af59fa7e07/yieldcurves-0.2.9.zip",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-28 16:01:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sonntagsgesicht",
    "github_project": "yieldcurves",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "yieldcurves"
}
        
Elapsed time: 0.33984s