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.

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.19.0.tar.gz (771.0 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.19.0-cp314-cp314-win_amd64.whl (30.8 MB view details)

Uploaded CPython 3.14Windows x86-64

csp-0.19.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.19.0-cp314-cp314-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

csp-0.19.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.19.0-cp313-cp313-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

csp-0.19.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.19.0-cp312-cp312-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

csp-0.19.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.19.0-cp311-cp311-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

csp-0.19.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.19.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.19.0.tar.gz.

File metadata

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

File hashes

Hashes for csp-0.19.0.tar.gz
Algorithm Hash digest
SHA256 5971d1dfe6290032c79610e0aec76ab5f71669f60a7a3a0e2ac7b4f9ab8b3f0b
MD5 737c2b4a66275d519c2ab79f01111b9c
BLAKE2b-256 add31e0e68ca82189a8fbfffdc70d41627b63f54c58ffedcf8590b07db8a349b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.19.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/7.0.0 CPython/3.14.6

File hashes

Hashes for csp-0.19.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 46564d589f9554ed38e82f6b80606f68ec8917593caff129c3ec14f8c0736a89
MD5 90e77e667886a1b5019e9910d69ff2ff
BLAKE2b-256 d8f4fba19e5e6515e83a2300fb02baf903906937aa5ad1cf946f3bddcfda148e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 46cf9154d2b5b3807bfa024ff5b48bac695ae6652da4fcef71d7b764528e901a
MD5 f3d57d8a4892249e6063a2f1377704b3
BLAKE2b-256 9e09c5a6b091a6a42d7d4fc9e18ad03c5b766c67718bd4713f925209b463562c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ffbff80d34ed7321fa73df5cbc69fce93fb8c1cebecdeedb41247fc70c29f943
MD5 4d5d4c078878a5ed6d7511a82e133859
BLAKE2b-256 1a14d3e5b3ac3c64247bc600685a8143eebbf619679fdd095d7c96312464c268

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.19.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/7.0.0 CPython/3.14.6

File hashes

Hashes for csp-0.19.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9ae8a3d537e77e3a1e83cd68403ae569ad3a5c0fe881ab7aadad50b73dfd8080
MD5 6bc449bce4cc09a090e777fdef5cada8
BLAKE2b-256 07747a13c5d4b5a61c7db8fe18af9743cfcd9dff14cdc6ec7ea95b3b71372dfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8218c56b134e389cd1d66bae6287fbc11b59c6e2b87315ef67b511e9611a054c
MD5 820988d09c5be51f6443fe0528d52efd
BLAKE2b-256 434c322b4eebf1f1e583a6d8b7d5e54443c2945e3ba946c35a7a2a4eac49be27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 038fa36e0edcd0aba6fca63752e8273947c03c50cf957cf8d79eb5215fd6e857
MD5 85bc946bbd8039bf1d394fad43da4324
BLAKE2b-256 9ec1edaa0d26f8e8ebe797103d1bb6b078b2e71e5516e424381105e957a6d4da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.19.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/7.0.0 CPython/3.14.6

File hashes

Hashes for csp-0.19.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d17bc502aa5635024e12ca054698640f8a421667d71b1d75fc9f9864306d4a25
MD5 6f74025dd26454d295d76210d7a1a3a7
BLAKE2b-256 186f5d7c43c959bafaaebcf3577c013cb24139d14f404192d2a42e0a19974605

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 963d700fad90b85e63e1d81e9ddca39bf8393e6d104173c7cff15b196a014282
MD5 c3418a1ba8468167501c454085b0a87a
BLAKE2b-256 d7e40cbcec7d878f371ffda4d8c9a21a6714efa25c6c07ff236309adc33eaf71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9d62bbfa889ed7b4047907b5a6de5ac0a386eeaed46ba1ee718e7d87e514726
MD5 d8a07154bd593d53861f88a5955e76aa
BLAKE2b-256 0723fe82258e757332ad875d197cb7f73866c17e3a78337ac9d5bef3c6cedffd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.19.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/7.0.0 CPython/3.14.6

File hashes

Hashes for csp-0.19.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d83c9be0fb90c94d6549accf446a395e28960ce5ea95530e99e666624e919392
MD5 ea5871524fcf26e98bcab33cf5be24d9
BLAKE2b-256 48e4f23e1790596cf90775f7121e98f8aed8b53d6f3a8d9b1792a7107d509254

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 49cf4a2fd9e7b768df68189e3e5780ff1feb6eac5cb12f9172d847acf66c77ce
MD5 fdd75d2a638e60d1233d86f97d60ccab
BLAKE2b-256 953a8add203d5e1bf6549b76ed2f21d16730038092105d6ca30257a8e52ad340

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57cb3d50463fd31189b380cf70ef30d24de2eeca46867a147e644b2826921f40
MD5 8d238f49198d602305789c0bc4f8035a
BLAKE2b-256 acc99b2a9b6e6fdf1ad8494e66784b85439569755f58011fb35925b33c267eff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.19.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/7.0.0 CPython/3.14.6

File hashes

Hashes for csp-0.19.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0dd32800337b03df3c8c005fcbb06aa5e5451a17fc0aeb2237bbe43af3ec8e80
MD5 0d0aa83392275e11487f5be5e5f37b55
BLAKE2b-256 64f20a7338e54e3266137ad4a7e0967c244d24ff90d74e7a00dc67716691baed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ede71949a51262ecbd7a0c773dcce84526b0575a14210d105a95073c64a1dcc5
MD5 7d114237f60eff6b4333344f377185bb
BLAKE2b-256 ba12250082c85b832f0a395ed0ea4675c5167bd45e7a84bbaf8001abeadae031

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.19.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8310733e5a41b66621c98a9046fbdf848f274f99eb40fea551988b22273a4407
MD5 5c812ce771a46a86a3d0f46cf2e42b20
BLAKE2b-256 926a9e9b4f15be8885ffaea5ad7000306f45b9674b9ba3cca8f9bc416b9d729a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.19.0 This release

16 files

0.18.0

16 files

0.17.1

13 files

0.17.0

13 files

0.16.0

13 files

0.15.0

13 files

0.14.1

13 files

0.14.0

13 files

0.13.2

13 files

0.13.1

13 files

0.13.0

13 files

0.12.0

16 files

0.11.3

16 files

0.11.2

16 files

0.11.1

16 files

0.11.0

16 files

0.10.1

16 files

0.10.0

16 files

0.9.0

16 files

0.8.0

16 files

0.0.11

16 files

0.0.10

16 files

0.0.9

16 files

0.0.8

16 files

0.0.7

19 files

0.0.6

19 files

0.0.5

19 files

0.0.4

19 files

0.0.3

11 files

0.0.2

11 files

0.0.1

11 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