semvec/pypi-packages huggingface dataset:
pretreatment-automation 0.1.3
A Python library for automatically preprocessing datasets.
Requires Python: >=3.6

# Pretreatment Automation

Pretreatment Automation is a Python library for automatically preprocessing datasets. It provides functionalities such as removing outliers, handling missing values, and unifying data formats.

## Features

- Remove outliers from your data
- Handle missing values with specified thresholds
- Unify data formats for consistent analysis

## Installation

You can install Pretreatment Automation from PyPI:

```sh
pip install pretreatment-automation
```

## Usage

### Example Usage

```python
import pandas as pd
from Pretreatment_automation import PretreatmentAutomation

# Load data from a CSV file
file_path = 'sample_data.csv'
processor = PretreatmentAutomation(file_path=file_path)

# Process the data
processed_df = processor.process(outliers=False, missing=True, format=True, missing_threshold=0.2, fill_value=50000)

print(processed_df)
```

### Sample Data

Save the following data into a file named `sample_data.csv`:

```csv
name,age,income,city
Alice,25,50000,New York
Bob,32,60000,Los Angeles
Charlie,22,,Chicago
David,35,55000,New York
Edward,29,70000,San Francisco
```

## License

This project is licensed under the MIT License.
pytora 0.0.4
A minimal PyTorch implementation of LoRA
Requires Python: >=3.8

# Pytora

A minimal pytorch implementation for lora via [pytorch parametrizations](https://pytorch.org/tutorials/intermediate/parametrizations.html)

## Installation

```pip install pytora```

## Usage

```
from pytora import apply_lora

apply_lora(
    model,
    lora_r = 4,
    lora_alpha = 1,
    lora_dropout = 0.0
)

```

A simple example use case with a pretrained huggingface model can be found in demo.ipynb
proxypool-util 0.1.4
Proxy pool to rotate and manage proxies
Requires Python: >=3.8

# ProxyPool v0.1.0

by Myhailo Razbeiko

## Instalation

Install using pip

    pip install proxypool_util

## Usage

### Create a ProxyPool object 

    MyPool = ProxyPool(["https://proxy1:port", "https://proxy2:port", "https://proxy3:port"])

#### Attributes:

- **proxy_list** -- a list of proxies
- **max_give_outs** -- maximum number of simultaneous uses of one proxy
- **max_time_outs** -- maximum number of time-outs one proxy can receive, being banned after exceeding it 
- **max_uses** -- maximum number of uses per proxy
- **time_out_on_use** -- time-out given to proxy after being used

#### Methods:

- **available_proxy_count()** -- returns number of available proxies
- **Proxy()** -- returns ProxyPool.Proxy() linked to this ProxyPool

### Generate proxy object

    MyProxy = MyPool.Proxy()

#### Get an available proxy to use

    temp_proxy = MyProxy.use()

- If no proxies are available **ProxyExceptions.NoValidProxies** will be raised. This can happen due to all proxies being banned.
- If no proxies are available, but at least one is on a time-out **ProxyExceptions.ProxiesTimeout** will be raised. You can access a time-out end timestamp with ProxyExceptions.ProxiesTimeout().timeout.

#### Timeout last proxy

    MyProxy.timeout(25)  # proxy will be returned to proxy pool and not available for 25 seconds 

#### Ban last proxy

    MyProxy.ban()  # proxy will be banned and returned to proxy pool

## Example
icas 1.1
Tool for labeling images

# Image Clustering and Segmenting: icas
Tool for clustering and segmenting image datasets. Detailed descriptions for packages and pipelines can be found in [github repo](https://github.com/mericdemirors/icas). Below is just basic usage sytle.

# Test the whole system pipeline with:

### * clusterimg test
```python
import icas.clusterimg.clusterimg_test as ct
ct()
```

### * Deep Learning clusterimg test
```python
import icas.clusterimg.DL_clusterimg_test as dl_ct
dl_ct()
```

### * segmentimg test
```python
import icas.segmentimg.segmentimg_test as st
st()
```

<br/><br/>
<br/><br/>

# Use the icas systems with:

### * clusterimg 
```python
from icas.clusterimg.Clusteror import  Clusteror

test_path = "path/to/images"
method = "TM"
batch_size = 500
threshold = 0.5

cl = Clusteror(test_path, method, method, threshold=threshold, overwrite=True)
cl()
```

### * Deep Learning clusterimg 
```python
from icas.clusterimg.DL_ModelTrainer import ModelTrainer
from icas.clusterimg.DL_Datasets import ImageDataset
from icas.clusterimg.DL_Models import PowerOf2s32to128
from icas.clusterimg.DL_Clusteror import DL_Clusteror

device = "cpu"
method = "kmeans"
loss = "mse"
test_path = "path/to/images"

mt = ModelTrainer(num_of_epochs=1, lr=0.001, batch_size=2, loss_type=loss, dataset=ImageDataset(test_path), model=PowerOf2s32to128(), verbose=0, device=device)

dlc = DL_Clusteror(model_trainer=mt, method=method, batch_size=100, overwrite=True, verbose=0)
dlc()
```

### * segmentimg
```python
from icas.segmentimg.Segmentator import  Segmentator

test_path = "path/to/images"
method = "graph"

sg = Segmentator(test_path, method=method)
sg()
```

<br/><br/>
<br/><br/>

# To user attention:
We insist you to add comments, descriptions and example usage to your contributions  

Below libraries are not installed with icas since aim for __icas__ is to be lightweight. Advanced usage such as Deep Learning Clustering and SAM segmentation requires below installations:
```python
pip install torch
pip install torchvision
pip install scikit-learn
pip install git+https://github.com/facebookresearch/segment-anything.git
```
traceme 0.6.0
Python debug and tracer library
Requires Python: <4.0,>=3.10

# traceme

Is a `structlog` helper library that helps you to debug and trace your
code. It aims to replace `print` debugging with a more powerful and
permanent solution.

## Installation

```bash
pip install traceme
```

## Usage

```python
import math
from collections.abc import Callable

import structlog

import traceme


logger = structlog.get_logger()

@traceme.info(exit=True)
def add(a: int, b: int, cont: Callable[[int], None]) -> None:
    cont(a + b)


@traceme.info(exit=True)
def square(a: int, cont: Callable[[int], None]) -> None:
    cont(a * a)


@traceme.info(exit=True)
def sqrt(a: int, cont: Callable[[int], None]) -> None:
    cont(int(math.sqrt(a)))


@traceme.info(exit=True)
def pythagoras(a: int, b: int, cont: Callable[[int], None]) -> None:
    square(
        a,
        lambda a2: square(
            b,
            lambda b2: add(
                a2,
                b2,
                lambda a2b2: sqrt(
                    a2b2,
                    cont,
                ),
            ),
        ),
    )


if __name__ == "__main__":
    traceme.configure()

    pythagoras(3, 4, lambda result: logger.info("The result is", result=result))
```

This will output:

```bash
❯ poetry run python tests/test_pythagoras.py
```

<img width="977" alt="Screenshot 2024-05-25 at 12 02 27" src="https://github.com/dbrattli/traceme/assets/849479/9a435fe0-fd73-4c62-b55b-e84983402b86">


Switching `traceme` to `Environment.PRODUCTION` will remove all the indentation.

```python
traceme.configure(Environment.PRODUCTION)
```

```json
{"event": "pythagoras", "timestamp": "2024-05-25T09:49:09.802510Z", "level": "info"}
{"event": "square", "timestamp": "2024-05-25T09:49:09.802929Z", "level": "info"}
{"event": "square", "timestamp": "2024-05-25T09:49:09.802991Z", "level": "info"}
{"event": "add", "timestamp": "2024-05-25T09:49:09.803050Z", "level": "debug"}
{"event": "sqrt", "timestamp": "2024-05-25T09:49:09.803101Z", "level": "info"}
{"result": 5, "event": "The result is", "timestamp": "2024-05-25T09:49:09.803147Z", "level": "debug"}
{"event": "sqrt", "timestamp": "2024-05-25T09:49:09.803200Z", "level": "info"}
{"event": "square", "timestamp": "2024-05-25T09:49:09.803248Z", "level": "info"}
{"event": "square", "timestamp": "2024-05-25T09:49:09.803291Z", "level": "info"}
{"event": "pythagoras", "timestamp": "2024-05-25T09:49:09.803335Z", "level": "info"}
```
habit-tracker 0.1.0
A simple habit tracker application
Requires Python: >=3.6

# Habit Tracker

This is a simple habit tracker application.

## Installation

````bash
pip install habit_tracker

# Add a new habit
habits add "Exercise"

# List all habits
habits list

# Mark a habit as done for today
habits done 1


### LICENSE ファイル
MITライセンスファイルです。

```text
MIT License

...

````