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 in from your live streaming data source, or in from 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.11.1.tar.gz (674.0 kB view details)

Uploaded Source

Built Distributions

csp-0.11.1-cp312-cp312-win_amd64.whl (29.9 MB view details)

Uploaded CPython 3.12Windows x86-64

csp-0.11.1-cp312-cp312-manylinux_2_28_x86_64.whl (36.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

csp-0.11.1-cp312-cp312-macosx_11_0_arm64.whl (30.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

csp-0.11.1-cp312-cp312-macosx_10_15_x86_64.whl (32.4 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

csp-0.11.1-cp311-cp311-win_amd64.whl (29.9 MB view details)

Uploaded CPython 3.11Windows x86-64

csp-0.11.1-cp311-cp311-manylinux_2_28_x86_64.whl (36.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

csp-0.11.1-cp311-cp311-macosx_11_0_arm64.whl (30.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

csp-0.11.1-cp311-cp311-macosx_10_15_x86_64.whl (32.4 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

csp-0.11.1-cp310-cp310-win_amd64.whl (29.9 MB view details)

Uploaded CPython 3.10Windows x86-64

csp-0.11.1-cp310-cp310-manylinux_2_28_x86_64.whl (36.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

csp-0.11.1-cp310-cp310-macosx_11_0_arm64.whl (30.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

csp-0.11.1-cp310-cp310-macosx_10_15_x86_64.whl (32.4 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

csp-0.11.1-cp39-cp39-win_amd64.whl (29.9 MB view details)

Uploaded CPython 3.9Windows x86-64

csp-0.11.1-cp39-cp39-manylinux_2_28_x86_64.whl (36.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

csp-0.11.1-cp39-cp39-macosx_10_15_x86_64.whl (32.4 MB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: csp-0.11.1.tar.gz
  • Upload date:
  • Size: 674.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.11.1.tar.gz
Algorithm Hash digest
SHA256 6ae52243b32cce28e59e4079ed1b652caa41e40d8273ebcddb38f07916cb8c4d
MD5 1dee961404798dcd002a03ad49dbdba2
BLAKE2b-256 a448b988c467eea54f9f11789b37a7eafdb573cb6ace8021f0c2fe5ed5f6f7d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.11.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 29.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.11.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 26ab1627eee3dd3c1c2a5424d8e593489b06dd71b9e48500a10ea043efaa63c3
MD5 dce95e54752b1152c0d5b0815ef4d47b
BLAKE2b-256 ebdade274d681eb6714cf2b8bc94516f01cb08753830db57df2f675262b5d190

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8f2edb0e18ae60e81f2942a5a16ea35a85dd62459ad63f26186537235e19bc1b
MD5 4390a3dc2392f03f6661dc331339763f
BLAKE2b-256 5f98bd527dd28d1008118be52877689502624abc1b67bc77946927b7ccdd0125

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4326722b199aae376b76deaa67439057495d278b04737caa2df34bb92a1c29f
MD5 5fa89a730604a23604d18b0c78d9b0e0
BLAKE2b-256 7ad327577a085e00ac1880575f0c3780dbaceddf664748347f2a1245deb80985

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d482a4cb27df87cd977dc41c5ad7b04c162d9a45d80d3449054f28c98c4332df
MD5 9e00e93bef45a329970c83329fc6d545
BLAKE2b-256 7a65a52705ed818eb94a867bea4ac5d3662e17cae35e72f65966fcbdcf81df8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.11.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 29.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.11.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1d959aacfa69ba26f4bd19806cf1afd33cfdb8d42ab69404616918429f11e0cf
MD5 1f4c935abe4d69e3406341015eb8d763
BLAKE2b-256 176b94d6cfee17cdfd2ef8734647204b52f9045b455ddf6cb67df6ac86f872cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 16874241c6c17f031608e4c74afe3d21a55a450376069058bda6423ddd1e1dff
MD5 150e27e17518f5250fcdb9ebf8455184
BLAKE2b-256 28a2425ede21ef93d3deaa914e4e16393c4e937494a62809356b4e7171be7cea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed2785ce7e1a051bfae1844184b9e66fcb0753a831109190ab59f132526aeb3e
MD5 35a08d93e57f2776884af19d6b3e6571
BLAKE2b-256 a71e31fd1b5bf009a913054f4f507a07ddeb307a5b549fc1494c6c1b5e78e08a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6b1d8918837f96ddda30b707c646119618fb900e5d3bd062be73b51513f13e46
MD5 7e5293e0cd16b2acd6218ae2fdec0b14
BLAKE2b-256 1c84232767d43c2b4eecb81cdfc6a8d4f6466426c1a700ed36f8a7c43631867d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.11.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 29.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.11.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5a740f20e6d1b94d6b5e775137ac070503364954a5a9aaa456b478af997cb95e
MD5 087bc0ebe3269fc3c131ea08938e80f2
BLAKE2b-256 cb290337759bbe0c00058b27a2d66d1269b2b972c16c8533b4e79932db2749b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b56cf2cc02b4120f38148dc24a2c03e82c37e409b9b12c3451815dcea0a9a36c
MD5 aa0d3157ff2bce10b48a1fb5fe5032e3
BLAKE2b-256 7edf02f33a8d7a71ce2f104a62d389ad200dd5212eb8fd99f1a50de20c3856b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34dd18cb1666ef6100d8fd07738b638943c38eef031a81d1a5e647c12907947b
MD5 e878526dd19e00886fc1735459929e85
BLAKE2b-256 65628b34db9f078dc627d2dc8b53839de81d5ba3f6f27b9ef1afe5bf9d64c9f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d7bb12414586b26a4cb1f61d9d5b4f60264e0a424c5d019b9130fa0168aac7b8
MD5 6a8753ee58a044f27e4f7b3aba112fd5
BLAKE2b-256 bb882add030727bfe7b54cfae0a74fe44dc25b78ed5e7990068fc680fd4a32cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.11.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 29.9 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.11.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b4afc716dff5e2b45f7c2b5c0caf47ed24d6eee913225695e1f47a33cad11998
MD5 c29d5d61f3f98a27cca5d500b7d34a73
BLAKE2b-256 03b7b8861c3368e34ef84f59a0b0e86cde7e137b879c35b2bbee303e32037175

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eef20b80799d91f16e3de8d686c7ee2f62c7a2e562e1419c78cbe364808b6f81
MD5 4142c8b68bd1fffd28db7d2b35a9ce0b
BLAKE2b-256 f81e95e789642ed85d024e8b2481a16e66eb64955a215dd6faa3f2981dbad2f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.11.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f8c3b4bd5d6c21be2fa8ced41d38813d1c54be6f61dec41234dabd7b4a1862e4
MD5 e04653e47a768d752a03dd2d1f5f9dfd
BLAKE2b-256 648e49d787631559d7929c01660ed8954a4cbe1ac7ea802c6a6dcffcfea2d066

See more details on using hashes here.

Supported by

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