semvec/pypi-packages huggingface dataset:
acvr 0.1.0
Accurate video reader for python.
Requires Python: >=3.9

# Accurate video reader (acvr)
Video reader built around PyAV for frame-accurate seeking.

Inspired by code in [rerun.io]().

Supports:
- accurate, random-access retrieval of individual frames from videos encoded with modern codecs (H.264, H.265)
- works with variable-frame rate videos
- LRU
- Fast scrubbing mode

## Installation
In a terminal window run:
```shell
pip install acvr
```
or
```shell
conda install acvr -c ncb
```


## Usage
Open a video file and read frame 100:
```python
from acvr import VideoReader
vr = VideoReader(video_file_name)
print(vr)  # prints video_file_name, number of frames, frame rate and frame size
frame = vr[100]
vr.close()
```

Or use a context manager which takes care of opening and closing the video:
```python
with VideoReader(video_file_name) as vr:  # load the video
    frame = vr[100]
```

### Read modes
```python
from acvr import VideoReader

with VideoReader(video_file_name, build_index=True) as vr:
    accurate = vr.read_frame(index=100, mode="accurate")
    fast = vr.read_frame(index=100, mode="fast")
    scrub = vr.read_frame(t_s=1.0, mode="scrub", keyframe_mode="nearest")
```

## Documentation
The latest documentation lives at https://janclemenslab.org/acvr.

To build the docs locally:
```shell
pip install acvr[docs]
mkdocs serve
```

## Publishing
Build and upload the distribution to PyPI:
```shell
python -m build
python -m twine upload dist/*
```

## Test videos
The test video generator script `scripts/make_test_h264_videos.py` requires `ffmpeg`
to be available on your PATH. The script also needs OpenCV; install the dev extras
to pull in a headless build:
```shell
pip install acvr[dev]
```
If you're using conda, you can install `ffmpeg` like this:
```shell
conda install -c conda-forge ffmpeg
```

## Benchmark snapshot
On the bundled CFR/VFR test assets (M1-class laptop, PyAV 12.x):

| Mode | CFR fast (ms/frame) | CFR accuracy | VFR fast (ms/frame) | VFR accuracy |
| --- | --- | --- | --- | --- |
| Accurate | ~89 | exact | ~88 | matches PyAV reference |
| Scrub (keyframes) | ~2 | very approximate | ~2 | very approximate |
| Fast (PyAV) | ~12 | matches OpenCV | ~12 | matches OpenCV |
congressional-trades 0.1.0
Scrape and analyze stock trades by members of US Congress
Requires Python: >=3.10
Keywords: congress, finance, house, politics, senate, stocks, trading

# congressional-trades

Scrape and analyze stock trades by members of the US Congress.

[![PyPI version](https://badge.fury.io/py/congressional-trades.svg)](https://badge.fury.io/py/congressional-trades)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Features

- Scrapes directly from official sources (efdsearch.senate.gov)
- Clean, typed Python API
- Local caching for fast repeated queries
- Export to CSV/DataFrame
- Daily updates via GitHub Actions

## Installation

```bash
pip install congressional-trades
```

## Quick Start

```python
from congressional_trades import get_trades, get_politicians

# Get all recent trades
trades = get_trades()

# Filter by various criteria
trades = get_trades(
    chamber="senate",
    ticker="NVDA",
    start_date="2024-01-01",
    transaction_type="purchase",
)

# Get as pandas DataFrame
df = get_trades(as_dataframe=True)

# List all politicians
politicians = get_politicians(chamber="senate")
```

## CLI Usage

```bash
# List recent trades
congressional-trades list --ticker NVDA --since 2024-01-01

# Export to CSV
congressional-trades export trades.csv

# Force refresh from source
congressional-trades refresh
```

## Data Sources

- **Senate**: [efdsearch.senate.gov](https://efdsearch.senate.gov) - Electronic Financial Disclosure
- **House**: Coming in v2 (PDF parsing required)

## Data Model

Each trade includes:

| Field | Type | Description |
|-------|------|-------------|
| `politician` | str | Full name |
| `chamber` | str | "senate" or "house" |
| `party` | str | "D", "R", or "I" |
| `state` | str | Two-letter state code |
| `ticker` | str | Stock ticker (if resolved) |
| `asset_name` | str | Full asset description |
| `transaction_type` | str | "purchase", "sale", etc. |
| `transaction_date` | date | When trade occurred |
| `disclosure_date` | date | When disclosed |
| `amount_min` | int | Minimum transaction amount |
| `amount_max` | int | Maximum transaction amount |

## Contributing

Contributions welcome! The biggest need is help with House PDF parsing.

```bash
# Development setup
git clone https://github.com/guttu44/congressional-trades
cd congressional-trades
pip install -e ".[dev]"
pytest
```

## License

MIT