3
1
Fork
You've already forked multivolume
1
multi volume file wrapper
  • Python 100%
Find a file
2025年02月27日 02:18:31 +00:00
.github CI: add coverage options 2021年02月23日 10:11:13 +09:00
multivolumefile Support truncate() ( #5 ) 2022年04月15日 23:02:20 +09:00
tests Support truncate() ( #5 ) 2022年04月15日 23:02:20 +09:00
.flake8 chore: full migrate to pyproject.toml 2024年05月19日 20:11:33 +09:00
.gitignore Introduce read functions 2020年09月19日 10:24:29 +09:00
Changelog.rst Release v0.2.3 2021年04月29日 20:58:05 +09:00
LICENSE First import 2020年09月19日 07:36:58 +09:00
MANIFEST.in Add py.typed typing file 2021年02月28日 11:31:09 +09:00
pyproject.toml fix typo in pyproject.toml 2025年02月22日 22:56:27 +00:00
README.rst chore: full migrate to pyproject.toml 2024年05月19日 20:11:33 +09:00

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

The multivolumefile module is considered as *Alpha* stage. All binary mode operation are implemented, but text mode is not completed, such as readline() method. Because the library handles your files, it may damage your files.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

There is a good coverage on testing, but it may not be perfect. You are welcome to add more test for a reliability.

Install

You can install it as usual public libraries, you can use pip command

` pip install multivolumefile OR, alternatively, through conda: conda install -c conda-forge 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

  • Text mode is not implemented.
    • readlines(), writeline() and readline() raises NotImplementedError.
  • fileno() is not supported and when call it, you will get RuntimeError exception.
  • *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-Requests are always welcome.

License

Multivolume is licensed under GNU Lesser General Public license version 2.1 or later.