Catalog PyPI
PACKAGE EXPLORERView in registry

agualpha

PyPI

Overseas HTTP client for AGuAlpha Investment Platform (UK deployment)

Versions collected1
Direct dependencies6From release 0.3.1
Last observed21 Oct, 09:31 UTC

README

Version 0.3.1 documentation

AGuAlpha Python Client (Overseas)

A Python library for accessing the AGuAlpha Investment Platform via the UK (eu-west-1) deployment at https://agualpha.com/api/.

Which package should I use?

  • agualpha (this one) — points to https://agualpha.com/api. Use this if you or your customers cannot reach the .cn domain (e.g. clients outside mainland China).
  • agualphacn — points to https://www.agualpha.cn/api. Use this for domestic (mainland China) deployments.

Both packages expose the same public API (AGuAlphaClient, AGuAlphaAsyncClient, identical method signatures). Only the default base_url differs.

Installation

pip install agualpha

For async support:

pip install agualpha[async]

For pandas integration:

pip install agualpha[pandas]

Configuration

Set your API key as an environment variable (recommended over passing it in code):

export AGUALPHA_API_KEY="sk-your-api-key-here"

Optional overrides:

# Point the client at a non-default gateway (e.g. staging).
export AGUALPHA_BASE_URL="https://agualpha.com/api"

No credentials other than the API key are required — the gateway handles database access on its side.

Quick Start

Synchronous Usage

from agualpha import AGuAlphaClient

with AGuAlphaClient(api_key="sk-your-api-key-here") as client:
    positions = client.get_positions(start_date="2025-01-01")
    for p in positions.data:
        print(p.date, p.outstanding, p.value)

Asynchronous Usage

import asyncio
from agualpha import AGuAlphaAsyncClient

async def main():
    async with AGuAlphaAsyncClient(api_key="sk-...") as client:
        rows = await client.get_adj_close(
            membership="csi300",
            start_date="2025-01-01",
            end_date="2025-12-31",
        )
        print(f"{len(rows)} rows")

asyncio.run(main())

API Surface

All methods mirror agualphacn exactly. List-returning methods auto-paginate when page=None (the default); pass page=int for a single page.

MethodReturnsTierNotes
get_positions(...)PositionsResponsestandarddate filter optional
get_ideas(...)IdeasResponsestandardstatus / direction optional
get_csi_weights(index=..., ...)list[dict]VIPindex required
get_revision_fy2(...)list[dict]VIPdate filter required
get_adj_close(membership=..., ...)list[dict]VIPmembership + date required, supports cursor
get_p_cies(zone=...)list[dict]VIPzone required ("hk" or "cn")
get_sp_rolling_index(...)list[dict]VIPat least one filter required
get_sp_rolling_index_products()list[str]VIPno params
get_limit_evts(...)list[dict]VIPdate filter required

Each list method has a _dataframe variant (get_csi_weights_dataframe, etc.) that returns a pandas.DataFrame.

CLI

A agualpha console-script is provided for quick one-off queries:

agualpha --api-key sk-... positions --start-date 2025-01-01
agualpha adj-close --membership csi300 --start-date 2025-01-01 --end-date 2025-12-31

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.3.116 Sept 20266

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
agualpha/agualpha-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:31 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:206bd8c8a706fdb2a7153a378de4c0311adf3547c9d2282431919403b3947a1e