semvec/pypi-packages huggingface dataset:
ankhas-greens-angets 0.0.2
Angets (Ankha's Gets): Functions for user input.
License: MIT
Requires Python: >=3.10

# Angets (Ankha's Gets): Functions for user input.

Ever get tired of fine-tuning user input?
\
Well, this is the package for you!
\
At least it is for me since I made the whole thing in the first place...

## Prerequisites

Python 3.10.x or newer.

## Installation

`pip install ankhas-greens-angets`

## Usage

Import Module.
```python
from ankhas_greens import angets
```

Basic usage, One attempt with a prompt to the user.
```python
input0 = angets.get_non_empty_string('Give me a response! ')
```

To get inputs with a bit more control.
> Remember to set `verbose` to True as no warning will be conveyed to the user otherwise.
```python
input1 = angets.get_constrained_float(
    wihtin=(6, 9),
    interval='[]',
    prompt='Now give me a number within said range!',
    warning="Oops! Not within the bounds I'm afraid...",
    verbose=True,
    attempts=10
)
```

That is the gist of the main features.
\
It should be a useful utility tool to mitigate against invalid user inputs.

## Problem?

Actually, I don't expect anyone else other than me to use this package.
\
But if you find it useful enough to want to contribute, be my guest!

## Changes

Created: 19 February 2025.
\
Updated: None.
tools-mp 0.3.0
Convenient multiprocessing function for Python
License: MIT
Keywords: multiprocessing, Python

# tools-mp

This Python library provides a convenient one-line multiprocessing option that can be used as follows:

```Python
from tools_mp import multiprocess
from tools_mp import process

def any_function( arg_1, arg_2, ..., arg_n ):
    do something
    return result

args = [ 
    {
        'arg_1': arg_1,
        'arg_2': arg_2,
        ...
        'arg_n': arg_n,
        } for arg_1, arg_2, ..., arg_n in arguments
    ]

data = multiprocess(
    function = any_function,
    args = args,
    return_data = True,
    verbose = True,
    workers = 8,
    **kwargs,
    )

data = process(
    function = any_function,
    args = args,
    return_data = True,
    verbose = True,
    workers = 8,
    mp_threshold = 4, # <- if the number of tasks is less than this value,
	# the process function will use single core processing, otherwise it
	# will use multiprocessing. This can speed up the processing of small
	# tasks significantly, as the overhead of multiprocessing is avoided.
    **kwargs,
    )


```

If verbose=True, the progress of the calculation will be visualized via the [tqdm](https://pypi.org/project/tqdm/) library.
If workers=None (default) all available CPU cores will be used for processing.
**kwargs will be passed to 'multiprocessing.Pool' as keyword arguments. This is important if you would like to initialize the workers with a specific function or variables for example.



# Installation

    pip install tools-mp