Thanks to visit codestin.com
Credit goes to pypi.org

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.12.0.tar.gz (676.9 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.12.0-cp313-cp313-win_amd64.whl (30.1 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

csp-0.12.0-cp312-cp312-win_amd64.whl (30.1 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

csp-0.12.0-cp311-cp311-win_amd64.whl (30.1 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

csp-0.12.0-cp310-cp310-win_amd64.whl (30.1 MB view details)

Uploaded CPython 3.10Windows x86-64

csp-0.12.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.12.0-cp310-cp310-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

csp-0.12.0-cp39-cp39-win_amd64.whl (30.1 MB view details)

Uploaded CPython 3.9Windows x86-64

csp-0.12.0-cp39-cp39-manylinux_2_28_x86_64.whl (38.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

csp-0.12.0-cp39-cp39-macosx_11_0_arm64.whl (31.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: csp-0.12.0.tar.gz
  • Upload date:
  • Size: 676.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.12.0.tar.gz
Algorithm Hash digest
SHA256 c54cd70c3892fb76989b2a9c4f4c2d28b7232c0ec97231bb957f4e74b1a94ab2
MD5 9e6731e0ce4e682f258188bc9bab8abe
BLAKE2b-256 2742143b713d815ff16fcb18defb2839be1768555f90ac99f9c9cbf43b0d7877

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.12.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 30.1 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.12.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 28e8244d7e6680334d463971bda3745f36a3d19f96391fb6522544062deba6ac
MD5 44fa6fcb88568a12dc790eee3f93b9a5
BLAKE2b-256 566ed5baee570dbf5b0e27d08767c158aae303ee40e8bfea6dcad75f833818cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08767cc2eb0ee79e367bbb2c0502039d25de03425b4c96505be54f611d5b6df5
MD5 759478134a91ef7c28f6b7eb10432927
BLAKE2b-256 c7708b897c5f22d403b43add825e203d8fe5bcedbdbcc8bf6eafac842968a375

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 639945e88ae55a3211b3ac3c02e2dc012e735bef604a3f20085c8ec5ca6622bd
MD5 696578a62ac2011d5dc62e4dd3d44cd6
BLAKE2b-256 371e00315df321ae6c257e552d6fcb47e9f065b79dd9487264acef23bcb095c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.12.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 30.1 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.12.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0ef7ec692ea5ebce6d699e198f78413a7e628fafc2d83a1fd69c6986afa13614
MD5 61e1d886f36647226456ed009b2e6692
BLAKE2b-256 d910ca5f069f9aa11d9460a4c19c0f3c4d5e024aea5b31d254076d25f44b8aca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 19ad71401dd32829928efa217159e8d9f40a0164d92c7edeea5e00c3e57e9e9a
MD5 cdd49fba5ea858c58e70376ce8860b9e
BLAKE2b-256 59dd63d2d6565a0f2e078fe0ac8c71336092e9593fcb9f6d38e5bcf89aa7f1db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3ea0ea3f55e6b4637f70cdc75c10b083fc83350c110d63bb1c281afadb2ae1d
MD5 9f81e9bee54f99f63d7482c911ab0a53
BLAKE2b-256 9673a3d2c597445d30e1a6830d22e0c7380e8190f218595e1809d5112c679ee6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.12.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 30.1 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.12.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a73a7e6f1e419ba40df2084a8ad66cfa0aa1c826cb522b38647276d6e0e9b870
MD5 43ff4868f1978d919ce4e8bc542db63b
BLAKE2b-256 c26c3ad34063a588f50355e418dd4df481919956fc0306afcdfb09893ebe029a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a454bfc0444752789c9e75af7c67728e1960b0b307402cb0b22bfef0336c5939
MD5 f95d98cd5ebc4d475e735f8e332f9e0b
BLAKE2b-256 4b00d361ef077056e8ef77ea5da42c975c0518f144e4e3e79593ff7767a24f43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed30994518e1acd7c6bfcb66642f48a52cc5ac5dc08fa208b52b0990f8572dcb
MD5 e7b3cdb65d90669b23212069e138b8f0
BLAKE2b-256 3ee3a4049d169b07a9e2843d09195e5d69d2a1e33ddb06e6a684f8120726bffd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.12.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 30.1 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.12.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 853ed26bbefb4147f39c5dc86270b861324107a1b4e2f1f977c7da363dd7500c
MD5 4719db2c57332d96b80e11911c5f86f7
BLAKE2b-256 0d1e22a131390bbf6468420bc57afeb558e5f59777a3d6362c63e4c24cbf5d19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0c33f14d3cf8966182dd49855866ba12d424b58eff147276a3c1cc4295532c29
MD5 690db59ac3d0d1dd5d6c0f71026c1952
BLAKE2b-256 ef5fb79c29e7097f08c775fa723421236dcb4711c9053fbf0a842d2dc840224d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp-0.12.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b6174693aa1ba0441472d50410905a53b652235899f064e6370ee281f0d962b
MD5 72475d722df20421db5841183b73e097
BLAKE2b-256 936d9e169b08b1dea971088b3a2348810f9c16a2b4ca7afd3cce28afaf3c5032

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.12.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 30.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.12.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 960992dc0f4878fa167e96e1468b8cdeac8aed24b1056a24d7e300bc712cc23b
MD5 658b80af3f3c80f4f7c9255f046e226d
BLAKE2b-256 aefe5fb81b5ec193fa7c8bd72a6ce010639e693cd98e24ba551812d1d9e77170

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp-0.12.0-cp39-cp39-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 38.3 MB
  • Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.12.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dd4e8b36fa51ec0724a288aa27d71f5fc9a98cf75738e5c4e03e5cb96f29359d
MD5 7abf87ba37a23c030140cd36bf70f1f5
BLAKE2b-256 8b97f0f6ff011235238ebc8f12a6c710337b9d34d9aaa611247730a3edb9cac9

See more details on using hashes here.

File details

Details for the file csp-0.12.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: csp-0.12.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 31.2 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for csp-0.12.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1926ead25a0cca3831b15e7af455347f274b36c4cb44406a4800d701b383034d
MD5 0907cb56974384ca4becb917e3e62a3b
BLAKE2b-256 b7d908dc568925c4b5ea064f196a5a2a9c0ee12838339938e2714d22f8cffd50

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