%global _empty_manifest_terminate_build 0
Name: python-xphyle
Version: 4.4.2
Release: 1
Summary: Utilities for working with files.
License: MIT
URL: https://github.com/jdidion/xphyle
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/31/1b/a07dd1bc3b01b149ba05cbdd77abe2d1461735d93ec92cce688b032468b4/xphyle-4.4.2.tar.gz
BuildArch: noarch
Requires: python3-pokrok
Requires: python3-lorem
Requires: python3-zstandard
%description
# xphyle: extraordinarily simple file handling
[](https://pypi.python.org/pypi/xphyle)
[](https://travis-ci.org/jdidion/xphyle)
[](https://coveralls.io/github/jdidion/xphyle?branch=master)
[](https://www.codacy.com/app/jdidion/xphyle?utm_source=github.com&utm_medium=referral&utm_content=jdidion/xphyle&utm_campaign=Badge_Grade)
[](http://xphyle.readthedocs.io/en/latest/?badge=latest)
[](https://zenodo.org/badge/latestdoi/71260678)
[](http://joss.theoj.org/papers/10.21105/joss.00255)
xphyle is a small python library that makes it easy to open compressed
files. Most importantly, xphyle will use the appropriate program (e.g. 'gzip') to compress/decompress a file if it is available on your system; this is almost always faster than using the corresponding python library. xphyle also provides methods that simplify common file I/O operations.
Recent version of xphyle (4.0.0+) require python 3.6. Older versions of xphyle support python 3.4+.
Please note that xphyle may work on Windows, but it is not tested.
# Installation
```
pip install xphyle
```
# Building from source
Clone this repository and run
```
make
```
# Example usages:
```python
from xphyle import *
from xphyle.paths import STDIN, STDOUT
# Open a compressed file...
myfile = xopen('infile.gz')
# ...or a compressed stream
# e.g. gzip -c afile | python my_program.py
stdin = xopen(STDIN)
# Easily write to the stdin of a subprocess
with open_('|cat', 'wt') as process:
process.write('foo')
# We have to tell xopen what kind of compression
# to use when writing to stdout
stdout = xopen(STDOUT, compression='gz')
# The `open_` method ensures that the file is usable with the `with` keyword.
# Print all lines in a compressed file...
with open_('infile.gz') as myfile:
for line in myfile:
print(line)
# ... or a compressed URL
with open_('http://foo.com/myfile.gz') as myfile:
for line in myfile:
print(line)
# Transparently handle paths and file objects
def dostuff(path_or_file):
with open_(path_or_file) as myfile:
for line in myfile:
print(line)
# Read all lines in a compressed file into a list
from xphyle.utils import read_lines
lines = list(read_lines('infile.gz'))
# Sum the rows in a compressed file where each line is an integer value
total = sum(read_lines('infile.gz', convert=int))
```
See the [Documentation](https://xphyle.readthedocs.io/en/latest/) for full usage information.
# Supported compression formats
* `gzip` (uses `igzip` or `pigz` if available)
* `bgzip`
* `bzip2` (uses `pbzip2` if available)
* `lzma`
* `zstd`
# Issues
Please report bugs and request enhancements using the [issue tracker](https://github.com/jdidion/xphyle).
# Roadmap
Future releases are mapped out using [GitHub Projects](https://github.com/jdidion/xphyle/projects).
# Citing xphyle
[Didion, JP (2017) xphyle: Extraordinarily simple file handling. Journal of Open Source Software; doi:10.21105/joss.00255](https://joss.theoj.org/papers/10.21105/joss.00255#)
# Acknowledgements
* [Dependencies scanned by PyUp.io](http://pyup.io/)
* Thanks to [@ctb](https://github.com/ctb) for reviewing the xphyle paper
%package -n python3-xphyle
Summary: Utilities for working with files.
Provides: python-xphyle
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-xphyle
# xphyle: extraordinarily simple file handling
[](https://pypi.python.org/pypi/xphyle)
[](https://travis-ci.org/jdidion/xphyle)
[](https://coveralls.io/github/jdidion/xphyle?branch=master)
[](https://www.codacy.com/app/jdidion/xphyle?utm_source=github.com&utm_medium=referral&utm_content=jdidion/xphyle&utm_campaign=Badge_Grade)
[](http://xphyle.readthedocs.io/en/latest/?badge=latest)
[](https://zenodo.org/badge/latestdoi/71260678)
[](http://joss.theoj.org/papers/10.21105/joss.00255)
xphyle is a small python library that makes it easy to open compressed
files. Most importantly, xphyle will use the appropriate program (e.g. 'gzip') to compress/decompress a file if it is available on your system; this is almost always faster than using the corresponding python library. xphyle also provides methods that simplify common file I/O operations.
Recent version of xphyle (4.0.0+) require python 3.6. Older versions of xphyle support python 3.4+.
Please note that xphyle may work on Windows, but it is not tested.
# Installation
```
pip install xphyle
```
# Building from source
Clone this repository and run
```
make
```
# Example usages:
```python
from xphyle import *
from xphyle.paths import STDIN, STDOUT
# Open a compressed file...
myfile = xopen('infile.gz')
# ...or a compressed stream
# e.g. gzip -c afile | python my_program.py
stdin = xopen(STDIN)
# Easily write to the stdin of a subprocess
with open_('|cat', 'wt') as process:
process.write('foo')
# We have to tell xopen what kind of compression
# to use when writing to stdout
stdout = xopen(STDOUT, compression='gz')
# The `open_` method ensures that the file is usable with the `with` keyword.
# Print all lines in a compressed file...
with open_('infile.gz') as myfile:
for line in myfile:
print(line)
# ... or a compressed URL
with open_('http://foo.com/myfile.gz') as myfile:
for line in myfile:
print(line)
# Transparently handle paths and file objects
def dostuff(path_or_file):
with open_(path_or_file) as myfile:
for line in myfile:
print(line)
# Read all lines in a compressed file into a list
from xphyle.utils import read_lines
lines = list(read_lines('infile.gz'))
# Sum the rows in a compressed file where each line is an integer value
total = sum(read_lines('infile.gz', convert=int))
```
See the [Documentation](https://xphyle.readthedocs.io/en/latest/) for full usage information.
# Supported compression formats
* `gzip` (uses `igzip` or `pigz` if available)
* `bgzip`
* `bzip2` (uses `pbzip2` if available)
* `lzma`
* `zstd`
# Issues
Please report bugs and request enhancements using the [issue tracker](https://github.com/jdidion/xphyle).
# Roadmap
Future releases are mapped out using [GitHub Projects](https://github.com/jdidion/xphyle/projects).
# Citing xphyle
[Didion, JP (2017) xphyle: Extraordinarily simple file handling. Journal of Open Source Software; doi:10.21105/joss.00255](https://joss.theoj.org/papers/10.21105/joss.00255#)
# Acknowledgements
* [Dependencies scanned by PyUp.io](http://pyup.io/)
* Thanks to [@ctb](https://github.com/ctb) for reviewing the xphyle paper
%package help
Summary: Development documents and examples for xphyle
Provides: python3-xphyle-doc
%description help
# xphyle: extraordinarily simple file handling
[](https://pypi.python.org/pypi/xphyle)
[](https://travis-ci.org/jdidion/xphyle)
[](https://coveralls.io/github/jdidion/xphyle?branch=master)
[](https://www.codacy.com/app/jdidion/xphyle?utm_source=github.com&utm_medium=referral&utm_content=jdidion/xphyle&utm_campaign=Badge_Grade)
[](http://xphyle.readthedocs.io/en/latest/?badge=latest)
[](https://zenodo.org/badge/latestdoi/71260678)
[](http://joss.theoj.org/papers/10.21105/joss.00255)
xphyle is a small python library that makes it easy to open compressed
files. Most importantly, xphyle will use the appropriate program (e.g. 'gzip') to compress/decompress a file if it is available on your system; this is almost always faster than using the corresponding python library. xphyle also provides methods that simplify common file I/O operations.
Recent version of xphyle (4.0.0+) require python 3.6. Older versions of xphyle support python 3.4+.
Please note that xphyle may work on Windows, but it is not tested.
# Installation
```
pip install xphyle
```
# Building from source
Clone this repository and run
```
make
```
# Example usages:
```python
from xphyle import *
from xphyle.paths import STDIN, STDOUT
# Open a compressed file...
myfile = xopen('infile.gz')
# ...or a compressed stream
# e.g. gzip -c afile | python my_program.py
stdin = xopen(STDIN)
# Easily write to the stdin of a subprocess
with open_('|cat', 'wt') as process:
process.write('foo')
# We have to tell xopen what kind of compression
# to use when writing to stdout
stdout = xopen(STDOUT, compression='gz')
# The `open_` method ensures that the file is usable with the `with` keyword.
# Print all lines in a compressed file...
with open_('infile.gz') as myfile:
for line in myfile:
print(line)
# ... or a compressed URL
with open_('http://foo.com/myfile.gz') as myfile:
for line in myfile:
print(line)
# Transparently handle paths and file objects
def dostuff(path_or_file):
with open_(path_or_file) as myfile:
for line in myfile:
print(line)
# Read all lines in a compressed file into a list
from xphyle.utils import read_lines
lines = list(read_lines('infile.gz'))
# Sum the rows in a compressed file where each line is an integer value
total = sum(read_lines('infile.gz', convert=int))
```
See the [Documentation](https://xphyle.readthedocs.io/en/latest/) for full usage information.
# Supported compression formats
* `gzip` (uses `igzip` or `pigz` if available)
* `bgzip`
* `bzip2` (uses `pbzip2` if available)
* `lzma`
* `zstd`
# Issues
Please report bugs and request enhancements using the [issue tracker](https://github.com/jdidion/xphyle).
# Roadmap
Future releases are mapped out using [GitHub Projects](https://github.com/jdidion/xphyle/projects).
# Citing xphyle
[Didion, JP (2017) xphyle: Extraordinarily simple file handling. Journal of Open Source Software; doi:10.21105/joss.00255](https://joss.theoj.org/papers/10.21105/joss.00255#)
# Acknowledgements
* [Dependencies scanned by PyUp.io](http://pyup.io/)
* Thanks to [@ctb](https://github.com/ctb) for reviewing the xphyle paper
%prep
%autosetup -n xphyle-4.4.2
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-xphyle -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri May 05 2023 Python_Bot - 4.4.2-1
- Package Spec generated