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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

csp-0.18.0-cp314-cp314-win_amd64.whl (30.8 MB view details)

Uploaded CPython 3.14Windows x86-64

csp-0.18.0-cp314-cp314-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

csp-0.18.0-cp314-cp314-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

csp-0.18.0-cp313-cp313-win_amd64.whl (30.2 MB view details)

Uploaded CPython 3.13Windows x86-64

csp-0.18.0-cp313-cp313-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

csp-0.18.0-cp313-cp313-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

csp-0.18.0-cp312-cp312-win_amd64.whl (30.2 MB view details)

Uploaded CPython 3.12Windows x86-64

csp-0.18.0-cp312-cp312-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

csp-0.18.0-cp312-cp312-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

csp-0.18.0-cp311-cp311-win_amd64.whl (30.2 MB view details)

Uploaded CPython 3.11Windows x86-64

csp-0.18.0-cp311-cp311-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

csp-0.18.0-cp311-cp311-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

csp-0.18.0-cp310-cp310-win_amd64.whl (30.2 MB view details)

Uploaded CPython 3.10Windows x86-64

csp-0.18.0-cp310-cp310-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

csp-0.18.0-cp310-cp310-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: csp-0.18.0.tar.gz
  • Upload date:
  • Size: 772.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for csp-0.18.0.tar.gz
Algorithm Hash digest
SHA256 e82d01c2cc697b3d881c2ef3727f1e85fab2eaab9e039457d0bd6ab31302f932
MD5 eb502cf57475ebb78c3b53a5f2582b80
BLAKE2b-256 16568b26e7287c8180456b97a2e0b0ce4839af208d4053df4aff7613637b345d

See more details on using hashes here.

File details

Details for the file csp-0.18.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: csp-0.18.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 30.8 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for csp-0.18.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5dad902d91005f5cd5e751ddf3dd76f3fdbb38866065b08a85c3bda34ae6818b
MD5 f28d3e4dcd0dcc3db9c460887c1b99fd
BLAKE2b-256 ebc42f5e834823591454c6c530d949e7e8fac82d8e4935ca23dbf6c7f1b4d024

See more details on using hashes here.

File details

Details for the file csp-0.18.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.18.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 12356bc22c469915276e956214a209256138ed9a930a971f84a09bab1996d80f
MD5 5c17eb4798c1002bf1116d732d7be84a
BLAKE2b-256 8e071db4bf313f21e008506fa1c1d3835004d062e10ccc0c1cd36e0e718d6dcc

See more details on using hashes here.

File details

Details for the file csp-0.18.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for csp-0.18.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b87788b16ee5faabd9de877f2a5eb7e868cd729983eaeb906b638fc4d572b761
MD5 087f45bc1a0f709ce785af182c71939c
BLAKE2b-256 0a668aa8231adae48742e24a439f806d56d8e04e0ac90048c78ba0a66cef6e82

See more details on using hashes here.

File details

Details for the file csp-0.18.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: csp-0.18.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 30.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for csp-0.18.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 33d7ddd2d9d1c9b3488eb2a2e182c47ac7c3184e3add345f94d2d4307731d272
MD5 c6f69755a677ad0d737d9f8eda6ac4f5
BLAKE2b-256 de9bc028d5d662b00b7018e408e128c1964f5dcc48f95d598b58881cc44b5dfb

See more details on using hashes here.

File details

Details for the file csp-0.18.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.18.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 27135a03ce70ef3f5e1a1ba290ee5779439227fd4a2d6237158424d30a3b0f90
MD5 97af05798d6b87e8d263c288600c4dea
BLAKE2b-256 c35f6248bd65d9d43cc1b912fdcc10754551b41f5116e362389552f08585f327

See more details on using hashes here.

File details

Details for the file csp-0.18.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for csp-0.18.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a0accf4875636d0568cce9bc7c5c3d88306be7ad6274df8525530270ba4fb5a
MD5 75a9f9b11f72036d858052be827ed0cc
BLAKE2b-256 636c226139e23f373d06e17a6671184f3e084032a0597a3eb39e8c082d1194c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.18.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 30.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for csp-0.18.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c8feaedbc0991f3dbe41c521bf2e3e3eed861cd90dad2e7a39c30fdb4569d5e8
MD5 ec8757d8b84b5ac9bc35ffadbb05585f
BLAKE2b-256 213c15e09522540e74bd9cc99ce2243b32d1bc4bbb1f0dc5ecae2dcfe90a0c08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.18.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b84eb7c3cc6b03f27ec1153a1353f9585f9c380d3c62363bfcb56d1df857b314
MD5 a9977f73d66b26de1afc4a5faeff8e3f
BLAKE2b-256 1f539f336f9705599deac3b73f4a4f86dce28d202084ac23470b78872d6ab87e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.18.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb925f587b131dde900e9815221b358b6e180134ab76627676922de2840d6a68
MD5 1e47884f5acd97a5e214df7e183d46b4
BLAKE2b-256 1a8467bf1985db1b0fff04b061d14de4706a98864130265a461a285eefe7295d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.18.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 30.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for csp-0.18.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 235e936c1ad648189a8d4aae96856ec1e840969a131a9441b97e5018c3733d6a
MD5 e25138a5c5cf4a3ae1380e666ea6044b
BLAKE2b-256 96d54c8304ad50399ae0227c4ad019b7c505056acbb671ce75d4195fe1f93609

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.18.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 636f4e2c14766a69bae9ae0f0756dd8385e3baa838e17f45d9867fc163dccc6a
MD5 a2fb4828a841f1c16bb5789fe3913162
BLAKE2b-256 195e30605862cd772b7f37949f9a46a5168e63e1c512cc8ea60a2ed846377f07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.18.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1db7b408856326f9c075bce5eaba8f5ae40d178f13c03d5d309249fca87baf7c
MD5 9542580a02a494fe08f07f03518a86b8
BLAKE2b-256 b74086eef68d515f82426d5244b185a868bddcf2387ad4e014e0673813db05e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.18.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 30.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for csp-0.18.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fab01081b5f4bbb5bb2f61499364b665245c61ea54848f9df0580857e7d62bdd
MD5 530b99dd57eedc53433c5606f94fee77
BLAKE2b-256 39973c603409aa56f452cdf6802365ea5a6ac36ed6fbafd1e84f52245f3cea27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.18.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c020dfd19e712a86e3ea09f20b8e056b59aa31386ee9599396ac75b1c3fe4e27
MD5 99a9b9a1606e387ffa61e157df9cf29b
BLAKE2b-256 824c46a35dca0fac8ea001140b42f45e81a9e7fc81e99d433e0137275e2f654f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.18.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71f8e82e5122a6271ba4900ba50a98aaf33271d868f7cc16a74fe1c77948d7c3
MD5 aac35b569a72979a81f963b1fee86119
BLAKE2b-256 d43ae294a6c47b93d41246fbcb4b97ba483fe03cf4445617bf9cf6341dd1c127

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