Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Streaming and Fileutils libraries to work with streams and files

Project description

Streaming module

  • bstream class. This class is the analogue of the “str” class in Python 2 or “bytes” class in Python 3 and is used to operate with binary data. bstream class now has the same functions as the bytes and BytesIO classes. It also has functions to encode/decode using zlib or base64 algorythms.
  • ustream class. This class is the analogue of the “unicode” class in Python 2 or “str” class in Python 3 and is used to operate with Unicode data. ustream class now has the same functions as the unicode and StringIO classes. It also includes some functions from re module, but yet it is not full.
  • fstream class. This class is almost similar to file class in Python, but yet has no direct analogues as far as I know. This class can use gzip/bzip2/lzop/xz/lzma compression methods, using the corresponding applications. It’s a very good class for user who needs all the possibilities of gzip or bzip2 modules, but has some problems while using these modules (they are very slow when you work with large files and has problems when you are trying to write Unicode data or even encoded symbols, for example, from Russian alphabet). I’ve called this feature “filter”, because for user it looks the same as Boost filters (though it uses another algorithm).
  • pstream class. This class is the analogue of the subprocess.Popen class, but it doesn’t have problems with Unicode and returns stdout by default (or if special flag was specified it returns code of error and its message).

This module can operate with str, unicode, QByteArray and QString types. It detects type of the object and then performs the neccessary operations.

Fileutils module

The most part is similar to os, os.path and shutils modules, but it also has other useful functions:

  • cat function. This function is the analogue of the default Linux cat application, but it has one great advantage: it can get the content of the compressed file (see above about fstream class).
  • compress function. Used to compress one file to another using filters (see above about fstream class).
  • decompress function. Used to decompress one file to another using filters (see above about fstream class).
  • magic function. This function is the analogue for default Linux file application. It returns mimetype of the file.

Project details


Download files

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

Files for streaming-fileutils, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size streaming-fileutils-linux-0.2.tar.gz (571.9 kB) File type Dumb Binary Python version 2.7 Upload date Hashes View hashes
Filename, size streaming-fileutils-linux-source-0.2.tar.gz (72.7 kB) File type Source Python version None Upload date Hashes View hashes
Filename, size streaming-fileutils-win32-0.2.tar.gz (816.9 kB) File type Dumb Binary Python version 2.7 Upload date Hashes View hashes
Filename, size streaming-fileutils-win32-source-0.2.tar.gz (583.3 kB) File type Source Python version None Upload date Hashes View hashes

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