semvec/pypi-packages huggingface dataset:
lightning-trainer-utils 2025.5.26.15.18
A Python package for using PyTorch Lightning with custom callbacks and model wrappers.
Requires Python: >=3.11

[![PyPI version](https://badge.fury.io/py/lightning-trainer-utils.svg)](https://pypi.org/project/lightning-trainer-utils/)
# PyTorch Lightning Trainer Utilities

## Installation
```bash
pip install lightning-trainer-utils
```

## ML Model Assumptions

### forward
- The model wrapper uses the forward function as follows:
```python
    output = self.model(**x, **self.forward_kwargs)
    return ModelOuput(**output)
```
It expects `batch` as `dict` and returns a `dict` with keys `[loss, report, output]`.

### return
- ML model should return a dict with the following keys:
    - `loss`
    - `report`
    - `output` [optional]


## Trainer
### Global Step
`batch_step = num_samples / (batch_size * num_devices)
trainer_global_step = num_samples / (batch_size * num_devices * grad_accumulation)`
`SaveCheckpoint` also use `trainer_global_step`.
ark-calculator 0.1.1
Just a test calculator package

# 🧮 Calculator Package (Sample Python Project)

This is a **sample project for creating a package in Python**. It demonstrates how to structure a simple Python project, add CLI support, write tests with `pytest`, and run it like a command-line tool.

---

## 📁 Project Structure

```
calculator_package/
│
├── calculator/               # Package source code
│   ├── __init__.py
│   ├── core.py               # Calculator logic
│   └── cli.py                # CLI interface
│
├── tests/                    # Unit tests
│   ├── __init__.py
│   ├── test_core.py
│   └── conftest.py           # Adds package to PYTHONPATH for tests
│
├── main.py                   # Entry point (CLI executable)
├── pyproject.toml
├── requirements.txt
├── setup.py
└── README.md
```

---

## 🚀 Usage

### 🧪 1. Setup Virtual Environment

```bash
python -m venv venv
source venv/bin/activate
```

### 📦 2. Install Dependencies

```bash
pip install -r requirements.txt
```

### ▶️ 3. Run the Calculator

Make `main.py` executable:

```bash
chmod +x main.py
```

Now run:

```bash
./main.py add 2 3
# Output: Result: 5.0
```

---

## 🔬 Running Tests

Make sure you add `PYTHONPATH` or use `conftest.py`.

```bash
pytest
```

---

## 🛠 Calculator Functions

- `add(a, b)`
- `subtract(a, b)`
- `multiply(a, b)`
- `divide(a, b)` → raises error on divide by zero

---

## 🎁 Optional: Install as a Package (Editable Mode)

```bash
pip install -e .
```

Now you can use it anywhere in the virtual environment.

---

## ✅ License

MIT License

---

## 🧪 Educational Purpose

This project is designed for **learning and testing** how to properly create and structure a Python package with CLI and tests.
packio 0.1.2
IO for multiple python objects to/from a single file
Requires Python: >=3.10

# packio

Packio allows you to use a single file to store and retrieve multiple python objects. See [the docs](https://packio.readthedocs.io/en/latest/).

Example:
```
import dummio
import pandas as pd
from packio import Reader, Writer

# define some objects and an output filepath
df = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
lookup = {"a": 1, "b": 2}
filepath = tmp_path / "data.packio"

# save both objects to the same filepath
with Writer(filepath) as writer:
    df.to_parquet(writer.file("df.parquet"))
    dummio.json.save(lookup, filepath=writer.file("lookup.json"))

# load the objects from the file
with Reader(filepath) as reader:
    df2 = pd.read_parquet(reader.file("df.parquet"))
    lookup2 = dummio.json.load(reader.file("lookup.json"))

assert df.equals(df2)
assert lookup == lookup2
```

[Available on pypi](https://pypi.org/project/packio/): `pip install packio`.

## Why a single file and not a directory?

In a word, *encapsulation*. Copy/move operations with a file are simpler than a directory, especially when it comes to moving data across platforms such as to/from the cloud. A file is also more tamper-resistant - it's typically harder to accidentally modify the contents of a file than it is for someone to add or remove files or subdirectories in a directory.

## Why not pickle?

Although `pickle` may be the most common approach for serialization of complex python objects, there are strong reasons to dislike pickle. As summarized by Gemini, "Python's pickle module, while convenient, has drawbacks. It poses security risks due to potential code execution vulnerabilities when handling untrusted data. Compatibility issues arise because it's Python-specific and version-dependent.  Maintaining pickle can be challenging due to refactoring difficulties and complex debugging." See also [Ben Frederickson](https://www.benfrederickson.com/dont-pickle-your-data/).

## Development

Create and activate a virtual env for dev ops:
```
git clone git@github.com:zkurtz/packio.git
cd packio
pip install uv
uv sync
source .venv/bin/activate
pre-commit install
```
hfold 0.0.4
HFold: Python bindings for the HFold C++ library
Requires Python: >=3.8

# How to test the hfold python package

## 1. Make sure you have ViennaRNA installed on your system
### ViennaRNA package installation
The `hfold` package requires ViennaRNA to be installed before compilation.

1. Download the ViennaRNA package: [ViennaRNA-2.7.0.tar.gz](https://github.com/ViennaRNA/ViennaRNA/releases/download/v2.7.0/ViennaRNA-2.7.0.tar.gz)


2. Install the Package:
```bash
tar -zxvf ViennaRNA-2.7.0.tar.gz
cd ViennaRNA-2.7.0
./configure --without-perl
sudo make -j$(nproc)              # Linux
sudo make -j$(sysctl -n hw.ncpu)  # macOS
sudo make install
```
More info: [ViennaRNA GitHub](https://github.com/ViennaRNA/ViennaRNA) 

## 2. Setup a Virtual Environment
Make sure you're in a virtual environment
```bash
python3 -m venv venv
source venv/bin/activate
```

## 3. Install Python Dependencies
Make sure you have pybind11 and setuptools installed
```bash
sudo apt install pybind11-dev # linux
brew install pybind11 # MacOS
python3 -m pip install pybind11 setuptools scikit-build
```

## 4. Build the Python Extension
From the project root:
```bash
pip install -v -e ./pylib/
```

## 5. Start Python
```bash
python3
```

## 6. Run Test Commands
Once in the Python shell, you can test `hfold`:
```python
import hfold

# Basic sequence folding
hfold.hfold("AGGGCUAUCCUU", param_file="../params/rna_DirksPierce09.par")[0][0]

# Folding with suboptimal structures
hfold.hfold("AGGGCUAUCCUU", subopt=5, param_file="../params/rna_DirksPierce09.par")[0]

# Folding sequences from file
hfold.hfold(subopt=2, fileI="./sample_inputs/sample.txt", param_file="../params/rna_DirksPierce09.par")
```

## Full List of Parameters
| Parameter        | Type   | Description                     |
|------------------|--------|---------------------------------|
| `sequence`       | str    | RNA sequence                    |
| `restriction`    | str    | Folding constraint              |
| `pk_free`        | bool   | Exclude pseudoknots             |
| `pk_only`        | bool   | Only allow pseudoknots          |
| `dangles`        | int    | Dangle configuration            |
| `subopt`         | int    | Number of suboptimal structures |
| `fileI`          | str    | Input file path                 |
| `fileO`          | str    | Output file path                |
| `param_file`     | str    | Thermodynamic parameters file   |
| `noConv_given`   | bool   | Do not convert DNA into RNA     |
| `suppress_output`| bool   | Suppress console output         |


Build wheels 
```bash
python -m pip install --upgrade cibuildwheel scikit-build-core twine pybind11 setuptools # install pre-req
cibuildwheel pylib --output-dir dist # build
python -m twine upload dist/* # upload
```
tor-search 0.1.2
Search the web anonymously through the Tor network
Requires Python: >=3.6

# Tor Search

Search the web anonymously through the Tor network. This Python package allows you to make search queries to Google, DuckDuckGo, and Yandex via the Tor network, protecting your privacy.

## Features

- Anonymous web searching through Tor network
- Support for multiple search engines:
  - DuckDuckGo (most reliable through Tor)
  - Google
  - Yandex
- Command line interface
- Python API for integration into your own projects
- User agent rotation
- CAPTCHA detection for Yandex

## Installation

### Prerequisites

You need to have Tor running on your system:
- On Mac/Linux: `brew install tor` then `brew services start tor`
- On Ubuntu/Debian: `apt-get install tor` then `service tor start`
- On Windows: Install the Tor Browser Bundle and ensure it's running

### Install from PyPI

```bash
pip install tor-search
```

## Usage

### Command Line
```bash
# Basic search with DuckDuckGo (default)
tor-search "python programming"

# Search with Google and show 5 results
tor-search "python programming" -e google -n 5

# Search with Yandex
tor-search "machine learning" -e yandex
```

### Python Module
```bash
from tor_search import TorSearcher

# Create a searcher instance
searcher = TorSearcher()

try:
    # Connect to Tor and search
    results = searcher.search("python programming", num_results=3, engine="duckduckgo")
    
    # Process results
    for result in results:
        print(f"Title: {result['title']}")
        print(f"URL: {result['link']}")
        print(f"Snippet: {result.get('snippet', '')}")
        print()
        
    # You can perform additional searches without reconnecting
    more_results = searcher.search("machine learning", engine="google")
finally:
    # Always disconnect when done to restore original socket
    searcher.disconnect()
```

## License
MIT License

## Disclaimer
This tool is meant for legitimate privacy-focused research. Please use responsibly and respect search engines' terms of service.
pyrpgmaker 0.1.1
A Python RPG Maker
Requires Python: >=3.13

# PyRPGMaker

A Python-based RPG Maker tool for creating role-playing games.

## Installation

```bash
pip install pyrpgmaker
```

## Usage

```python
from pyrpgmaker import Game

# Create a new game
game = Game()
```

## Features

- Create and manage RPG games
- Customizable characters and maps
- Event system
- Battle system

## License

This project is licensed under the MIT License - see the LICENSE file for details.