Skip to content

A library that implements C++-style IO with streams in Python

License

Notifications You must be signed in to change notification settings

mrlegohead0x45/cppstream

Repository files navigation

isort

black

pypi version

downloads/monthly

total downloads

python versions

license

Codecov

tests status

flake8 & mypy status

CodeFactor Grade

cppstream

This is a library that implements C++-style IO with streams in Python. It is not a wrapper around the actual C++ streams, but instead provides a higher-level interface that is more Pythonic.

For example

#include <iostream>
#include <fstream>
std::cout << "Hello, " << "World!" << std::endl;

std::ofstream ostrm("test.txt");
ostrm << "Hello, World!" << std::endl;

translates to

import cppstream

cppstream.cout << "Hello, " << "World!" << cppstream.endl

ostrm = cppstream.OutFileStream()

# or using the context manager 
with cppstream.OutFileStream() as ofs:
    ofs.open("test.txt")
    ofs << "beans" << cppstream.endl

See the inheritance diagram:

image

About

A library that implements C++-style IO with streams in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages