semvec/pypi-packages huggingface dataset:
dbjobq 0.1.0
A very simple async job queue with a database
Requires Python: <3.14,>=3.9
Keywords: async, background, database, job, queue

# DBJobQ

Database-backed Job Queue for Python. Supports multiple storage backends: SQLAlchemy, MongoDB, Redis, DynamoDB.

## Installation

```bash
# Basic installation (includes scheduling support)
pip install dbjobq

# Or install with specific storage backend(s)
pip install dbjobq[sqlalchemy]  # SQLAlchemy with async drivers
pip install dbjobq[mongo]        # MongoDB
pip install dbjobq[redis]        # Redis
pip install dbjobq[dynamo]       # DynamoDB

# Or install all storage backends
pip install dbjobq[all]
```

### Development Installation

```bash
# Install uv if not already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the project
git clone <repo-url>
cd dbjobq

# Sync dependencies with all extras and dev tools
uv sync --all-extras
```

## Usage

### Define Jobs

```python
from dbjobq import job

@job
def my_background_task(data):
    print(f"Processing {data}")
    # Do work
```

### Create Job Queue

```python
from dbjobq import JobQueue, Worker
from dbjobq.storage import SQLAlchemyStorage

# For SQLAlchemy
storage = SQLAlchemyStorage('sqlite:///jobs.db')
job_queue = JobQueue(storage)

# Enqueue a job
job_id = job_queue.enqueue(my_background_task, {'key': 'value'})

# Inspect the queue
pending_jobs = job_queue.get_pending_jobs()
running_jobs = job_queue.get_running_jobs()
completed_jobs = job_queue.get_completed_jobs()
failed_jobs = job_queue.get_failed_jobs()

# Get a specific job
job = job_queue.get_job(job_id)
if job:
    print(f"Job {job.id}: {job.type} - {job.status}")

# List all jobs or filter by status
all_jobs = job_queue.list_jobs()
pending_only = job_queue.list_jobs(status="pending", limit=10)

# Start a worker
worker = Worker(job_queue)
worker.start()

# Later, stop the worker
worker.stop()
```

### Storage Backends

- **SQLAlchemy**: Supports any SQL database.
- **MongoDB**: `MongoStorage(mongo_url, db_name)`
- **Redis**: `RedisStorage(redis_url)`
- **DynamoDB**: `DynamoStorage(table_name, region_name)`

## Features

- Cross-process job locking
- Multiple storage backends
- Simple API similar to Celery
- Suitable for web apps like FastAPI with Gunicorn

## Development

```bash
# Run tests
uv run pytest

# Run the example
uv run python hello.py
```
intvert 0.1.0
A package for inversion of integer signals from sampled DFT coefficients.
Requires Python: >=3.9

=======
intvert
=======

intvert is a pure Python package for inversion of 1D and 2D integer arrays from partial DFT samples. This package contains the codebase for the paper [LV]_. See the full documentation `here <https://intvert.readthedocs.io/en/latest/index.html>`_.

Examples
--------

An example usage of the sampling and inversion procedures in 2D for a large binary matrix.

>>> import intvert
>>> import numpy as np
>>> import gmpy2 
>>> 
>>> gen = np.random.default_rng(0)
>>> signal = gen.integers(0, 2, (30, 40)) # generate random binary matrix signal
>>> signal
array([[1, 1, 1, ..., 0, 0, 0],
       [0, 0, 0, ..., 1, 1, 0],
       [1, 1, 0, ..., 0, 1, 0],
       ...,
       [0, 1, 0, ..., 1, 1, 1],
       [1, 1, 1, ..., 0, 0, 1],
       [1, 1, 1, ..., 1, 1, 0]], shape=(30, 40)) 
>>> with gmpy2.get_context() as c: # perform sampling and inversion with increased precision
...     c.precision = 100
...     sampled = intvert.sample_2D(signal)
...     inverted = intvert.invert_2D(signal, beta2=1e20)
... 
>>> inverted
array([[1, 1, 1, ..., 0, 0, 0],
       [0, 0, 0, ..., 1, 1, 0],
       [1, 1, 0, ..., 0, 1, 0],
       ...,
       [0, 1, 0, ..., 1, 1, 1],
       [1, 1, 1, ..., 0, 0, 1],
       [1, 1, 1, ..., 1, 1, 0]], shape=(30, 40))
>>> np.allclose(signal, inverted) # inverted signal matches signal
True

Installation
------------

intvert may be installed from `PyPI <https://pypi.org/project/intvert/>`_ with `pip <https://pypi.org/project/pip/>`_.

.. code-block:: bash

       pip install intvert


References
----------
.. [LLL]

       Arjen K. Lenstra, Hendrik W. Lenstra, and László Lovász. Factoring polynomials with rational coefficients. Mathematische Annalen, 261(4):515–534, December 1982. ISSN 1432-1807. doi: 10.1007/bf01457454. URL: `<http://dx.doi.org/10.1007/BF01457454>`_.

.. [LV] 
       
       Howard W. Levinson and Isaac Viviano. Recovery of integer images from limited dft measurements with lattice methods, 2025. URL: `<https://arxiv.org/abs/2510.11949>`_.

.. [PC] 
       
       Soo-Chang Pei and Kuo-Wei Chang. Binary signal perfect recovery from partial dft coefficients. IEEE Transactions on Signal Processing, 70:3848–3861, 2022. doi: 10.1109/TSP.2022.3190615. URL: `<http://dx.doi.org/10.1109/TSP.2022.3190615>`_.


Requirements
------------
intvert relies on the following Python packages:
 - `numpy <https://numpy.org/doc/stable/>`_ for fast array operations
 - `gmpy2 <https://gmpy2.readthedocs.io/en/stable/>`_ for multiple precision floating point operations
 - `fpylll <https://fpylll.readthedocs.io/en/stable/>`_ for implementations of the LLL lattice basis reduction algorithm [LLL]_
 - `sympy <https://docs.sympy.org/latest/index.html>`_ for integer factorization