Skip to main content

algierex (Python)

Python SDK for the Algierex market data API: the Algerian exchange's daily prices back to 1999, sessions, the Dzair index, the OAT yield curve, exchange rates, company events and news.

No dependencies. Python 3.9 or newer.

Install

pip install algierex            # or "algierex[pandas]" for to_frame()

Get a key

Create a key and choose a plan at algierex.com/developers. Then:

export ALGIEREX_API_KEY=alx_...

Example

from algierex import Algierex, PaymentRequiredError, to_frame

client = Algierex()  # reads ALGIEREX_API_KEY

try:
    client.list_tickers()
except PaymentRequiredError as err:
    raise SystemExit(f"{err}")  # no active plan: choose one at algierex.com/developers

# Every daily close of Saidal since 2025, as a pandas DataFrame.
prices = to_frame(client.get_prices("SAI", from_="2025-01-01"))
print(prices["close"].tail())

# The OAT yield curve on a past date.
curve = client.get_yield_curve(date="2026-09-30")
print(curve["asOf"], curve["fit"]["rSquared"] if curve["fit"] else "not enough trades")

# Upcoming company events, in French.
for event in client.get_calendar(from_="2026-11-01", locale="fr"):
    print(event["date"], event["ticker"], event["label"])

Methods

Method Route
list_tickers() GET /tickers
get_prices(ticker, from_=, to=) GET /prices/{ticker}
list_sessions(market=, from_=, to=) GET /sessions
get_dzair_index(from_=, to=) GET /index/dzair
get_yield_curve(date=) GET /yield-curve
list_fx() GET /fx
get_fx_history(code, source=, from_=, to=) GET /fx/{code}
get_calendar(from_=, to=, ticker=, locale=) GET /calendar
list_news(ticker=, source=, from_=, to=, locale=, include_routine=) GET /news

from is a Python keyword, so the parameter is from_. Every response is plain JSON (dicts and lists), typed with TypedDicts.

Paging

Paging is automatic: list methods return every row. For long histories, the iter_* twin yields rows as pages arrive:

for day in client.iter_prices("SAI"):
    ...

page_size (1 to 1000, default 1000) sets rows per request; the default keeps calls against your plan's limits low.

Errors

Every error raises a subclass of AlgierexError, with .status and .code:

Exception When
BadRequestError 400: a parameter is not valid
AuthenticationError 401: the key is missing, wrong, or revoked
PaymentRequiredError 402: no active plan, or the last payment failed
NotFoundError 404: no such security, currency, or date
RateLimitError 429: the plan's limit is used up; .retry_after in seconds

On a 429 the client waits Retry-After and retries, up to max_retries (default 3) and only for waits up to max_retry_wait seconds (default 60). Algierex(max_retries=0) raises at once. Server errors (5xx), timeouts (timeout=30 seconds) and network failures raise AlgierexError and are not retried.

Regenerating

This SDK is generated from the API's OpenAPI spec. From the repository root, after npm install: npm run sdk.

Metadata

Release files for algierex 1.0.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 algierex 1.0.0
File Size Uploaded Provenance
algierex-1.0.0.tar.gz 13.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 25.5 kB

Release files / algierex-1.0.0.tar.gz

Download URL algierex-1.0.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c6b53d01d23602b824f0a8bbbcf5b394010b7533447ae1e0beed0bbb02ff43a9
BLAKE2b-256 checksum
How to use checksums
ddc0a7af747021ca6d45674659bfdc2e2f8f01c7f7c1197531c59b965722ffed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"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}

Release files / algierex-1.0.0-py3-none-any.whl

Download URL algierex-1.0.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
193a3d48dce74d87cdfd652d9ca79fa2b402b7294c1fcb3056704bfb81b5b299
BLAKE2b-256 checksum
How to use checksums
4d85978cc1330aef09547a9c9656f8e2b6f0a1ae2ee9f42512bc8a2e91fc5a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"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}

Security for algierex 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.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