Skip to main content

Official Python SDK for the Forecite API — scored news feed (REST), Verdict scoring, and realtime WebSocket streaming.

Project description

forecite (Python SDK)

PyPI version Python versions license: MIT

Official Python SDK for the Forecite API — the scored news feed (REST), the Verdict scoring engine, and the realtime WebSocket stream. Fully type-hinted, sync, minimal dependencies.

Install

pip install forecite

Quick start

from forecite import Forecite

forecite = Forecite("fc_live_your_key")
# or: Forecite(api_key, base_url=..., ws_url=...)

# REST — list scored feeds
res = forecite.feeds.list(symbol="TSLA", limit=20)
print(res["data"], res["next_cursor"])

# Score an artifact (Pro+)
verdict = forecite.score({
    "type": "news",
    "title": "Acme beats earnings",
    "body": "Acme reported Q2 revenue of …",
})

# Account + usage
me = forecite.me()
usage = forecite.usage(days=14)

Realtime stream

def on_feed(item):
    print(item["title"], "→", item.get("scoring"))

stream = forecite.stream(
    filters={"symbols": ["TSLA", "AAPL"]},
    snapshot=10,
    on_feed=on_feed,
    on_welcome=lambda w: print("connected:", w["tier"]),
)
stream.run()              # blocks; or stream.run_in_thread()
# stream.close()

API surface

Group Methods
Feeds feeds.list(**query), feeds.get(id)
Scoring score(artifact, options=None)
Account me(), usage(days=30)
Reference providers.list/get, sources.list/get, symbols.list/get, tags.list/get
Webhooks webhooks.list/create/get/update/delete
Realtime stream(filters=…, snapshot=…, on_feed=…)

Config

Forecite(
    api_key="fc_live_…",
    base_url="http://localhost:3000/api",  # local dev (default: https://api.forecite.dev)
    ws_url="ws://localhost:8080",          # local dev (default: wss://ws.forecite.dev)
)

Errors raise ForeciteError with .status and .code.

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

forecite-0.1.3.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

forecite-0.1.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file forecite-0.1.3.tar.gz.

File metadata

  • Download URL: forecite-0.1.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for forecite-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f221103e830b63591d9742ce01a7420e29932d6ddb47657a46ba456d9d64e3df
MD5 e72a090e6c10a696182c7d83eed6add5
BLAKE2b-256 f269d5ac63837275807857ee13a3fcea7b705b73405d16620f3ccdba9088461f

See more details on using hashes here.

File details

Details for the file forecite-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: forecite-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for forecite-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bcfbfb7ec024781d923f13d955af482b3db0bac7c81e038746bbff9d2646f384
MD5 371fc38311157a1309dbce76fbe8edcf
BLAKE2b-256 da8be353a502a9143656070b1587362244b8dfa29da19d42aacae0c13edbb137

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