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 tohttps://agualpha.com/api. Use this if you or your customers cannot reach the.cndomain (e.g. clients outside mainland China).agualphacn— points tohttps://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 defaultbase_urldiffers.
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.
| Method | Returns | Tier | Notes |
|---|---|---|---|
get_positions(...) |
PositionsResponse |
standard | date filter optional |
get_ideas(...) |
IdeasResponse |
standard | status / direction optional |
get_csi_weights(index=..., ...) |
list[dict] |
VIP | index required |
get_revision_fy2(...) |
list[dict] |
VIP | date filter required |
get_adj_close(membership=..., ...) |
list[dict] |
VIP | membership + date required, supports cursor |
get_p_cies(zone=...) |
list[dict] |
VIP | zone required ("hk" or "cn") |
get_sp_rolling_index(...) |
list[dict] |
VIP | at least one filter required |
get_sp_rolling_index_products() |
list[str] |
VIP | no params |
get_limit_evts(...) |
list[dict] |
VIP | date 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agualpha-0.2.0.tar.gz.
File metadata
- Download URL: agualpha-0.2.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94e095ded2b212f29d1a1b1e7db73de61a3b6af78a05fae38a74d110209b2303
|
|
| MD5 |
9357584e58f102b61a7978f04da837eb
|
|
| BLAKE2b-256 |
c659c0417856538aa47525b69f0349dea79bd821929d4d79c77bf5da714d16c1
|
Provenance
The following attestation bundles were made for agualpha-0.2.0.tar.gz:
Publisher:
publish.yml on yvasseur33/agualpha-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agualpha-0.2.0.tar.gz -
Subject digest:
94e095ded2b212f29d1a1b1e7db73de61a3b6af78a05fae38a74d110209b2303 - Sigstore transparency entry: 2357540415
- Sigstore integration time:
-
Permalink:
yvasseur33/agualpha-sdk@e1b02cbcf55db9526cd4c1d9edd08e85604ae7aa -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yvasseur33
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1b02cbcf55db9526cd4c1d9edd08e85604ae7aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file agualpha-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agualpha-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ca7c4920c3dbd744e605a7be5c67e8ca7fc1c395380556dd4f91eda4d1c4a9d
|
|
| MD5 |
ac5d8fbff626ef25b220b0d141b6917a
|
|
| BLAKE2b-256 |
17cf451e1f89b2df59e83d107729f2a6cbd61be94022ba250dacc855893315ec
|
Provenance
The following attestation bundles were made for agualpha-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on yvasseur33/agualpha-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agualpha-0.2.0-py3-none-any.whl -
Subject digest:
5ca7c4920c3dbd744e605a7be5c67e8ca7fc1c395380556dd4f91eda4d1c4a9d - Sigstore transparency entry: 2357540680
- Sigstore integration time:
-
Permalink:
yvasseur33/agualpha-sdk@e1b02cbcf55db9526cd4c1d9edd08e85604ae7aa -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yvasseur33
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1b02cbcf55db9526cd4c1d9edd08e85604ae7aa -
Trigger Event:
push
-
Statement type: