Install & Compatibility
Where this runs
tested against v1.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.042s · 17.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.034s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FifoDiskQueue
✓ from queuelib import FifoDiskQueue
✗ from queuelib.disk import FifoDiskQueue
LifoDiskQueue
✓ from queuelib import LifoDiskQueue
PriorityQueue
✓ from queuelib import PriorityQueue
This quickstart demonstrates creating and using a `FifoDiskQueue` for persistent storage. It shows pushing and popping items, closing the queue for integrity, and reopening it to retrieve previously stored data. Remember to always call `.close()` on disk-based queues and handle the storage directory appropriately.
import tempfile
import shutil
from queuelib.disk import FifoDiskQueue
# Create a temporary directory for the queue files
qdir = tempfile.mkdtemp()
try:
q = FifoDiskQueue(qdir)
print(f"Queue created at: {qdir}")
q.push(b'item1')
q.push(b'item2')
print(f"Pushed: item1, item2. Size: {len(q)}")
item = q.pop()
print(f"Popped: {item}. Size: {len(q)}")
q.close() # IMPORTANT: Always close disk queues to ensure data integrity
print("Queue closed.")
# Reopen the queue from the same directory to demonstrate persistence
q2 = FifoDiskQueue(qdir)
item2 = q2.pop()
print(f"Reopened queue. Popped: {item2}. Size: {len(q2)}")
q2.close()
except Exception as e:
print(f"An error occurred: {e}")
finally:
shutil.rmtree(qdir) # Clean up the temporary directory
print(f"Cleaned up directory: {qdir}")
Debug
Known issues
breakingQueuelib frequently removes support for older Python versions. Ensure your environment meets the `requires_python` specification for the installed version.fixUpgrade your Python interpreter to a supported version (e.g., Python 3.10+ for queuelib 1.9.0) or downgrade queuelib if older Python support is critical.
affects: >=1.7.0
gotchaDisk-based queues (e.g., `FifoDiskQueue`, `LifoDiskQueue`, `PriorityDiskQueue`) *must* be explicitly closed using the `.close()` method to ensure all pending writes are flushed to disk and file handles are released. Failure to close can lead to data loss or corruption, especially during unexpected program termination.fixAlways call `.close()` on disk queue instances, preferably within a `try...finally` block or by using them as context managers if available (though explicit `.close()` is the most robust approach for Queuelib).
affects: All versions with disk queues
gotchaThe `peek()` method, which allows viewing the next item without removing it, was added in version 1.6.0. Code relying on `peek()` will fail on older `queuelib` versions.fixUpgrade `queuelib` to version 1.6.0 or newer if you need `peek()` functionality. If you cannot upgrade, you'll need to implement alternative logic.
affects: <1.6.0
gotchaBe mindful of the distinct import paths for different queue types. `PriorityQueue` (in-memory) is imported directly from `queuelib`, while persistent disk queues are in `queuelib.disk`, and other memory queues are in `queuelib.queue`. Confusing these paths is a common mistake.fixAlways refer to the official documentation or source code for the correct import path for the specific queue class you intend to use (e.g., `from queuelib.disk import FifoDiskQueue` vs. `from queuelib import PriorityQueue`).
affects: All versions
Upgrade
Version history
1.10.0latest on PyPI · released Aug 24, 2026
Audit
Dependencies
No dependency data recorded yet.