Skip to main content

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.

Metadata

Release files for csp 0.19.1

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

Source distribution (sdist)

Source distribution for csp 0.19.1
File Size Uploaded
csp-0.19.1.tar.gz 771.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for csp 0.19.1
File
csp-0.19.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
csp-0.19.1-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details
csp-0.19.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
csp-0.19.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
csp-0.19.1-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
csp-0.19.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
csp-0.19.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
csp-0.19.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
csp-0.19.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
csp-0.19.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
csp-0.19.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
csp-0.19.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
csp-0.19.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
csp-0.19.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
csp-0.19.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 501.8 MB

Release files / csp-0.19.1.tar.gz

Download URL csp-0.19.1.tar.gz
Size 771.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3ba69f959deb6a1672d0163e005423aecb56406043ba0bb8d6391e63e67612da
BLAKE2b-256 checksum
How to use checksums
4d0b3e573a12628bbbf2d918647dd48ae1ae264d9624cc0ba6b46640ae44aafe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp314-cp314-win_amd64.whl

Download URL csp-0.19.1-cp314-cp314-win_amd64.whl
Size 30.8 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
08312ed243150f893d88b4d5083616aea6adfd7b5fa9286f215d480eda74dd95
BLAKE2b-256 checksum
How to use checksums
551384b60ba3719533850484cf5ea0a1e53854cd3be54c8d37c93c38aa71021a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL csp-0.19.1-cp314-cp314-manylinux_2_28_x86_64.whl
Size 38.7 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
64fab6ff53eb3ebd7c36660fdedf74538dd88673d1dda49526109ffc8a089a99
BLAKE2b-256 checksum
How to use checksums
997b5754933b29bc6a235915cab781fbbe93d7a33ac287fc3cd98eca98a0fb78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL csp-0.19.1-cp314-cp314-macosx_11_0_arm64.whl
Size 31.2 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4455dabf4b99619addafeaf749af51c3907aa8569d5aa5ac4fe01a6ec9e0c34e
BLAKE2b-256 checksum
How to use checksums
7cf7b69f93fd53d2515f71bcc0fec2f3b5509561ffa6e01ea38ca204baa665a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp313-cp313-win_amd64.whl

Download URL csp-0.19.1-cp313-cp313-win_amd64.whl
Size 30.2 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
818f643a984cf6fdcac75ab42191cf3bf29439c1a59e912d4b6202bd7b60ed18
BLAKE2b-256 checksum
How to use checksums
0ec33083dc87ba42ac0e431ad3fe911b0b86ce736c89e9813aa7770a9a006637
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL csp-0.19.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 38.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
eeb6b93f8d298b145c5f6162428609aa1dc0d849d321864ecb71e2f55f110c69
BLAKE2b-256 checksum
How to use checksums
cacf19cc8806706ceaa1de3f0d421c365162bf977c6630084535ac9054b4965d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL csp-0.19.1-cp313-cp313-macosx_11_0_arm64.whl
Size 31.2 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c8a4ceb2746fe2531da3bbcdab2c826e6e20a3d244fe1ab6b4321c6dc559a979
BLAKE2b-256 checksum
How to use checksums
d78cded4dbf61968573df383628156894060dee133e6af5ace9d93afadb57ea1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp312-cp312-win_amd64.whl

Download URL csp-0.19.1-cp312-cp312-win_amd64.whl
Size 30.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6dfac9634cf46b58c346f708d74363fe8b7513cb05a4704ed469ab9b37643e2f
BLAKE2b-256 checksum
How to use checksums
94b04ef6632ae8bd2671809d810bcc856c632b3a55738b3f54c344d604652ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL csp-0.19.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 38.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e482739965e0ca9b322c2a6e6ea05b7f78f4933308d25c7ff6c0078f6e1dbf25
BLAKE2b-256 checksum
How to use checksums
eb71b75f6013e64067c7abc9169f02b221d2afe582d667c4602f5edef38d6804
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL csp-0.19.1-cp312-cp312-macosx_11_0_arm64.whl
Size 31.2 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b8bf17d2024f8b5b828cc94a675462f3787b2caa9f801b7f36812e0b769717ca
BLAKE2b-256 checksum
How to use checksums
57d708fc874dab587ecf3b160dfc1ecf14c7f654fdaaaf0d5661ee7b0e7f0d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp311-cp311-win_amd64.whl

Download URL csp-0.19.1-cp311-cp311-win_amd64.whl
Size 30.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
5385fa083ccc0b4e0dc981cf8dbf825e2f38ff8a4bc404dc972a6ba39eb0ee51
BLAKE2b-256 checksum
How to use checksums
859b2957e90fb559805724c74b840dfa248ea72e3c4fef9da94f76d5c7c56151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL csp-0.19.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 38.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2b995c0b4aa5db7f1519696d2d76ab97038785a5d34188ac3bfd61888c691706
BLAKE2b-256 checksum
How to use checksums
4c8826a8eaa9d047628ec7c153ecdecaa73e095f270c389804e03c7c3b7c92dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL csp-0.19.1-cp311-cp311-macosx_11_0_arm64.whl
Size 31.2 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cc84ce8c10034e8a67fc69b138db82adab4ca46d3d3bd337d817e68d57eab39a
BLAKE2b-256 checksum
How to use checksums
aababc31c4037a3a6d328898669e923400d3be55fd5ee1d5261ae32ae32cc35e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp310-cp310-win_amd64.whl

Download URL csp-0.19.1-cp310-cp310-win_amd64.whl
Size 30.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d1262e65ba7fbbc96f541485118d4f6e539eb7ddbb0d0f2adb734a937d986970
BLAKE2b-256 checksum
How to use checksums
384c798fc352ceb37412712414a003cee6c0fef2b0492889db12926067cdfbde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL csp-0.19.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 38.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
96c47d7e6ae25524547601861f3793597fdc6aa4e7708658000c1c170ad80b0d
BLAKE2b-256 checksum
How to use checksums
a5b5b9d79024eb5107e9f6ca80a1aed4a4673261e881de1e4c162ab16e75b69b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / csp-0.19.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL csp-0.19.1-cp310-cp310-macosx_11_0_arm64.whl
Size 31.2 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
08da8cdd713c99696949ab56e2205da7f61dbf44885bd88acb28ba4a520efe0d
BLAKE2b-256 checksum
How to use checksums
524d68247871ffda7472145a606fc964144994bb6575096450cfcd4d209c4cfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.19.1 This release

16 release files

0.8.0

16 release files

0.0.9

16 release files

0.0.8

16 release files

0.0.7

19 release files

0.0.5

19 release files

0.0.4

19 release files

0.0.2

11 release files

0.0.1

11 release files

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