---
title: "Zipline in Python"
description: "Backtesting in Python with zipline-reloaded: quant stack, pipeline and a first backtest; data bundles, analysis with pandas and a Backtrader comparison."
url: "https://pythonparatrading.com/en/series/zipline-in-python/"
lang: "en"
image: "https://pythonparatrading.com/og/en/series/zipline-in-python.png"
---

# Zipline in Python

> Backtesting in Python with zipline-reloaded: quant stack, pipeline and a first backtest; data bundles, analysis with pandas and a Backtrader comparison.

Active · 02/02 parts

A hands-on series on backtesting with `zipline-reloaded`, the maintained branch of Zipline, the engine that came from Quantopian. It is written for readers who know Python and pandas and want a research and backtesting setup in Python.

[Part 1](https://pythonparatrading.com/en/zipline-backtesting-with-python-quant-stack/) starts with a five-minute smoke test: install zipline-reloaded and call `run_algorithm` on a bundle. It then covers what Quantopian was and the quant stack: ArcticDB for data, zipline-reloaded for backtests, alphalens for factor analysis, and pyfolio and empyrical for reports and ratios. It ends with a `pytest` test that checks a strategy runs end to end on a known bundle. [Part 2](https://pythonparatrading.com/en/backtesting-python-zipline-bundle-2/) explains what a data bundle contains, loads one, lists its assets, queries prices into pandas, runs a basic strategy with `run_algorithm` and gives a rule for choosing between Zipline and Backtrader.

The series is still open; two parts are published so far. Together they give a working install, a first backtest and a test that guards it.

## Parts

1. [Zipline in Python - Part 1: Quant Stack and Pipeline](https://pythonparatrading.com/en/zipline-backtesting-with-python-quant-stack/) · 2023-10-01 — In algorithmic trading there are countless options for carrying out your analyses or backtests, but we are going to use the best quant stack to build a professional research and…
2. [Zipline, Backtesting in Python 2: My First Data Analysis](https://pythonparatrading.com/en/backtesting-python-zipline-bundle-2/) · 2023-10-02 — In this second part of the Zipline tutorial, we will perform our first data analysis using bundles and build a basic strategy.
