Streaming and Fileutils libraries to work with streams and files
- 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.
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.
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|
|streaming-fileutils-linux-0.2.tar.gz (571.9 kB) Copy SHA256 hash SHA256||Dumb Binary||2.7||Mar 26, 2012|
|streaming-fileutils-linux-source-0.2.tar.gz (72.7 kB) Copy SHA256 hash SHA256||Source||None||Mar 26, 2012|
|streaming-fileutils-win32-0.2.tar.gz (816.9 kB) Copy SHA256 hash SHA256||Dumb Binary||2.7||Mar 26, 2012|
|streaming-fileutils-win32-source-0.2.tar.gz (583.3 kB) Copy SHA256 hash SHA256||Source||None||Mar 26, 2012|