halalterminal — Python SDK
Official Python client for the Halal Terminal API — Shariah stock screening across 5 audited methodologies (AAOIFI, DJIM, FTSE, MSCI, S&P), real-time market data, ETF look-through analysis, zakat & purification calculators.
Install
pip install halalterminal
Python ≥ 3.9, single runtime dependency (requests).
Quickstart
from halalterminal import Client
ht = Client(api_key="ht_…") # or set HALAL_TERMINAL_API_KEY
# Screen a stock — works on 10,000+ tickers
aapl = ht.screen("AAPL")
print(aapl.is_compliant, aapl.compliance_explanation)
# Every relevant response carries typed disclaimers — render them in your UI
for d in aapl.disclaimers:
print(f"[{d.severity}] {d.text} ({d.url})")
Need a free API key? POST https://api.halalterminal.com/api/keys/generate with {"email": "you@example.com"} — no credit card.
Typed endpoints
quote = ht.get_quote("MSFT")
portfolio = ht.scan_portfolio(["AAPL", "MSFT", "JNJ", "BAC"])
zakat = ht.calculate_zakat(
holdings=[{"symbol": "AAPL", "market_value": 25_000}],
gold_price_per_gram=65.0,
)
disclaimers = ht.get_disclaimers() # public registry, no API key required
Each call returns a frozen dataclass with the most-used fields promoted to attributes, plus a .raw dict for everything else.
Generic escape hatch
The API surfaces 60+ endpoints. For anything not wrapped in a typed method:
trending = ht.get("/api/trending")
report = ht.post("/api/reports/portfolio", json={"symbols": ["AAPL", "MSFT"]})
Error handling
from halalterminal import ApiKeyError, QuotaExceededError, NotFoundError
try:
ht.screen("NOTAREALTICKER")
except NotFoundError:
...
except QuotaExceededError as e:
# e.detail carries the upgrade hint
...
except ApiKeyError:
...
Disclaimers
Every compliance / market-data / zakat / purification response carries a disclaimers: list[Disclaimer]. Each disclaimer is versioned, severity-tagged (religious for fatwa caveats, data for freshness/sourcing), and deep-links to a specific section on the Halal Terminal legal page. Show them inline — the API ships your compliance copy for you.
for d in aapl.disclaimers:
print(d.id, d.version, d.severity, d.url)
License
MIT. © Halal Terminal.
Metadata
Release files for halalterminal 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| halalterminal-0.1.1.tar.gz | 10.4 kB | Without provenance | Details for halalterminal-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| halalterminal-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for halalterminal-0.1.1-py3-none-any.whl |
Total release size: 19.5 kB
Release files / halalterminal-0.1.1.tar.gz
| Download URL | halalterminal-0.1.1.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b18ac9faa800aeed1f4493749de16181f84b358ee44f25e57fae6fcc0af50e1
|
|
BLAKE2b-256 checksum How to use checksums |
1ab5fe857c7498fd2935a235d48580c876274a095d9b0503a734d13990635ddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / halalterminal-0.1.1-py3-none-any.whl
| Download URL | halalterminal-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fcf5ccae921f9366438820ecff8e42ac685f3ab8eae47126335c30096faf3598
|
|
BLAKE2b-256 checksum How to use checksums |
caf142fea54a987b8bdd92c29c0a45b8ab1c3d3875d96bf25079ddbe4ff9299a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for halalterminal 0.1.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.