Python client for The Reasoning Room / Portfolio Adviser market data API
Project description
PALib
Python client for The Reasoning Room Portfolio Adviser market data API.
Public repo: github.com/ljohri/PALib
Install
pip install rr-palib
# optional DataFrame helper
pip install rr-palib[pandas]
Import remains palib:
from palib import Client
From a clone (editable):
git clone git@github.com:ljohri/PALib.git
cd PALib
uv pip install -e ".[dev,pandas]"
Documentation and examples
| Resource | Description |
|---|---|
docs/index.md |
Documentation home |
docs/getting-started.md |
Install, env vars, base_url rules |
docs/api/client.md |
Full Client method reference |
docs/api/models.md |
Response models |
docs/api/errors.md |
Exception hierarchy |
examples/ |
Runnable scripts for each API |
Auth
Create an API key in the Portfolio Adviser web app: Settings → Developer. Keys look like rr_live_….
from palib import Client
# Explicit key
client = Client(api_key="rr_live_...")
# Or env: PALIB_API_KEY / RR_API_KEY
# Optional: PALIB_BASE_URL=http://localhost:8000
client = Client()
Default base URL: https://api.thereasoningroom.com.
base_url must be an origin only (no /api/... path) — see getting started.
Usage
from palib import Client
with Client(api_key="rr_live_...") as client:
page = client.list_universe(limit=100, q="AA")
for t in page:
print(t.ticker, t.market_cap_b)
hist = client.get_eod("AAPL", days=20)
print(hist.anchor_date, hist.market_cap_b, len(hist.rows))
macro = client.get_macro_snapshot()
print(macro.as_of, macro.metrics["vix"].value)
market_cap_b is the latest universe snapshot from the API (not historical per EOD date).
Errors
| Exception | When |
|---|---|
AuthenticationError |
Missing/invalid key, 401/403 |
NotFoundError |
Unknown ticker (404) |
ValidationError |
Bad params (422) or malformed base_url |
RateLimitError |
429 |
APIError |
Other HTTP / network failures |
Details: docs/api/errors.md.
Tests
uv pip install -e ".[dev]"
pytest
Publish to PyPI
Distribution name is rr-palib (not palib — that name is blocked on PyPI).
Full monorepo runbook (uv workspace dist/ path, TestPyPI, troubleshooting): see README_PALIB.md in the Portfolio Adviser repo.
# from portfolio_adviser monorepo root
uv build --package rr-palib
uv publish --token "$PYPI_TOKEN" dist/rr_palib-<version>*
Bump version in pyproject.toml and __version__ in src/palib/__init__.py before each release.
Related
- Portfolio Adviser monorepo (private): API docs live under
docs/api_readme.md - Live API:
https://api.thereasoningroom.com
Project details
Release history Release notifications | RSS feed
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 rr_palib-0.2.0.tar.gz.
File metadata
- Download URL: rr_palib-0.2.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b4f196c648ba17b982c443488ada10fafaf4a6b8680b356e4acd426fa279ff
|
|
| MD5 |
76f64003f057328ae804862230d58dc1
|
|
| BLAKE2b-256 |
8f9491052991482cd34aea4c34b73be162d4eabc504c9e90a2fbcc60dbf25b01
|
File details
Details for the file rr_palib-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rr_palib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b07286526956019152a0a0893138c8ed25d828d17d79b0e7165170cb29bcdba
|
|
| MD5 |
2726dfdcf92e95d52d83ebcec59a6ea5
|
|
| BLAKE2b-256 |
a3258fb0a077148e78c2e0c362dbc0227c374c1bbbe6a2a953bb6fe6498a3bb3
|