{ "info": { "author": "Victor Frazao", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython" ], "description": "\n# IEXTools\n\nv 0.0.7\n\nThis package provides tools for working with data provided by IEX's REST API and tools to decode and use IEX's binary market data (dubbed \"HIST\"). For more information on the type of data offered by IEX please visit their website: and \n\nDocumentation for the module is hosted on readthedocs.io: \n\n## Disclaimers\n\nThe author and contributors to this repository are not in any way associated with IEX. This code is provided AS IS with no warranties or any guarantees. It is entirely possible that at any moment this package will not work either due to a programming error or due to a change from IEX.\n\nThis package is under active development and may be subject to regular breaking changes.\n\n## Executive Summary\n\nThe Investors Exchange (IEX) was founded in 2012 by Brad Katsuyama to combat the effect that high frequency trading was having on other stock exchanges. The story of IEX was made famous by Michael Lewis in his book, _Fast Boys_.\n\nThis package aims to provide a variety of tools for working with stock data provided by IEX such as:\n\n1. The IEX HIST binary data feed files that are freely available through IEX. These files contain nanosecond precision information about stocks such as trades and quotes.\n2. The IEX REST API which provides a huge amount of data such as realtime price information for stocks.\n\n## Installation\n\n**Note: both of these installation methods will fail without Python 3.7 or greater.**\n\nInstall from PyPI:\n\n```shell\n$ py -m pip install IEXTools\n```\n\nOR\n\nNavigate to the folder containing the README.md file and run the pip command to install the package:\n\n```shell\n$ pip install .\n```\n\n### Requirements\n\n- Python 3.7 or greater\n- requests\n\n## Usage\n\n### Web API\n\nPurpose: Interact with the IEX web API. All methods return Python dictionaries.\n\nThe web API has a large number of endpoints returning data:\n\n```Python\n>>> from IEXTools import IEXAPI\n>>> api = IEXAPI()\n>>> meths = [d for d in dir(api) if not d.startswith('_')]\n>>> for i, j, k in zip(meths[::3], meths[1::3], meths[2::3]):\n... print(i.ljust(20), j.ljust(20), k.ljust(20))\n...\nBASE batch book\nchart collections company\ncrypto deep deep_book\ndeep_trades delayed_quote dividends\nearnings earnings_today effective_spread\nfinancials hist iex_auction\niex_corp_actions iex_dividends iex_historical\niex_historical_daily iex_next_day_ex_div iex_official_price\niex_short_interest iex_stats_intraday iex_stats_recent\niex_stats_records iex_symbols iex_threshold_securities\nlargest_trades last logo\nmarket news ohlc\noperational_halt peers previous\nprice quote relevant\nsector_performance security_event short_sale_price_test_status\nsplits stats stock_list\nsymbols system_event timeout\ntimeseries today_ipos tops\ntrade_break trading_status upcoming_ipos\n```\n\nUsers should consult the docstrings of a given function or IEX's docs for additional information on how to use a given endpoint. All endpoints documented in the IEX API docs are implemented in this class.\n\n```Python\n>>> help(api.ohlc)\nHelp on method ohlc in module IEX_API:\n\nohlc(symbol: str) -> dict method of IEX_API.IEX_API instance\n Returns the open, high, low, and close prices for a given company.\n\n https://iextrading.com/developer/docs/#ohlc\n\n>>> apple_ohlc = api.ohlc('aapl')\n>>> print(IEX_API.pretty_json(apple_ohlc))\n{\n \"close\": {\n \"price\": 204.47,\n \"time\": 1541797200568\n },\n \"high\": 206.01,\n \"low\": 202.25,\n \"open\": {\n \"price\": 205.55,\n \"time\": 1541773800180\n }\n}\n```\n\nAll symbols available on the API can be retrived using the `symbols` method:\n\n```Python\n>>> all_symbols = api.symbols()\n>>> len(all_symbols)\n8756\n>>> api.symbols()[1]\n{'symbol': 'AA', 'name': 'Alcoa Corporation', 'date': '2018-11-09', 'isEnabled': True, 'type': 'cs', 'iexId': '12042'}\n```\n\n### Downloader\n\nPurpose: Download IEX's pcap files containing nanosecond precision stock data - the so called HIST files.\n\nThe `DataDownloader` class can be instantiated without any arguments by simply calling the class.\n\n```Python\nd1 = IEXTools.DataDownloader()\n```\n\nThere are three available methods in this class:\n\n```python\n>>> print([method for method in dir(IEXTools.DataDownloader) if not method.startswith('_')])\n\n['decompress', 'download', 'download_decompressed']\n```\n\n- download: Downloads the gziped TOPS or DEEP file for a given datetime input\n- decompress: Unzips the compressed HIST file into a pcap\n- download_decompressed: downloads and decompresses the HIST file - deletes the zipped file at the end\n\n**Warning, IEX HIST files are generally very large (multiple gbs)**\n\nUsage:\n\n```Python\n>>> import IEXTools\n>>> from datetime import datetime\n>>> d1 = IEXTools.DataDownloader()\n>>> d1.download_decompressed(datetime(2018, 7, 13), feed_type='tops')\n'20180713_IEXTP1_TOPS1.6.pcap'\n```\n\n### Parser\n\nPurpose: Parse the binary PCAP / HIST files offered by IEX.\n\nTo create a Parser object simply supply the file path as an argument. Please note that if using a version 1.5 TOPS file then the `tops_version` parameter must be set to `1.5` on instantiation.\n\n```Python\n>>> from IEXTools import Parser, messages\n>>> p = Parser(r'IEX TOPS Sample\\20180103_IEXTP1_TOPS1.6.pcap')\n>>> p\nParser(\"IEX TOPS Sample\\\\20180103_IEXTP1_TOPS1.6.pcap\", tops=True, deep=False)\n```\n\nThis instantiates a Parser object with the pcap file opened. You can also optionally specify what type of HIST file you are loading, either TOPS (`tops=True`) or DEEP (`deep=True`).\n\nUse the `get_next_message` method of the Parser object to return a message object. The message objects are documented in the messages.py module. You can optionally specify a list of message classes to restrict the returned messages to only those types.\n\n```Python\n>>> allowed = [messages.TradeReport]\n>>> p.get_next_message(allowed)\nTradeReport(flags=64, timestamp=1514984427833117218, symbol='ZVZZT', size=975, price_int=100150, trade_id=577243)\n```\n\nThe last message retrieved can also be accessed through the Parser object itself with the `message` attribute. Similarly the message type can be accessed as `Parser.message_type` and the binary encoded message can be accessed with `Parser.message_binary`. The message object also has several attributes that may be accessed (varies by object).\n\n```Python\n>>> p.message\nTradeReport(flags=64, timestamp=1514984427833117218, symbol='ZVZZT', size=975, price_int=100150, trade_id=577243)\n>>> p.message.date_time\ndatetime.datetime(2018, 1, 3, 13, 0, 27, 833117, tzinfo=datetime.timezone.utc)\n>>> p.message.price\n10.015\n>>> p.message_type\n84\n>>> p.message_binary\nb'@\"\\xca=uON\\x06\\x15ZVZZT\\xcf\\x03\\x00\\x006\\x87\\x01\\x00\\x00\\x00\\x00\\x00\\xdb\\xce\\x08\\x00\\x00\\x00\\x00\\x00'\n```\n\nThe program also allows you to use it with a context manager and loop through it like a file:\n\n```Python\nwith Parser(file_path) as iex_messages:\n for message in iex_messages:\n do_something(message)\n```\n\nBenchmarks:\nOn my personal laptop (Lenovo ThinkPad X1 Carbon, Windows 10):\n\n```text\nBeginning test - 1,000,000 messages - all messages, not printing\nParsed 1,000,000 messages in 52.2 seconds -- 19141.6 messages per second\n\nBeginning test - 1,000,000 messages - only TradeReport and QuoteUpdate messages, not printing\nParsed 1,000,000 messages in 54.0 seconds -- 18512.9 messages per second\n```\n\nBy not specifying the `allowed` argument the parser returns 1,000,000 parsed messages approximately 3% faster. However, in order to return 1,000,000 parsed messages the Parser with the `allowed` argument set may have to read through more than 1,000,000 messages. Testing suggests that actually decoding the message takes about 10 microseconds (130,000 messages per second).\n\n## External References\n\n- HIST Download page: \n- IEX Transport Protocol documentation: \n- IEX TOPS documentation: \n- API docs: \n\n## Discussion\n\n### Pros\n\n**HIST**\n\n- This is tick by tick historical data offered by IEX for free - other exchanges typically charge large amounts of money for access to similar data\n\n**API**\n\n- The IEX web API provides a vast amount of data and has very high rate limits\n\n### Cons\n\n**HIST**\n\n- Some people say that the quality of data from IEX may be lower due to the lower volume that they handled when compared to other bigger exchanges (not sure how valid this actually is)\n- Unsure how this data is maintained (if at all)\n- The future availability of this data is not guaranteed, IEX may choose to paywall this data in the future\n- Data is unadjusted so it would need to be manually adjusted in order to use in a backtesting engine\n\n**API**\n\n- It appears that the v1 API will be deprecated in the first half of 2019 and will no longer be offered as a free service\n- There appears to be many inaccuracies in the data (as seen from a review of their issues page on Github)\n\n### Questions\n\n1. Q: Is the HIST data adjusted for dividends, splits, etc.? If so how often? A: No, HIST data is just a saved version of the live binary trading stream - unadjusted.\n2. Q: Am I required to fill out and submit a Data Agreement prior to accessing the data? A: According to the IEX API maintainers this is not required to access the historical data\n3. Q: Will this data remain free? A: It appears that there are plans for monetizing the web API in 2019 although there will be a free tier plan offered. The fate of the HIST data has not been divulged.\n\n## Release Notes\n\n### 0.0.1\n\n- `Parser` class - allows decoding of HIST binary data\n- `Message` objects defined - each IEX message type defined in TOPS now has an associated Python object\n\n### 0.0.2\n\n- `DataDownloader` class: allows user to download specified HIST files\n- Packaging for easy PIP install\n- Added context manager and iteration support to `Parser` object\n- Added typing support\n- Added some test coverage (still needs improvement)\n\n### 0.0.3\n\n- Bug fix: Circular import issue with AllMessages from the TypeAliases file\n- Security: Upgraded requests library to 2.20.0 due to vulnerability\n- `IEXAPI` class: allows the user to access all endpoints of the IEX REST API v1\n- Added tests for the `IEXAPI` class\n\n### 0.0.4\n\n- Added documentation (via Sphinx)\n\n### 0.0.5\n\n- Added support for version 1.5 TOPS files\n- Updated urllib3 version in requirements.txt due to vulnerability\n\n### 0.0.6\n\n- Fixed bug raised in issue #7\n\n### 0.0.7\n\n- Fixed bug raised in issue #9\n\n### 0.0.8\n\n- Changes in https://github.com/vfrazao-ns1/IEXTools/pull/13\n- Make download path configurable\n- Decompress .gz files on the fly\n\n### Future Focus\n\n- Additional testing\n- Review typing functionality\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vfrazao-ns1/IEXTools", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "IEXTools", "package_url": "https://pypi.org/project/IEXTools/", "platform": "", "project_url": "https://pypi.org/project/IEXTools/", "project_urls": { "Homepage": "https://github.com/vfrazao-ns1/IEXTools" }, "release_url": "https://pypi.org/project/IEXTools/0.0.8/", "requires_dist": [ "requests" ], "requires_python": ">=3.7.0", "summary": "('Package for handling IEX stock market data',)", "version": "0.0.8", "yanked": false, "yanked_reason": null }, "last_serial": 9621837, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "11c4915fead899973a7d40c96534de22", "sha256": "6bc1c9b44765e6a296a104fb79d47df9c9b982dba9bbb712ebfae46ee1907913" }, "downloads": -1, "filename": "IEXTools-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "11c4915fead899973a7d40c96534de22", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7.0", "size": 26022, "upload_time": "2018-11-25T19:58:49", "upload_time_iso_8601": "2018-11-25T19:58:49.221041Z", "url": "https://files.pythonhosted.org/packages/34/99/2153348a5f780de97ee62c28cc79d3646b9f910f8c90dcdf39a9b1fe38a3/IEXTools-0.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4d7899f46170dcf3afdc53c4c9aaa153", "sha256": "4c263d4f918eb8093d9130580104b8cba4d0220378b484f2233f6c8cf60a07de" }, "downloads": -1, "filename": "IEXTools-0.0.3.tar.gz", "has_sig": false, "md5_digest": "4d7899f46170dcf3afdc53c4c9aaa153", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 24077, "upload_time": "2018-11-25T19:58:51", "upload_time_iso_8601": "2018-11-25T19:58:51.487878Z", "url": "https://files.pythonhosted.org/packages/45/0b/ee10bb2033b976dce155241c5d7077ea1875750cca2cbc6cc5af5d97c7e4/IEXTools-0.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "baa46c9dd0592d64ee385f0fce998b53", "sha256": "73a17aa6e9420e68d34b543d3b831e3dd00d25c2a8ad385b8a7ba5b9c6416af1" }, "downloads": -1, "filename": "IEXTools-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "baa46c9dd0592d64ee385f0fce998b53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7.0", "size": 30284, "upload_time": "2018-12-01T22:20:15", "upload_time_iso_8601": "2018-12-01T22:20:15.413445Z", "url": "https://files.pythonhosted.org/packages/ba/50/3979fa9f4cb378dfd727837379fe03d26572d12e172d5a3f5e1552c37f78/IEXTools-0.0.4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "bfeab7c84e16d24abe523d87565c545c", "sha256": "55d438eaffbb4876d9826ca9d0d9ebd615198f29f10efffaec593cae28ca263d" }, "downloads": -1, "filename": "IEXTools-0.0.4.tar.gz", "has_sig": false, "md5_digest": "bfeab7c84e16d24abe523d87565c545c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 24228, "upload_time": "2018-12-01T22:20:17", "upload_time_iso_8601": "2018-12-01T22:20:17.261978Z", "url": "https://files.pythonhosted.org/packages/09/90/13735514a60146be71b452a4fa60fbcf7c8b18a06e69388df02e87aeb1b3/IEXTools-0.0.4.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "24360d4a2dab717c6570446f520b14b5", "sha256": "c114bc071e0f1364cca35696a685986a081b928baff4fd81e884a863d5cb9200" }, "downloads": -1, "filename": "IEXTools-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "24360d4a2dab717c6570446f520b14b5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7.0", "size": 31015, "upload_time": "2019-04-29T03:09:36", "upload_time_iso_8601": "2019-04-29T03:09:36.838779Z", "url": "https://files.pythonhosted.org/packages/c6/e7/a5a4851abcfec7dbc24630d6d558193ace16599e753c364adcfccfd0e580/IEXTools-0.0.5-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "5157fd739f97c858a13185787f41b0fd", "sha256": "dd574c61fc6a4f5ba26bce09372c13a81d3b7f65fa7762c6f813463a74804d4c" }, "downloads": -1, "filename": "IEXTools-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "5157fd739f97c858a13185787f41b0fd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7.0", "size": 30981, "upload_time": "2019-05-04T01:59:41", "upload_time_iso_8601": "2019-05-04T01:59:41.515608Z", "url": "https://files.pythonhosted.org/packages/c7/67/bb07d589984768c628b807e091dd4c5ab90468b35b4057e0fd74dbce0637/IEXTools-0.0.6-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "17713a2a1d461c3f9b7aa2abb7e90a6c", "sha256": "e25bb3d829f7fadedd4046f53a8c319bc823f5246cf14cdebc5c81e506e2119f" }, "downloads": -1, "filename": "IEXTools-0.0.6.tar.gz", "has_sig": false, "md5_digest": "17713a2a1d461c3f9b7aa2abb7e90a6c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 24622, "upload_time": "2019-05-04T01:59:42", "upload_time_iso_8601": "2019-05-04T01:59:42.902938Z", "url": "https://files.pythonhosted.org/packages/e1/27/87d3ce49eeb238c7b0d76eb9fe619bda059bbe3472cca94b697a52ba614d/IEXTools-0.0.6.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "7d171df27d50795a1ae1fe1bb72547f2", "sha256": "7cc97f51fe00880276caef1540e0c81b48266d0ed27f13206afeeb3bdb701421" }, "downloads": -1, "filename": "IEXTools-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "7d171df27d50795a1ae1fe1bb72547f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7.0", "size": 31021, "upload_time": "2019-10-30T15:25:54", "upload_time_iso_8601": "2019-10-30T15:25:54.322379Z", "url": "https://files.pythonhosted.org/packages/e6/a5/c375a056007c1686ecc20821accd46aa553a880bf921d043b1ad4c3b7ebf/IEXTools-0.0.7-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "ca086efb727806e38f34ae5b95841c54", "sha256": "335337af9ed70f2deb7003e7049eeb7e3dff39f55f35a289e71f8548fb50895a" }, "downloads": -1, "filename": "IEXTools-0.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "ca086efb727806e38f34ae5b95841c54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7.0", "size": 30913, "upload_time": "2021-03-03T15:53:30", "upload_time_iso_8601": "2021-03-03T15:53:30.734991Z", "url": "https://files.pythonhosted.org/packages/45/41/9ae9635cb05e6248f19b1e199467a94ae95eac7c927a8a63129bbef3af0a/IEXTools-0.0.8-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "611ef0729a39a8cd9715340bb2d4b02b", "sha256": "8def082236eacb6c1a013959666da4927e8838ddfd78960e3f448ae420311da6" }, "downloads": -1, "filename": "IEXTools-0.0.8.tar.gz", "has_sig": false, "md5_digest": "611ef0729a39a8cd9715340bb2d4b02b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 25184, "upload_time": "2021-03-03T15:53:31", "upload_time_iso_8601": "2021-03-03T15:53:31.935252Z", "url": "https://files.pythonhosted.org/packages/ac/75/4ffe0ad302d055ffdae4d9498d805a6a5c6a31645db0e1f5718983b108e4/IEXTools-0.0.8.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ca086efb727806e38f34ae5b95841c54", "sha256": "335337af9ed70f2deb7003e7049eeb7e3dff39f55f35a289e71f8548fb50895a" }, "downloads": -1, "filename": "IEXTools-0.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "ca086efb727806e38f34ae5b95841c54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7.0", "size": 30913, "upload_time": "2021-03-03T15:53:30", "upload_time_iso_8601": "2021-03-03T15:53:30.734991Z", "url": "https://files.pythonhosted.org/packages/45/41/9ae9635cb05e6248f19b1e199467a94ae95eac7c927a8a63129bbef3af0a/IEXTools-0.0.8-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "611ef0729a39a8cd9715340bb2d4b02b", "sha256": "8def082236eacb6c1a013959666da4927e8838ddfd78960e3f448ae420311da6" }, "downloads": -1, "filename": "IEXTools-0.0.8.tar.gz", "has_sig": false, "md5_digest": "611ef0729a39a8cd9715340bb2d4b02b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7.0", "size": 25184, "upload_time": "2021-03-03T15:53:31", "upload_time_iso_8601": "2021-03-03T15:53:31.935252Z", "url": "https://files.pythonhosted.org/packages/ac/75/4ffe0ad302d055ffdae4d9498d805a6a5c6a31645db0e1f5718983b108e4/IEXTools-0.0.8.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }