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.com)
    ws_url="ws://localhost:8080",          # local dev (default: wss://ws.forecite.com)
)

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.0.tar.gz (5.5 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.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: forecite-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 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.0.tar.gz
Algorithm Hash digest
SHA256 f4d2fc701b6337bb44ec8064068ab71a1d8783cd8d2ba92135552e363af7f9e5
MD5 17aaca536ae7ef298eb3d2cdbedfaab1
BLAKE2b-256 6f649f7553718d727977cf2942e39ac70abe55ce5cb85c1074ecd3c8bff44bf7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: forecite-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 874b40919fe50b0d83034ff4bb129846786f51f8f9155641389c096c916e57f0
MD5 8a2657cea07d636ce8534bfe0b180019
BLAKE2b-256 f2521ef59dc708e4e4df91f4b70ad5b3b897fcf11ca4db0c1624c44fc3caf4e5

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