Skip to main content
https://travis-ci.org/necrolyte2/filehandle.svg https://coveralls.io/repos/necrolyte2/filehandle/badge.svg https://badge.fury.io/py/filehandle.svg

filehandle

Normalize the way you get file handle from either gzip or normal file

Typical way to open gzip or regular file

>>> import gzip
>>> import os.path
>>> files = ['/path/to/foo.bar.gz', '/path/to/foo.bar']
>>> for f in files:
...   root, ext = os.path.splitext(f.replace('.gz',''))
...   ext = ext[1:]
...   if f.endswith('.gz'):
...     handle = gzip.open(f)
...   else:
...     handle = open(f)

Using filehandle

>>> import filehandle
>>> files = ['/path/to/foo.bar.gz', '/path/to/foo.bar']
>>> for f in files:
...   handle, extension = filehandle.open(f)

Metadata

Release files for filehandle 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for filehandle 0.0.9
File Size Uploaded Provenance Actions
filehandle-0.0.9.tar.gz 1.6 kB Without provenance Details for filehandle-0.0.9.tar.gz

Release files / filehandle-0.0.9.tar.gz

Download URL filehandle-0.0.9.tar.gz
Size 1.6 kB
Tags Source
SHA-256 checksum
How to use checksums
99c966fe0c4df486759799264b2a4c0b84763f1674dec6c5e6d8a3e11f004077
BLAKE2b-256 checksum
How to use checksums
54ec1a6385184b6fc512b62ace58cc4446bdc1b5a693f93157edd030ad3125b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for filehandle 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.9 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page