Skip to main content

csp is a high performance reactive stream processing library, written in C++ and Python

Project description


csp csp

PyPI License Build Status Python Versions


csp is a high performance reactive stream processing library. The main engine is a C++ complex event graph processor, with bindings exposed into Python. Its key features include switchable simulation/realtime timesteps for both offline and online processing, custom input and output adapters for integration with static and streaming data sources and sinks, and extensible acceleration via customizable C++ nodes for calculations.

The high level goal of csp is to make writing realtime code simple and performant. Write event driven code once, test it in simulation, then deploy as realtime without any code changes.

Here is a very simple example of a small csp program to calculate a bid-ask spread. In this example, we use a constant bid and ask, but in the real world you might pipe these directly into your live streaming data source, or into your historical data source, without modifications to your core logic.

import csp
from csp import ts
from datetime import datetime


@csp.node
def spread(bid: ts[float], ask: ts[float]) -> ts[float]:
    if csp.valid(bid, ask):
        return ask - bid


@csp.graph
def my_graph():
    bid = csp.const(1.0)
    ask = csp.const(2.0)
    s = spread(bid, ask)

    csp.print('spread', s)
    csp.print('bid', bid)
    csp.print('ask', ask)


if __name__ == '__main__':
    csp.run(my_graph, starttime=datetime.utcnow())

Running this, our output should look like (with some slight variations for current time):

2024-02-07 04:37:13.446548 bid:1.0
2024-02-07 04:37:13.446548 ask:2.0
2024-02-07 04:37:13.446548 spread:1.0

Getting Started

See our wiki!

Development

Check out the Developer Documentation

Authors

csp was developed at Point72 by the High Frequency Algo team, with contributions from users across the firm.

robambalu jacarr4 AdamGlustein stephenmarkacs

License

This software is licensed under the Apache 2.0 license. See the LICENSE file for details.

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

csp-0.0.3.tar.gz (948.4 kB view details)

Uploaded Source

Built Distributions

csp-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

csp-0.0.3-cp311-cp311-macosx_11_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

csp-0.0.3-cp311-cp311-macosx_10_15_x86_64.whl (24.4 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

csp-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

csp-0.0.3-cp310-cp310-macosx_11_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

csp-0.0.3-cp310-cp310-macosx_10_15_x86_64.whl (24.4 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

csp-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

csp-0.0.3-cp39-cp39-macosx_10_15_x86_64.whl (24.4 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

csp-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

csp-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl (24.4 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file csp-0.0.3.tar.gz.

File metadata

  • Download URL: csp-0.0.3.tar.gz
  • Upload date:
  • Size: 948.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.3.tar.gz
Algorithm Hash digest
SHA256 53258f6359df7bb94e7a581f3c0aee7dd483d4dcf11708c6a2c8b74d1a18b30d
MD5 c34df05e717d6f788f8d28a2bb813101
BLAKE2b-256 9d721be52b81a921f47da1446a0a6ba8545ba0ba70b54d803f068f96e4485fd6

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc56e80c16ea79e0d1c5764fd8e1f06571a7eb5ce1c4de89a0f4f1d3c917cc38
MD5 0407f09254485b2784de6968440b94c4
BLAKE2b-256 4a194297426f2c9f9d3f41fa3ce75b9ccef4599ec6b8a380f18b1d5be2b33a24

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d893a745115227b2a2c18326b11768a97b16befb7e99deda7ab725f10326c363
MD5 9c6f3a263052f752c40941b395ef5cc8
BLAKE2b-256 5b742432fbefbaf3e268f0b51966eabaf2df28a881ac641e3dfbce6625229d57

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8a9974269d7d02eeca6e253b8eb6553da6e33704ec1c767ed0ef98d909a99e4f
MD5 dfe1a0d62b0a5de710cacfa1995f9b7e
BLAKE2b-256 89e2306017033a70a182469f346e8a7a30760965c042dccd82c7e9e47db85426

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6262a1bc0079ccc4c6f3a2cbd9028ba1e9a39b8c7729ede0981e490380aef15
MD5 b6f2b8a5fbe3026fd9603aa12831704d
BLAKE2b-256 68db89e144a7e257ec0737169169630067fb30cf2f3aff47625ae7ea89a25d54

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b138cca215a951705b354bdcb4b9545c2ac30b57fc6ec1dd35a6077ab39bd6e
MD5 8ae657acb064ec09549821260b0d64d7
BLAKE2b-256 671926ed26182cb1cb64448a02fba75f571b53ee6d4160a3bc80f2679bcbffcc

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fffef469f85d0e2f040a34568762453604ef60f37269af515f635ab16888b425
MD5 2be437ce96d1451c08f5e466386f2f1d
BLAKE2b-256 02943828013cef3fdcf1c54d1c4c7b84cc923060c44611f2e142758d4223553a

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb7a027960419f916a73fd09df4c2631932cae1f2a9dd65431c308ba442e4134
MD5 13d50b9ba67594483226bec4db7906b1
BLAKE2b-256 24d58e6cac00ce211b00c58690d1c70765d34b58f06aeec4567b7f25b0f46ee9

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f9032b31da2fad05e4f565d8f4ded6e866d25471a29635da4ca6992499f1f1af
MD5 47cc5444a6451a5d2f3dd2fbf45bff79
BLAKE2b-256 ceeeeb61f7ec6f56d60e0d45d95fc98965f523152e5cf641efe406186210eee6

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa1ba0ae3a190ce6d90f8fec37d2b8796478a227823e26463d41f67ffccb8b10
MD5 0d2cc3956c520090f6079d68bc324af3
BLAKE2b-256 0c017841cf2b6d9e3872b8fc0dcd97082947da004a588ee007c5cfebfdd37700

See more details on using hashes here.

File details

Details for the file csp-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 23f953e8f512cdf7171f5c1637db01825c2d74b2ce9c81fe7f1a7ec3877b2802
MD5 db5ef94725fe5489810e6d61a6b5f349
BLAKE2b-256 473125b207dfef77700b7d6bf0719860b5554dbe81f5a9ba908e443a7daad6d8

See more details on using hashes here.

Supported by

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