semvec/pypi-packages huggingface dataset:
yutilx 0.0.3
Xinyu's common utilities
Requires Python: >=3.9

# yutilx

[![PyPI version](https://badge.fury.io/py/yutilx.svg)](https://badge.fury.io/py/yutilx)
[![Python Version](https://img.shields.io/pypi/pyversions/yutilx.svg)](https://pypi.org/project/yutilx/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A Python utilities library providing efficient parallel processing with caching capabilities.

## Features

- **Parallel Processing**: Execute functions concurrently using ThreadPoolExecutor
- **Smart Caching**: Automatic result caching with MD5-based deduplication
- **Flexible Storage**: Choose between file-based (JSONL) or in-memory caching
- **Retry Logic**: Built-in retry mechanism for handling transient failures
- **Progress Tracking**: Real-time progress visualization with tqdm
- **Thread-Safe**: Safe concurrent access to cache

## Installation

```bash
pip install yutilx
```

## Quick Start

```python
from yutilx import CachedParallelProcessor

# Define your processing function
def process_text(text: str) -> str:
    # Your processing logic here
    return text.upper()

# Create a processor instance
processor = CachedParallelProcessor(
    process_func=process_text,
    max_retry_cnt=3,
    cache_filename="results.jsonl"
)

# Process data in parallel
inputs = ["hello", "world", "python", "rocks"]
processor.run(inputs, num_threads=4)

# Retrieve results
results = processor.get_result(inputs)
print(results)  # ['HELLO', 'WORLD', 'PYTHON', 'ROCKS']
```

## API Reference

### CachedParallelProcessor

```python
CachedParallelProcessor(
    process_func: Callable[[str], str],
    max_retry_cnt: int = 3,
    cache_filename: Optional[str] = None,
    cache_file_free: bool = False
)
```

#### Parameters

- `process_func`: Function to process each input string
- `max_retry_cnt`: Maximum retry attempts for failed processing (default: 3)
- `cache_filename`: Path to cache file (default: "cache.jsonl")
- `cache_file_free`: If True, use in-memory cache only (default: False)

#### Methods

- `run(input_lis: list[str], num_threads: int = 10)`: Process inputs in parallel
- `get_result(input_lis: list[str]) -> list[str]`: Retrieve cached results

## Development

This project uses [uv](https://github.com/astral-sh/uv) for dependency management.

### Setup Development Environment

```bash
# Clone the repository
git clone https://github.com/cauyxy/yutilx.git
cd yutilx

# Install dependencies
uv sync

# Run tests
uv run pytest

# Format code
uv run ruff format

# Lint code
uv run ruff check
```

### Building

```bash
# Build distribution packages
uv build
```

## License

MIT License - see [LICENSE](LICENSE) for details.

## Author

Xinyu Yang (<cauyxy@gmail.com>)
layman-terminal 0.1.0b6
AI-powered terminal assistant
Requires Python: >=3.9
Keywords: ai terminal cli assistant

# Layman Terminal

This project aims to reduce the effort of searching the internet or using tools like ChatGPT to find terminal commands, copying them, editing them as per your requirements, and then running them in the terminal. What if we gave you the ability to write a command in natural language, and an agent would convert it into a terminal command and execute it for you? 

Now, you might say, "Existing tools like Copilot already do this." But I don't want to use those tools. I prefer not to give direct access to my laptop to such tools, and honestly, it's fun to create a tool that does exactly what these billion-dollar companies do—without compromising user data or requiring a subscription. 

Use this project at your own risk. I will try to maintain it on my end, but I can't guarantee anything. I started this as a fun project to help with my day-to-day tasks, and I'm not sure how far I will take it. Feel free to use it and go crazy with it. 

## Requirements

- Python 3.9+

## Setup

1. Create virtual environemnt.

```sh
conda create -n layman_terminal_3_11 python=3.11
```

2. Activate virtual environment.

```sh
conda activate layman_terminal_3
```

2. Install dependencies:

```sh
pip install -r requirements.txt
```
calculator-a1 1.0.0
This is a basic calculator package that can do additions, subtractions, etc.
Requires Python: >=3.12

# SimpleMathOps

A lightweight Python package that provides basic arithmetic operations including addition, subtraction, multiplication, division, and exponentiation (power).

## 📦 Features

- ➕ Addition
- ➖ Subtraction
- ✖️ Multiplication
- ➗ Division (with zero-division handling)
- 🔢 Power (exponentiation)
SpinExplorer 1.3
A package for NMR processing and analysis
Requires Python: >3.11

A python-based graphical interface package to perform NMR data processing and analysis.

Full processing functionality is enabled through nmrPipe installation: https://www.ibbr.umd.edu/nmrpipe/install.html  
In the absence of nmrPipe (e.g. windows systems), NMR processing is performed using nmrglue.

Full documentation provided at "https://github.com/james-eaton-1/SpinExplorer" in Documentation.pdf

Once installed, the commands SpinConverter, SpinProcess and SpinView can be ran from a terminal in a directory containing raw NMR data to perform NMR data conversion, processing, and viewing/analysis, respectively. 

Installation (macOS/Linux):
- Ensure python3 version is greater than 3.10 (package not tested on python<3.10)
- It is recommended to create a python3 virtual environment in the terminal using the command:  
"python3 -m venv ~/SpinEnv"    
More details at https://docs.python.org/3/tutorial/venv.html
- Alternatively conda environments can be used if preferred
- Activate the virtual environment using the command:  
"source ~/SpinEnv/bin/activate"  
This will need to be ran every time a new terminal is created, or the following line can be
added to the ~/.zshrc or ~/.bashrc file: "source ~/SpinEnv/bin/activate"
- Install the SpinExplorer package and all dependencies using:
"python3 -m pip install SpinExplorer"

Note: the wxPython dependency might not install correctly on Linux systems.  
More details and fixes at https://wxpython.org/pages/downloads/  
Currently, wxPython needs to be build from source for Linux systems without x86_64 architecture.  
More details at https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html

Installation (Windows):
- Using py (py-launcher) is recommended for windows systems  
If py is not present, download latest python from https://www.python.org, and ensure install py-launcher is ticked
- If desired, a virtual environment for the package can be created according to https://docs.python.org/3/tutorial/venv.html
- Install the SpinExplorer package and all dependencies using the following command in command prompt/power shell:  
"py -m pip install SpinExplorer"
reduce-ex 0.1.0a0
n-ary reduce operator with support for prefix/suffix elements. Intermediate results are yielded as well. Like `functools.reduce` but more powerful.
Requires Python: >=2

# `reduce-ex`

n-ary reduce operator with support for prefix/suffix elements. Intermediate results are yielded as well. Like `functools.reduce` but more powerful.

## Key Features

- **N-ary operation support**: Works with functions of any arity (n ≥ 2)
- **Intermediate results yielded**: Not just the last result is returned
- **Flexible input**: Supports prefix/suffix elements for initialization/termination
- **Memory efficient**: Uses bounded deque for argument handling
- **Zero Dependencies**: Works with stock Python 2+

## Usage

### Basic Usage

For binary operations (n=2), `reduce_ex` maintains identical left-associative evaluation order as `functools.reduce`, while yielding intermediate results:

```python
from reduce_ex import reduce_ex

for partial_sum in reduce_ex(lambda a, b: a + b, range(1, 5)):
    print(partial_sum)
# Computation steps:
# 1+2 = 3
# 3+3 = 6
# 6+4 = 10
# Yields: 3, 6, 10
```

### N-ary Operation (n=3)

For n-ary operations, the evaluation proceeds via left-associative sliding windows:

```python
from reduce_ex import reduce_ex

# Polynomial recurrence: a * b + c
for partial_result in reduce_ex(lambda a, b, c: a * b + c, [2, 3, 4, 5, 6], n=3):
    print(partial_result)
# Computation steps:
# 2 * 3 + 4 = 10
# 10 * 5 + 6 = 56
# Yields: 10, 56
```

### With `prefix`

```python
from math import tanh

from reduce_ex import reduce_ex

W_h = 0.5
W_x = 0.5
B = 0.5


# Simulate an RNN cell
def rnn_cell(h_prev, x):
    global W_h, W_x, B
    
    return tanh(W_h * h_prev + W_x * x + B)


h_0 = 0.0

for i, h_i in enumerate(
    reduce_ex(
        rnn_cell,
        [0.1, 0.2, 0.3],
        prefix=[h_0]
    ),
    start=1
):
    print(f"Hidden state {i}: {h_i}")
```

### With `prefix` and `suffix`

```python
from reduce_ex import reduce_ex

for partial_sum in reduce_ex(lambda a, b: a + b, range(5), prefix=(1, 2), suffix=(10,)):
    print(partial_sum)
# Computation steps:
# 1 + 2 = 3
# 3 + 0 = 3
# 3 + 1 = 4
# 4 + 2 = 6
# 6 + 3 = 9
# 9 + 4 = 13
# 13 + 10 = 23
# Yields: 3, 3, 4, 6, 9, 13, 23
```

## How It Works

The reducer maintains the following invariants:

- Consumes `n` elements.
- Calls function, yields result, uses the previous result as first argument, and consumes `(n-1)` more elements.
- Calls function, yields result, uses the previous result as first argument, and consumes `(n-1)` more elements.
- ...

## API Reference

### `reduce_ex(function, iterable, n=2, prefix=(), suffix=())`

- `function`: Callable of arity n
- `iterable`: Input elements
- `n`: Operation arity (must be ≥ 2)
- `prefix`: Elements prepended to input
- `suffix`: Elements appended to input

## Contributing

Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.

## License

This project is licensed under the [MIT License](LICENSE).
jdformvalidator 1.0.0
JD Form Validator - A Professional Python Library for Input Validations
Requires Python: >=3.6
Keywords: validation, form, email, phone, python, pan, aadhaar, file type, dob

# JD Form Validator

![PyPI version](https://img.shields.io/pypi/v/jdformvalidator)

JD Form Validator is a professional and reusable Python library for validating common form inputs like email, phone number, PAN card, Aadhaar, file types, PIN codes, string lengths, and date of birth.

## Installation
```bash
pip install jdformvalidator
```

## Available Validators
- Email Validation
- Password Strength Validation
- Phone Number Validation
- PAN Card Validation
- Aadhaar Number Validation
- File Type Validation
- PIN Code Validation
- String Length Validation
- Date of Birth Validation (Age Check - Customizable)

## Usage Example
```python
from jdformvalidator.validators import (
    is_valid_email, is_strong_password, is_valid_phone,
    is_valid_pan, is_valid_aadhaar, is_valid_file_type,
    is_valid_pincode, is_valid_length, is_valid_dob
)

# Email Validation
print(is_valid_email('test@gmail.com'))          # ✅ True
print(is_valid_email('invalid-email'))           # ❌ False

# Password Validation
print(is_strong_password('Password1'))           # ✅ True
print(is_strong_password('weak'))                # ❌ False

# Phone Number Validation
print(is_valid_phone('9876543210'))              # ✅ True
print(is_valid_phone('1234567890'))              # ❌ False

# PAN Card Validation
print(is_valid_pan('ABCDE1234F'))                # ✅ True
print(is_valid_pan('ABCDE123F'))                 # ❌ False

# Aadhaar Number Validation
print(is_valid_aadhaar('234567890123'))          # ✅ True
print(is_valid_aadhaar('123456789012'))          # ❌ False

# File Type Validation
print(is_valid_file_type('document.pdf'))        # ✅ True
print(is_valid_file_type('malware.exe'))         # ❌ False

# PIN Code Validation
print(is_valid_pincode('600001'))                # ✅ True
print(is_valid_pincode('012345'))                # ❌ False

# String Length Validation
print(is_valid_length('Jalal', min_length=3))    # ✅ True
print(is_valid_length('Hi', min_length=3))       # ❌ False

# Date of Birth Validator - Customizable Minimum Age
print(is_valid_dob('2000-01-01'))                # ✅ True (default min_age=18)
print(is_valid_dob('2005-01-01', min_age=21))    # ❌ False (custom min_age=21)
print(is_valid_dob('2010-01-01', min_age=18))    # ❌ False
```
basic-calculator-aviks 1.0.0
This is a basic calculator package that can do additions, subtractions, etc.
Requires Python: >=3.12

# SimpleMathOps

A lightweight Python package that provides basic arithmetic operations including addition, subtraction, multiplication, division, and exponentiation (power).

## 📦 Features

- ➕ Addition
- ➖ Subtraction
- ✖️ Multiplication
- ➗ Division (with zero-division handling)
- 🔢 Power (exponentiation)

## 📥 Installation

You can install this package (after it's published) using pip:

```bash
pip install basic-calculator
basic-calculator-avik 1.0.0
This is a basic calculator package that can do additions, subtractions, etc.
Requires Python: >=3.12

# SimpleMathOps

A lightweight Python package that provides basic arithmetic operations including addition, subtraction, multiplication, division, and exponentiation (power).

## 📦 Features

- ➕ Addition
- ➖ Subtraction
- ✖️ Multiplication
- ➗ Division (with zero-division handling)
- 🔢 Power (exponentiation)

## 📥 Installation

You can install this package (after it's published) using pip:

```bash
pip install basic-alculator
pyfend 0.1.2
python bindings for fend-core
Requires Python: >=3.7

python bindings for [fend-core](https://crates.io/crates/fend-core)

## example
```
>>> import pyfend
>>> context = pyfend.Context()

>>> pyfend.evaluate('a = pi to 3 sf', context)
'approx. 3.14'
>>> pyfend.evaluate('a mi to ft', context)
'approx. 16500 ft'

>>> pyfend.evaluate('2d4', context)
'{ 2: 6.25%, 3: 12.50%, 4: 18.75%, 5: 25.00%, 6: 18.75%, 7: 12.50%, 8: 6.25% }'
>>> context.set_output_mode_terminal()
>>> print(pyfend.evaluate('2d4', context))
  2:  6.25%  #######
  3: 12.50%  ###############
  4: 18.75%  ######################
  5: 25.00%  ##############################
  6: 18.75%  ######################
  7: 12.50%  ###############
  8:  6.25%  #######

>>> pyfend.evaluate('@debug 1kg to m', context)
pyfend.FendError: cannot convert from kg to m: units 'kilogram' and 'meter' are incompatible
```

## testing
do not run `uv -m unittest`. bypass the uv cache:
```
uv run maturin develop --uv && .venv/bin/python -m unittest
```
elasticsearch-utils 0.6.0
A simple wrapper for Elasticsearch tool
Requires Python: >=3.9

# elasticsearch-utils

This library provides utilities for interacting with Elasticsearch and results retrived from it.

The core features are:
- Index creation (even if already exists)
- Index deletion
- Search (can include `explain: True` in the DSL query)
- Explain

## Installation

```
uv add elasticsearch-utils
```

## Example usage

### Instantiate
```python
from elasticsearch_utils import ESClient


# Using API key to authenticate
es = ESClient(ES_ENDPOINT, api_key=ES_API_KEY)

# Using basic authen with username and password
es = ELS(ES_ENDPOINT, basic_authen=(USERNAME, PASSWORD))
```
### Create index
```python
mapping = {"mappings": {"properties": {...}}}

es.create_index(index_name="my-index", json_mapping=mapping, replace_if_exists=True)
```

### Bulk update
```python
data = [{"some-id": "1", "field1": "some-value"}, {"some-id": "2", "field1": "another-value"}]

es.bulk_update(index_name="my-index", data=data, id_key="some-id")

# Routing option is also available if needed
es.bulk_update(index_name="my-index", data=data, id_key="some-id", routing_key="1")
```

### Results

```python
dsl = {"query": {...}}
results = es.search(INDEX_NAME, dsl)

# results: <SearchResults total_hits=510>

# Get the JSON
results.json

# Get the hits
result.hits

# Get the sources
results.get_sources(as_list=False)  # as_list can be `True` if you wish to get just a list of sources

# Get results in a DataFrame format
results.to_dataframe()

# You can also pass in just the columns you want
results.to_dataframe(columns=["field1"])

# If explain: True was passed in the DSL, you can also get explanations
results.get_explanations()  # This returns a dict of {`_id`: `<ExplainResult>`}
```

### Explanation

#### Using the `explain` API
```python
dsl = {"query": {...}}
explain = es.explain(INDEX_NAME, doc_id="75720", dsl=dsl, routing=None)

# Get the JSON
explain.json

# Get score
explain.score

# Get the explanation dict
explain.explanation

# Get the scores terms, e.g., field, term, score, boost, etc.
explain.get_field_details()

# Get the contributions summary for each field
explain.get_field_summary()
```

#### Using the explanation from the `search` API
```python
dsl = {"explain": True, "query": {...}}
results = es.search(INDEX_NAME, dsl=dsl)

# This returns a dict of {`_id`: `<ExplainResult>`}
explanations = results.get_explanations()

# You can do the same thing as the `ExplainResult` for each item
explanations["75720"].get_field_summary()  # Given that the key "75720" exists in the results

```

### Index Mappings and settings

```python

mappings_results = es.get_mappings(INDEX_NAME)

mapping_results.fields_mappings

```

```python

settings_results = es.get_settings(INDEX_NAME)

settings_results.index_settings
```
basic-alculator 1.0.0
This is a basic calculator package that can do additions, subtractions, etc.
Requires Python: >=3.12

# SimpleMathOps

A lightweight Python package that provides basic arithmetic operations including addition, subtraction, multiplication, division, and exponentiation (power).

## 📦 Features

- ➕ Addition
- ➖ Subtraction
- ✖️ Multiplication
- ➗ Division (with zero-division handling)
- 🔢 Power (exponentiation)

## 📥 Installation

You can install this package (after it's published) using pip:

```bash
pip install simplemathops
exorigsim 0.1.0
CTF educational package to simulate persistence behaviors
Requires Python: >=3.6

\# exorigsim



This package simulates malware-style persistence behavior for educational and CTF purposes. - crypto mining

We are not liable for any damage caused as this made for custom use

Disclamer:- any damage is at ur own cost..



It:



\- Creates a Windows service that runs a custom command on boot

\- Adds Windows Defender exclusions

\- Copies a xmrig EXE and a watchdog script

\- Sets up a persistent startup watchdog



DO NOT use this outside of a test lab or VM you fully control.