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 contribution guide and local development instructions.

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.5.tar.gz (775.1 kB view details)

Uploaded Source

Built Distributions

csp-0.0.5-cp312-cp312-win_amd64.whl (26.3 MB view details)

Uploaded CPython 3.12 Windows x86-64

csp-0.0.5-cp312-cp312-manylinux_2_28_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

csp-0.0.5-cp312-cp312-macosx_11_0_arm64.whl (27.1 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

csp-0.0.5-cp312-cp312-macosx_10_15_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.12 macOS 10.15+ x86-64

csp-0.0.5-cp311-cp311-win_amd64.whl (26.3 MB view details)

Uploaded CPython 3.11 Windows x86-64

csp-0.0.5-cp311-cp311-manylinux_2_28_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

csp-0.0.5-cp311-cp311-macosx_11_0_arm64.whl (27.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

csp-0.0.5-cp311-cp311-macosx_10_15_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

csp-0.0.5-cp310-cp310-win_amd64.whl (26.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

csp-0.0.5-cp310-cp310-manylinux_2_28_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

csp-0.0.5-cp310-cp310-macosx_11_0_arm64.whl (27.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

csp-0.0.5-cp310-cp310-macosx_10_15_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

csp-0.0.5-cp39-cp39-win_amd64.whl (26.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

csp-0.0.5-cp39-cp39-manylinux_2_28_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

csp-0.0.5-cp39-cp39-macosx_10_15_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

csp-0.0.5-cp38-cp38-win_amd64.whl (26.3 MB view details)

Uploaded CPython 3.8 Windows x86-64

csp-0.0.5-cp38-cp38-manylinux_2_28_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

csp-0.0.5-cp38-cp38-macosx_10_15_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: csp-0.0.5.tar.gz
  • Upload date:
  • Size: 775.1 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.5.tar.gz
Algorithm Hash digest
SHA256 afe4ea19455fd86bec7bda9fd3fb52a3c029468f8847db033823287e601af1ea
MD5 8ee0b9f85f37731ff0358a21e790f3d2
BLAKE2b-256 2a22b8f6d71facb1ecc8cac8c31150846408965e55f8b8d6003ec33e410a0049

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: csp-0.0.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 26.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3d6055459d634326d709856afe4e75b89e89ee81798e8833f24618e381efd2ba
MD5 88beb1a93d9e47a86efe290a6978d246
BLAKE2b-256 6bcc14b77fc18af5d761f051b35151f3a1acc84e9c2670aa8210d2450dda1848

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2de9a1bc3218d9ff176b927e7e70c8a1356057b1f7582e6f780622dff7583af0
MD5 ca1bcd6b712e7e6be0349c9e7a8b7727
BLAKE2b-256 f5dca008585b9152ba69f78eb726a6231de81f242ea36a2de693ead94ebacbbb

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for csp-0.0.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 24ed1dc3a73816373d3c07110e3ce5cd4d7c80c39a2396a3fb108a6bfe1e46e0
MD5 367d8bb15450ac7d1d7d9b142d91dcda
BLAKE2b-256 455d032edeb12e6193a3c8868941889e262866908f9a18995f45be7fb6a98606

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.5-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5dc8af47c0b17974d0c16abd8fae34879fb01b4b3deefd203924edde0ce0c7ca
MD5 e94e03a7aefccb201125c068a0216934
BLAKE2b-256 639af933f43f4552f09bf7c67bb5955997d4f6062a949c20e7c8b2ee2525f18a

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: csp-0.0.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 26.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d5ba3bdaa29e5edf9c9e5bf8b1441b676b7488ead97dac15478bc762ac9019f9
MD5 c9bf96cd79a623b3609f2d213a31ccc8
BLAKE2b-256 9d26e6ec9fc75df7da126bfb2727d645c63d746c90cfc3569c211c0e54cb2986

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 542a91d165955ca5da55f0907ed0ade17b030fd34364a9b0d284c63befac2e36
MD5 09ae6f977290b78a6aacfa9566c8d246
BLAKE2b-256 ef68379d604c34510f6ff0a1a66854005787f7eb5d558d4ab937a894e8494b0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c72f3bd2455ac905f75862e63356eff292a39ed72a345dd09e425e2b472a6b50
MD5 434391f3de5ce4701cef0e77f59c25ba
BLAKE2b-256 f5ee6be322223c737a530c5a84337599a7f39218f4aea1df3f9d922aeae4f5bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.5-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 679e1e2b07115095cd4e8f94cf0bbdf2679b0f88d80472d1973299ce3740434f
MD5 2babafb7c4fe67c1622a168ccf62c48c
BLAKE2b-256 4df2add2ea51ac929ecacc75e01bc2185fcbce0eca421cd0f569a2389abe169d

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: csp-0.0.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 26.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 de92e4861304a9a9e8230c5f828fca5659647ad03d3b5282e607301369483d8a
MD5 7490f02906039829c3c57e3085dc996b
BLAKE2b-256 d8e7c99cf9ecd68ce7cb984f9c9f5880e3b711fdaa35868bf52a8d1c62e6b429

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.5-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a27e1e0d1dadad61ea322085c3fbb622959bebf5f6ef007d1343b3ad685b6551
MD5 4728abe2e4aa47cf3116e34e18082fdf
BLAKE2b-256 700878f0b210c634fac3e7d0cd47001538c2f5327a82c3318116296894b5767c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e4be048fb2a632582a6e616a1c3aeff640d73cc85729e19db1360f1624d2cc30
MD5 86d5c0cddf865e958f46b0ad9581893a
BLAKE2b-256 25b0b97f7b6d6d8be92081b2639764b426edc0a64bb2f243a7d5926ed277f331

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.5-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0fbf5385a746abb2de59939b0251255be8efada783ae86ac3e5fe95153ae764f
MD5 6921653edd3b8b3d7864923012a8e927
BLAKE2b-256 afb637261e7b4e9e0c3e6e460365905b381fa6836980ded5a2dbfd630d8ca164

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: csp-0.0.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 26.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 554860eda8b547f3155d9ce8050300d2d7937d260900226d3859b08562417bb6
MD5 b2c01c235cc8bcba04f46f9f95aaca5f
BLAKE2b-256 79c9e9e1093bab7a5560fd70c8543c2b41db86c4998fecb63dc611f4c7edafe9

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.5-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3de2faec2457ff20849be1572b4dd7fb1e6ba622052f5cf0fcbac8e5c996a9eb
MD5 5864b442c748397912517fe855c2cec7
BLAKE2b-256 0cb0064c4748a7e8acd56b2e76843e4a7299eadf5f8f90e22ddae26c2d21b973

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.5-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b31a01a7d83005d35ec6d31a10a10614cbbf7d05e2358dab00a94991ce0ebb2d
MD5 6530ad7a6c4daf95762cc8b396ee68a8
BLAKE2b-256 36f5413aef460c263c89ed1c4a987b38f30cbb12d81d791067e47ec6d3846a98

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: csp-0.0.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 26.3 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c434f5d24cdba86b559fb0950362959891668123b8d51dc23c4abbe91e22dcbb
MD5 c04d91f3b48d6788cb49fccb88e39f66
BLAKE2b-256 d6fa9ebf430023fb259d36f308799cf2be2528146f1690dad6f5f8ce3293e1b3

See more details on using hashes here.

File details

Details for the file csp-0.0.5-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.5-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6d6922e959a17a4837adfe5141c6bc059e83c2b2f7dcd794810e199dc9155e8b
MD5 7d713173c51c38843d530b3d4c801931
BLAKE2b-256 e70ce9ef3d0e466791e7a7c7cfb9e6083a02f4aaeb623b01f1eba714ef8077af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.5-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 60c2e31d4188e4c75ad0dc277c7cb5ea7e0a89ce3681e4ca57b29cd424363386
MD5 f4d26aa06f4cc25d088a90d68e0d16eb
BLAKE2b-256 d7f5b5ee376aac64ea672cfe057bd09e3fb218eebc5419f3166213b7d7308591

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