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.2.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.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: forecite-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 51deac4316af8592a35c0736b0ce61a24eebf11d42a7fa01c182cce18f8db787
MD5 6c9fe4057c40106a8efbafe3cc08270c
BLAKE2b-256 dee96ee439a199df8411afe0145fc912554d1ff9b7ec5b698e5dab284a883951

See more details on using hashes here.

File details

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

File metadata

  • Download URL: forecite-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cad03aca3e8010b798fe9880f52cbd233d00f35cc2b4cc30bb7c4e873fd1efdc
MD5 2d9ef5df87785a2603fb111f2c3a0732
BLAKE2b-256 6c35c9db10f588b04a551283ce2d96e00e30373819a2f2b953f8fc9b166c4c40

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