Skip to main content

Just in time open files.

Project description

This package provides a way to delay opening files until the something is written to the file handle. This can be convenient when opening a large number of files of which most of them will not be frequently used. To deal with resource limits a queue is used from which, when full, the least frequent file is closed.

Installation

The software is distributed via PyPI, it can be installed with pip:

pip install jit_open

From source

The source is hosted on GitHub, to install the latest development version, use the following commands.

git clone https://git.lumc.nl/j.f.j.laros/jit-open
cd jit_open
pip install .

Usage

In the following example, only the file used.txt is created.

>>> from jit_open import Handle, Queue
>>>
>>> queue = Queue()
>>> used = Handle("used.txt", queue)
>>> unused = Handle("unused.txt", queue)
>>>
>>> used.write("line 1\n")
>>> used.write("line 2\n")

Library

The library provides the Handle and Queue classes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jit_open-1.0.3.tar.gz (106.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jit_open-1.0.3-py2.py3-none-any.whl (110.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jit_open-1.0.3.tar.gz.

File metadata

  • Download URL: jit_open-1.0.3.tar.gz
  • Upload date:
  • Size: 106.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jit_open-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9c87da65129a2306c036cb3955edf09c9b5f38157a67ed8836e5a32d07f3b35c
MD5 81ad005b2951a4577324499647e42c5b
BLAKE2b-256 47209b20fae4687486f3561037493e07eb912b6a45f0285bf0760153eb7dd920

See more details on using hashes here.

Provenance

The following attestation bundles were made for jit_open-1.0.3.tar.gz:

Publisher: release.yml on jfjlaros/jit-open

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jit_open-1.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: jit_open-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 110.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jit_open-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5b2e71d22727daf4b5f45975b40e2651ff583eb3ea270bc48f601194876f4b68
MD5 8b1b7ddbd0828b566347f8d82285550d
BLAKE2b-256 b35218c3f809030efa2f893f93d46b7c73a114baf6456d60cb8b9566b855d67c

See more details on using hashes here.

Provenance

The following attestation bundles were made for jit_open-1.0.3-py2.py3-none-any.whl:

Publisher: release.yml on jfjlaros/jit-open

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page