semvec/pypi-packages huggingface dataset:
wsi-packer 0.1.0
A lightweight image packing library
License: MIT
Requires Python: >=3.8
Keywords: image, packing, numpy, opencv, medical-imaging

# Simple Packer

A lightweight image packing library.

## Why?

This package was created to solve color space issues with existing image packing libraries like `image-packer`, which use PIL/Pillow internally and can introduce unwanted RGB/BGR conversions. `wsi-packer` works directly with OpenCV/NumPy arrays in their native color space, making it ideal for medical imaging and other applications where color accuracy is critical.

## Features

- **Color preserving**: No PIL/Pillow conversions - works directly with NumPy arrays
- **Shelf packing algorithm**: Efficient First Fit Decreasing Height (FFDH) bin packing
- **Automatic sizing**: Container dimensions calculated automatically based on content
- **Configurable margins**: Control spacing between packed images

## Installation

Install via pip:

```bash
pip install wsi-packer
```

Or install directly from GitHub:

```bash
pip install git+https://github.com/computationalpathologygroup/wsi-packer.git
```

For development:

```bash
git clone https://github.com/computationalpathologygroup/wsi-packer.git
cd wsi-packer
pip install -e .
```

## Usage

```python
import numpy as np
from wsi_packer import pack_images

# Create some example images (or load with cv2.imread)
images = [
    np.random.randint(0, 255, (100, 200, 3), dtype=np.uint8),
    np.random.randint(0, 255, (150, 150, 3), dtype=np.uint8),
    np.random.randint(0, 255, (80, 120, 3), dtype=np.uint8),
]

# Pack them into a single image
packed = pack_images(images, margin=5)

# Save or display
import cv2
cv2.imwrite('packed.jpg', packed)
```

## Algorithm

Uses a shelf packing algorithm:
1. Sorts images by height (tallest first)
2. Creates horizontal "shelves" to place images
3. Tries to fit each image on an existing shelf before creating a new one
4. Automatically sizes the container based on actual content

This provides better space utilization than a simple grid layout while maintaining simplicity and color accuracy.

## Parameters

- `images` (List[np.ndarray]): List of NumPy arrays (images) to pack
- `margin` (int): Margin in pixels between images (default: 5)

## Returns

Single NumPy array containing all packed images with white background (255, 255, 255).
fastapi-pro-temp-generator 0.1.3
A simple CLI tool to generate a clean FastAPI project structure.
License: MIT
Requires Python: >=3.8
Keywords: fastapi, cli, generator, starter-kit, boilerplate

# FastAPI Project Generator CLI

A lightweight, beginner-friendly CLI tool that creates a clean, ready-to-use FastAPI project structure instantly.

## 🚀 Features

- ✅ **One-command bootstrapping:** Start a FastAPI project in seconds.
- ✅ **Opinionated structure:** Follows best practices for organized code.
- ✅ **Pre-configured:** Generates `main.py`, routes, config, tests, `.env`, and more.
- ✅ **Beginner Friendly:** No complex configuration needed.

## 📦 Installation

```bash
# Clone the repository
git clone <repository-url>
cd fastapi-starter

# Install locally
pip install .
```

## 🛠️ Usage

Creating a new project is as simple as:

```bash
fastapi-starter my_awesome_app
```

This will create a `my_awesome_app/` directory with the following structure:

```text
my_awesome_app/
├── app/
│   ├── main.py          # Entry point
│   ├── core/            # Configuration
│   └── modules/         # Feature-based modules
│       └── users/       # Example module
│           ├── routes.py
│           ├── models.py
│           ├── schemas.py
│           └── services.py
├── tests/               # Unit tests
├── .env                 # Environment variables
├── .gitignore          
├── requirements.txt
└── README.md
```

## 🚀 Getting Started with the Generated Project

1. Navigate to your new project:
   ```bash
   cd my_awesome_app
   ```
2. Install dependencies:
   ```bash
   pip install -r requirements.txt
   ```
3. Run the development server:
   ```bash
   fastapi dev app/main.py
   ```
4. Explore your API:
   - Interactive docs: [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)
pydantic-invoices 1.3.1
Pydantic schemas and repository interfaces for invoice management
License: MIT
Requires Python: >=3.10
Keywords: billing, invoice, pydantic, repository-pattern, schemas

# Pydantic Invoices

Type-safe Pydantic schemas and repository interfaces for invoice management systems.

## Installation

```bash
pip install pydantic-invoices
# or
uv add pydantic-invoices
```

## Usage

### Using Schemas


```python
from pydantic_invoices import Invoice, InvoiceCreate, Client, ClientCreate
from pydantic_invoices.schemas import InvoiceStatus, InvoiceType
from datetime import datetime

# Create invoice data
invoice_data = InvoiceCreate(
    number="INV-001",
    client_id=1,
    company_id=1,
    issue_date=datetime.now(),
    due_date=datetime.now(),
    status=InvoiceStatus.DRAFT,
    type=InvoiceType.STANDARD,
    payment_terms="Net 30",
    lines=[],
)

# Validate and use
invoice = Invoice(id=1, **invoice_data.model_dump())
```

### Invoice Statuses & Types
The library supports a strict state machine workflow:
- **Statuses**: `DRAFT`, `SENT`, `PAID`, `PARTIALLY_PAID`, `CANCELLED`, `REFUNDED`, `CREDITED`.
- **Types**: `STANDARD`, `CREDIT_NOTE`.
- **Linking**: `Credit Notes` can be linked to original invoices via `original_invoice_id`.

### Implementing Repository Interfaces

```python
from pydantic_invoices.interfaces import InvoiceRepository, ClientRepository
from pydantic_invoices import Invoice, InvoiceCreate, Client

class MyInvoiceRepo(InvoiceRepository):
    def create(self, entity: InvoiceCreate) -> Invoice:
        # Your implementation
        pass
    
    def get_by_id(self, id: int) -> Invoice | None:
        # Your implementation
        pass
    
    # ... implement other methods
```

## Architecture

See [System Diagram](docs/system_diagram.md) for a visual overview of the entities and their relationships.

## Features

- ✅ Type-safe Pydantic v2 schemas
- ✅ Repository pattern interfaces
- ✅ No implementation dependencies
- ✅ Fully typed with mypy support
- ✅ Clean separation of concerns
- ✅ Support for **Credit Notes** and **Strict Lifecycle**


## Schemas Included

- `Invoice`, `InvoiceCreate`, `InvoiceUpdate`
- `InvoiceLine`, `InvoiceLineCreate`
- `Client`, `ClientCreate`, `ClientUpdate`
- `Payment`, `PaymentCreate`
- `Company`, `CompanyCreate`, `CompanyUpdate`
- `Product`, `ProductCreate`, `ProductUpdate`
- `PaymentNote`, `PaymentNoteCreate`, `PaymentNoteUpdate`
- `AuditLog`

## Interfaces Included

- `BaseRepository` - Generic CRUD operations
- `InvoiceRepository` - Invoice-specific operations
- `ClientRepository` - Client management
- `PaymentRepository` - Payment tracking
- `CompanyRepository` - Company management
- `ProductRepository` - Product catalog
- `PaymentNoteRepository` - Payment instructions

## License

MIT