semvec/pypi-packages huggingface dataset:
lab-auto-pulumi 0.1.18
Pulumi helpers. Especially useful for tooling created by the LabAutomationAndScreening github organization.
Requires Python: >=3.12.7

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
[![Actions status](https://github.com/LabAutomationAndScreening/lab-auto-pulumi/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/LabAutomationAndScreening/lab-auto-pulumi/actions)
[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/LabAutomationAndScreening/lab-auto-pulumi)
[![PyPI Version](https://img.shields.io/pypi/v/lab-auto-pulumi.svg)](https://pypi.org/project/lab-auto-pulumi/)
[![Downloads](https://pepy.tech/badge/lab-auto-pulumi)](https://pepy.tech/project/lab-auto-pulumi)
[![Python Versions](https://img.shields.io/pypi/pyversions/lab-auto-pulumi.svg)](https://pypi.org/project/lab-auto-pulumi/)
[![Codecov](https://codecov.io/gh/LabAutomationAndScreening/lab-auto-pulumi/branch/main/graph/badge.svg)](https://codecov.io/gh/LabAutomationAndScreening/lab-auto-pulumi)
[![OpenIssues](https://isitmaintained.com/badge/open/LabAutomationAndScreening/lab-auto-pulumi.svg)](https://isitmaintained.com/project/LabAutomationAndScreening/lab-auto-pulumi)

# Usage
Documentation is hosted on [ReadTheDocs](https://lab-auto-pulumi.readthedocs.io/en/latest/?badge=latest).

# Development
This project has a dev container. If you already have VS Code and Docker installed, you can click the badge above or [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/LabAutomationAndScreening/lab-auto-pulumi) to get started. Clicking these links will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.

To publish a new version of the repository, you can run the `Publish` workflow manually and publish to the staging registry from any branch, and you can check the 'Publish to Primary' option when on `main` to publish to the primary registry and create a git tag.





## Updating from the template
This repository uses a copier template. To pull in the latest updates from the template, use the command:
`copier update --trust --conflict rej --defaults`
datefun 0.0.8
Functional approach to dates (as ISO-DATE string)
Requires Python: >=3.10

# datefun

Functional approach to date manipulations

Date is string. In ISO format (Y-M-D). Mostly it came from database. 

Now we want some manipulations and return again ISO date as string.

Conversion functions:
- dt_make(year: int, month: int, day: int) -> str
- dt_from_object(obj: datetime) -> str

Date (string) output functions:
- dt_month_start(iso_date: str) -> str
- dt_month_end(iso_date: str) -> str
- dt_week_start(iso_date: str, week_start_monday: bool = True) -> str
- dt_week_end(iso_date: str, week_start_monday: bool = True) -> str
- dt_quarter_start(iso_date: str) -> str
- dt_quarter_end(iso_date: str) -> str
- dt_semiyear_start(iso_date: str) -> str
- dt_semiyear_end(iso_date: str) -> str
- dt_year_start(iso_date: str) -> str
- dt_year_end(iso_date: str) -> str
- dt_add_years(iso_date: str, many_years: int, interpret_0228_as_monthend: bool = True) -> str
- dt_add_months(iso_date: str, many_months: int, stay_in_month_end: bool = True) -> str
- dt_add_days(iso_date: str, many_days: int) -> str
- dt_easter(year: int) -> str
- dt_easter_gauss(year: int) -> str
- dt_good_friday(year: int) -> str
- dt_pentecost(year: int) -> str
- dt_add_week(iso_date: str, many_weeks: int) -> str
- dt_add_quarter(iso_date: str, many_quarters: int, stay_in_month_end: bool = True) -> str
- dt_add_semiyear(iso_date: str, many_semiyear: int, stay_in_month_end: bool = True) -> str

Boolean output functions:
- is_leap_year(year_or_date: int | str) -> bool
- is_valid_date(iso_date: str) -> bool

Integer output functions:
- int_days_in_month(iso_date: str) -> int


No external dependecies (only internals, eg. datetime)

Needs python 3.10 (because of type hints/annotations with pipes)

# install

`pip install datefun`

(or pip3 or pipx)

# usage

```python
from datefun import datefun

print(datefun.dt_add_months("2025-02-28", -1)) # outputs 2025-01-31
print(datefun.dt_add_months("2025-02-28", 1, False)) # outputs 2025-03-28

```

or

```python
from datefun.datefun import dt_add_months

print(dt_add_months("2025-02-28", -1)) # outputs 2025-01-31
print(dt_add_months("2025-02-28", 1, False)) # outputs 2025-03-28

```
vrw 0.2.0
Library for simple video reading and writing
Requires Python: >=3.12

# vrw: A Simple Library for Video Reading and Writing

![PyPI](https://img.shields.io/pypi/v/vrw)

`vrw` is a lightweight Python library for reading and writing video files with slicing support. It provides a simple interface for handling video frames using NumPy arrays and supports multiple backends like OpenCV and PyAV.

---

## Installation
To install `vrw`, use the following command:

```bash
pip install vrw
```

---

## Usage

### Reading Videos
The `VideoReader` class allows you to read video files and access frames with slicing and indexing.

```python
from vrw import VideoReader

# Open a video file
vr = VideoReader("video.mp4")

# Access video properties
print(vr.shape)  # (N, H, W, C): N frames, H height, W width, C channels
print(vr.fps)    # Frames per second
print(vr.dtype)  # Data type of the frames

# Access frames using slicing
print(vr[:, 0].shape)         # (N, W, C): All frames, first row
print(vr[::2, :, -1].shape)   # (N // 2, H, C): Every second frame, last column
print(vr[..., 0].shape)       # (N, H, W): All frames, first channel
print(vr[[1, 3, 3, 7], :42].shape)  # (4, 42, W, C): Specific frames, first 42 rows

# Reading grayscale frames
vr_gray = VideoReader("video.mp4", to_gray=True)
print(vr_gray.shape)  # (N, H, W): Grayscale frames
```

Note that [advanced indexing](https://numpy.org/doc/2.2/user/basics.indexing.html#advanced-indexing) involving the 0th axis has not been implemented yet.

### Writing Videos
The `VideoWriter` class allows you to write video files frame by frame.

#### Writing RGB Frames
```python
from vrw import VideoWriter
import numpy as np

# Write RGB frames to a video file
with VideoWriter("video.mp4", fps=30) as vw:
    for i in range(256):
        im = np.full((256, 256, 3), i, dtype=np.uint8)
        im[..., 0], im[..., 1] = np.mgrid[:256, :256]
        vw.write(im)
```

#### Writing Grayscale Frames
```python
# Write grayscale frames to a video file
with VideoWriter("video.mp4", fps=30) as vw:
    for i in range(256):
        vw.write(np.full((256, 256), i, dtype=np.uint8))
```

#### Using the PyAV Backend
The PyAV backend allows you to use advanced codecs (e.g., `libx264`) for video writing. Ensure that FFmpeg is installed and built with the required codecs.

```python
# Use the PyAV backend with a specific codec
with VideoWriter("video.mp4", fps=30, backend="pyav", codec="libx264") as vw:
    for i in range(256):
        im = np.full((256, 256, 3), i, dtype=np.uint8)
        im[..., 0], im[..., 1] = np.mgrid[:256, :256]
        vw.write(im)
```

---

## Backends
`vrw` supports the following backends
- **OpenCV**: Default backend for reading and writing videos.
- **PyAV**: Alternative backend for advanced codec support (requires FFmpeg built with the necessary codecs).

To specify a backend, use the `backend` parameter  (e.g., `backend="cv2"` or `backend="pyav"`) when creating a `VideoReader` or `VideoWriter` instance.
caxample 0.1.0
Example generator for cache testing. Example amplifier for marginal frequecy and temporal locality.
Requires Python: >=3.10

# caxample

Lightweight utilities to ``amplify`` sequences using a temporal kernel and marginal PDF.

## Install

```bash
pip install caxample
```

For development:

```bash
pip install -e ".[dev]"
```

## Basic usage

There are two primary entry points:

- `Amplifier` class for programmatic control
- `amplify()` convenience function

Example:

```python
from caxample.amplify import amplify, Amplifier
from caxample.kernel.powerlaw import PowerLawKernel
from caxample.pdf.zipf import ZipPDF

# Examples can be list of `any` objects.
examples = ['a', 'b', 'c', 'd','e','f','g']

# simple one-liner using defaults
out = amplify(examples, length=100, seed=42)

# more control: use a power-law temporal kernel and a Zipf marginal
kernel = PowerLawKernel(alpha=-1.5, window_size=100)
pdf = ZipPDF(s=1.2)
amp = Amplifier(f_kernel=kernel, g_pdf=pdf, p=1.0, seed=42)
out = amp.amplify(examples, length=200)

print(out[:20])
```

## Notes

- If `f_kernel` is omitted, draws are independent from the marginal `g_pdf`.
- If `g_pdf` is omitted, a uniform PDF is used.
- Supplying both `f_kernel` and `g_pdf` may produce temporal correlations that alter observed marginals (see code warnings).

## Running tests

Run the test suite with:

```bash
pytest -q
```