| 1 |
=============== |
| 2 |
multivolumefile |
| 3 |
=============== |
| 4 |
|
| 5 |
.. image:: https://coveralls.io/repos/github/miurahr/multivolume/badge.svg?branch=master |
| 6 |
:target: https://coveralls.io/github/miurahr/multivolume?branch=master |
| 7 |
|
| 8 |
.. image:: https://github.com/miurahr/multivolume/workflows/Run%20Tox%20tests/badge.svg |
| 9 |
:target: https://github.com/miurahr/multivolume/actions |
| 10 |
|
| 11 |
MultiVolumefile is a python library to provide a file-object wrapping multiple files |
| 12 |
as virtually like as a single file. It inherit io.RawIOBase class and support some of |
| 13 |
its standard methods. |
| 14 |
|
| 15 |
See API details at `python library reference`_ |
| 16 |
|
| 17 |
.. _`python library reference`: https://docs.python.org/3/library/io.html |
| 18 |
|
| 19 |
Status |
| 20 |
====== |
| 21 |
|
| 22 |
multivolumefile module is under active development and considered as ***Alpha*** state. |
| 23 |
It is not good idea to use it on production systems, but it may work well in a limited range |
| 24 |
of usage. Please check limitations and passed test cases. |
| 25 |
|
| 26 |
|
| 27 |
Install |
| 28 |
======= |
| 29 |
|
| 30 |
You can install it as usual public libraries, you can use pip command |
| 31 |
|
| 32 |
``` |
| 33 |
pip install multivolumefile |
| 34 |
``` |
| 35 |
|
| 36 |
You are also able to add it to your setup.py/cfg as dependency. |
| 37 |
|
| 38 |
Usages |
| 39 |
------ |
| 40 |
|
| 41 |
- For reading multi-volume files, that has names `archive.7z.0001`, `archive.7z.0002` and so on, |
| 42 |
you can call multivolumefile as follows; |
| 43 |
|
| 44 |
.. code-block:: |
| 45 |
|
| 46 |
with multivolumefile.open('archive.7z', 'rb') as vol: |
| 47 |
data = vol.read(100) |
| 48 |
vol.seek(500) |
| 49 |
|
| 50 |
- For writing multi-volue files, that has names `archive.7z.0001`, `archive.7z.0002` and so on, |
| 51 |
you can call multivolumefile as follows; |
| 52 |
|
| 53 |
|
| 54 |
.. code-block:: |
| 55 |
|
| 56 |
data = b'abcdefg' |
| 57 |
with multivolumefile.open('archive.7z', 'wb') as vol: |
| 58 |
size = vol.write(data) |
| 59 |
vol.seek(0) |
| 60 |
|
| 61 |
you will see file `archive.7z.001` are written. |
| 62 |
|
| 63 |
Limitations and known issues |
| 64 |
============================ |
| 65 |
|
| 66 |
- fileno() is not supported and when call it, you will get RuntimeError exception. |
| 67 |
- There are several non-implemented functions such as truncate() and writeline() that will raise NotimplementedError |
| 68 |
- There are several non-implemented functions such as readlines(), readline() and readall(). |
| 69 |
- Text mode is not implemented. |
| 70 |
- ***Caution***: When globbing existent volumes, it glob all files other than 4-digit extensions, it may break your data. |
| 71 |
|
| 72 |
|
| 73 |
Contribution |
| 74 |
============ |
| 75 |
|
| 76 |
You are welcome to contribute the project, as usual on github projects, Pull-Requests are always welcome. |
| 77 |
|
| 78 |
License |
| 79 |
======= |
| 80 |
|
| 81 |
Multivolume is licensed under GNU Lesser General Public license version 2.1 or later. |