Skip to main content

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 from PyPI (once published):

pip install palib
# optional DataFrame helper
pip install palib[pandas]

From a clone (editable):

git clone git@github.com:ljohri/PALib.git
cd PALib
uv pip install -e ".[dev,pandas]"

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.

Usage

from palib import Client

with Client(api_key="rr_live_...") as client:
    # One page of the universe (includes market_cap_b snapshot)
    page = client.list_universe(limit=100, q="AA")
    for t in page:
        print(t.ticker, t.market_cap_b)

    # Walk all tickers
    for t in client.iter_universe(active=True):
        ...

    # EOD history — days = trading rows, not calendar days
    hist = client.get_eod("AAPL", days=20)
    print(hist.anchor_date, hist.market_cap_b, len(hist.rows))

    # Optional pandas
    df = hist.to_dataframe()  # requires palib[pandas]

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)
RateLimitError 429
APIError Other HTTP / network failures

Publish to PyPI

uv build
uv publish   # or: twine upload dist/*

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rr_palib-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rr_palib-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file rr_palib-0.1.0.tar.gz.

File metadata

  • Download URL: rr_palib-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for rr_palib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d267720b60c502e85f79e9792449996299b8256135ea66b4b00b5d989584e3ca
MD5 5773074afca471beb0303fe9984f8dd6
BLAKE2b-256 c9be0668bbdaa11e34bb3d43db91b66b827e39732bc0f7dd4b643c1632b08fc0

See more details on using hashes here.

File details

Details for the file rr_palib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rr_palib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for rr_palib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 192193a9681d3ede6f43c62f9509a01ae8c369b65eea726143dcf1624bdc4599
MD5 57047c42164c7947351b060c0206d6e8
BLAKE2b-256 e46f3eed970fc319de16d8174cf2433df40700219e4d590ddcce906a4c2e8dfa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page