Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ensure gunzip command for single files #47

Merged
merged 7 commits into from
Jul 25, 2022
Merged

Adds ensure gunzip command for single files #47

merged 7 commits into from
Jul 25, 2022

Conversation

cthoyt
Copy link
Owner

@cthoyt cthoyt commented Jul 22, 2022

Closes #45

This supports ensuring/unzipping GZ files. In addition, it wraps the sqlite opener for use cases like the following:

import pandas as pd

import pystow

if __name__ == "__main__":
    sql = "SELECT * FROM entailed_edge LIMIT 10"
    url = "https://s3.amazonaws.com/bbop-sqlite/hp.db.gz"
    with pystow.ensure_open_sqlite_gz("test", url=url) as conn:
        df = pd.read_sql(sql, conn)
    print(df)

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2022

Codecov Report

Merging #47 (383e6d6) into main (aa60314) will decrease coverage by 0.82%.
The diff coverage is 23.52%.

@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
- Coverage   66.66%   65.83%   -0.83%     
==========================================
  Files          10       10              
  Lines         867      884      +17     
  Branches      145      147       +2     
==========================================
+ Hits          578      582       +4     
- Misses        268      281      +13     
  Partials       21       21              
Impacted Files Coverage Δ
src/pystow/__init__.py 100.00% <ø> (ø)
src/pystow/impl.py 72.87% <10.00%> (-2.66%) ⬇️
src/pystow/api.py 70.27% <33.33%> (-0.77%) ⬇️
src/pystow/utils.py 61.48% <50.00%> (-0.16%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us.

src/pystow/utils.py Outdated Show resolved Hide resolved
cthoyt and others added 3 commits July 25, 2022 15:28
Co-authored-by: Max Berrendorf <berrendorf@dbs.ifi.lmu.de>
@cthoyt cthoyt marked this pull request as ready for review July 25, 2022 19:38
@cthoyt cthoyt merged commit 91da88f into main Jul 25, 2022
@cthoyt cthoyt deleted the ensure-gunzip branch July 25, 2022 19:42
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syncing an upstream gzip file with an expanded local version
3 participants