Skip to main content

C++-style IO with streams

Project description

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:

streams.png

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

cppstream-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cppstream-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file cppstream-0.1.0.tar.gz.

File metadata

  • Download URL: cppstream-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Windows/10

File hashes

Hashes for cppstream-0.1.0.tar.gz
Algorithm Hash digest
SHA256 595d5b871486ec4fd926bd452e075a0ea00fba45fd1e0987b96fbb7920531406
MD5 8abb0f3bb9b4bc62de4b3a5dcd4b6be7
BLAKE2b-256 916b80fa9b01c8bc341dfe6f7a082dbf39c7b48f61b6b7e30eaff18410d30ba1

See more details on using hashes here.

File details

Details for the file cppstream-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cppstream-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Windows/10

File hashes

Hashes for cppstream-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3eb7c20727018d95566b1645ed322885a9f3d882c2097d87b3150874353f1488
MD5 2e87426aa663c2bee04411312e23f9e3
BLAKE2b-256 49b6e688cf1da314851a89fdaf1acba7e55ca8419873c8703d49d472b8d8d236

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