Skip to main content

multi volume file wrapper library

Project description

multivolumefile

https://coveralls.io/repos/github/miurahr/multivolume/badge.svg?branch=master https://github.com/miurahr/multivolume/workflows/Run%20Tox%20tests/badge.svg

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, but it may work well in a limited range of usage. Please check limitations and passed test cases.

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.

  • There are several non-implemented functions such as truncate() and writeline() that will raise NotimplementedError

  • There are several non-implemented functions such as readlines(), readline() and readall().

  • Text mode is not implemented.

  • *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.

ChangeLog

All notable changes to this project will be documented in this file.

Unreleased

Added

Changed

Fixed

Deprecated

Removed

Security

v0.2.0

Added

  • Type hint information bundled.

Fixed

  • Seek() returns current position.

Changed

  • Explanation of unsupported methods an modes in README

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


Download files

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

Source Distribution

multivolumefile-0.2.0.tar.gz (75.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multivolumefile-0.2.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file multivolumefile-0.2.0.tar.gz.

File metadata

  • Download URL: multivolumefile-0.2.0.tar.gz
  • Upload date:
  • Size: 75.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for multivolumefile-0.2.0.tar.gz
Algorithm Hash digest
SHA256 59a6e18dd2b198af38809525bf4e37503c3ee9a3c90edaa1b8c8605f4ee8cb39
MD5 2e2d843db38cef5fc82795ffd07f2d8c
BLAKE2b-256 d76e2b077c7cfd2e1d96ffdd4ba90e8ff4a404ba72029fc89de7c262c8d48108

See more details on using hashes here.

File details

Details for the file multivolumefile-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: multivolumefile-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for multivolumefile-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c794b1820e050b97ca775a75a6cf05e4f06778c5cfae619ef653b4dd2a0a20d
MD5 75c17440246fc0a95aa0a62d908b0a26
BLAKE2b-256 5e6e89a617f9819e8d009cf7efea396e180d68c6839259f9b480ae5ef9ca2bab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page