https://github.com/luizirber/2018-cython-streams
https://github.com/luizirber/2018-cython-streams
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/luizirber/2018-cython-streams
- Owner: luizirber
- Created: 2018-06-08T17:31:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-07T22:10:50.000Z (over 5 years ago)
- Last Synced: 2025-06-22T11:06:49.476Z (4 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Loading data from a Python buffer in C++ streams
Trying out a way to pass a bytestring or buffer in Python and process it using
C++ streams. I need this because (as of 2018-06-08) [khmer][0] need to load
data from files, which lead to [annoying workarounds][2] in [sourmash][1].
I made this repo to test the approach before digging into `khmer`, which is
way more complex than this PoC =]More refs:
- http://www.cplusplus.com/reference/sstream/istringstream/rdbuf/
- https://stackoverflow.com/questions/44978420/how-to-get-sfmls-error-message-to-cython
- https://github.com/capnproto/pycapnp/pull/163/files
- https://stackoverflow.com/questions/7781898/get-an-istream-from-a-char/7781958#7781958
- https://stackoverflow.com/questions/30984078/cython-working-with-c-streams[0]: https://github.com/dib-lab/sourmash
[1]: https://github.com/dib-lab/sourmash
[2]: https://github.com/dib-lab/sourmash/blob/ad9999e39ecf1701edc13aaf35006128c66a4dc1/sourmash/sbt.py#L724