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.15.0.tar.gz (698.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.15.0-cp313-cp313-win_amd64.whl (30.2 MB view details)

Uploaded CPython 3.13Windows x86-64

csp-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl (38.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

csp-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl (38.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

csp-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl (38.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

csp-0.15.0-cp310-cp310-manylinux_2_28_x86_64.whl (38.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

csp-0.15.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.15.0.tar.gz.

File metadata

  • Download URL: csp-0.15.0.tar.gz
  • Upload date:
  • Size: 698.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.15.0.tar.gz
Algorithm Hash digest
SHA256 f9dffd59943afdaf32bd4a41bc473e388399faecbf9e4bba724157d3acf8ecf2
MD5 82ea11960dd48cf88b550660531773b7
BLAKE2b-256 9823e5226cc41defbfb58931bf1eeb788fe99fcc1fd260821215ae58808d8513

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.15.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.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.15.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ea4bbef71280a783d0d50c7161501dd329c5418eed5632f3c674fdadc7b3fa99
MD5 4219cc9ffcfec72293d14eb8c7960eda
BLAKE2b-256 af6075da7b5af5ebd2298556e9e8bb4a5a6a96fc321de23af8a664437def1ae5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9f2776cd26e3e41a990cea4431b01cb7563eeb490598b9faa4b264e1463bb95d
MD5 5f861d0bf1358577b7e22d1e7ba54298
BLAKE2b-256 a07d69e3b200adecf373c63cf7a591f8e82933e9187833bd7792b30a1ca87977

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77a13bc0aa7640cee5ec47923182b25f6bfe1d1bb592ff219051ae858b195bde
MD5 c54f464c9907ecfc663575093499b3a9
BLAKE2b-256 5d9e63f1a2980fc4235d7555e07a95e2e2f2746b5a921da724cb0aa8e10eafca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.15.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.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.15.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dbb4647a9cf4109d8166e778c2c132c5ae18b978507c00754b9085475c48f050
MD5 c263c5626a97a2009831829637fe3c1b
BLAKE2b-256 94e7824cbc4ed3de9d2c4ce2dbd7d891e7f7c19fd07f89c1f9f7bd63a3426cc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 529618fb8b2f120e89e6bf55c24fb49f1487308e070201780535c7d98776d608
MD5 0c2bfb4c79d44c141fbf53df4855b8af
BLAKE2b-256 446318404c664769d77c72a5600ae2cb876d6951bd13c5b19f0025fd79faa072

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 855e87b67271d5c441157bbb006142490840a6dbe51140720fa4ac2ed31d2a98
MD5 5bd8ee284b4025d9ab4c0dc1a682a55c
BLAKE2b-256 de016257c7f836e5f909cfdf1792089fddc6985d9b9585635c2a5d525b2c6023

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.15.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.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.15.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6e673c0f68c95c8c87bb9249fd87738bc3af3c33956794c3c1aa4c3f9af357f5
MD5 a13349f707acb955e7acd6cf198efac6
BLAKE2b-256 ce3f85628a8215cceac78e6b5045fa5adc9a1134fcfd85740a4c494b088ba411

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 47c517bc6867099c137c04ae077d988867de3468e9dd53c0e089087b8623418f
MD5 eafc89cdcd531c827af9ee5e9f22e25e
BLAKE2b-256 9b63119dc1522a275961c2497fabea1dadeb155f4349ed4adefba82ebb786595

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5c8040174cca71e7d937a0fa68054dd934e89931da9153aad21e3e8173458f7
MD5 14d09e9ff07c26970976f2b1cbc526e7
BLAKE2b-256 7448c6efbb1b5cd9e61d4f7793f14822863ef14f5d16cb70e6b2985c0be1d670

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.15.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.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.15.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 605eb79c157b9d9c547209db09c30083fbea89c62998b2b8ba5c15338251fc4f
MD5 ab43dc2b631c7fc1194663e969931124
BLAKE2b-256 3a56f9f0b89a20af56a5da9104efb44b7338f34d867e2907071d27a3d79fa772

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38ecccaa96887609cdc618df54fc05d448d992c78a819b5c9f3fc0c875d5cc6f
MD5 361da31d9438ac5dd6f1a222f0cf68da
BLAKE2b-256 0e4fe3752431081dc76fb4bfaf23279e64116433cadb2428faf330e614980e8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.15.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b94c445bf9557ad1dd764ed87f0c92c96781185653c5c55757dcf8bef25c519e
MD5 8f8c6dd2779418cf6c89c41dc0bc28a4
BLAKE2b-256 fecc91f32d1a8f6456e253de99dcca206bcd9ea687fbf2dd64df85c04573786a

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