python-libarchive-c
python-libarchive-c copied to clipboard
Provide sane defaults for file_writer
It seems as though the line:
with libarchive.file_writer('test.tar.gz', 'ustar', 'gzip') as archive:
could be boiled down to:
with libarchive.file_writer('test.tar.gz') as archive:
as format_name and filter_name can be inferred by filepath's extension.
Currently, users have to:
- Dig through
ffi.pysource code to see the list of validformat_names andfilter_names- Providing a docstring for
file_writerwould be invaluable here.
- Providing a docstring for
- Already know what types of formats to use for what filters.
- I'm sure a list of sane default could be chosen for most formats, which could still be overwritten if specified in the function call.
I'm sure this is a jarring experience to most.
Coming to this lib for the first time, I'll say +1 for this (outside of this feature more documentation would be great!)