Skip to main content

DiskQ

codecov PyPI PyPI - Python Version Downloads GitHub top language GitHub stars https://blog.csdn.net/flower_drop autofix enabled

DiskQ is a Python library for persistent queue management. It allows you to store queue data on disk, making it easier to manage your data and prevent data loss in the event of system crashes or power outages.

Installation

You can install DiskQ using pip:

pip install diskq

Usage

PersistentQueue

The PersistentQueue class is used to create a persistent queue. Here's an example:

from diskq import PersistentQueue

# create a new persistent queue
queue = PersistentQueue('my_queue.pkl')

# add items to the queue
queue.put('item1')
queue.put('item2')
queue.put('item3')

# get items from the queue
item1 = queue.get()
item2 = queue.get()
item3 = queue.get()

PersistentPriorityQueue

The PersistentPriorityQueue class is used to create a persistent priority queue. Here's an example:

from diskq import PersistentPriorityQueue

# create a new persistent priority queue
queue = PersistentPriorityQueue('my_priority_queue.pkl')

# add items to the queue with priorities
queue.put((1, 'item1'))
queue.put((2, 'item2'))
queue.put((3, 'item3'))

# get items from the queue in order of priority
item1 = queue.get()
item2 = queue.get()
item3 = queue.get()

PersistentLifoQueue

The PersistentLifoQueue class is used to create a persistent last-in, first-out (LIFO) queue. Here's an example:

from diskq import PersistentLifoQueue

# create a new persistent LIFO queue
queue = PersistentLifoQueue('my_lifo_queue.pkl')

# add items to the queue
queue.put('item1')
queue.put('item2')
queue.put('item3')

# get items from the queue in reverse order
item3 = queue.get()
item2 = queue.get()
item1 = queue.get()

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for diskq 1.0.0

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

Source distribution (sdist)

Source distribution for diskq 1.0.0
File Size Uploaded
diskq-1.0.0.tar.gz 4.7 kB Details

Built distribution (wheel)

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

Total release size: 13.5 kB

Release files / diskq-1.0.0.tar.gz

Download URL diskq-1.0.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e4f21343fa921e544115b54b5b3bb1ad662470d626e04802714ea9f04684a475
BLAKE2b-256 checksum
How to use checksums
aec2c0f1f6e9842166be924ff766ff3bf7f9a8ad31f7d39d63f07669d995a715
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / diskq-1.0.0-py3-none-any.whl

Download URL diskq-1.0.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fceea201f65468602db0c2f372c43958226f3270928ae12437a998bbb41c1ee
BLAKE2b-256 checksum
How to use checksums
b8bc74842e6695f82b73c87d3689b406c6bc5bb2f3a3814cfb90f88dacfe98de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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