semvec/pypi-packages huggingface dataset:
python-embed 3.9.0
Get Embedded Python from pip

# python-embed

**Install Embedded Python from pip**

## Usage

```cmd
pip install python-embed==3.13 --target install_location
```

support 3.8 to 3.13

## Build Package
```cmd
python -m build --sdist
```

## Test Installation
```cmd
pip install -v --target embed .\dist\python_embed-3.13.0.tar.gz
```

## Publish to PyPI
```cmd
python -m twine upload dist/*
```
MKE-M17-MicroPython 0.1.4
A MicroPython driver for the L9110 motor controller over I2C

# Describe
A MicroPython package to control the L9110 motor driver over I2C.

# Installation


# How to use `mke_m17_micropython` lib

## 1. Initialize the Driver
> Create an `L9110` instance to control your device.

**Parameters:**

* `address` (int): The I2C address of the L9110 chip. Default is `0x40`.
* `bus` (I2C): A pre-initialized `machine.I2C` object (optional). If not provided, a default I2C bus is used.
* `bus_number` (int): The I2C bus number (default is `1`). Ignored if `bus` is provided.

**Example:**

```python
from machine import I2C, Pin
from L9110_I2C import L9110

# Default settings (bus_number=1)
l9110 = L9110()

# Custom I2C bus (e.g., for ESP32)
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
l9110 = L9110(address=0x42, bus=i2c)

# With context manager
with L9110(address=0x42, bus=i2c) as l9110:
    pass
```
## 2. Control Servos
> Use `control_servo()` to set servo angles.

**Args:**

* `servo_id` (int): 1 (S1) or 2 (S2).
* `degree` (int): Angle in degrees (default: 0-180).

**Returns:**
> `True` on success, `False` on failure.

**Example:**
```python
l9110.control_servo(1, 150)  # Servo 1 to 150°
l9110.control_servo(2, 90)   # Servo 2 to 90°
```

## 3. Control DC Motors
> Use `control_motor()` to set motor speed and direction.

**Args:**

* `motor_id` (int): 0 (MA) or 1 (MB).
* `percent` (float): Speed as a percentage (0-100).
* `direction` (int): 0 (CW) for clockwise, 1 (CCW) for counterclockwise.

**Returns:**
> `True` on success, `False` on failure.

**Example:** 
```python
l9110.control_motor(0, 50, 0)  # Motor A, 50%, clockwise
l9110.control_motor(1, 70, 1)  # Motor B, 70%, counterclockwise
```

## 4. Change I2C Address
> Update the device’s I2C address with `set_address()`.

**Args:**
* `new_address` (byte): New address (0x40-0x44).

**Returns:**
> `True` on success, `False` on failure.

**Example:**
```python
l9110.set_address(0x42)
# Output: "Set address successful. New address: 0x42"
```

## 5. Customize Servo Range
### Set new range degree.
> using `set_range_degree(min_degree, max_degree)` to set new range degree for servo motor

**Args:**
* `min_degree`(int): (0-359).
* `max_degree`(int): (1-360).

**Example:**
```python
l9110.set_range_degree(0, 270)
```
### Set new range pulse.
> using `set_range_pulse(min_pulse, max_pulse)` to set new range degree for servo motor

**Args:**
* `min_pulse`(int): (0-2814).
* `max_pulse`(int): (1-2815).

**Example:**
```python
l9110.set_range_pulse(600, 2400)
```
validate-choice-field 1.2.1
It is a Python package that allows users to validate a post value against the choices defined in a Django model choice field and returns the corresponding choice data for database storage.
Requires Python: >=3.6

# validate_choice_field

## Introduction
`validate_choice_field` package provides a simple and efficient way to validate user-submitted data against predefined choices in a Django model choice field. It ensures that the posted data matches one of the available choices and returns the corresponding value required for database storage. If no match is found, it returns **None**.

### How It Works

Djangoâ€™s **choices** field consists of two parts:

* **Value (Stored in Database)** â€“ The actual data saved in the database.
* **Display Label** â€“ The human-readable version shown in forms and admin panels.

For example, in a Django model:
```python

# Define choices
DURATION_TYPE_CHOICE = ( 
    ("Hour", "1 Hour"), 
    ("Day", "1 Day"),
)

class Event(models.Model):
    duration = models.CharField(max_length=250, choices=DURATION_TYPE_CHOICE)
```
In this case, **"Hour"** is stored in the database, while **"1 Hour"** is displayed to users.

#### how to use

```sh
pip install validate_choice_field
```

```python
from validate_choice_field import get_choice

print("If choice matches",get_choice(DURATION_TYPE_CHOICE,"1 Hour"))
# Output: "Hour"

print("If choice does not matches",get_choice(DURATION_TYPE_CHOICE,"Hour dcd"))
# Output: None

```

This function accepts two parameters:

* **choices**: A list of tuples representing the available choices, where each tuple consists of a database value and its corresponding display value.

* **posted_value**: The value submitted by the user, which needs to be validated.

The function compares the **posted_value** against the choices. If a match is found, it returns the corresponding database value. If no match is found, it returns **None**.

### Purpose of This Package

When handling API requests, it is crucial to validate input values before saving them to the database. This package ensures that:

- The submitted value exists in the predefined choices.
- If a match is found, it returns the corresponding value for storage.
- If no match is found, it returns **None**, preventing invalid data from being saved.

### Benefits

* **Simplifies choice validation** â€“ Reduces manual validation logic.
* **Enhances data integrity** â€“ Ensures only valid choices are stored.
* **Improves code maintainability** â€“ Provides a reusable and structured approach for handling choice fields in Django applications.



## conclusion
I hope this package proves beneficial to all developers. If you have any suggestions, corrections, or improvements, feel free to reach out via email at shalugassali@gmail.com. Looking forward to your feedback and contributions!