semvec/pypi-packages huggingface dataset:
random-symplectic 0.0.2
Random d-nary symplectic matrices for qudit Clifford gates.
Requires Python: >=3.8
Keywords: quantum computing, qudit, symplectic, clifford

# Random Symplectic
Python library for generating uniformly random d-nary symplectic matrices for prime $d$. These matrices form a representation of the $n$-qudit Clifford  group and can be decomposed into elementary 1- and 2-qudit gates (Hostens, 2005). Uniform sampling from the Clifford group is a critical subroutine to randomized benchmarking (Magesan, 2012).

The algorithm implements a mapping from the integers to $\text{Sp}(2n, \mathbb{Z}_d)$, reducing sampling from the symplectic group to sampling an integer, and is an extension of the qubit-based method presented by Koenig and Smolin (2014). A manuscript detailing the algorithm is forthcoming.



## Installation
To install the package for Python 3.8+, do
```
pip install random-symplectic
```


## Getting Started
The package implements the `DnaryArray` class, a subclass of `numpy`'s `ndarray` for arrays over the integers mod $d$. Users can specify $d$ using the classmethod `DnaryArray.set_d`, which will return a subclass of `DnaryArray` specialized to the given modulus.
```python
>>> from randomsymplectic import DnaryArray
>>> D3 = DnaryArray.set_d(3)
>>> D3([1, 2, 3, 4])
DnaryArray(d=3)([1, 2, 0, 1])
```

In particular, a specialized subclass exposes a plethora of useful methods for doing symplectic algebra over the group of d-nary arrays, as well as generating symplectic matrices.

### Random Symplectic Matrices

`DnaryArray` has two classmethods for generating uniformly random symplectic matrices: `DnaryArray.random_symplectic` and `DnaryArray.from_index`. The former operates by generating random d-nary vectors of lengths building up to the size of the matrix to be generated. The latter deterministically generates each of those vectors from the provided index.

```python
>>> from randomsymplectic import DnaryArray
>>> D3 = DnaryArray.set_d(3)
>>> D3.from_index(0, n=1)
DnaryArray(d=3)([[1, 0],
                 [0, 1]])
>>> D3.from_index(12152, 3)
DnaryArray(d=3)([[1, 0, 1, 2, 1, 1],
                 [0, 1, 0, 2, 1, 2],
                 [2, 0, 0, 1, 1, 0],
                 [0, 0, 2, 0, 1, 0],
                 [0, 0, 0, 0, 1, 0],
                 [2, 0, 2, 0, 2, 0]])
```

## References
1. E. Hostens, J. Dehaene, and B. De Moor, Stabilizer states and Clifford operations for systems of arbitrary dimensions and modular arithmetic, [Phys. Rev. A 71, 042315 (2005)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.71.042315), [arXiv:quant-ph/0408190](https://arxiv.org/abs/quant-ph/0408190).
2. E. Magesan, J. M. Gambetta, and J. Emerson, Characterizing quantum gates via randomized benchmarking, [Phys. Rev. A 85, 042311 (2012)](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.85.042311), [arXiv:1109.6887v2](https://arxiv.org/abs/1109.6887v2).
3. R. Koenig and J. A. Smolin, How to efficiently select an arbitrary Clifford group element, [Journal of Mathematical Physics 55, 122202 (2014)](https://doi.org/10.1063/1.4903507), [arXiv:1406.2170](https://arxiv.org/abs/1406.2170).
phasedist 0.1.2
Fit continuous and discrete phase-type distributions
Requires Python: >=3.10


<img src="https://github.com/areenberg/phasedist/blob/main/images/PhaseDist_logo.png" alt="Example" width="300">

PhaseDist is a Python package for fitting continuous and discrete phase-type distributions.

## Features

* Fit continuous and discrete phase-type distributions using EM algorithms.
* Use built-in methods to easily check the fitted distribution.
* Evaluate various metrics, such as the mean, density, quantile function, AIC and more.
* Simulate observations from phase-type distributions.
* Approximate another distribution, e.g. a log-normal distribution, using a phase-type distribution.

# Installation

Install directly from PyPI with:

```
pip install phasedist
```

# Quick start guide

The following shows how to use PhaseDist for fitting a continuous phase-type distribution from observed data. 

(1) Start by loading PhaseDist (and NumPy) and defining the observed data.

```python
import phasedist as ph
import numpy as np

obs = np.array([1.48246359,1.13468709,0.66779536,0.61823347,0.8888217,1.10124776,0.1424737,2.1228061,
1.73924933,0.9849647,1.4828275,1.97188842,2.56132465,1.58038807,1.27567082,2.7754917,1.42516854,0.4602795,
1.93701091,2.50633135,1.92906099,1.60935023,1.41949599,1.14870169,0.79146146,1.31530543,1.81352371,1.17079096,
0.78948314,1.39528837,1.62003755,1.52143826,0.46665594,1.37913488,3.10066725,0.76942733,1.42849783,1.61511175,
2.94617609,1.53719196,1.01144357,2.00466269,0.56886361,1.62237618,0.41023332,0.78733512,4.01849928,1.27761144,
1.09426382,1.36946933])
```

(2) Fit the data to a generalized Erlang distribution with 3 phases.

```python
fit = ph.fit(obs=obs,
             nphases=3,
             dtype="generlang")
```

(3) Compare the CDF of the fitted distribution to the empirical CDF.

```python
fit.plot()
```

<img src="https://github.com/areenberg/phasedist/blob/main/images/quickstart_example_CDF.png" alt="Example" width="500">

(4) Store the fitted distribution in the object `phdist` and compute the mean, variance, and 95% quantile.

```python
phdist = fit.getdist()

print(phdist.getmean())
#1.455814

print(phdist.getvar())
#0.706466

print(phdist.getquantile(p=0.95))
#3.055169
```

Find the complete example in the file `quickstart_example.py`.

# Documentation

The documentation can be found in the [wiki for PhaseDist](https://github.com/areenberg/phasedist/wiki).
video-specs 0.1.51
Add your description here
Requires Python: >=3.11

# <div align="center"> video-specs

Fill a form about the specifications of the video you want to generate and get the whole video description formatted either in XML, in JSON, HTML or in Markdown text blocks.

## Pre requisites

- Python 3.11+
- `uv` is definitely recommended

## Quick Start

### With `homebrew`:

```bash
brew tap dim-gggl/brew
brew install video-specs
```

### With `uv`

1. Global installation

```bash
uv tool install video-specs
```

2. Local installation (venv)

```bash
uv add video-specs
```

### with `pip`

```bash
pip install video-specs
```

## Start

```bash
video-specs
```

This should launch the interactive mode, otherwise you can start with a simple :

```bash
video-specs --help
```
solentware-base 5.3
Bitmapped record number databases.

=========================================================================
A bitmapped record number database interface for various database engines
=========================================================================

.. contents::


Description
===========

A record number database is seen as a set of fixed size segments, and an existence bitmap is associated with each segment which contains any records.  The idea is from Model 204 (Rocket Software).

Where an index value refers to many records in a segment these references are encoded as a bitmap or a list of record numbers, in a single <index value> : <bitmap or list> record, rather than as many <index value> : <record number> records.  When 'many' is small a list is favoured to save the space needed for large numbers of unset bits.

The interfaces provided by the apsw, berkeleydb, bsddb3, dptdb, lmdb, and sqlite3, Python modules are supported.

The interfaces provided by the dbm.gnu, dbm.ndbm, unqlite, and vedis, Python modules are available for experiment.


Installation Instructions
=========================

This package is available on PyPI so can be installed by typing

   python -m pip install --user solentware-base

at the command prompt.

See `Python`_ and `pip`_ documentation for alternatives and platform-specific points.


.. _Python: https://python.org
.. _pip: https://packaging.python.org/installing
pgn-read 2.6
Portable Game Notation (PGN) parser.

===================================
Portable Game Notation (PGN) parser
===================================

.. contents::


Description
===========

This package provides a parser for chess game scores in `PGN`_ format.

Both the strict export format and many less strict import formats are supported.

Chess variants are not supported.

The game module provides the Game, GameStrictPGN, GameTextPGN, and GameIgnoreCasePGN, classes and the generate_fen_for_position function.

The parser module provides the PGN class and add_token_to_game function.

The PGN.read_games method yields instances of the Game class, or a subclass, generated from a file-like source or string.

The add_token_to_game function searches for the next PGN token in a string and applies it to an instance of the Game class, or a subclass.

The generate_fen_for_position function returns the Forsyth English Notation (FEN) string for the representation of a position in the Game class, or a subclass.

The movetext_parser module provides classes which expect movetext but do not expect it to represent a game.

The tagpair_parser module provides classes which take just enough notice of movetext to correctly spot PGN Tag Pairs and Game Termination Markers.


Installation Instructions
=========================

This package is available on PyPI so can be installed by typing

   python -m pip install --user pgn-read

at the command prompt.

See `Python`_ and `pip`_ documentation for alternatives and platform-specific points.


Tests
=====

Tests are available at the `repository`_ in the pgn_read.core.tests sub-package.

Copy the tests directory and run tests by typing, for example,

   python -m pgn_read.core.tests.test_squares

at the command prompt with setup.py in the current directory.


Notes
=====

Project name and package name changed from 'pgn' to 'pgn-read' prior to upload to PyPI.

The version numbers of pgn-read continue on from pgn.

The pgn_read.core.tests sub-package was removed from the distribution created by setup when the `repository`_ was created.


.. _Python: https://python.org
.. _pip: https://packaging.python.org/installing
.. _PGN: https://www.chessclub.com/help/PGN-spec
.. _repository: https://github.com/RogerMarsh/pgn-read
chesscalc 2.0.4
Calculate player performances in chess games.

=====================================================
Calculate player performances from chess game results
=====================================================

.. contents::


Description
===========

This package provides methods to calculate player performances.

Calculate player performances from results of games imported from `PGN`_ format files.

Provide facilities to resolve player identities where inconsistencies exist in the PGN Tag Values for games involving the same player.

Provide facilties to resolve inconsistent identities, time controls or playing modes for example, derived from other PGN Tag Values.


Installation Instructions
=========================

This package is not available on PyPI, or any other package index, but can be installed by typing

   python -m pip install --user --trusted-host solentware.co.uk --find-links http://solentware.co.uk/wheels.html chesscalc

at the command prompt.

See `Python`_ and `pip`_ documentation for alternatives and platform-specific points.

Then run 'python -m pip check' to identify other packages which need to be installed.


Run
===

The command to run this package is:

   python -m chesscalc.calculate

You may need to give the path and version of Python depending on your system's configuration:

   <path to python>/python<version> -m chesscalc.calculate

   For example

      C:\\Python33\\python -m chesscalc.calculate

         on Microsoft Windows or

      python3.3 -m chesscalc.calculate

         on Unix-like systems.

Or use the facilities of your desktop (Microsoft Windows, GNOME, KDE, ...) to set up a convenient way of starting calculate.


Notes
=====

ChessCalc makes no attempt to ease the problems arising from not using PGN Tags in the way envisaged in the PGN specification.  For example:

    Not using the WhiteType and BlackType tags to indicate human or algorithmic players.

    Not using the TimeControl tag to indicate the time controls.  This determines if the game is standard, rapid, or blitz (using English Chess Federation terms); or some other distinctions.

    Not using the Mode tag to indicate Online or Over The Board play.

ChessCalc does use the WhiteTeam and BlackTeam tags which appear in PGN files published by `TWIC`_.  At time of writing I have not seen these PGN tags elsewhere.

The legacy sub-package contains some of the implementation prior to version 2.0.0 but this will be removed in the future.


.. _Python: https://python.org
.. _pip: https://packaging.python.org/installing
.. _PGN: https://www.chessclub.com/help/PGN-spec
.. _TWIC: https://theweekinchess.com
paginators 1.0.0
Some missing paginators for Django
Requires Python: >=3.0

=================
django-paginators
=================

A library collecting various paginators and pagination tools for Django.

Not locked to a Django version, the code was first designed for Django < 1.0
and Python < 2.7. It no longer supports Python 2.

Import what you need or add it as an app to use the template tag.

paginators.Paginator
====================

A thin shim around ``django.core.paginator.Paginator`` adding some helpful
methods.

paginators.Page
===============

Used by ``paginators.Paginator``, a thin shim around
``django.core.paginator.Page`` adding some helpful methods.

paginators.namepaginator.NamePaginator
======================================

The first paginator paging on strings instead of numbers.

paginators.namepaginator.NamePage
=================================

The page-object used by ``paginators.namepaginator.NamePaginator``.

paginators.stringpaginator.SingleLetterPaginator
================================================

Page on a single letter instead of a number: for for instance dictionaries.

paginators.stringpaginator.CombinedLetterPaginator
==================================================

Combine several letters into a single page: for for instance dictionaries.

paginators.stringpaginator.LetterPage
=====================================

Used by ``paginators.stringpaginator.SingleLetterPaginator`` and
``paginators.stringpaginator.CombinedLetterPaginator``.

The equivalent of ``django.core.paginator.Page`` but for letters.

paginators.templates
====================

The default template used by the template tag.

paginators.templatetags.paginator.paginator
===========================================

A template tag falling back to using the template in ``paginators.templates``
that prettily renders a paginator block.
usageflow-flask 0.3.5
Flask middleware for UsageFlow - Usage-based pricing made simple
Requires Python: >=3.6

# UsageFlow Flask

> ⚠️ **Beta Notice**: This package is currently in beta. While we strive to maintain stability, there may be breaking changes as we continue to improve the API.

The Flask package of UsageFlow provides easy integration with Flask applications for API usage tracking and management.

## Installation

```bash
pip install usageflow-flask
```

## Quick Start

```python
from flask import Flask, jsonify
from usageflow.flask import UsageFlowMiddleware

app = Flask(__name__)

# Initialize UsageFlow middleware
UsageFlowMiddleware(
    app,
    api_key="your_api_key_here",
    pool_size=10  # Optional: Number of WebSocket connections (default: 10)
)

@app.route("/api/v1/users")
def get_users():
    return jsonify({"users": ["user1", "user2"]})

if __name__ == "__main__":
    app.run()
```

## Configuration

The middleware accepts the following parameters:

- `app`: Your Flask application instance (required)
- `api_key`: Your UsageFlow API key (required)
- `pool_size` (optional): Number of WebSocket connections in the pool (default: 10)

## Features

- Automatic request tracking
- JWT token extraction and validation
- Request/response metadata collection
- Rate limiting and quota management
- Endpoint blocking support

## Development

To contribute to the project:

1. Clone the repository
2. Install development dependencies:
   ```bash
   pip install -e ".[dev]"
   ```
3. Run tests:
   ```bash
   pytest
   ```

## License

MIT License
cline-core 0.1.10
Add your description here
Requires Python: >=3.10

# Cline Core

A python library to run cline core

## Installation

Install Cline CLI which includes Cline Core. For more info visit: https://cline.bot/cline-cli
```bash
RUN npm install -g cline@1.0.8
```

Install this library

```bash
pip install cline_core
```

## Usage

### Basic Cline Instance Management

```python
from cline_core import ClineInstance

with ClineInstance.with_available_ports() as instance:
    print(f"Instance started: {instance.address}")
    # Use the instance
```

### Examples

See `examples/example.py` for a complete example of creating and monitoring tasks.

## API Reference

### ClineInstance

`ClineInstance` class for managing Cline Core processes.

#### Methods

- **start()**: Launches cline-host and cline-core.js processes, waits for instance lock
- **stop()**: Terminates the processes
- **wait_for_instance(timeout=30)**: Waits for instance lock in database
- **is_running()**: Checks if processes are still running
- **with_available_ports(cwd, config_path=None)**: Factory method for automatic port allocation

Supports context manager protocol for automatic cleanup.

### Protocol Buffer Files

The library includes gRPC protocol buffer definitions and generated Python files for communicating with Cline's gRPC services. These files are located in `src/cline/proto/` and include:

- Task management (`task_pb2.py`)
- State management (`state_pb2.py`)
- Common types (`common_pb2.py`)
- And more...

Protocol buffer files are automatically generated during the build process using `uv build`. The generated files are included in the package distribution but ignored in version control.

To manually regenerate these files during development:

```bash
uv run build.py
```

## Development

This project uses uv for package management and development.

```bash
# Install dependencies
uv sync --dev

# Run tests
uv run pytest

# Semantic release (handled by CI)
```

- Automatic versioning with python-semantic-release
- CI/CD with GitHub Actions
zeek-reports 0.1.7
Zeek notice reporting with CSV/JSON output and anomaly detection.
Requires Python: >=3.6

# zeek-reports

zeek-reports is a Python script that generates Zeek notice reports in text, CSV, and JSON formats. It is designed to improve reporting for security posture assessments, highlight targeted Notice events, and surface anomalous or unauthorized activity for investigation.

## Install

```bash
git clone git@gitlab.esss.lu.se:cert-ess/zeek-reports.git
cd zeek-reports
pip3 install . # doing this in a virtual environment is better

```

## Usage
```sh
usage:
	zeek-reports --period {daily,weekly,monthly} [--log-root LOG_ROOT]
	                      [--networks NETWORKS] [--include-today]
	                      [--no-baseline] [--output OUTPUT]
	                      [--output-dir OUTPUT_DIR]

optional arguments:
  -h, --help            show this help message and exit
  --period              Report period based on local system time.
  --log-root            Root Zeek log directory (default: /opt/zeek/logs).
  --networks            Path to networks.cfg for internal IP ranges.
  --include-today       Include the current day in the report window.
  --no-baseline         Skip baseline comparisons (faster, fewer anomalies).
  --output              Write report to a file instead of stdout.
  --output-dir          Directory to write JSON/CSV reports.

For Example:

       zeek-reports --period daily --output /home/csi/reports/zeek/zeek_notice_daily.txt
```
## Uninstall
```sh
pip3 uninstall zeek-reports
Found existing installation: zeek-reports 0.1.0
Uninstalling zeek-reports-0.1.0:
  Would remove:
    /usr/local/bin/zeek-notice-report
    /usr/local/lib/python3.8/site-packages/zeek_reports-0.1.0.dist-info
Proceed (y/n)? y
  Successfully uninstalled zeek-reports-0.1.0
```
[![Quality Gate Status](https://sonarqube.esss.lu.se/api/project_badges/measure?project=zeek-reports&metric=alert_status)](https://sonarqube.esss.lu.se/dashboard?id=zeek-reports)
mini-download-ui 1.0.1
Minimal terminal download UI
Requires Python: >=3.8

# Mini Download UI

A minimalist and cross-platform Python module providing a terminal download using ANSI escape sequences.

This project focuses on **simplicity and clarity**:
- No external dependencies
- Pure Python
- Works on Linux, macOS and modern Windows terminals

---

## Features

- APT style progress bar
- Log area displayed above the progress bar
- Progress percentage indicator
- Adaptive to terminal size
- ANSI-based rendering
- Simple and explicit usage

---

## Requirements

- Python **3.8+**
- ANSI-compatible terminal  
  - Linux terminals  
  - macOS Terminal / iTerm2  
  - Windows Terminal, PowerShell 7+, WSL

---

## Installation

No installation step required.
Simply install the lib with `pip`

```bash
pip install mini-download-ui
```

---

## Basic Usage

```python
from mini_dl_ui import DownloadUI
import time

ui = DownloadUI()

for i in range(101):
    ui.progress(i)
    ui.log(f"Downloading package {i}/100")
    time.sleep(0.05)

ui.close()
```

# Alternative Usage

```python
from mini_dl_ui import DownloadUI
import time

with DownloadUI() as ui:
    for i in range(101):
        if i in (10, 40, 70):
            ui.log(f"Downloading package {i}/100")
        ui.progress(i)
        time.sleep(0.03)
    ui.log("Finished.")
    time.sleep(0.5)
```

# Example Terminal Output

```text
[LOG] Downloading package 48/100
[LOG] Downloading package 49/100
[LOG] Downloading package 50/100
--------------------------------------------------
[##########                                  ] 50%
```

---

## Threaded Usage

```python
import threading
import time
from mini_dl_ui import DownloadUI

ui = DownloadUI(fill='=')

def worker():
    for i in range(101):
        ui.progress(i)
        ui.log(f"Chunk {i} received")
        time.sleep(0.03)
    ui.close()

threading.Thread(target=worker).start()
```
# Example Terminal Output

```text
[LOG] Downloading package 48/100
[LOG] Downloading package 49/100
[LOG] Downloading package 50/100
--------------------------------------------------
[=========                                  ] 50%
```