xphyle

xphyle: Extraordinarily simple file handling - Published in JOSS (2017)

https://github.com/jdidion/xphyle

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software
Last synced: 6 months ago · JSON representation ·

Repository

Python library that facilitates opening, reading, and writing files (and file-like entities like URLs and streams) agnostic of compression format. (production)

Basic Info
  • Host: GitHub
  • Owner: jdidion
  • License: other
  • Language: Python
  • Default Branch: develop
  • Homepage:
  • Size: 2.38 MB
Statistics
  • Stars: 23
  • Watchers: 3
  • Forks: 3
  • Open Issues: 16
  • Releases: 32
Created over 9 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

xphyle: extraordinarily simple file handling

PyPI Travis CI Coverage Status Codacy Badge Documentation Status DOI JOSS

logo

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(pathorfile): with open(pathor_file) as myfile: for line in myfile: print(line)

Read all lines in a compressed file into a list

from xphyle.utils import readlines lines = list(readlines('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 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.

Roadmap

Future releases are mapped out using GitHub Projects.

Citing xphyle

Didion, JP (2017) xphyle: Extraordinarily simple file handling. Journal of Open Source Software; doi:10.21105/joss.00255

Acknowledgements

Owner

  • Name: John Didion
  • Login: jdidion
  • Kind: user
  • Location: Livermore, CA
  • Company: Apton

I am a programmer and bioinformatician. I develop and contribute to several open-source genomics projects.

JOSS Publication

xphyle: Extraordinarily simple file handling
Published
June 18, 2017
Volume 2, Issue 14, Page 255
Authors
John P. Didion ORCID
National Human Genome Research Institute, NIH, Bethesda, MD, USA
Editor
Pjotr Prins ORCID
Tags
io files python

Citation (CITATION)

Didion, JP (2017) xphyle: Extraordinarily simple file handling. Journal of Open Source Software; [doi:10.21105/joss.00255](https://doi.org/10.21105/joss.00255)

@article{Didion2017,
  doi = {10.21105/joss.00255},
  url = {https://doi.org/10.21105/joss.00255},
  year = {2017},
  publisher = {The Open Journal},
  volume = {2},
  number = {14},
  pages = {255},
  author = {John Didion},
  title = {xphyle: Extraordinarily simple file handling},
  journal = {Journal of Open Source Software}
}

GitHub Events

Total
  • Issues event: 1
  • Watch event: 3
  • Fork event: 1
Last Year
  • Issues event: 1
  • Watch event: 3
  • Fork event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 323
  • Total Committers: 4
  • Avg Commits per committer: 80.75
  • Development Distribution Score (DDS): 0.288
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
John Didion g****b@d****t 230
Didion, John (NIH/NHGRI) [F] j****n@n****v 79
pyup-bot g****t@p****o 12
C. Titus Brown t****s@i****g 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 24
  • Total pull requests: 83
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 5
  • Total pull request authors: 3
  • Average comments per issue: 1.21
  • Average comments per pull request: 1.18
  • Merged pull requests: 20
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.75
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jdidion (17)
  • ctb (3)
  • standage (2)
  • adrienyhuel (1)
  • dridk (1)
  • pyup-bot (1)
Pull Request Authors
  • pyup-bot (85)
  • jdidion (5)
  • ctb (2)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 172 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 4
    (may contain duplicates)
  • Total versions: 65
  • Total maintainers: 1
pypi.org: xphyle

Utilities for working with files.

  • Versions: 62
  • Dependent Packages: 2
  • Dependent Repositories: 4
  • Downloads: 172 Last month
Rankings
Dependent packages count: 4.7%
Dependent repos count: 7.5%
Average: 11.1%
Downloads: 12.9%
Stargazers count: 13.3%
Forks count: 16.9%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: xphyle
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Average: 45.7%
Stargazers count: 45.8%
Dependent packages count: 51.2%
Forks count: 51.6%
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • pokrok ==0.2.0
  • sphinx ==4.4.0
requirements.txt pypi
  • pokrok ==0.2.0
setup.py pypi
  • pokrok *