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 into your live streaming data source, or into 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.0.4.tar.gz (771.2 kB view details)

Uploaded Source

Built Distributions

csp-0.0.4-cp312-cp312-win_amd64.whl (20.1 MB view details)

Uploaded CPython 3.12 Windows x86-64

csp-0.0.4-cp312-cp312-manylinux_2_28_x86_64.whl (29.7 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

csp-0.0.4-cp312-cp312-macosx_11_0_arm64.whl (24.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

csp-0.0.4-cp312-cp312-macosx_10_15_x86_64.whl (25.3 MB view details)

Uploaded CPython 3.12 macOS 10.15+ x86-64

csp-0.0.4-cp311-cp311-win_amd64.whl (20.1 MB view details)

Uploaded CPython 3.11 Windows x86-64

csp-0.0.4-cp311-cp311-manylinux_2_28_x86_64.whl (29.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

csp-0.0.4-cp311-cp311-macosx_11_0_arm64.whl (24.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

csp-0.0.4-cp311-cp311-macosx_10_15_x86_64.whl (25.3 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

csp-0.0.4-cp310-cp310-win_amd64.whl (20.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

csp-0.0.4-cp310-cp310-manylinux_2_28_x86_64.whl (29.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

csp-0.0.4-cp310-cp310-macosx_11_0_arm64.whl (24.4 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

csp-0.0.4-cp310-cp310-macosx_10_15_x86_64.whl (25.3 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

csp-0.0.4-cp39-cp39-win_amd64.whl (20.1 MB view details)

Uploaded CPython 3.9 Windows x86-64

csp-0.0.4-cp39-cp39-manylinux_2_28_x86_64.whl (29.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

csp-0.0.4-cp39-cp39-macosx_10_15_x86_64.whl (25.3 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

csp-0.0.4-cp38-cp38-win_amd64.whl (20.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

csp-0.0.4-cp38-cp38-manylinux_2_28_x86_64.whl (29.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

csp-0.0.4-cp38-cp38-macosx_10_15_x86_64.whl (25.3 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: csp-0.0.4.tar.gz
  • Upload date:
  • Size: 771.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f08c0ca0a116c4f3fd189453ff0cfd80a8179ee8d6f58e1da536b2d618b6e794
MD5 0778ec03d09c9326c20f23779537bb0b
BLAKE2b-256 86559f115e71e35813592c16c099d30efe7bcfbfc95b16b9a85b3f2451b183dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.0.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 20.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8b355a869ce460571b421f602ed95af71ef0c88869b08f5f5b9ff5f7a70d6272
MD5 bf2891f405d520b8bc802cd03d8e6d53
BLAKE2b-256 bb7f990b4cee63effbd3655b77455e33ceda2c74d3dd24c70a939ada9718d198

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 336ab8b0eed184deb34304b8cacc371163780ae47555c0185afcd806d7760872
MD5 cb211f09ea9785e099d8f178bd7c8a9d
BLAKE2b-256 ed259206354f393d71563ded6c4d47affc7dc723da423e057f100341f11ed52f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0777d251337b654b2d3ebacd14a5c5212a19e660f7c0cd5280aef73055bdb1c8
MD5 34fa05cfd0aa01fce24f647bdf3750b3
BLAKE2b-256 4620679c40f20397e55848c6f64369779c2ec96354730864fa4f6ebce5aafd5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d905e2a0e843faf99e1d47292ae321f02813fae6848b0ea7958c4f8399989248
MD5 8d60766948369421b53f125194b042ae
BLAKE2b-256 90297e5850ed966e73dafdeb8b04b5010733e3c0de723518744e3fc2a1c4a6c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.0.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 20.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cc8e64719b959d406e05729c28ed21b2d5941338ae0b4226e5cdc9e0e3a18746
MD5 b2c5e487ad265e809789eea4a7acd9e7
BLAKE2b-256 41f2de4a49c96cd087c2e6f873c0baed653e0ee2e185152bd06761f5d0af53f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce41f068788533dd85f7db7476a4cec4b1b20a3d2f33e0be508ea0938f50bcfe
MD5 7344055e9fed3daa63ed897efde0ce60
BLAKE2b-256 38169c43784a8306322182c996e612d9d2d2bf79378b9a13784d45576b6fe66e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aed6ce0ab4232a1b8dccce2323b227ad76a67833f3c3b29d95065c9cc5663388
MD5 110d8a8589c1e37a7a0dc54f4adb0a25
BLAKE2b-256 8126765584c33886906a1fdb5d2ade1216314989c008644f6a2b0eeab44f2f66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 df2582fb5c76cc9823242b7e951d63412045cc89e73a4ada9cacf496d4ec0f87
MD5 76c6aaf45297c5d2893611245c952475
BLAKE2b-256 9e177b68ff1e8d9bc9e7aa5b4744d4e8e0b7908ccb18a3797f7c7894fd39c2b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.0.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 20.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 91ecfa43d79723d4519e1086f0692184c05c89e1f1c3fa9eb0676291afa0d801
MD5 4eb0e62a6d7f49b090746e6e1b08c7dd
BLAKE2b-256 0f8a6dd1e2ac8bfa185274ab801c9f386cb49c1b1e510aaf398b69592f1c3535

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 558f14b54901960462acf8eee39fe66434228cc2665dc1d16d63698443c27e1a
MD5 458bfb1102ad69e2ac84fe5e5caa42f6
BLAKE2b-256 ca38cd0ccbb5121d6b7bfc156f2a88074147bf92ffe06d55b44393121a418531

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c8a36086cc0954df417327fcfde80124a9f7c926937b3cd6cc702a627767799
MD5 8a1383e4625449b9356ab5c59179afa4
BLAKE2b-256 1c716d0c3b5ee43a525f91e5adeaea6d9da2d1112d4a2a5c21378560ec911905

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 52ed7d8d68502a4414167aac94e6c2b7e12c8f9b956a2cc950e1b964293eaa93
MD5 6fc97f7c16a967e86766138970f6ba23
BLAKE2b-256 f36644c3f5c9d22866ceebc9079f8ab819b59136c1e63ab702bbaeefd2a17d79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.0.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 20.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c9c1c03d05d2df59ca7f94c7705b9479fed66b052e533eadc4ab06545e9b7904
MD5 1a7d231e7ea92fe37b58108fa84fbbe4
BLAKE2b-256 3dc50b90f6b15fa65be3a9f8527a7de73e38c5b5e8541bcd6f4d5d972f70bd79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ed7721e9c1296cea5e0f609b2fc7dadbbdb9c2418d4e2d70ec5c21d709c2a462
MD5 b36cf0b6c49f456835318396892ea508
BLAKE2b-256 5f44b1893776b8b7706bc630f7f9d146a19e97d0b13f4add8a424c82d6edd8c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.0.4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 381fc79ed656175f3fecfc1e4fdaacc49f1b6ccf58e2c1c84def048f1bfc9e91
MD5 008cd3b52b7944bd61bcb1f3fc23a25f
BLAKE2b-256 ea1f2ad020d4f2c1a5d8fb854f49607bf181c1803aab0026ce9b9cd433f52bca

See more details on using hashes here.

File details

Details for the file csp-0.0.4-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: csp-0.0.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 20.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for csp-0.0.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 485b961c7c26365bc9ff4ef8e55a38241d0bf1413f7344c3a690a0f4e4885a13
MD5 90f720d2270e4e215c4ee1d4694b1f84
BLAKE2b-256 b29ec90b90498ffe518b8b99970ea1af016a2180c22c0105bbf25dfb41c4f7cd

See more details on using hashes here.

File details

Details for the file csp-0.0.4-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.4-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6dc9a9bc67bb9cf175bb49756e64f241a52150f54eddfac7b1de8c47ce6ef9bf
MD5 ac72e236d3c38e20278fe912199c0bce
BLAKE2b-256 d83f6740fa5bb2bf33e86cb5aa38322240c2998d00532d1f9a89ab0d86697898

See more details on using hashes here.

File details

Details for the file csp-0.0.4-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for csp-0.0.4-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5ecfa1491684987f3665696d9d0a5bb6d19ca91fb8287f3301f66fdbac7f7159
MD5 49d30b79287a43aef3e04ef1dff23131
BLAKE2b-256 82ab55014c151dadbd857f1da5d3933bde69b2a23ee8f64cb582448d0a8ebf29

See more details on using hashes here.

Supported by

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