Registry / database / persist-queue

persist-queue

JSON →
library1.1.0pypypi✓ verified 83d ago

A thread-safe, disk-based persistent queue for Python with support for file, SQLite, MySQL, and auto-recovery. Current version 1.1.0, updated with priority queues and sync API. Release cadence: occasional.

pip install persist-queue
INSTALL
IMPORT
SIG · PERSIST-QUEUE
P
persist-queue
databasepythonv1.1.0
Install
1.6s avg
Import
239ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.252s · 18.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.226s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Queue
from persistqueue import Queue
from persistqueue.file import Queue
Queue is now at top-level since v1.0.0
SQLiteQueue
from persistqueue.sqlite import SQLiteQueue
MySQLQueue
from persistqueue.mysql import MySQLQueue

Basic usage of file and SQLite persistent queues.

import os from persistqueue import Queue # File-based queue q = Queue('myqueue') q.put('foo') q.put('bar') print(q.get()) # foo print(q.get()) # bar # SQLite-based queue from persistqueue.sqlite import SQLiteQueue sqlq = SQLiteQueue('myqueue.db', auto_commit=True) sqlq.put({'task': 'example'}) print(sqlq.get()) # {'task': 'example'} # To ensure auth check (not needed for persist-queue): db_path = os.environ.get('PERSIST_QUEUE_PATH', 'default.db') print('Queue path:', db_path)
Debug
Known issues
breakingIn v1.0.0, Python 2 support was removed and import paths changed. Top-level Queue moved from `persistqueue.file` to `persistqueue`.
fix
Update imports: `from persistqueue import Queue` instead of `from persistqueue.file import Queue`.
affects: <1.0.0
gotchaFile-based queue stores data in pickled format by default. Using different Python versions or serializers (e.g., msgpack, cbor) may cause compatibility issues.
fix
Always use the same serializer and Python version when reading old queues. Consider using SQLite-based queues for cross-version compatibility.
affects: all
deprecatedPython 2 and Python 3.4 are deprecated since v0.8.0 and removed in v1.0.0. These versions are no longer supported.
fix
Upgrade to Python 3.5+ and persist-queue v1.0.0+.
affects: <1.0.0
gotchaSQLiteQueue does not support multiple writers across separate processes. Only use within a single process or use MySQLQueue for concurrent access.
fix
Use MySQLQueue if cross-process concurrency is needed.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Queue' from 'persistqueue'
Old import path `from persistqueue import Queue` not available in versions before 1.0.0; or using wrong package name.
fix
Upgrade to persist-queue >=1.0.0: `pip install -U persist-queue`.
AttributeError: 'Queue' object has no attribute 'full'
Method `full()` was added in v0.8.1. Older versions do not have it.
fix
Upgrade to v0.8.1 or later: `pip install -U persist-queue`.
TypeError: put() got an unexpected keyword argument 'raw'
The `raw` argument is only supported for SQLite-based queues, not file-based Queue.
fix
Use `q.put(item, raw=True)` only with SQLiteQueue or MySQLQueue.
Upgrade
Version history
1.1.0latest on PyPI · released Oct 25, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
1
Resources
persist-queue — pip install persist-queue · libregistry