---
title: "Datalake: market data on ArcticDB over S3"
description: "QUANTARMY Datalake: a NoSQL market data lake on ArcticDB over S3. Management CLI, Alpha Vantage macro routine and reads from Zipline."
url: "https://pythonparatrading.com/en/lab/datalake/"
lang: "en"
image: "https://pythonparatrading.com/og/en/lab/datalake.png"
---

# Datalake

> Market data in a NoSQL datalake over S3, with ArcticDB. pandas DataFrames in, pandas DataFrames out.

- Version: 5.1
- Stars: 1
- Language: Python
- Code on GitHub: https://github.com/quantarmyz/datalake

## What it is

QUANTARMY Datalake (version 5.1) is the code to build and manage a market data lake based on ArcticDB and several
data sources.

The problem it addresses is fragmentation. Prices, fundamentals, macro and alternative data end up in different
places and formats. The datalake centralises them in a single NoSQL store and serves them in the format researchers
already use: pandas DataFrames.

Storage is an S3 bucket. There is no database server: the Python client itself sends the queries to S3. ArcticDB, by
Man Group, versions every symbol: a new write does not delete the previous version.

## What's included

The repository is small. The `qadatalake` package has three files:

- `cli.py`: menu-driven management CLI (version `V.5.1.0-predator`) with three options: list the symbols of every
  library in the datalake, run the Alpha Vantage macro routine, and exit.
- `tasks/routine.py`: connection to ArcticDB over S3 and listing of libraries and symbols.
- `data/alphavantage.py`: downloads the US unemployment and inflation series from Alpha Vantage and stores them in the
  `alphavantage` library (`UNEMPLOYMENT.MACRO.US` and `INFLATION.MACRO.US`). It updates at most every 15 days.

The connection reads four variables from a `.env` file: `ENDPOINT`, `DB`, `ACCESS_KEY` and `SECRET_KEY`. Quantstack
uses the same ones.

Price ingestion is not in the repository. The Big Data Management series builds it step by step: connecting to
ArcticDB, managing libraries, a macroeconomic calendar, and a Nasdaq datalake with prices, dividends, splits and
metadata from EODHD.

## Installation and first run

The README does not document installation and the repository has no `setup.py` or `requirements.txt`. The
dependencies are the ones the code imports: arcticdb, pandas, requests and python-dotenv.

```bash
git clone https://github.com/quantarmyz/datalake
cd datalake/qadatalake
pip install arcticdb pandas requests python-dotenv
```

The CLI looks for `.env` in the folder it is launched from:

```dotenv filename="qadatalake/.env"
ENDPOINT=your-endpoint.com
DB=your-bucket
ACCESS_KEY=your-access-key
SECRET_KEY=your-secret-key
```

```bash
python cli.py
```

From a notebook, the connection is the same one the repository code uses:

```python
from os import getenv
from dotenv import load_dotenv
from arcticdb import Arctic

load_dotenv('.env')
ac = Arctic(f"s3s://{getenv('ENDPOINT')}:{getenv('DB')}?access={getenv('ACCESS_KEY')}&secret={getenv('SECRET_KEY')}")
ac.list_libraries()
```

## How it fits

The Datalake is the first piece of the lab chain: it stores the data. Quantstack reads it with its `qa_datalake.py`
connector, which queries ArcticDB with the same four environment variables and loads prices, dividends and splits
into a Zipline bundle. Part 4 of the Big Data Management series explains that step. Backtest results end up in the
QAStats report.

*Data, backtest and report: Datalake → Quantstack (Zipline) → QAStats*

## Related research

Recommended reading order

1. [Big Data Management. 1 - Introduction to Big Data for Trading with ArcticDB](https://pythonparatrading.com/en/big-data-for-trading/)
2. [Big Data Management. 2 - First Lines of Code](https://pythonparatrading.com/en/big-data-for-trading-with-arcticdb/)
3. [Big Data Management 3 - Building a Datalake on the Nasdaq with ArcticDB.](https://pythonparatrading.com/en/big-data-with-arcticdb/)
4. [Big Data Management 4 - Using the Datalake in Zipline](https://pythonparatrading.com/en/backtesting-with-zipline-and-arcticdb/)

## Other systems

- [QAStats](https://pythonparatrading.com/en/lab/qastats/) · Library · Python · v3.0.1 — Pandas-based reporting library for portfolios and strategies: performance and risk metrics, drawdowns and factsheets. Built on empyrical and pyfolio.
- [Quantstack](https://pythonparatrading.com/en/lab/quantstack/) · Repository · Jupyter Notebook — Research and backtesting environment in one container: Docker, Debian, conda, JupyterLab, zipline-reloaded and ArcticDB.
