Skip to main content

Technical analysis and quantitative trading toolkit for retail investors taking on the market

Project description

dumbmoney

dumbmoney is a technical analysis and quantitative trading toolkit designed for retail investors. The current version provides a unified, transparent interface to fetch daily stock prices across A-shares, H-shares, and US markets by abstracting popular data packages like massive, tushare, and akshare, hiding their implementation complexity.

from dumbmoney import fetch_daily_prices

df = fetch_daily_prices("600519.SH", "2025-01-01", "2025-06-01")

You get normalized OHLCV data automatically - no need to care which provider supplies it.

✨ Features

  • 🔌 One function to fetch prices: fetch_daily_prices(symbol, start, end)
  • 🌏 Multiple markets supported
    • A-shares (.SH, .SZ)
    • H-shares (.HK)
    • US stocks (.US)
  • ⚙️ Automatic provider routing
    • A-shares → TuShare → AkShare
    • H-shares → TuShare → AkShare
    • US stocks → Massive → AkShare
  • 📐 Unified normalized output
    • open, high, low, close, volume
  • 🔁 Fallback logic
    • If one provider fails, the next takes over
  • 🧩 Extensible architecture (plug in new providers)

Important Notice

  • To use massive/tushare as a provider, you need to apply for a key or token from them.
  • massive's free api key only supports retrieving data from the most recent two years.
  • tushare's free token only supports retrieving data of A-shares.
  • akshare is free but depends on third-party data sources that may have variable reliability.

🏷️ Symbol Format

dumbmoney uses suffix-based symbol conventions:

Market Example Symbol
A-share 600519.SH or 600519
A-share 000001.SZ or 000001
H-share 0700.HK
US AAPL.US

Suffixes for H-shares and US stocks are required. A-share symbols may omit suffixes; however, if they are present, they must be valid and correct.

📦 Installation

Install only the core:

pip install dumbmoney

Install with tushare and massive:

pip install "dumbmoney[tushare,massive]"

🚀 Quick Start

from dumbmoney import fetch_daily_prices

df = fetch_daily_prices(
    "600519.SH",
    "2023-01-01",
    "2023-06-01",
    adjust="forward",
)

print(df.head())

To use the massive or tushare providers, you must set the required environment variables MASSIVE_KEY or TUSHARE_TOKEN.

📘 API Reference

fetch_daily_prices(symbol, start, end, adjust="none", ...)

Fetch normalized daily OHLCV prices.

  • Parameters
Name Type Description
symbol str Stock symbol with suffix (600519.SH, 0700.HK, AAPL.US)
start str Start time, e.g. "2025-01-01"
end str End time, e.g. "2025-12-01"
adjust str Adjustment mode, "none" | "forward" | "backward"
  • Returns

A pandas.DataFrame with:

Column Description
open Opening price
high High
low Low
close Close
volume Traded volume

Index is a DatetimeIndex named date.

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

dumbmoney-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

dumbmoney-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file dumbmoney-0.1.0.tar.gz.

File metadata

  • Download URL: dumbmoney-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dumbmoney-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b65e5543a8efe4ba049e710484fe1149c2294f654fcce847e0af7ffb84c6a593
MD5 dc924dbeb9296e8f2aee1abf08ad1d44
BLAKE2b-256 d9811ccdfb81c7dc2a1d1c8c3a9e2ae5352f24cb95a24945759027c946766724

See more details on using hashes here.

File details

Details for the file dumbmoney-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dumbmoney-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dumbmoney-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87e43aa55e710fceaf4089528c69063b42b6a4cf7ce378186b1642e19626abef
MD5 6cfa7568d58f3720364e67ba890f53fa
BLAKE2b-256 bc620244d99dd34f17cf8f2ccd0ea768b7e8acf0f8ddf35fe9531c4183248de9

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