Skip to main content

Openfeed SDK for Python

This SDK encapuslates the openfeed proto objects and faciliates client connections to openfeed servers.

Build

PyPI

Installation

pip install openfeed

Requires Python 3.9 or newer.

Example Usage

import openfeed

# new client with credentials
of_client = openfeed.OpenfeedClient("username", "password")

# optional state handlers
of_client.on_error = lambda x: print("Error:", x)
of_client.on_connected = lambda x: print("Connected")
of_client.on_disconnected = lambda x: print("Disconnected")

# attach a global message handler
of_client.on_message = lambda x: print("Global Message:", x)

# sub to markets by symbol
def on_message(msg):
    print("Market Data: ", msg)

of_client.add_symbol_subscription("AAPL", callback=on_message)

# sub to markets by exchange
of_client.add_exchange_subscription("NYSE", callback=on_message)

of_client.start()

Expected Output

of-client: Connected
of-client: Market Data:  subscriptionResponse
of-client: Market Data:  marketSnapshot
of-client: Market Data:  marketUpdate
of-client: Market Data:  marketUpdate

Server

By default the client connects to openfeed.aws.barchart.com. Pass a host name to connect to another server, or a full ws:// or wss:// URL to set the scheme and path (for example, for TLS or a proxy):

of_client = openfeed.OpenfeedClient("username", "password", server="demo.openfeed.barchart.com")
of_client = openfeed.OpenfeedClient("username", "password", server="wss://host:port/path")

Openfeed Documentation

Subscription Types

Openfeed supports many levels of subscription types.

OHLC

of_client.add_exchange_subscription(["NYSE"], callback=on_message, subscription_type=["OHLC"])
{
  marketId: 5389879102616877808
  symbol: "AAPL"
  open {
    price: 1205600
  }
  high {
    price: 1205600
  }
  low {
    price: 1205247
  }
  close {
    price: 1205490
  }
  volume: 43635
  priceVolume: 5259897.1422
  numberTrades: 224
  tradeDate: 20201116
  transactionTime: 1605547921000000000
  openStartTime: 1605547885850000000
  closeEndTime: 1605547920964000000
}

Development

Requires uv and protoc (brew install protobuf).

uv sync                                          # create .venv and install deps
uv run python example.py -u USER -p PASS         # run the example
./build.sh                                       # regenerate protos and build dist/

Metadata

Release files for openfeed 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openfeed 1.5.0
File Size Uploaded Provenance Actions
openfeed-1.5.0.tar.gz 41.9 kB With provenance Details for openfeed-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openfeed 1.5.0
File Interpreter ABI Platform Actions
openfeed-1.5.0-py3-none-any.whl Python 3 none any Details for openfeed-1.5.0-py3-none-any.whl

Total release size: 86.0 kB

Release files / openfeed-1.5.0.tar.gz

Download URL openfeed-1.5.0.tar.gz
Size 41.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7c9104141d4158cef027122964366368b470836350d9e06de2312635a67358f1
BLAKE2b-256 checksum
How to use checksums
5928a66846d40feafd4a7ca5b9bdb0b0263577175fa849dea58e49a49de31d4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / openfeed-1.5.0-py3-none-any.whl

Download URL openfeed-1.5.0-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6fae3ba3af516ba82329f477fafec82cd7ba3ad1f4f699f3abb78d79b5d5535
BLAKE2b-256 checksum
How to use checksums
2a953aab7066cb68c5b019ae6b206bc2d98e2d5b007eddb166c42224da501a8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for openfeed 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openfeed-1.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page