Findatapy
Python library to download market data via Bloomberg, Eikon, Quandl, Yahoo etc.
Install / Use
/learn @cuemacro/FindatapyREADME
findatapy
findatapy creates an easy to use Python API to download market data from many sources including ALFRED/FRED, Bloomberg, Yahoo, Google etc. using a unified high level interface. Users can also define their own custom tickers, using configuration files. There is also functionality which is particularly useful for those downloading FX market data. Below example shows how to download AUDJPY data from Quandl (and automatically calculates this via USD crosses).
Contributors for the project are very much welcome, see below!
from findatapy.market import Market, MarketDataRequest, MarketDataGenerator
market = Market(market_data_generator=MarketDataGenerator())
# Get you FRED API key from https://fred.stlouisfed.org/docs/api/api_key.html
fred_api_key = "WRITE YOUR KEY HERE"
md_request = MarketDataRequest(start_date='year', category='fx', data_source='alfred', tickers=['AUDJPY'],
fred_api_key=fred_api_key)
df = market.fetch_market(md_request)
print(df.tail(n=10))
Here we see how to download tick data from DukasCopy, wih the same API calls and minimal changes in the code.
md_request = MarketDataRequest(start_date='14 Jun 2016', finish_date='15 Jun 2016',
category='fx', fields=['bid', 'ask'], freq='tick',
data_source='dukascopy', tickers=['EURUSD'])
df = market.fetch_market(md_request)
print(df.tail(n=10))
I had previously written the open source PyThalesians financial library. This new findatapy library has similar functionality to the market data part of that library. However, I've totally rewritten the API to make it much cleaner and easier to use. It is also now a fully standalone package, so you can more easily use it with whatever libraries you have for analysing market data or doing your backtesting (although I'd recommend my own finmarketpy package if you are doing backtesting of trading strategies!).
A few things to note:
- Please bear in mind at present findatapy is currently a highly experimental alpha project and isn't yet fully documented
- Uses Apache 2.0 licence
Contributors
Contributors are always welcome for finmarketpy, findatapy and chartpy. If you'd like to contribute, have a look at Planned Features for areas we're looking for help on. Or if you have any ideas for improvements to the libriares please let us know too!
Gallery
To appear
Requirements
Major requirements
- Required: Python 3.10 (Python 2 is not supported)
- Required: pandas, numpy etc.
- Recommended: blpapi - Bloomberg Python Open API - install by separately running
pip install --index-url=https://blpapi.bloomberg.com/repository/releases/python/simple blpapi - Recommended: chartpy - for funky interactive plots (https://github.com/cuemacro/chartpy) and
Installation
For detailed installation instructions for chartpy, findatapy & finmarketpy and its associated Python libraries go to https://github.com/cuemacro/finmarketpy/blob/master/INSTALL.md. The tutorial includes details on how to setup your entire Python environment.
You can install the library using the below. After installation:
- Make sure you edit the dataconstants class for the correct Eikon API, Quandl API and Twitter API keys etc.
- Or you can run set_api_keys.py script to set the API keys via storing in your keyring
- Or you can create a datacred.py file which overwrites these keys
- Or some of these API keys can be passed via MarketDataRequest on demand
To install via pip (latest release):
pip install findatapy
To install newest repo copy:
pip install git+https://github.com/cuemacro/findatapy.git
Couldn't push MarketDataRequest message
You might often get an error like the below, when you are downloading market data with findatapy, and you don't have Redis installed.
Couldn't push MarketDataRequest
findatapy includes an in-memory caching mechanism, which uses Redis a key/value in-memory store. The idea is that if we do exactly the same data download call with the same parameters of a MarketDataRequest it will check this volatile cache first, before going out to our external data provider (eg. Quandl).
Note, that Redis is usually set up as volatile cache, so once your computer is turned off, this cache will be lost.
If Redis is not installed, this caching will fail and you'll get this error. However, all other functionality aside from the caching will be fine. All findatapy will do is to always go externally to download market data. Redis is available for Linux. There is also an unsupported (older) Windows version available, which I've found works fine, although it lacks some functionality of later Redis versions.
findatapy examples
In findatapy/examples you will find several demos on how to download data from many different sources. Note, for some such as Bloomberg or Eikon, you'll need to have a licence/subscription for it to work. Also there might be certain limits of the history you can download for intraday data from certain sources (you will need to check with individual data providers)
Release Notes
- 0.1.42 - findatapy (20 Mar 2026)
- 0.1.41 - findatapy (02 Jan 2026)
- 0.1.40 - findatapy (08 Mar 2025)
- 0.1.39 - findatapy (08 Mar 2025)
- 0.1.38 - findatapy (19 Feb 2025)
- 0.1.37 - findatapy (15 Jan 2025)
- 0.1.36 - findatapy (27 Apr 2024)
- 0.1.35 - findatapy (10 Apr 2024)
- 0.1.34 - findatapy (08 Apr 2024)
- 0.1.33 - findatapy (01 Apr 2024)
- 0.1.32 - findatapy (17 Feb 2024)
- 0.1.31 - findatapy (01 Dec 2023)
- 0.1.30 - findatapy (12 Oct 2023)
- 0.1.29 - findatapy (14 May 2023)
- 0.1.28 - findatapy (19 Jul 2022)
- 0.1.27 - findatapy (20 May 2022)
- 0.1.26 - findatapy (07 Oct 2021)
- 0.1.25 - findatapy (07 Oct 2021)
- 0.1.24 - findatapy (06 Oct 2021)
- 0.1.23 - findatapy (03 Jun 2021)
- 0.1.22 - findatapy (01 Jun 2021)
- 0.1.21 - findatapy (04 May 2021)
- 0.1.20 - findatapy (11 Feb 2021)
- 0.1.19 - findatapy (22 Jan 2021)
- 0.1.18 - findatapy (02 Oct 2020)
- 0.1.17 - findatapy (01 Oct 2020)
- 0.1.16 - findatapy (13 Sep 2020)
- 0.1.15 - findatapy (10 Sep 2020)
- 0.1.14 - findatapy (25 Aug 2020)
- 0.1.13 - findatapy (24 Aug 2020)
- 0.1.12 - findatapy (06 May 2020)
Coding log
- 27 Mar 2026
- Added UTC default for timezone in get_file_properties in IOEngine & tests
- 20 Mar 2026
- Improved caching of Parquet files in IOEngine (and via MarketDataRequest)
- 11 Jan 2026
- Speeding up ticker parsing in ConfigManager
- 02 Jan 2026
- Refactored ConfigManager so it can take DataFrames as input (not just CSVs)
- 29 Oct 2025
- Added flag for conversion of datetime in IOEngine
- 18 Jul 2025
- Speeded up Redis read/write of DataFrames
- 08 Mar 2025
- Fixed various deprecation warnings for Pandas
- 19 Feb 2025
- Fixed bug with Yahoo
- 15 Jan 2024
- Fixed various issues accessing data on s3 related to credentials
- 09 Nov 2024
- Added ALFRED/FRED FX tickers to time series mapping CSV files
- Fixed bug when downloading ALFRED/FRED FX tickers
- Added intraday downloading for Yahoo (and example for FX)
- Refactored out crypto downloaders into datavendorcrypto.py
- Refactored out ALFRED/FRED into datavendorfred.py
- Starting to add Databento Historical API
- Fixed deprecation error in calculations.py for
- 27 Apr 2024
- Removed additional list typecheck (to make code Python 3.8 compatible)
- 09 Apr 2024
- Bugfix for reading Parquet files with columns
- 08 Apr 2024
- Removed list typecheck (to make code Python 3.8 compatible)
- 01 Apr 2024
- Added support for ArcticDB to store market data with findatapy
- 17 Feb 2024
- Fixed ALFRED/FRED wrapper so now compatible with Python 3.10
- 01 Dec 2023
- Remove fxcmpy dependency (package no longer exists?)
- Added type hinting in ioengine.py
- 26 Jul 2023
- Fixed overrides for BBG
- 12 May 2023
- Fixed Dukascopy downloader
- 29 Aug 2022
- Reformatted text for line length
- 23 Aug 2022
- Simplified MarketDataRequest
- 12 Aug 2022
- Minor changes in MarketDataGenerator for non-standard columns
- 11 Aug 2022
- Fixed various bug in MarketDataRequest, when updating constants and freeform str ticker queries with kwargs
- 19 Jul 2022
- Various fixes for data download
- 20 May 2022
- Added more customisation for data vendors
- 25 Jan 2022
- Fixed delete key problem with Redis
- 20 Jan 2022
- Fixed path join for s3
- 17 Jan 2022
- Fixed bug in BBG wrapper
- 16 Jan 2022
- Started to refactor code for PEP8 standards
- Added BBG tests
- 15 Jan 2022
- Changed read/write on Redis to use Pickle instead of Arrow
- 14 Dec 2021
- Fixed bug in overrides for BBG
- Patched ticker for EUR1Y deposit rate
- 07 Oct 2021
- Fixed bug in downloading data for unusual categories
- Fixed missing ticker in time_series_tickers.csv
- 27 Sep 2021
- Fixed bug in numeric conversion in DataFrame
- Error trapping when downloading web pages to DataFrame
- Added ignore case in filter columns
- Removed lz4 compression for Arrow caching
- 23 Sep 2021
- Fixed bug in YoY calculation
- 29 Jul 2021
- Minor changes to
Marketfor managing tickers
- Minor changes to
- 28 Jul 2021
- Improved freeform ticker queries and fixed bug with downloading whole categories
- 22 Jul 2021
- Fixed S3 credentials management and added S3 file copy method
- Added roll costs
- 19 Jul 2021
- Added delete file method in
IOEnginefor S3
- Added delete file method in
- 12 Jul 2021
- Can now read CSV conf files for tickers from S3 buckets and improved S3 support (can now specify AWS credentials, as parameter)
- Additional file functions (eg. list_files)
- 05 Jul 2021
- Now (optionally) writes Parquet files in chunks (user specified size) to a
