Skip to main content

openfile

openfile is a trivial Python module that implements a single convenience function openfile(filename, mode="rt", **kwargs) wich delegates the real work to one of the following standard library functions:

  • gzip.open(filename, mode, **kwargs) if the file ends with suffix .gz;

  • bz2.open(filename, mode, **kwargs) if the file ends with suffix .bz2;

  • lzma.open(filename, mode, **kwargs) if the file ends with suffix .xz or .lzma;

  • open(filename, mode, **kwargs) if the file does not end with any suffix mentioned above.

If the filename is a single dash - then sys.stdin or sys.stdout is returned, depending on mode being r or w, respectively.

The following keyword arguments are used by openfile:

  • expanduser=True will cause openfile to call os.path.expanduser for filename.

  • expandvars=True will cause openfile to call os.path.expandvars for filename.

  • makedirs=True will cause openfile to call os.makedirs for the parent directory os.path.dirname(filename) if it does not exist and mode contains either "w" or "a".

All other keyword arguments passed to openfile will be passed down to the open functions listed above.

Metadata

Release files for openfile 0.0.7

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

Source distribution (sdist)

Source distribution for openfile 0.0.7
File Size Uploaded Provenance Actions
openfile-0.0.7.tar.gz 2.2 kB Without provenance Details for openfile-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openfile 0.0.7
File Interpreter ABI Platform Actions
openfile-0.0.7-py3-none-any.whl Python 3 none any Details for openfile-0.0.7-py3-none-any.whl

Total release size: 4.6 kB

Release files / openfile-0.0.7.tar.gz

Download URL openfile-0.0.7.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea4e8f19112049f578ec161b12f70c1113144988c0a488ab173a138b50f37479
BLAKE2b-256 checksum
How to use checksums
16466c8b936e55ace50a6d9ea722dd4b11a4996d58cff41690636a0d6f6f6718
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.23.2 CPython/3.6.4

Release files / openfile-0.0.7-py3-none-any.whl

Download URL openfile-0.0.7-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d21b69dba1306c9dd397a44fd8f4fa8a83812f1d935c409085e8a25c411d16ec
BLAKE2b-256 checksum
How to use checksums
93e6805db6867faacb488b44ba8e0829ef4de151dd0499f3c5da5f4ad11698a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.23.2 CPython/3.6.4

Security for openfile 0.0.7

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.

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