semvec/pypi-packages huggingface dataset:
a3exception 0.3.0
a3exception  is a package for unifying exceptions during front-end and back-end communication.
License: MIT
Requires Python: >=3.10

# a3exception

English | [简体中文](README_ZH.md)

`a3exception` is a package for unifying exceptions during front-end and back-end communication.

## 1. Introduction

### errors

* Base exception: Error
* Predefined client exceptions: ValidationError, NotFoundError ...
* Predefined server exceptions: ServerKnownError, ServerUnknownError

### DynamicErrorFactory

* Generate a exception dynamically according to the dictionary: build_error_by_status
* Add a custom exception: add_custom_error_cls

## 2. Usage

### Install

```shell
pip install a3exception

```

### Examples

```python
from a3exception.dynamic_error_factory import DynamicErrorFactory
from a3exception.errors import Error


class MyError(Error):
    def __init__(self, message: str, **kwargs):
        super().__init__(message=message, **kwargs)

        
if __name__ == "__main__":
    DynamicErrorFactory.add_custom_error_cls(MyError)
    
    error_message = "custom error"
    error = DynamicErrorFactory.build_error_by_status(status=MyError.__name__, message=error_message)
    assert isinstance(error, MyError)
    assert error.message == error_message

```
pupil_labs_video 1.0.1
A high-level wrapper of PyAV providing an easy to use interface to video data.
License: MIT
Requires Python: <4.0,>=3.10

# pl-video

[![ci](https://github.com/pupil-labs/pl-video/workflows/ci/badge.svg)](https://github.com/pupil-labs/pl-video/actions?query=workflow%3Aci)
[![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://pupil-labs.github.io/pl-video/)
[![pypi version](https://img.shields.io/pypi/v/pupil_labs_video.svg)](https://pypi.org/project/pupil_labs_video/)

A high-level wrapper of [PyAV](https://github.com/PyAV-Org/PyAV) providing an easy to use interface to video data.

The goal of this library is to provide a simple interface while maintaining good computational performance. At current, only MP4 and MJPEG videos are officially compatible.

Features include:

- Performant reading of video files (optionally including audio) utilizing multi-threading.
- Ability to arbitrarily index frames by their index or timestamp.
- Ability to slice the video by frame index or time. Large slices will be loaded lazily to avoidexcessive RAM consumption.
- A frame buffer is maintained to cache frames close to the current decoding position, which avoids repetitive seeking when going back and forth between frames in the same neighborhood or iterating backwards.
- Avoids demuxing and seeking operations as much as possible.
- Reading multi-part video files (e.g. how they are generated by Neon or Pupil Invisible).

## Installation

```bash
pip install pupil_labs_video
```

## Quick Start

You can open a video file and read frames like this:

```python
import pupil_labs.video as plv

with plv.Reader(video_path) as video:
    # Iterate through video frames
    for frame in video:
        # Convert video frame to BGR array
        img = frame.bgr

    # Index individual frames or slices
    first_frame = video[0]
    last_frame = video[-1]
    frames = video[10:20]

    # Index frames by time
    ts = video[10].time
    frame = video.by_container_timestamps[ts]
    frames = video.by_container_timestamps[ts : ts + 10]
```

You can write video files like this:

```python
import pupil_labs.video as plv

with (plv.Writer(out_path) as writer):
    for img in images:
        writer.write_image(img)
```

To learn more see the documentation (to be linked) and examples (to be linked).