{"id":15068182,"url":"https://github.com/point72/csp","last_synced_at":"2025-04-10T16:13:26.703Z","repository":{"id":221255981,"uuid":"746824024","full_name":"Point72/csp","owner":"Point72","description":"csp is a high performance reactive stream processing library, written in C++ and Python","archived":false,"fork":false,"pushed_at":"2024-04-13T00:06:20.000Z","size":3090,"stargazers_count":49,"open_issues_count":34,"forks_count":11,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-04-14T11:10:36.176Z","etag":null,"topics":["cpp","python","reactive","reactive-programming","stream-processing","streaming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Point72.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-22T18:40:41.000Z","updated_at":"2024-04-15T15:03:32.717Z","dependencies_parsed_at":"2024-04-01T14:30:54.561Z","dependency_job_id":"e1cbbba4-0230-47bf-a8ec-dbadcdad279b","html_url":"https://github.com/Point72/csp","commit_stats":null,"previous_names":["point72/csp"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Point72%2Fcsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Point72%2Fcsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Point72%2Fcsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Point72%2Fcsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Point72","download_url":"https://codeload.github.com/Point72/csp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248251484,"owners_count":21072689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","python","reactive","reactive-programming","stream-processing","streaming"],"created_at":"2024-09-25T01:32:07.184Z","updated_at":"2025-04-10T16:13:26.698Z","avatar_url":"https://github.com/Point72.png","language":"C++","readme":"\u003cbr /\u003e\n\u003ca href=\"https://github.com/point72/csp#gh-light-mode-only\"\u003e\n  \u003cimg src=\"https://github.com/point72/csp/raw/main/docs/img/csp-light.png?raw=true#gh-light-mode-only\" alt=\"csp\" width=\"400\"\u003e\u003c/a\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/point72/csp#gh-dark-mode-only\"\u003e\n  \u003cimg src=\"https://github.com/point72/csp/raw/main/docs/img/csp-dark.png?raw=true#gh-dark-mode-only\" alt=\"csp\" width=\"400\"\u003e\u003c/a\u003e\n\u003c/a\u003e\n\u003cbr/\u003e\n\n[![PyPI](https://img.shields.io/pypi/v/csp.svg?style=flat)](https://pypi.python.org/pypi/csp)\n[![License](https://img.shields.io/badge/license-Apache--2.0-green)](https://github.com/Point72/csp/LICENSE)\n[![Build Status](https://github.com/Point72/csp/actions/workflows/build.yml/badge.svg)](https://github.com/Point72/csp/actions/workflows/build.yml)\n[![Python Versions](https://img.shields.io/badge/python-3.9_%7C_3.10_%7C_3.11_%7C_3.12-blue)](https://github.com/Point72/csp/blob/main/pyproject.toml)\n\n\u003cbr/\u003e\n\n`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.\n\nThe 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.\n\nHere is a very simple example of a small `csp` program to calculate a [bid-ask spread](https://en.wikipedia.org/wiki/Bid%E2%80%93ask_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.\n\n```python\nimport csp\nfrom csp import ts\nfrom datetime import datetime\n\n\n@csp.node\ndef spread(bid: ts[float], ask: ts[float]) -\u003e ts[float]:\n    if csp.valid(bid, ask):\n        return ask - bid\n\n\n@csp.graph\ndef my_graph():\n    bid = csp.const(1.0)\n    ask = csp.const(2.0)\n    s = spread(bid, ask)\n\n    csp.print('spread', s)\n    csp.print('bid', bid)\n    csp.print('ask', ask)\n\n\nif __name__ == '__main__':\n    csp.run(my_graph, starttime=datetime.utcnow())\n```\n\nRunning this, our output should look like (with some slight variations for current time):\n\n```raw\n2024-02-07 04:37:13.446548 bid:1.0\n2024-02-07 04:37:13.446548 ask:2.0\n2024-02-07 04:37:13.446548 spread:1.0\n```\n\n## Getting Started\n\nSee [our wiki!](https://github.com/Point72/csp/wiki)\n\n## Development\n\nCheck out the [contribution guide](https://github.com/Point72/csp/wiki/Contribute) and [local development instructions](https://github.com/Point72/csp/wiki/Local-Development-Setup).\n\n## Authors\n\n`csp` was developed at Point72 by the High Frequency Algo team, with contributions from users across the firm.\n\n[\u003cimg src=\"https://avatars.githubusercontent.com/u/28680700\" alt=\"robambalu\" width=\"50\" height=\"50\"\u003e](https://github.com/robambalu)\n[\u003cimg src=\"https://avatars.githubusercontent.com/u/35146413\" alt=\"jacarr4\" width=\"50\" height=\"50\"\u003e](https://github.com/jacarr4)\n[\u003cimg src=\"https://avatars.githubusercontent.com/u/55991383\" alt=\"AdamGlustein\" width=\"50\" height=\"50\"\u003e](https://github.com/AdamGlustein)\n[\u003cimg src=\"https://avatars.githubusercontent.com/u/18348081\" alt=\"stephenmarkacs\" width=\"50\" height=\"50\"\u003e](https://github.com/stephenmarkacs)\n\n## License\n\nThis software is licensed under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoint72%2Fcsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoint72%2Fcsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoint72%2Fcsp/lists"}