Skip to main content

Library combining the power of CCXT with Pandas.

Project description

CCXT-Pandas

Python version GitHub PyPI version Downloads Binder Explore Data License Code style: black Docs Medium badge

🚀 CCXT → Pandas DataFrames in One Line

No more JSON → DataFrame glue code. Every CCXT method returns a clean, typed pandas DataFrame.

import ccxt
from ccxt_pandas import CCXTPandasExchange

exchange = CCXTPandasExchange(exchange=ccxt.binance())
ohlcv = exchange.fetch_ohlcv("BTC/USDT", timeframe="1m", limit=1000)
plt = ohlcv.close.plot(title="BTC/USDT — 1m")
plt.show()

Why CCXT-Pandas?

CCXT-Pandas fuses the power of Pandas with the market-connectivity of CCXT. It turns CCXT’s nested JSONs into clean, typed DataFrames for analysis, backtests, or dashboards. It lets you place/cancel live orders using the same DataFrame-centric API.

1-liners, everywhere. Fetch OHLCV, tickers, trades, order books, balances, orders → all as DataFrames.

  • Consistent columns & dtypes. Timestamps as UTC datetime64[ns, UTC], numeric columns as proper numerics.
  • Zero boilerplate. Stop writing JSON-to-DataFrame glue for every exchange.
  • CCXT-compatible. Keep your favorite CCXT params; just get DataFrames back.

Installation

CCXT-Pandas can be installed on Python 3.11~3.14:

pip install ccxt-pandas

Examples

Find all examples in the CCXT-Pandas-Example Repository

Getting Started

CCXT-Pandas works identically to CCXT. Just add exchange = CCXTPandasExchange(exchange=exchange) and the exchange methods provided by CCXT will be exposed to CCXT-Pandas. More examples can be found on Binder:

Sync

import ccxt
from ccxt_pandas import CCXTPandasExchange

# Initialize a CCXTPandasExchange object
exchange = ccxt.binance(dict(apiKey="your_api_key_here", secret="your_secret_here"))
exchange = CCXTPandasExchange(exchange=exchange)

# OHLCV
ohlcv = exchange.fetch_ohlcv("BTC/USDT", timeframe="1m", limit=100)      # -> DataFrame
# Trades
trades = exchange.fetch_trades("BTC/USDT", limit=1000)                   # -> DataFrame
# Orderbook
ob = exchange.fetch_order_book("BTC/USDT", limit=50)                 # -> DataFrame
# Tickers
tick = exchange.fetch_tickers()                               # -> DataFrame

# Fetch open orders from an exchange
open_orders = exchange.fetch_open_orders(symbol="BTC/USDT")

# Halve the amount and edit orders
open_orders["amount"] /= 2
response = exchange.edit_orders(open_orders)

# Display the transformed orders dataframe
print(response)

Async

import asyncio
import ccxt.pro as ccxtpro
from ccxt_pandas import AsyncCCXTPandasExchange

ex = AsyncCCXTPandasExchange(ccxtpro.okx())

async def main():
    while True:
        trades = await ex.watch_trades("BTC/USDT")
        print(trades)

if __name__ == "__main__":
    asyncio.run(main())

Claude Code Integration

CCXT-Pandas includes a Claude Code skill to accelerate your development workflow!

The skill provides:

  • Quick reference for sync/async usage patterns
  • Common DataFrame structures for all methods
  • Batch operation examples and best practices
  • Troubleshooting tips and testing setup

Using the Skill

In this repository: The skill is automatically available. Invoke with /ccxt-pandas-helper

In your projects: Copy to your global skills directory:

# Windows
cp .claude/skills/ccxt-pandas-helper.md %USERPROFILE%\.claude\skills\

# macOS/Linux
cp .claude/skills/ccxt-pandas-helper.md ~/.claude/skills/

After copying, use /ccxt-pandas-helper in any project for instant access to ccxt-pandas patterns and documentation.

See .claude/skills/README.md for more details.

About Sigma Quantiphi

Sigma Quantiphi is a quantitative-engineering firm that builds end-to-end algorithmic-trading systems for the cryptocurrency markets. We create open-source, Python-first tools—like ccxt-pandas—and deliver turnkey execution, data, and research pipelines that emphasize simplicity, transparency, and rapid deployment.

License

This project is licensed under the Apache License. See the LICENSE file for more details.

Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository, create a new branch for your feature or fix, and send a pull request.

  1. Fork the repository.
  2. Create your feature/fix branch: git checkout -b my-new-feature.
  3. Commit your changes: git commit -am 'Add some feature'.
  4. Push to the branch: git push origin my-new-feature.
  5. Submit a pull request.

Support

If you encounter any issues or have questions, feel free to open an issue on the GitHub repository or contact us via email at contact@sqphi.com. Happy trading! 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccxt_pandas-0.13.4.tar.gz (373.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccxt_pandas-0.13.4-py3-none-any.whl (90.8 kB view details)

Uploaded Python 3

File details

Details for the file ccxt_pandas-0.13.4.tar.gz.

File metadata

  • Download URL: ccxt_pandas-0.13.4.tar.gz
  • Upload date:
  • Size: 373.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ccxt_pandas-0.13.4.tar.gz
Algorithm Hash digest
SHA256 d8c23ffc1af4b4c0e050034526afc4716b349f319d0e231730a67b01c996aece
MD5 9090a0bacdbbb12bb0fb8a2bf4445a8a
BLAKE2b-256 b9b8a3b62407c764ac827e8173b49deb40a920c8f6d03986ff66d4a5ddf484f8

See more details on using hashes here.

File details

Details for the file ccxt_pandas-0.13.4-py3-none-any.whl.

File metadata

  • Download URL: ccxt_pandas-0.13.4-py3-none-any.whl
  • Upload date:
  • Size: 90.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ccxt_pandas-0.13.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ef1b63fb092bf9ec52fe46fd0fdfb93f65cf069d00b0431d737663884d7581b0
MD5 e4a3386a8fb99390cdd5b2c07944d65c
BLAKE2b-256 6219ca2488fb359ee7cd10272956a4390b9fe254d3ba3bae147421093d789f6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page