semvec/pypi-packages huggingface dataset:
FuncHub 0.1.6
A library containing common functions developers used to write repetitevly
Requires Python: >=3.6

#  Utility Library

A collection of utility functions for file operations, text processing, AI, and machine learning, designed to streamline common tasks in PyTorch projects.

## Features

- Load and save JSON and YAML files.
- Text processing utilities including tokenization and normalization.
- Device management for PyTorch (CPU, CUDA, or MPS).
- Similarity computation for embeddings using cosine similarity.
- Utility functions for data manipulation such as moving averages, safe division, and flattening dictionaries.

## Installation

You can install the library via pip:

```bash
pip install FuncHub
```

## Usage

### File Operations

#### Load YAML File

```python
from pytorch_utility_library import open_yaml

config = open_yaml('config.yaml', key='model')
```

#### Load JSON File

```python
from pytorch_utility_library import open_json

data = open_json('data.json')
```

#### Save Data to JSON

```python
from pytorch_utility_library import dump_to_json

dump_to_json('output.json', data)
```

#### Save Text to File

```python
from pytorch_utility_library import dump_to_text

dump_to_text('Hello, World!', 'output/hello.txt')
```

### Text Processing

#### Tokenize Text

```python
from pytorch_utility_library import tokenize

tokens = tokenize("Hello, how are you?")
```

#### Normalize Text

```python
from pytorch_utility_library import normalize_text

normalized = normalize_text("  Hello,   How Are You?  ")
```

### AI and Machine Learning

#### Get Device

```python
from pytorch_utility_library import get_device

device = get_device()
print(f"Using device: {device}")
```

#### Compute Cosine Similarity

```python
from pytorch_utility_library import compute_similarity

similarity = compute_similarity(embedding1, embedding2)
```

### Utility Functions

#### Calculate Moving Average

```python
from pytorch_utility_library import moving_average

averages = moving_average([1, 2, 3, 4, 5], window_size=3)
```

#### Flatten a Nested Dictionary

```python
from pytorch_utility_library import flatten_dict

flat_dict = flatten_dict({'a': {'b': 1, 'c': 2}, 'd': 3})
```

## Logging

The library uses a custom logger for error and information logging. Make sure to configure the logger in your application as needed.

## Contributing

Contributions are welcome! 

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
abnf-to-plantuml 2.0.0
A tool to transform ABNF-grammars into the subset of EBNF that PlantUML recognizes.
Requires Python: >=3.8

# abnf_to_plantuml

[![PyPI - Version](https://img.shields.io/pypi/v/abnf-to-plantuml.svg)](https://pypi.org/project/abnf-to-plantuml)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/abnf-to-plantuml.svg)](https://pypi.org/project/abnf-to-plantuml)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

-----

## Table of Contents

- [Installation](#installation)
- [License](#license)

## Installation

```console
pip install abnf-to-plantuml
```

## License

`abnf-to-plantuml` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
hmac2 0.0.2
A small test package for hmac2.
Requires Python: >=3.4

# HMAC2 Documentation

## Overview
The `HMAC` class implements an HMAC (Hash-based Message Authentication Code) using a specified hash function. It provides a simple interface to generate HMAC values using a key and a hash algorithm like SHA256, MD5, etc.

## Usage

### Creating an HMAC Instance
```python
from hmac2 import HMAC

# Define a key and a message
key = b'secret_key'
message = b'my message'

# Create a new HMAC instance with the key, message, and hash algorithm
h = HMAC(key, message, digestmod='sha256')
```

### Updating with More Data
If you need to add more data to the existing HMAC computation:
```python
h.update(b' additional message')
```

### Getting the Final HMAC Value
```python
# Get the HMAC value in hexadecimal format
print(h.hexdigest())

# Alternatively, get the raw binary value
print(h.digest())
```

## Methods

- **`__init__(self, key, msg=None, digestmod='sha256')`**  
  Initializes an HMAC instance with a given key, an optional message, and a digest algorithm. The default digest algorithm is `'sha256'`.

- **`update(self, msg)`**  
  Updates the HMAC object with more message bytes. You can call this method multiple times with different parts of the message.

- **`digest(self)`**  
  Returns the raw HMAC value as a byte sequence.

- **`hexdigest(self)`**  
  Returns the HMAC value as a hexadecimal string.

## Alternative Usage with `new` Function
You can also use the `new` function for a more concise syntax:

```python
import hmac2

# Define a key and a message
key = b'secret_key'
message = b'my message'

# Create a new HMAC and get the result in hex format
hmac_value = hmac2.new(key, message, 'sha256').hexdigest()
print("HMAC: ", hmac_value)
```
code-generator-odin 0.1.2
A flexible source code generator with fixed structure templates
Requires Python: >=3.7
Keywords: code generator, template, python

# Code Generator Odin

A flexible source code generator with fixed structure templates.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

## Features

- Generate code snippets for various programming languages.
- Create project templates for quick setup.
- Customize boilerplate code to fit your needs.

## Installation

To install the Code Generator Odin, clone the repository and install the dependencies:

```sh
git clone https://github.com/odin-hoang/code-generator.git
cd code-generator
pip install .
```

For development, you can install the package with testing dependencies:

```sh
pip install -e .[test]
```

## Usage

To generate a code snippet, run the following command:

```sh
generate-code -t path/to/template.json -o path/to/output.py
```

**Arguments**

- `-t`, `--template`: Path to the JSON template file (required).
- `-o`, `--output`: Output file path (defaults to stdout).
- `--indent`: Number of spaces for indentation (default: 4).

## Development

**Running Tests**

```sh
pytest tests/
```

The tests are automatically run on each push and pull request to the main branch using GitHub Actions. See the tests.yml for more details.

# Contributing

We welcome contributions! Please read our contributing guidelines for more details.

# License

This project is licensed under the MIT License. See the LICENSE file for more information.