pandas-market-calendars


Namepandas-market-calendars JSON
Version 4.4.0 PyPI version JSON
download
home_page
SummaryMarket and exchange trading calendars for pandas
upload_time2024-02-10 22:19:16
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT
keywords trading exchanges markets otc datetime holiday business days
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pandas_market_calendars
=======================
Market calendars to use with pandas for trading applications.

.. image:: https://badge.fury.io/py/pandas-market-calendars.svg
    :target: https://badge.fury.io/py/pandas-market-calendars

.. image:: https://readthedocs.org/projects/pandas-market-calendars/badge/?version=latest
   :target: http://pandas-market-calendars.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

.. image:: https://coveralls.io/repos/github/rsheftel/pandas_market_calendars/badge.svg?branch=master
    :target: https://coveralls.io/github/rsheftel/pandas_market_calendars?branch=master

Documentation
-------------
http://pandas-market-calendars.readthedocs.io/en/latest/

Overview
--------
The Pandas package is widely used in finance and specifically for time series analysis. It includes excellent
functionality for generating sequences of dates and capabilities for custom holiday calendars, but as an explicit
design choice it does not include the actual holiday calendars for specific exchanges or OTC markets.

The pandas_market_calendars package looks to fill that role with the holiday, late open and early close calendars
for specific exchanges and OTC conventions. pandas_market_calendars also adds several functions to manipulate the
market calendars and includes a date_range function to create a pandas DatetimeIndex including only the datetimes
when the markets are open. Additionally the package contains product specific calendars for future exchanges which
have different market open, closes, breaks and holidays based on product type.

This package provides access to over 50+ unique exchange calendars for global equity and futures markets.

This package is a fork of the Zipline package from Quantopian and extracts just the relevant parts. All credit for
their excellent work to Quantopian.

Major Releases
~~~~~~~~~~~~~~
As of v1.0 this package only works with Python3. This is consistent with Pandas dropping support for Python2.

As of v1.4 this package now has the concept of a break during the trading day. For example this can accommodate Asian
markets that have a lunch break, or futures markets that are open 24 hours with a break in the day for trade processing.

As of v2.0 this package provides a mirror of all the calendars from the `exchange_calendars <https://github.com/gerrymanoim/exchange_calendars>`_
package, which itself is the now maintained fork of the original trading_calendars package. This adds over 50 calendars.

As of v3.0, the function date_range() is more complete and consistent, for more discussion on the topic refer to PR #142 and Issue #138.

As of v4.0, this package provides the framework to add interruptions to calendars. These can also be added to a schedule and viewed using
the new interruptions_df property. A full list of changes can be found in PR #210.

Source location
~~~~~~~~~~~~~~~
Hosted on GitHub: https://github.com/rsheftel/pandas_market_calendars

Installation
~~~~~~~~~~~~
``pip install pandas_market_calendars``

Arch Linux package available here: https://aur.archlinux.org/packages/python-pandas_market_calendars/

Calendars
---------
The list of `available calendars <https://pandas-market-calendars.readthedocs.io/en/latest/calendars.html>`_

Quick Start
-----------
.. code:: python

    import pandas_market_calendars as mcal
    
    # Create a calendar
    nyse = mcal.get_calendar('NYSE')

    # Show available calendars
    print(mcal.get_calendar_names())

.. code:: python

    early = nyse.schedule(start_date='2012-07-01', end_date='2012-07-10')
    early

    
.. parsed-literal::

                      market_open             market_close
    =========== ========================= =========================
     2012-07-02 2012-07-02 13:30:00+00:00 2012-07-02 20:00:00+00:00
     2012-07-03 2012-07-03 13:30:00+00:00 2012-07-03 17:00:00+00:00
     2012-07-05 2012-07-05 13:30:00+00:00 2012-07-05 20:00:00+00:00
     2012-07-06 2012-07-06 13:30:00+00:00 2012-07-06 20:00:00+00:00
     2012-07-09 2012-07-09 13:30:00+00:00 2012-07-09 20:00:00+00:00
     2012-07-10 2012-07-10 13:30:00+00:00 2012-07-10 20:00:00+00:00

    
.. code:: python

    mcal.date_range(early, frequency='1D')




.. parsed-literal::

    DatetimeIndex(['2012-07-02 20:00:00+00:00', '2012-07-03 17:00:00+00:00',
                   '2012-07-05 20:00:00+00:00', '2012-07-06 20:00:00+00:00',
                   '2012-07-09 20:00:00+00:00', '2012-07-10 20:00:00+00:00'],
                  dtype='datetime64[ns, UTC]', freq=None)



.. code:: python

    mcal.date_range(early, frequency='1H')




.. parsed-literal::

    DatetimeIndex(['2012-07-02 14:30:00+00:00', '2012-07-02 15:30:00+00:00',
                   '2012-07-02 16:30:00+00:00', '2012-07-02 17:30:00+00:00',
                   '2012-07-02 18:30:00+00:00', '2012-07-02 19:30:00+00:00',
                   '2012-07-02 20:00:00+00:00', '2012-07-03 14:30:00+00:00',
                   '2012-07-03 15:30:00+00:00', '2012-07-03 16:30:00+00:00',
                   '2012-07-03 17:00:00+00:00', '2012-07-05 14:30:00+00:00',
                   '2012-07-05 15:30:00+00:00', '2012-07-05 16:30:00+00:00',
                   '2012-07-05 17:30:00+00:00', '2012-07-05 18:30:00+00:00',
                   '2012-07-05 19:30:00+00:00', '2012-07-05 20:00:00+00:00',
                   '2012-07-06 14:30:00+00:00', '2012-07-06 15:30:00+00:00',
                   '2012-07-06 16:30:00+00:00', '2012-07-06 17:30:00+00:00',
                   '2012-07-06 18:30:00+00:00', '2012-07-06 19:30:00+00:00',
                   '2012-07-06 20:00:00+00:00', '2012-07-09 14:30:00+00:00',
                   '2012-07-09 15:30:00+00:00', '2012-07-09 16:30:00+00:00',
                   '2012-07-09 17:30:00+00:00', '2012-07-09 18:30:00+00:00',
                   '2012-07-09 19:30:00+00:00', '2012-07-09 20:00:00+00:00',
                   '2012-07-10 14:30:00+00:00', '2012-07-10 15:30:00+00:00',
                   '2012-07-10 16:30:00+00:00', '2012-07-10 17:30:00+00:00',
                   '2012-07-10 18:30:00+00:00', '2012-07-10 19:30:00+00:00',
                   '2012-07-10 20:00:00+00:00'],
                  dtype='datetime64[ns, UTC]', freq=None)

Contributing
------------
All improvements and additional (and corrections) in the form of pull requests are welcome. This package will grow in
value and correctness the more eyes are on it.

To add new functionality please include tests which are in standard pytest format. 

Use pytest to run the test suite.

For complete information on contributing see CONTRIBUTING.md_

.. _CONTRIBUTING.md: https://github.com/rsheftel/pandas_market_calendars/blob/master/CONTRIBUTING.md

Future
------
This package is open sourced under the MIT license. Everyone is welcome to add more exchanges or OTC markets, confirm
or correct the existing calendars, and generally do whatever they desire with this code.

Sponsor
-------
.. image:: https://www.tradinghours.com/img/logo-with-words.png
    :target: https://www.tradinghours.com/data
    :alt: TradingHours.com

`TradingHours.com <https://www.tradinghours.com>`_ provides the most accurate and comprehensive coverage of market holidays and trading hours data available. They cover over 900 markets around the world. Their data is continually monitored for changes and updated daily. `Learn more <https://www.tradinghours.com/data>`_

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pandas-market-calendars",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "trading,exchanges,markets,OTC,datetime,holiday,business days",
    "author": "",
    "author_email": "Ryan Sheftel <rsheftel@alumni.upenn.edu>",
    "download_url": "https://files.pythonhosted.org/packages/d9/f1/fa78d21275f5b5492093aa26a78a3917d51d7e884095905a2bbb117facce/pandas_market_calendars-4.4.0.tar.gz",
    "platform": null,
    "description": "pandas_market_calendars\r\n=======================\r\nMarket calendars to use with pandas for trading applications.\r\n\r\n.. image:: https://badge.fury.io/py/pandas-market-calendars.svg\r\n    :target: https://badge.fury.io/py/pandas-market-calendars\r\n\r\n.. image:: https://readthedocs.org/projects/pandas-market-calendars/badge/?version=latest\r\n   :target: http://pandas-market-calendars.readthedocs.io/en/latest/?badge=latest\r\n   :alt: Documentation Status\r\n\r\n.. image:: https://coveralls.io/repos/github/rsheftel/pandas_market_calendars/badge.svg?branch=master\r\n    :target: https://coveralls.io/github/rsheftel/pandas_market_calendars?branch=master\r\n\r\nDocumentation\r\n-------------\r\nhttp://pandas-market-calendars.readthedocs.io/en/latest/\r\n\r\nOverview\r\n--------\r\nThe Pandas package is widely used in finance and specifically for time series analysis. It includes excellent\r\nfunctionality for generating sequences of dates and capabilities for custom holiday calendars, but as an explicit\r\ndesign choice it does not include the actual holiday calendars for specific exchanges or OTC markets.\r\n\r\nThe pandas_market_calendars package looks to fill that role with the holiday, late open and early close calendars\r\nfor specific exchanges and OTC conventions. pandas_market_calendars also adds several functions to manipulate the\r\nmarket calendars and includes a date_range function to create a pandas DatetimeIndex including only the datetimes\r\nwhen the markets are open. Additionally the package contains product specific calendars for future exchanges which\r\nhave different market open, closes, breaks and holidays based on product type.\r\n\r\nThis package provides access to over 50+ unique exchange calendars for global equity and futures markets.\r\n\r\nThis package is a fork of the Zipline package from Quantopian and extracts just the relevant parts. All credit for\r\ntheir excellent work to Quantopian.\r\n\r\nMajor Releases\r\n~~~~~~~~~~~~~~\r\nAs of v1.0 this package only works with Python3. This is consistent with Pandas dropping support for Python2.\r\n\r\nAs of v1.4 this package now has the concept of a break during the trading day. For example this can accommodate Asian\r\nmarkets that have a lunch break, or futures markets that are open 24 hours with a break in the day for trade processing.\r\n\r\nAs of v2.0 this package provides a mirror of all the calendars from the `exchange_calendars <https://github.com/gerrymanoim/exchange_calendars>`_\r\npackage, which itself is the now maintained fork of the original trading_calendars package. This adds over 50 calendars.\r\n\r\nAs of v3.0, the function date_range() is more complete and consistent, for more discussion on the topic refer to PR #142 and Issue #138.\r\n\r\nAs of v4.0, this package provides the framework to add interruptions to calendars. These can also be added to a schedule and viewed using\r\nthe new interruptions_df property. A full list of changes can be found in PR #210.\r\n\r\nSource location\r\n~~~~~~~~~~~~~~~\r\nHosted on GitHub: https://github.com/rsheftel/pandas_market_calendars\r\n\r\nInstallation\r\n~~~~~~~~~~~~\r\n``pip install pandas_market_calendars``\r\n\r\nArch Linux package available here: https://aur.archlinux.org/packages/python-pandas_market_calendars/\r\n\r\nCalendars\r\n---------\r\nThe list of `available calendars <https://pandas-market-calendars.readthedocs.io/en/latest/calendars.html>`_\r\n\r\nQuick Start\r\n-----------\r\n.. code:: python\r\n\r\n    import pandas_market_calendars as mcal\r\n    \r\n    # Create a calendar\r\n    nyse = mcal.get_calendar('NYSE')\r\n\r\n    # Show available calendars\r\n    print(mcal.get_calendar_names())\r\n\r\n.. code:: python\r\n\r\n    early = nyse.schedule(start_date='2012-07-01', end_date='2012-07-10')\r\n    early\r\n\r\n    \r\n.. parsed-literal::\r\n\r\n                      market_open             market_close\r\n    =========== ========================= =========================\r\n     2012-07-02 2012-07-02 13:30:00+00:00 2012-07-02 20:00:00+00:00\r\n     2012-07-03 2012-07-03 13:30:00+00:00 2012-07-03 17:00:00+00:00\r\n     2012-07-05 2012-07-05 13:30:00+00:00 2012-07-05 20:00:00+00:00\r\n     2012-07-06 2012-07-06 13:30:00+00:00 2012-07-06 20:00:00+00:00\r\n     2012-07-09 2012-07-09 13:30:00+00:00 2012-07-09 20:00:00+00:00\r\n     2012-07-10 2012-07-10 13:30:00+00:00 2012-07-10 20:00:00+00:00\r\n\r\n    \r\n.. code:: python\r\n\r\n    mcal.date_range(early, frequency='1D')\r\n\r\n\r\n\r\n\r\n.. parsed-literal::\r\n\r\n    DatetimeIndex(['2012-07-02 20:00:00+00:00', '2012-07-03 17:00:00+00:00',\r\n                   '2012-07-05 20:00:00+00:00', '2012-07-06 20:00:00+00:00',\r\n                   '2012-07-09 20:00:00+00:00', '2012-07-10 20:00:00+00:00'],\r\n                  dtype='datetime64[ns, UTC]', freq=None)\r\n\r\n\r\n\r\n.. code:: python\r\n\r\n    mcal.date_range(early, frequency='1H')\r\n\r\n\r\n\r\n\r\n.. parsed-literal::\r\n\r\n    DatetimeIndex(['2012-07-02 14:30:00+00:00', '2012-07-02 15:30:00+00:00',\r\n                   '2012-07-02 16:30:00+00:00', '2012-07-02 17:30:00+00:00',\r\n                   '2012-07-02 18:30:00+00:00', '2012-07-02 19:30:00+00:00',\r\n                   '2012-07-02 20:00:00+00:00', '2012-07-03 14:30:00+00:00',\r\n                   '2012-07-03 15:30:00+00:00', '2012-07-03 16:30:00+00:00',\r\n                   '2012-07-03 17:00:00+00:00', '2012-07-05 14:30:00+00:00',\r\n                   '2012-07-05 15:30:00+00:00', '2012-07-05 16:30:00+00:00',\r\n                   '2012-07-05 17:30:00+00:00', '2012-07-05 18:30:00+00:00',\r\n                   '2012-07-05 19:30:00+00:00', '2012-07-05 20:00:00+00:00',\r\n                   '2012-07-06 14:30:00+00:00', '2012-07-06 15:30:00+00:00',\r\n                   '2012-07-06 16:30:00+00:00', '2012-07-06 17:30:00+00:00',\r\n                   '2012-07-06 18:30:00+00:00', '2012-07-06 19:30:00+00:00',\r\n                   '2012-07-06 20:00:00+00:00', '2012-07-09 14:30:00+00:00',\r\n                   '2012-07-09 15:30:00+00:00', '2012-07-09 16:30:00+00:00',\r\n                   '2012-07-09 17:30:00+00:00', '2012-07-09 18:30:00+00:00',\r\n                   '2012-07-09 19:30:00+00:00', '2012-07-09 20:00:00+00:00',\r\n                   '2012-07-10 14:30:00+00:00', '2012-07-10 15:30:00+00:00',\r\n                   '2012-07-10 16:30:00+00:00', '2012-07-10 17:30:00+00:00',\r\n                   '2012-07-10 18:30:00+00:00', '2012-07-10 19:30:00+00:00',\r\n                   '2012-07-10 20:00:00+00:00'],\r\n                  dtype='datetime64[ns, UTC]', freq=None)\r\n\r\nContributing\r\n------------\r\nAll improvements and additional (and corrections) in the form of pull requests are welcome. This package will grow in\r\nvalue and correctness the more eyes are on it.\r\n\r\nTo add new functionality please include tests which are in standard pytest format. \r\n\r\nUse pytest to run the test suite.\r\n\r\nFor complete information on contributing see CONTRIBUTING.md_\r\n\r\n.. _CONTRIBUTING.md: https://github.com/rsheftel/pandas_market_calendars/blob/master/CONTRIBUTING.md\r\n\r\nFuture\r\n------\r\nThis package is open sourced under the MIT license. Everyone is welcome to add more exchanges or OTC markets, confirm\r\nor correct the existing calendars, and generally do whatever they desire with this code.\r\n\r\nSponsor\r\n-------\r\n.. image:: https://www.tradinghours.com/img/logo-with-words.png\r\n    :target: https://www.tradinghours.com/data\r\n    :alt: TradingHours.com\r\n\r\n`TradingHours.com <https://www.tradinghours.com>`_ provides the most accurate and comprehensive coverage of market holidays and trading hours data available. They cover over 900 markets around the world. Their data is continually monitored for changes and updated daily. `Learn more <https://www.tradinghours.com/data>`_\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Market and exchange trading calendars for pandas",
    "version": "4.4.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/rsheftel/pandas_market_calendars/issues",
        "Changelog": "https://pandas-market-calendars.readthedocs.io/en/latest/change_log.html",
        "Documentation": "https://pandas-market-calendars.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/rsheftel/pandas_market_calendars",
        "Source": "https://github.com/rsheftel/pandas_market_calendars"
    },
    "split_keywords": [
        "trading",
        "exchanges",
        "markets",
        "otc",
        "datetime",
        "holiday",
        "business days"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "32006818028f0daa7b65774aaad2403d1bab246200ab3d320a0b8ff15c22ebb6",
                "md5": "5f8dc47ee843046a19c3c358868492b0",
                "sha256": "1c3f042962a1733c48c5fee99da1955e22fb27a2b811832dec60dbc98f4becf1"
            },
            "downloads": -1,
            "filename": "pandas_market_calendars-4.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5f8dc47ee843046a19c3c358868492b0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 106629,
            "upload_time": "2024-02-10T22:19:14",
            "upload_time_iso_8601": "2024-02-10T22:19:14.205094Z",
            "url": "https://files.pythonhosted.org/packages/32/00/6818028f0daa7b65774aaad2403d1bab246200ab3d320a0b8ff15c22ebb6/pandas_market_calendars-4.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9f1fa78d21275f5b5492093aa26a78a3917d51d7e884095905a2bbb117facce",
                "md5": "d2736d3eda3efc8f231f0c5e6182c705",
                "sha256": "febff8054f3bd2dd27111c0e9902e14534ee9ac33de6128bb9b83f408a3e1584"
            },
            "downloads": -1,
            "filename": "pandas_market_calendars-4.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d2736d3eda3efc8f231f0c5e6182c705",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 134215,
            "upload_time": "2024-02-10T22:19:16",
            "upload_time_iso_8601": "2024-02-10T22:19:16.663405Z",
            "url": "https://files.pythonhosted.org/packages/d9/f1/fa78d21275f5b5492093aa26a78a3917d51d7e884095905a2bbb117facce/pandas_market_calendars-4.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-10 22:19:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rsheftel",
    "github_project": "pandas_market_calendars",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pandas-market-calendars"
}
        
Elapsed time: 0.24109s