semvec/pypi-packages huggingface dataset:
DIYables-MicroPython-Joystick 0.1.0
MicroPython Library for Joystick, created by DIYables
Requires Python: >=3.6

## MicroPython Joystick Library - DIYables_MicroPython_Joystick
This MicroPython library is designed for any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit... to make it easy to use with joystick. It is easy to use for not only beginners but also experienced users... 

It is created by DIYables to work with DIYables Joystick, but also work with products from other brands. Please consider purchasing products from [DIYables Store on Amazon](https://amazon.com/diyables) to support our works.



Features
----------------------------
* Works with any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit...

Product Link
----------------------------
* [Joystick](https://diyables.io/products/joystick)
* [Sensor Kit](https://diyables.io/products/sensor-kit)



Available Functions
----------------------------
* \_\_init\_\_(pin_x, pin_y, pin_button, mode=Pin.PULL_UP)
* read_x()	
* read_y()	
* read_button_state()
* is_pressed()
* is_released()
* get_press_count()
* set_press_count_mode(mode)
* reset_press_count()
* set_debounce_time(time_ms)
* loop()



Available Examples
----------------------------
* main.py



Tutorials
----------------------------
* [Raspberry Pi Pico - Joystick](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-joystick)



References
----------------------------
* [MicroPython Joystick Library](https://newbiely.com/tutorials/micropython/micropython-joystick-library)
DIYables-MicroPython-Servo 0.1.0
MicroPython Library for Servo Motor, created by DIYables
Requires Python: >=3.6

## MicroPython Servo Motor Library - DIYables_MicroPython_Servo
This MicroPython library is designed for any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit... to make it easy to use with servo motor 180째. It is easy to use for not only beginners but also experienced users... 

It is created by DIYables to work with DIYables Servo Motor, but also work with products from other brands. Please consider purchasing products from [DIYables Store on Amazon](https://amazon.com/diyables) to support our works.



Features
----------------------------
* Works with any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit...

Product Link
----------------------------
* [Servo Motor](https://diyables.io/products/servo-motor-sg90-180-degree)
* [Sensor Kit](https://diyables.io/products/sensor-kit)



Available Functions
----------------------------
* \_\_init\_\_(pin_number, min_pulse=600, max_pulse=2450, frequency=50)
* move_to_angle(angle)
* deinit()
* \_\_del\_\_()



Available Examples
----------------------------
* move.py
* sweep.py



Tutorials
----------------------------
* [Raspberry Pi Pico - Servo Motor](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-servo-motor)



References
----------------------------
* [MicroPython Servo Library](https://newbiely.com/tutorials/micropython/micropython-servo-motor-library)
DIYables-MicroPython-Keypad 0.1.0
Servo Motor Library for Keypad, created by DIYables
Requires Python: >=3.6

## MicroPython Keypad Library - DIYables_MicroPython_Keypad
This MicroPython library is designed for any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit... to make it easy to use with keypad 3x4, keypad 4x4. It is easy to use for not only beginners but also experienced users... 

It is created by DIYables to work with DIYables Keypad, but also work with products from other brands. Please consider purchasing products from [DIYables Store on Amazon](https://amazon.com/diyables) to support our works.



Features
----------------------------
* Works with any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit...

Product Link
----------------------------
* [Keypad 3x4](https://diyables.io/products/keypad-3x4)
* [Keypad 4x4](https://diyables.io/products/keypad-4x4)


Available Functions
----------------------------
* \_\_init\_\_(keymap, row_pins, column_pins, num_rows, num_cols)
* get_key()
* set_debounce_time(time_ms)


Available Examples
----------------------------
* keypad_3x4.py
* keypad_4x4.py



Tutorials
----------------------------
* [Raspberry Pi Pico - Keypad 3x4](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-keypad-3x4)
* [Raspberry Pi Pico - Keypad 4x4](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-keypad-4x4)



References
----------------------------
* [MicroPython Keypad Library](https://newbiely.com/tutorials/micropython/micropython-keypad-library)
DIYables-MicroPython-Button 0.1.0
MicroPython Library for Button, created by DIYables
Requires Python: >=3.6

## MicroPython Button Library - DIYables_MicroPython_Button
This MicroPython library is designed for any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit... to make it easy to use push button, momentary switches, toggle switch, magnetic contact switch (door sensor)... It is easy to use for not only beginners but also experienced users... 

It is created by DIYables to work with DIYables products, but also work with products from other brands. Please consider purchasing products from [DIYables Store on Amazon](https://amazon.com/diyables) from to support our work.



Features
----------------------------
* Works with any hardware plaform that supports MicroPython such as Raspberry Pi Pico, ESP32, Micro:bit...
* Supports the internal pull-up/pull-down resistor to avoid the floating value
* Supports debounce to eliminate the chattering phenomenon
* Supports the pressed and released events
* Supports the counting (for FALLING, RISING and BOTH)
* Easy to use with multiple buttons
* All functions are non-blocking 


Available Functions
----------------------------
* \_\_init\_\_(pin, mode=Pin.PULL_UP)
* set_debounce_time(time_ms)
* get_state()
* get_state_raw()
* is_pressed()
* is_released()
* set_count_mode(mode)
* get_count()
* reset_count()
* loop()


Available Examples
----------------------------
* pull_up.py
* pull_down.py



Tutorials
----------------------------
* [Raspberry Pi Pico - Button](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-button)
* [Raspberry Pi Pico - Button Debounce](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-button-debounce)


References
----------------------------
* [MicroPython Button Library](https://newbiely.com/tutorials/micropython/micropython-button-library)
pyqweather 1.0.6
和风天气 api for python3
Requires Python: >=3.6

# pyqweather
和风天气 api for python3。

[![Supported Versions](https://img.shields.io/badge/python-&nbsp;&nbsp;3.10&nbsp;|&nbsp;3.11&nbsp;|&nbsp;3.12&nbsp;-blue)](https://pypi.org/project/pyqweather/)

## 安装

使用pip

```console
pip install pyqweather
```



## 前置条件
通过和风天气官网获取开发Key [如何获取你的Key](https://dev.qweather.com/docs/configuration/project-and-key/)


## 快速使用
调用“城市搜索”接口

```python
# coding:utf-8
from pyqweather import QWeatherConfig
from pyqweather.auth import SimpleAuthCredential
from pyqweather.factories import QWeatherFactory

endpoint = 'https://geoapi.qweather.com/v2'
auth_credential = SimpleAuthCredential('key')
conf = QWeatherConfig(endpoint, auth_credential)
pack = QWeatherFactory().create_geo_pack(conf)
resp = pack.city_lookup('北京')

if resp.get_code() == '200':
  print('OK')
else:
  print('Error')
```


### 使用App Key设置环境变量

#### Mac OS X/Linux/Unix

```bash
export QWEATHER_SDK_APP_KEY=<Your App Key>
export QWEATHER_SDK_PUBLIC_ID=<Your PublicId>
```

#### Windows

```shell
set QWEATHER_SDK_APP_KEY=<Your App Key>
set QWEATHER_SDK_PUBLIC_ID=<Your PublicId>
```

#### 通过环境变量进行接口调用

```python
# coding:utf-8
from pyqweather import QWeatherConfig
from pyqweather.auth import EnvironmentVariableSignAuthCredential
from pyqweather.factories import QWeatherFactory

endpoint = 'https://geoapi.qweather.com/v2'
conf = QWeatherConfig(endpoint, EnvironmentVariableSignAuthCredential()) # 使用数字签名的方式
factory = QWeatherFactory()

pack = factory.create_geo_pack(conf)
resp = pack.city_lookup('北京')

print(resp)
```

### <span style="color:#F44336">特殊的地方</span>

目前仅支持以**简单KEY认证的方式**调用空气质量（Beta）接口， 使用数字签名会报错。

使用简单KEY认证的方式示例：

```python
conf = QWeatherConfig(self._domain,EnvironmentVariableSimpleAuthCredential())
factory = QWeatherFactory()
pack = factory.create_airquality_pack(conf)
resp = pack.airquality_now('101090101')
print(resp.aqi)
```

## 接口的映射

对应官网的[接口列表](https://dev.qweather.com/docs/api/)，组件也定义了相应的Package类， 你总是可以通过工厂方法 ```QWeatherFactory().create_xxx()```的方式创建对应的API类（xxx表示下表的Package）。

具体对应关系如下表所示：



| 接口分组  |  Package   | 
|----------| ---------- |
| GeoAPI | geo_pack |
| 城市天气 | weather_pack |
| 分钟预报 | minutely_pack |
| 格点天气 | grid_weather_pack |
| 预警 | weather_warning_pack |
| 天气指数 |  indices_pack |
| 空气质量(beta) | air_quality_pack | 
| 空气质量 | air_pack |
| 时光机 | time_machine_pack |
| 热带气旋（台风） | tropical_cyclone_pack | 
| 海洋数据 | ocean_pack |
| 太阳辐射 | solar_radiation_pack | 
| 天文 | astronomy_pack |


## 更多内容

### [官方文档](https://dev.qweather.com/docs/start/)
hack4u-SKY-Daxxx 0.1.0
Una biblioteca para consultar los cursos de hack4u.

# Hack4U Academy Courses Library

Una biblioteca pmon para consultar cursos de la academia Hack4U.

## Cursos disponibles:

- Introducción a Linux [15 horas]
- Personalización de Linux [3 horas]
- Introducción al Hack ing [53 horas]

## Instalación

Instala el paquete usando `pip3`:

```python3
pip3 install hack4u
```

## Uso básico

### Listar todos los cursos

```python
from hack4u import list_courses

for course in list_courses():
print(course)
```

### Obtener un curso por nombre

```python
from hack4u import get_course_by_name

course = get_course_by_name("Introducción a Linux")
prtnt(course)
```

### Calcular durac tón total de los cursos

```python
from hack4u.utils import total_duration

print(f"Duración total: {total_duration()} horas")
pyf-login 0.24
A reusable Django login package

# Pyf Login

This is a reusable Django login package that includes a JWT-based login view.

## 在 django 中应用

1、下载

```bash
pip install pyf_login
```

2、配置
INSTALLED_APPS 中添加 "pyf_login",

3、在 urls.py 中添加
path("auth/", include("pyf_login.urls")),

4、访问
url 为：auth/login （auth 前如果有前缀，请添加自己的前缀）
odds-conversion-tb 0.0.1
This is a simple package which offers data types for odds and functions to convert between odds data type
Requires Python: >=3.8

# Odds Conversion Package

This is a simple package which offers data types for odds and functions to convert between odds data type. 

# Importing

You can import the odds conversion package by:
``` 
from odds_conversion import odds_conversion
from odds_conversion import american_odds
from odds_conversion import fractional_odds
from odds_conversion import decimal_odds
```

# Using Odds Conversion

You can use the Odds Conversion command using:
```
a = american_odds.AmericanOdds(float(200))
f = fractional_odds.FractionalOdds(float(2))
d = decimal_odds.DecimalOdds(float(3))

ai = convert_american_odds_to_implied_odds(a)
fi = convert_fractional_odds_to_implied_odds(f)
di = convert_decimal_odds_to_implied_odds(d)

print(ai, convert_implied_odds_to_american_odds(ai))
print(fi, convert_implied_odds_to_fractional_odds(fi))
print(di, convert_implied_odds_to_decimal_odds(di))
```
which will output
```
0.3333333333333333 AmericanOdds(odd=200.00000000000003)
0.3333333333333333 FractionalOdds(odd=2.0000000000000004)
0.3333333333333333 DecimalOdds(odd=3.0)
```

# Using Pot Odds

You can use the following commands to calculate pot odds using:
```
pot = float(10000)
call = float(3000)

odds = .5

print(implied_odds_to_call(pot, call))
print(bet_for_implied_odds(pot, odds))
```
which will output
```
0.23076923076923078
10000.0
```
nbweb 0.0.7
an application to simplify web data
Requires Python: >=3.11

# nbweb
nbweb is short for no bloat web

## description
nbweb extracts the clean information from websites removing all the bloat.

## installation
```sh
pip install nbweb
```

## usage
```sh
nbweb <url>

# return output in text format
nbweb --format=txt <url>

# return rss feed
nbweb --rss <url>

# check if website is supported
nbweb --supported <url>
```

## supported websites
list of supported websites can be found in the 'data.json' file

## features
* output as text or json 
* auto delete cache after 7 days
* return rss feed (only 1 website supported)
* checks if site is supported

## note
- this application is currently in experimental phase
png-to-pptx 0.1
A tool to convert PNG images to a PPTX presentation with a 16:9 aspect ratio.
Requires Python: >=3.6

PNG to PPTX Converter

`png_to_pptx` is a Python package designed to convert PNG images into a PowerPoint (PPTX) presentation with a 16:9 aspect ratio. This tool is useful for quickly creating presentations from a set of PNG images.

Features

- Converts PNG images to a PPTX presentation.
- Maintains a 16:9 aspect ratio for slides.
- Simple and easy-to-use API.

Installation

You can install `png_to_pptx` via pip:

pip install png_to_pptx

Usage

To convert PNG images to a PPTX presentation, use the `pngs_to_pptx_16x9` function. Here's a basic example:

```python
from png_to_pptx import pngs_to_pptx_16x9

# Path to the folder containing PNG images
png_folder = "path/to/png_folder"

# Path where the PPTX file will be saved
pptx_file = "path/to/output_presentation.pptx"

# Convert PNG images to PPTX
pngs_to_pptx_16x9(png_folder, pptx_file)
```

Parameters

- `png_folder` (str): The path to the folder containing PNG images.
- `pptx_file` (str): The path where the resulting PPTX file will be saved.

Example

Suppose you have a folder named `images` with PNG files and you want to create a PowerPoint presentation named `presentation.pptx`:

```python
from png_to_pptx import pngs_to_pptx_16x9

png_folder = "images"
pptx_file = "presentation.pptx"

pngs_to_pptx_16x9(png_folder, pptx_file)
```

This will create a PowerPoint presentation where each PNG image is placed on a slide with a 16:9 aspect ratio.

Acknowledgements

- python-pptx for handling PowerPoint file operations.
- Pillow for image processing.
django-autojob 1.0.0
Django customizes management pages based on APScheduler
Keywords: autojob

# README.md
- [English](https://github.com/lmycc/autojob/blob/main/README.md)
- [简体中文](https://github.com/lmycc/autojob/blob/main/README.zh_CN.md)

# AutoJob

#### AutoJob 是整合了APScheduler和Django的一个定时任务app，只需安装依赖，通过一定配置即可完成定时任务的开发，可通过页面管理定时任务的编辑和状态变更
#### 该app解决了在 Django + uwsgi 部署应用时，启动多个进程会导致定时任务启动冲突的情况
#### 暂只支持`corn`和`date`两种类型，本地需安装redis
#### 该定时任务还适配了simple-ui前端框架

## 安装方式
```
pip install autojob
```
## 使用方式

### 1. 添加 "autojob" 到 `settings.py`的 INSTALLED_APPS 中：
```
INSTALLED_APPS = [
    ...
    'autojob.apps.AutoJob',
]
```

### 2. 执行 `python manage.py migrate autojob` 迁移数据表，下面是添加触发器的方式
#### 两种录入自定义定时任务的方式
- **终端命令方式**
```
## django项目中编写了自定义的定时任务后，可以在终端执行以下命令：
python manage.py scan_jobs

##返回以下信息，即表示成功添加了定时任务触发器到数据表中（重复执行不会导致重复添加）：
###检测到新增定时任务：myapp.abc.job_test
```
- **代码调用方式**
```
## 这种方式是在`wsgi.py`文件中增加对command的引用来录入自定义定时任务触发器
from app.management.commands.scan_jobs import Command
scan_jobs = Command()
scan_jobs.handle()
 
##返回以下信息，即表示成功添加了定时任务触发器到数据表中（重复执行不会导致重复添加）：
###检测到新增定时任务：myapp.abc.job_test
```

### 3. django应用启动时调用定时任务，在 `wsgi.py`中添加：
```
from autojob import job_tool
job_tool.job_control()
```

### 4. 在 `settings.py`添加redis配置
```
CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379/0",
        "OPTIONS": {
            "PICK_VERSION": -1,
            "COMPRESSOR": "django_redis.compressors.zlib.ZlibCompressor",
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
            "PASSWORD": ""
        }
    }
}
```

### 5. 一个测试任务的demo： `job_test.py`

```
# coding=utf-8
import datetime
import logging

from app.job_tool import job_before

logger = logging.getLogger(__name__)


@job_before
def job_test(*args):
    # 当应用程序启动时，录入任务触发器时会读取下面这行文档当做触发器的描述，如果没有则默认描述是函数的路径
    """一个测试的定时任务"""
    now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    logger.info(now + '__This is a timed task for testing:' + args[0])
```
LLoghelper 0.2.0
A helper module for logging.
Requires Python: >=3.6

# LLoghelper

#### 1.使用：

> pip install LLoghelper

#### 2.导入：

> ```python
> from LLoghelper.log_helper import log, logger
>
>
> ```

#### 3.控制日志log, print 是否可以打印  print=false恢复原样

```python
logger.set_log_enable(True, True)  
```

说明：

```python
 ''' 日志辅助类 
    Just: 
    pip install LLoghelper
    from LLoghelper.log_helper import log, logger
    支持log.info, print 等方法提供日志输出、格式设置、颜色设置等功能
    调用方法：
        log.info("This is a test.")
        log.warning("This is a warning.")
        log.error("This is an error.")
        log.critical("This is a critical error.")
        log.debug("This is a debug message.")
    替换原生的 print 函数, 并支持颜色输出：
        print("This is a test.")
        print("This is a critical test.", log_level=logger.CRITICAL)
        print("This is a warning test.", log_level=logger.WARNING)
        print("This is an error test.", log_level=logger.ERROR)
        print("This is a debug test.", log_level=logger.DEBUG)
        print("This is a info test.", log_level=logger.INFO)
    主要功能：
    1. 日志输出到控制台和文件
    2. 日志格式设置：simple, standard, simple_color, verbose, debug
    3. 日志颜色设置：red, green, yellow, blue, magenta, cyan, reset
    4. 日志级别设置：DEBUG, INFO, WARNING, ERROR, CRITICAL, NOTSET
    5. 日志打印控制：可以控制日志是否可以打印到控制台和文件

    '''
```

![image](./docs/screenshot.png)
DIYables-Pico-Button 0.1.1
Button Library for with Raspberry Pi Pico, created by DIYables
Requires Python: >=3.6

## Button Library for Raspberry Pi Pico - DIYables_Pico_Button
This MicroPython library is designed for Raspberry Pi Pico to make it easy to use push button, momentary switches, toggle switch, magnetic contact switch (door sensor)... It is easy to use for not only beginners but also experienced users... 

It is created by DIYables to work with DIYables products, but also work with products from other brands. Please consider purchasing products from [DIYables Store on Amazon](https://amazon.com/diyables) from to support our work.



Features
----------------------------
* Works with any Raspberry Pi Pico board.
* Supports the internal pull-up/pull-down resistor to avoid the floating value
* Supports debounce to eliminate the chattering phenomenon
* Supports the pressed and released events
* Supports the counting (for FALLING, RISING and BOTH)
* Easy to use with multiple buttons
* All functions are non-blocking 


Available Functions
----------------------------
* __init__(pin, mode=Pin.PULL_UP)
* set_debounce_time(time_ms)
* get_state()
* get_state_raw()
* is_pressed()
* is_released()
* set_count_mode(mode)
* get_count()
* reset_count()
* loop()


Available Examples
----------------------------
* pull_up.py
* pull_down.py



Tutorials
----------------------------
* [Raspberry Pi Pico - Button](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-button)
* [Raspberry Pi Pico - Button Debounce](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-button-debounce)


References
----------------------------
* [Raspberry Pi Pico - Button Library](https://newbiely.com/tutorials/raspberry-pico/raspberry-pi-pico-button-library)