{"id":24230,"library":"persist-queue","title":"persist-queue","description":"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.","status":"active","version":"1.1.0","language":"python","source_language":"en","source_url":"https://github.com/peter-wangxu/persist-queue","tags":["persistent-queue","disk-based","thread-safe","sqlite","mysql","file-queue"],"install":[{"cmd":"pip install persist-queue","lang":"bash","label":"latest"}],"dependencies":[],"imports":[{"note":"Queue is now at top-level since v1.0.0","wrong":"from persistqueue.file import Queue","symbol":"Queue","correct":"from persistqueue import Queue"},{"symbol":"SQLiteQueue","correct":"from persistqueue.sqlite import SQLiteQueue"},{"symbol":"MySQLQueue","correct":"from persistqueue.mysql import MySQLQueue"}],"quickstart":{"code":"import os\nfrom persistqueue import Queue\n\n# File-based queue\nq = Queue('myqueue')\nq.put('foo')\nq.put('bar')\nprint(q.get())  # foo\nprint(q.get())  # bar\n\n# SQLite-based queue\nfrom persistqueue.sqlite import SQLiteQueue\nsqlq = SQLiteQueue('myqueue.db', auto_commit=True)\nsqlq.put({'task': 'example'})\nprint(sqlq.get())  # {'task': 'example'}\n\n# To ensure auth check (not needed for persist-queue):\ndb_path = os.environ.get('PERSIST_QUEUE_PATH', 'default.db')\nprint('Queue path:', db_path)","lang":"python","description":"Basic usage of file and SQLite persistent queues."},"warnings":[{"fix":"Update imports: `from persistqueue import Queue` instead of `from persistqueue.file import Queue`.","message":"In v1.0.0, Python 2 support was removed and import paths changed. Top-level Queue moved from `persistqueue.file` to `persistqueue`.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Always use the same serializer and Python version when reading old queues. Consider using SQLite-based queues for cross-version compatibility.","message":"File-based queue stores data in pickled format by default. Using different Python versions or serializers (e.g., msgpack, cbor) may cause compatibility issues.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Python 3.5+ and persist-queue v1.0.0+.","message":"Python 2 and Python 3.4 are deprecated since v0.8.0 and removed in v1.0.0. These versions are no longer supported.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Use MySQLQueue if cross-process concurrency is needed.","message":"SQLiteQueue does not support multiple writers across separate processes. Only use within a single process or use MySQLQueue for concurrent access.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to persist-queue >=1.0.0: `pip install -U persist-queue`.","cause":"Old import path `from persistqueue import Queue` not available in versions before 1.0.0; or using wrong package name.","error":"ImportError: cannot import name 'Queue' from 'persistqueue'"},{"fix":"Upgrade to v0.8.1 or later: `pip install -U persist-queue`.","cause":"Method `full()` was added in v0.8.1. Older versions do not have it.","error":"AttributeError: 'Queue' object has no attribute 'full'"},{"fix":"Use `q.put(item, raw=True)` only with SQLiteQueue or MySQLQueue.","cause":"The `raw` argument is only supported for SQLite-based queues, not file-based Queue.","error":"TypeError: put() got an unexpected keyword argument 'raw'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}