Skip to main content

A lightweight library for loading market data and computing engineered features.

Project description

AMQuant - Quick Start Guide

Overview

AMQuant is an open-source Python library for quantitative finance that provides:

  • Market data loading
  • OHLCV time series management
  • Feature engineering
  • A clean Python API for research, backtesting and quantitative analysis

Unlike the original script-based implementation, AMQuant is now a fully installable Python package available through PyPI.


1. Create a Python Virtual Environment

It is recommended to work inside a virtual environment.

Linux / macOS

python3 -m venv .venv
source .venv/bin/activate

Windows

python -m venv .venv
.venv\Scripts\activate

2. Install AMQuant

From PyPI

pip install amquant

3. Usage Example

import amquant

# Load market data for an explicit date range.
# fromdate / todate accept "YYYY-MM-DD" strings, date/datetime objects,
# or raw unix seconds.
result = amquant.load_market_data(
    fromdate="2024-01-01",
    todate="2024-06-01",
)

# Loading summary
print(f"Loaded : {result.ok}")
print(f"Failed : {result.failed}")
print(f"Skipped: {result.skipped}")

# Access raw market data
aapl_series = result.raw_series["AAPL"]

# Access engineered features
aapl_features = result.feature_sets["AAPL"]

# Alternatively, if update_globals=True (default)
aapl_series = amquant.RAW_SERIES["AAPL"]
aapl_features = amquant.FEATURE_SETS["AAPL"]

If fromdate / todate are omitted, load_market_data() defaults to a trailing 1-year window (today − 365 days → today).

Downloading a Single Symbol

Every instrument in the universe is fetched through the same download(what, fromdate, todate) call under the hood. You can use it directly if you just want one symbol without going through the full universe/feature pipeline:

from amquant.yahoo_finance import YahooFinanceClient

client = YahooFinanceClient()
series = client.download("AAPL", "2024-01-01", "2024-06-01")

print(series.symbol, len(series.bars))

Returned Object

load_market_data() returns a LoadResult dataclass containing both the loaded data and execution statistics.

Attribute Description
result.raw_series Dictionary mapping Symbol → Series for successfully loaded instruments.
result.feature_sets Dictionary mapping Symbol → FeatureSet containing the engineered features.
result.ok Number of instruments successfully loaded and featurized.
result.failed Number of instruments that failed during loading or feature computation.
result.skipped Number of skipped instruments (missing or unavailable data).

Note: By default (update_globals=True), the loaded data is also mirrored into amquant.RAW_SERIES and amquant.FEATURE_SETS for interactive exploration in a Python REPL or Jupyter notebook. For production code, using result.raw_series and result.feature_sets is recommended.

Contributing & Collaboration

AMQuant is an open-source project and welcomes contributions from developers, quantitative researchers, and Python enthusiasts.

Getting Started

1. Fork the repository

Create your own fork of the AMQuant repository, then clone it locally:

git clone https://github.com/rayenamer/AmQuant
cd amquant

2. create a virtual environment

python3 -m venv venv

source venv/bin/activate

3. install development dependencies

python -m pip install --upgrade pip

pip install -e ".[dev]"

4. Write some good code (please keep the AI slop away)

The Vision Behind AMQuant

AMQuant is designed as the data-engineering foundation of a quantitative research stack.

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

amquant-0.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

amquant-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file amquant-0.1.2.tar.gz.

File metadata

  • Download URL: amquant-0.1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amquant-0.1.2.tar.gz
Algorithm Hash digest
SHA256 900538684cd0be1380dd4b2bf98fdaf8c037f2a82ebfd88a652e7ccc61d6b293
MD5 32be330acb444236d80e60c0b27f56da
BLAKE2b-256 5b46ceeeb45f6aaacceefa73755186ee90378f00d85467b485c4db52845e3192

See more details on using hashes here.

Provenance

The following attestation bundles were made for amquant-0.1.2.tar.gz:

Publisher: publish.yaml on rayenamer/AmQuant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file amquant-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: amquant-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amquant-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e1cfd0e709169e4160c57e6735d78cfcd64955699346996260e7357952912b39
MD5 5378279e834f14bf541f7c0fff3f4371
BLAKE2b-256 1956d2afcc26f88fb84f79af3b40c3a4f131e8b0fdd5c93a6945ce3ac69b2eda

See more details on using hashes here.

Provenance

The following attestation bundles were made for amquant-0.1.2-py3-none-any.whl:

Publisher: publish.yaml on rayenamer/AmQuant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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