multi volume file wrapper library
Project description
multivolumefile
MultiVolumefile is a python library to provide a file-object wrapping multiple files as virtually like as a single file. It inherit io.RawIOBase class and support some of its standard methods.
See API details at python library reference
Status
multivolumefile module is under active development and considered as *Alpha* state. It is not good idea to use it on production systems.
Install
You can install it as usual public libraries, you can use pip command
` pip install multivolumefile `
You are also able to add it to your setup.py/cfg as dependency.
Usages
For reading multi-volume files, that has names archive.7z.0001, archive.7z.0002 and so on, you can call multivolumefile as follows;
with multivolumefile.open('archive.7z', 'rb') as vol:
data = vol.read(100)
vol.seek(500)
For writing multi-volue files, that has names archive.7z.0001, archive.7z.0002 and so on, you can call multivolumefile as follows;
data = b'abcdefg'
with multivolumefile.open('archive.7z', 'wb') as vol:
size = vol.write(data)
vol.seek(0)
you will see file archive.7z.001 are written.
Limitations and known issues
fileno() is not supported and when call it, you will get RuntimeError exception.
Extension of volume name is currently 4-digit of decimal number, start from 1, such as ‘0001’, ‘0002’ and so on.
*Caution*: When globbing existent volumes, it glob all files other than 4-digit extensions, it may break your data.
Contribution
You are welcome to contribute the project, as usual on github projects, Pull-Request are welcome.
License
Multivolume is licensed under GNU Lesser General Public license version 2.1 or later.
ChangeLog
All notable changes to this project will be documented in this file.
Unreleased
Added
Changed
Fixed
Deprecated
Removed
Security
v0.1.4
Fixed
Fix append mode bug.
v0.1.3
Fixed
Fix added volume size become wrong
v0.1.2
Fixed
Fix append mode (#1)
v0.1.1
Fixed
Fin NotImplementedError when writing boudning of target files
v0.1.0
*API changed*
Added
Add mode ‘x’, ‘xb’ and ‘xt’
Add mode ‘a’, ‘ab’ and ‘at’
Support flush()
Changed
Change API: file argument of ‘r’ and ‘rb’ now single basename instead of list of files
v0.0.5
Support context manager
Support read functions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for multivolumefile-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f0d231b83b9c9a1fb9fa1898867663dd8b53eb9d5d7be5ed7d8bcbe60cbcbf4 |
|
MD5 | 50c139bb9ecff056c093a6c4144df2c2 |
|
BLAKE2b-256 | 60f649365b7037b027fdda13c33489b2a545101e37384c3b88110bf8ad50c64b |