Skip to main content

Context manager to open encoded text file or stdin/stdout

Project description

Context manager to open a file or stdin/stdout. Encoding can be detected with chardet. Pass additional arguments to open().

Python writes BOM for utf-8-sig, utf-16, or utf-32. BOM is not written when endianness is specified.

Differences from open()

If file=None or '-', open stdin (for reading) or stdout (for writing).

If encoding=None and mode='r' or 'w+', file encoding will be detected using chardet.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
bom_open-0.3.6.tar.gz (2.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page