semvec/pypi-packages huggingface dataset:
ezdir 0.3.0
Change working directory up a number of levels or to a named folder
Requires Python: >=3.6
Keywords: os, directory, path, utility

# ezdir

Simple utilities to change the current working directory in Python:

- `up(n)` changes working folder to be up `n` directory levels.
- `goto("foldername")` changes working folder to the first parent folder (within the original path) matching a name.
- `find("foldername")` changes working folder to the first parent folder matching a name under `n` directory levels.

## Examples

If your current file is `Users/me/MyWork/src/main/work[.py/.ipynb]` and you wanted to
go up one level to `src` you could use the `up` function:

```python
import ezdir

ezdir.up(levels=1)
```

If you wanted to go to `Users/me/MyWork/src` you could go up two levels or use the `goto` function:

```python
import ezdir

ezdir.trim(folder_name='src')
```

As the `src` folder is within the original path.

If you wanted to switch your working directory to `Users/me/MyWork/tests` you could use `find`:

```python
import ezdir

ezdir.find(levels=2, folder_name='tests')
```

As this will go `up` two levels, and then search for a `tests` folder. We include a number
of excluded folders (e.g. `build`), but you can exclude more folders by passing a list to
the `ezdir.find` as the `add_ignore_subfolders` variable.

## Installation

```bash
pip install ezdir
```

## Why use it?

### Changing working directory in a Jupyter Notebook

If you are using a notebook on a cloud server, your working directory might
be different to some elses. Normally people do something like:

```python
import os

os.chdir(path)
```

But sometimes this path will be different based on the user. This library provides
a more sensible way of going up folder paths whether you're using a python script or
a notebook.
img2ascii-cli 1.0.0
A CLI tool to convert images to ASCII art
Requires Python: >=3.6


# img2ascii-cli

A simple CLI tool to convert images into ASCII art.

## Features
- Supports PNG and JPEG
- Outputs to terminal or .txt
- Adjustable width

## Usage

```bash
img2ascii image.jpg --width 120 --out output.txt
```

## Dependencies

- Pillow

```bash
pip install Pillow
```
pyPhasesRecordloaderMESA 0.4.1
Adds a record loaders to the pyPhases package
Requires Python: >=3.5

# Extension for pyPhasesRecordloader

Extension to load data records from the Multi-Ethnic Study of Atherosclerosis (MESA) database.

The extensions requires a downloaded version of the MESA dataset. The location can be set through the config value `mesa-path`.

## Usage

In a phase you can acess the data through the `RecordLoader`:

Add the plugins and config values to your `project.yaml`:

```yaml
name: MesaProject
plugins:
  - pyPhasesML
  - pyPhasesRecordloaderMESA
  - pyPhasesRecordloader

phases:
  - name: MyPhase

config:
  mesa-path: C:/datasets/mesa

```

In a phase (`phases/MyPhase.py`) you can acess the records through the `RecordLoader`:

```python
from pyPhasesRecordloader import RecordLoader
from pyPhases import Phase

class MyPhase(Phase):
    def run(self):
      recordIds = recordLoader.getRecordList()
      for recordId in recordIds:
        record = recordLoader.getRecord(recordId)
```

Run Your project with `python -m phases run MyPhase`
python-nano-bench 0.1.0
Control all Build Systems
Requires Python: >=3.8
Keywords: benchmark

Installation
============

Automatic:
----------
```bash
pip install https://github.com/FloydZ/python_nano_bench
```

Manual:
------
```
git clone --recursive https://github.com/FloydZ/python_nano_bench
cd python_nano_bench
./build.sh
```

The `./build.sh` command generates the needed executables.
In the case of `nixos` you can simply run `nix-shell`

Usage:
======
 
TODO
qnstr-optimizer 0.1.0
A Quasi-Newton Subspace Trust Region Algorithm for nonmonotone variational inequalities in adversarial learning over box constraints
Requires Python: >=3.12

# QNSTR-Optimizer

**QNSTR-Optimizer** is a Python implementation of the algorithm proposed in  
[A Quasi-Newton Subspace Trust Region Algorithm for Nonmonotone Variational Inequalities in Adversarial Learning over Box Constraints](https://arxiv.org/abs/2302.05935).

This package provides a robust and efficient optimizer for solving nonmonotone variational inequality (VI) problems, particularly those arising in adversarial learning and min-max optimization under box constraints. The algorithm leverages a quasi-Newton subspace trust region (QNSTR) approach, offering improved convergence properties for challenging saddle-point and VI problems.

---

## Features

- **Quasi-Newton Subspace Trust Region (QNSTR) Algorithm**: Efficiently solves nonmonotone VI problems with box constraints.
- **PyTorch Integration**: Easily integrates as a custom optimizer for PyTorch models.
- **Flexible Loss Function**: Supports user-defined loss functions for a wide range of applications.
- **Reproducible and Extensible**: Designed for research and practical use in adversarial learning and related fields.

---

## Installation

We recommend using [uv](https://github.com/astral-sh/uv) for dependency management:

```bash
uv sync
```

---

## Usage Example

Below is a minimal example demonstrating the use of `QnstrOptimizer` with a custom loss function in PyTorch:

```python
import torch
from qnstr_optimizer.optimizer import QnstrOptimizer

def loss_fn(x, y):
    return x**2 - 5 * x * y - y**2

x = torch.tensor([1.0], requires_grad=False)
y = torch.tensor([1.0], requires_grad=False)
params = [x, y]

optimizer = QnstrOptimizer(
    params,
    loss_fn,
    zeta1=0.1,
    zeta2=0.4,
    beta1=0.5,
    beta2=5,
    eta=0.5,
    nu=200,
    tau=0.9,
    epsilon=1e-6,
    epsilon_criteria=1e-4,
    memory_size=10,
    bfgs_dir_count=3,
    max_step=100,
    mu_s=1e-2,
)
optimizer.step()
assert abs(x.item()) < 0.1 and abs(y.item()) < 0.1
```

---

## Citation

If you use this code or algorithm in your research, please cite the following paper:

```
@article{Qiu_2024,
   title={A Quasi-Newton Subspace Trust Region Algorithm for Nonmonotone Variational Inequalities in Adversarial Learning over Box Constraints},
   volume={101},
   ISSN={1573-7691},
   url={http://dx.doi.org/10.1007/s10915-024-02679-y},
   DOI={10.1007/s10915-024-02679-y},
   number={2},
   journal={Journal of Scientific Computing},
   publisher={Springer Science and Business Media LLC},
   author={Qiu, Zicheng and Jiang, Jie and Chen, Xiaojun},
   year={2024},
   month=oct }
```

---

## References

- [A Quasi-Newton Subspace Trust Region Algorithm for Nonmonotone Variational Inequalities in Adversarial Learning over Box Constraints](https://arxiv.org/abs/2302.05935)

---

## License

This project is licensed under the MIT License.
filmsdk-gadeumarcy 0.0.5
SDK Python pour accéder à l’API MovieLens (Data Analysts/Data Scientists friendly)
Requires Python: >=3.10

# MovieLens SDK - `filmsdk`

Un SDK Python simple pour interagir avec l’API REST MovieLens. Il est conçu pour les **Data Analysts** et **Data Scientists**, avec une prise en charge native de **Pydantic**, **dictionnaires** et **DataFrames Pandas**.

[![PyPI version](https://badge.fury.io/py/moviesdk.svg)](https://badge.fury.io/py/moviesdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

---

## Installation

```bash
pip install filmsdk_gadeumarcy
```

---

## Configuration

```python
from filmsdk import MovieClient, MovieConfig

# Configuration avec l’URL de votre API (Render ou locale)
config = MovieConfig(movie_base_url="https://movie-backend-outp.onrender.com")
client = MovieClient(config=config)
```

---

## Tester le SDK

### 1. Health check

```python
client.health_check()
# Retourne : {"status": "ok"}
```

### 2. Récupérer un film

```python
movie = client.get_movie(1)
print(movie.title)
```

### 3. Liste de films au format DataFrame

```python
df = client.list_movies(limit=5, output_format="pandas")
print(df.head())
```

---

## Modes de sortie disponibles

Toutes les méthodes de liste (`list_movies`, `list_ratings`, etc.) peuvent retourner :

- des objets **Pydantic** (défaut)
- des **dictionnaires**
- des **DataFrames Pandas**

Exemple :

```python
client.list_movies(limit=10, output_format="dict")
client.list_ratings(limit=10, output_format="pandas")
```

---

## Tester en local

Vous pouvez aussi utiliser une API locale :

```python
config = MovieConfig(movie_base_url="http://localhost:8000")
client = MovieClient(config=config)
```

---

## Public cible

- Data Analysts
- Data Scientists
- Étudiants et curieux en Data
- Développeurs Python

---

## Licence

MIT License

---

## Liens utiles

- API Render : [https://movie-backend-outp.onrender.com](https://movie-backend-outp.onrender.com/)
- PyPI : [https://pypi.org/project/filmsdk-gadeumarcy/](https://pypi.org/project/filmsdk-gadeumarcy/)
molweightcal 0.1.0
A lightweight package to calculate molecular weights from chemical formulas.
Requires Python: >=3.6

# 🧪 molweightcal

`molweightcal` is a Python package to calculate the **molecular weight** of a chemical compound given its molecular formula (e.g., `H2O`, `C6H12O6`, `(NH4)2SO4`).

---

## Features
✅ Provides step-by-step calculation for each element
✅ Supports all known elements
✅ Lightweight and fast — no external dependencies

## 🔧 Installation

```bash
pip install molweightcal
```

## 🚀 Usage
```bash
import molweightcal

print(molweightcal("C6H12O6"))
```

## ✅ Output
Molecular weight of C6H12O6: 180.156
Details:
C(6) × 12.011 = 72.066
H(12) × 1.008 = 12.096
O(6) × 15.999 = 95.994

## ❗ Error Handling
molweightcal performs thorough input validation to detect and report issues such as:

✅ Unknown chemical elements (e.g., "Z6H2")
✅ Lowercase letters in invalid positions, etc.