semvec/pypi-packages huggingface dataset:
cufile-python 0.2.0
A basic Python wrapper for the NVidia cuFile API
License: MIT
Requires Python: >=3.6

# cufile-python

A basic Python wrapper for the NVidia cuFile API

## Installation

```bash
pip install cufile-python
```

## Usage

Basic usage with the `CuFile` context manager:

```python
from cufile import CuFile
import torch
import ctypes

# allocate an empty buffer in VRAM
t = torch.empty((1024, 1024, 16), dtype=torch.float32, device="cuda")
with CuFile("test.bin", "r") as f:
    f.read(ctypes.c_void_p(t.data_ptr()), t.nbytes)
```

Alternatively one could `import cufile.bindings` and use it as if calling libcufile from C++.

## Development

To set up the development environment:

1. Clone the repository:
```bash
git clone https://github.com/yanok/cufile-python.git
cd cufile-python
```

2. Install development dependencies:
```bash
pip install -r requirements.txt
```

3. Run tests:
```bash
python -m pytest tests/
```

## License

This project is licensed under the MIT License - see the LICENSE file for details.
scribus-image-embedder 1.0.5
Embed linked images inline into Scribus .sla files 
License: MIT
Requires Python: >=3.10

# Scribus Image Embedder

Embed **linked images** inline into Scribus `.sla` files using the same qCompress format Scribus understands.  
**Images only** (JPG/PNG/TIFF/GIF/BMP). 

---



## Why

Scribus layouts often reference external image files via `PFILE="..."`.  
When you move a `.sla` or share it, file links can break. This tool parses the `.sla`, finds **image frames** (`PTYPE="2"`), and embeds the raw image bytes directly into the document. The result is a self-contained `.sla` that opens cleanly even if original image files are missing.

---

## Features

- Preserves scaling/position attributes of frames.
- Stores data both as `ImageData` **attribute** and `<ImageData>...</ImageData>` **node** for compatibility.
- Removes `PFILE`/linking attributes, so the SLA stands alone.
- Clean CLI with success/failure exit codes.

---

## Install

Any OS (pip)

```powershell
pip install scribus-image-embedder
```
Usage
```powershell

scribus-embed /path/to/input.sla -o /path/to/output_embedded.sla
```

Windows examples
```powershell

scribus-embed "C:\Layouts\page1.sla" -o "C:\Layouts\page1_embedded.sla"
scribus-embed "\\server\share\page1.sla" -o "\\server\share\page1_embedded.sla"
```
Behavior

    Scans for PAGEOBJECT elements where PTYPE="2" (image frames).

    If PFILE="..." is present, reads the referenced file and embeds it:

        qCompress format: 4-byte big-endian length + zlib-compressed payload

        Sets isInlineImage="1", inlineImageExt="...", EMBEDDED="1", and other safe defaults

        Removes PFILE, PFILE2, PRFILE, previous ImageData, and link-only child nodes

    Writes a new .sla file; does not modify the original.

Verify Without Opening Scribus
Windows PowerShell
```powershell

# Show embedded data nodes (should see lines)
Select-String -Path "C:\Layouts\page1_embedded.sla" -Pattern '<ImageData>' | Select-Object -First 5

# Show any remaining file links (should show nothing)
Select-String -Path "C:\Layouts\page1_embedded.sla" -Pattern 'PFILE='
```

Linux/macOS


grep -n '<ImageData>' /path/to/page1_embedded.sla | head
grep -n 'PFILE=' /path/to/page1_embedded.sla

Supported Formats

    JPEG/JPG, PNG, TIFF, GIF, BMP (via Pillow

    )

    Width/height detection is best-effort; embedding still works even if detection fails.

Requirements

    Python 3.10+

    Pillow 8.0.0+
os-fastapi-firmware 1.0.6
Adaptable security middlewares for FastAPI: API keys, rate limiting, IP whitelist
License: MIT
Requires Python: >=3.8
Keywords: fastapi, middleware, security, rate-limit, api-key, ip-whitelist

# OS FastAPI Middlewares

Simple and adaptable: production-ready security middlewares for FastAPI, including API Key, Rate Limit, and IP Whitelist. Plug in in-memory or Redis providers, or implement your own.

- API Key: validates a key from the request, optionally injects metadata into request.state
- Rate Limit: enforces requests per time window and adds X-RateLimit-* headers
- IP Whitelist: allows only approved IPs or networks (supports CIDR)

Docs: see docs/installation.md, docs/quickstart.md, and docs/advanced.md.

## Installation

- Basic: `pip install os-fastapi-middleware`
- With Redis (optional): `pip install os-fastapi-middleware[redis]`

Requirements: Python >= 3.8, FastAPI >= 0.100, Starlette >= 0.27.

## Quick example

```python
from fastapi import FastAPI, Request
from os_fastapi_middleware.middleware import APIKeyMiddleware, RateLimitMiddleware, IPWhitelistMiddleware
from os_fastapi_middleware.providers import (
    InMemoryAPIKeyProvider,
    InMemoryRateLimitProvider,
    InMemoryIPWhitelistProvider,
)

app = FastAPI()

api_key_provider = InMemoryAPIKeyProvider(valid_keys={
    "secret-key-123": {"user": "john", "tier": "premium"}
})
rate_limit_provider = InMemoryRateLimitProvider()
ip_whitelist_provider = InMemoryIPWhitelistProvider(allowed_ips=["127.0.0.1"]) 

app.add_middleware(RateLimitMiddleware, provider=rate_limit_provider, requests_per_window=100, window_seconds=60)
app.add_middleware(APIKeyMiddleware, provider=api_key_provider, include_metadata=True)
app.add_middleware(IPWhitelistMiddleware, provider=ip_whitelist_provider)

@app.get("/secure")
async def secure(request: Request):
    return {"hello": request.state.api_key_metadata["user"]}
```

More examples in examples/.

## Key features

- Pluggable providers: in-memory, Redis, and base classes to customize
- Clear configuration: sensible, named parameters
- Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
- Works behind proxies (X-Forwarded-For) when enabled

## Tests

Install dev dependencies and run:

```bash
pip install -e .[dev]
pytest -q
```

## License

MIT. See LICENSE if available.