Skip to main content

datacaptain

Official Python SDK for the DataCaptain US ETF Data API.

Install

pip install datacaptain

For local development from this repo:

pip install -e packages/datacaptain-python

Quick start

from datacaptain import DataCaptain

dc = DataCaptain(api_key="sdata_your_key_here")

# ETF screener
screen = dc.etf_screener(return_min=10, dividend_yield_min=2, period="1y")
print(screen["data"][:5])

# Heatmap
heatmap = dc.etf_heatmap(basket="broad", period="1y")

# Backtest
bt = dc.backtest_buy_and_hold(
    symbol="SPY",
    start_date="2015-01-01",
    end_date="2025-01-01",
    investment=10000,
)

# Portfolio rebalance
rebalance = dc.portfolio_rebalance(
    holdings=[{"symbol": "VOO", "shares": 63}, {"symbol": "QQQ", "shares": 37}],
    target=[{"symbol": "VOO", "weight": 60}, {"symbol": "QQQ", "weight": 40}],
    drift_threshold=2,
)

Get your API key at datacaptain.in.

Metadata

Release files for datacaptain 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datacaptain 0.1.0
File Size Uploaded Provenance Actions
datacaptain-0.1.0.tar.gz 3.4 kB Without provenance Details for datacaptain-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datacaptain 0.1.0
File Interpreter ABI Platform Actions
datacaptain-0.1.0-py3-none-any.whl Python 3 none any Details for datacaptain-0.1.0-py3-none-any.whl

Total release size: 7.4 kB

Release files / datacaptain-0.1.0.tar.gz

Download URL datacaptain-0.1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cb05dc0a8e8a32ddb208d3c77478607068d79cea72183ac14b03ff6359857505
BLAKE2b-256 checksum
How to use checksums
fbc9718f4776010c0782b3917f7e0fe3a981e219ae56bd364845aa9b72b06b3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / datacaptain-0.1.0-py3-none-any.whl

Download URL datacaptain-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecf36f5ee55af8b2ed77ce7958faf3eb9555bd068726f120fa3b81e66a0514ce
BLAKE2b-256 checksum
How to use checksums
57b3ad422f69c972590cb50ea64a7b763fdc3f6476b0afad160b920f4f46a28c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for datacaptain 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page