Parser for IEX data files
Project description
iex_parser
Parser for IEX pcap DEEP and TOPS files.
Overview
At the time of writing the IEX exchange provides two file downloads for
historical data: DEEP and TOPS. This data is provided as a pcap
file
which is a dump of the network activity.
This package provides an API for extracting the data from these files.
Installation
Install from PyPi.
pip install iex_parser
Example
The following code processes the TOPS sample file downloaded from IEX.
from iex_parser import Parser, TOPS_1_6
TOPS_SAMPLE_DATA_FILE = 'data_feeds_20180127_20180127_IEXTP1_TOPS1.6.pcap'
with Parser(TOPS_SAMPLE_DATA_FILE, TOPS_1_6) as reader:
for message in reader:
print(message)
The result looks like this:
{'type': 'trading_status', 'status': b'T', 'timestamp': datetime.datetime(2018, 1, 27, 15, 23, 40, 490473, tzinfo=datetime.timezone.utc), 'symbol': b'SPEM', 'reason': b''}
{'type': 'trading_status', 'status': b'H', 'timestamp': datetime.datetime(2018, 1, 27, 15, 23, 42, 95642, tzinfo=datetime.timezone.utc), 'symbol': b'INCO', 'reason': b'NA'}
{'type': 'trading_status', 'status': b'H', 'timestamp': datetime.datetime(2018, 1, 27, 15, 23, 42, 852349, tzinfo=datetime.timezone.utc), 'symbol': b'CHSCN', 'reason': b'NA'}
{'type': 'price_level_update', 'side': b'S', 'flags': 1, 'timestamp': datetime.datetime(2018, 1, 27, 15, 23, 44, 856983, tzinfo=datetime.timezone.utc), 'symbol': b'ATLO', 'size': 8755, 'price': Decimal('38.95')}
{'type': 'price_level_update', 'side': b'S', 'flags': 0, 'timestamp': datetime.datetime(2018, 1, 27, 15, 23, 44, 856983, tzinfo=datetime.timezone.utc), 'symbol': b'ATLO', 'size': 37222, 'price': Decimal('48')}
{'type': 'price_level_update', 'side': b'S', 'flags': 1, 'timestamp': datetime.datetime(2018, 1, 27, 15, 23, 44, 856987, tzinfo=datetime.timezone.utc), 'symbol': b'ATLO', 'size': 8958, 'price': Decimal('38.95')}
{'type': 'price_level_update', 'side': b'S', 'flags': 0, 'timestamp': datetime.datetime(2018, 1, 27, 15, 23, 44, 856987, tzinfo=datetime.timezone.utc), 'symbol': b'ATLO', 'size': 37019, 'price': Decimal('48')}
The following code processes the DEEP sample file downloaded from IEX.
from iex_parser import Parser, DEEP_1_0
DEEP_SAMPLE_DATA_FILE = 'data_feeds_20180127_20180127_IEXTP1_DEEP1.0.pcap'
with Parser(DEEP_SAMPLE_DATA_FILE, DEEP_1_0) as reader:
for message in reader:
print(message)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iex_parser-1.0.0.tar.gz
(5.4 kB
view hashes)
Built Distribution
iex_parser-1.0.0-py3-none-any.whl
(10.0 kB
view hashes)
Close
Hashes for iex_parser-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36238800c7af71eaf0d2eba3643b20161971560eeb543ed4e475d824183399d3 |
|
MD5 | 8a9b8402e8b3e58b7be576c01dfe7709 |
|
BLAKE2b-256 | b0b75c1a62aa1dc6f5883fa10dbdc4f32f160b758afc0a71b0b39bbd603dd254 |