semvec/pypi-packages huggingface dataset:
jfatfat-package 0.0.3
A simple utility package
Requires Python: >=3.6

ft_package

A simple Python package with useful utility functions.

Build:
run in the terminal inside the ft_package main directory: pip install build twine
run in the terminal inside the ft_package main directory: python3 -m build
run in the terminal inside the ft_package main directory: twine upload dist/* and enter this api key, to get an api key, go to your account on PyPI and generate a new api key
run in the terminal inside the ft_package main directory: pip install jfatfat-package
now, you can run the tests inside ft_package/tests/ directory

Installation:
pip install jfatfat-package

Usage:
from ft_package import count_in_list, flatten_list, reverse_string

print(count_in_list(["apple", "banana", "apple"], "apple")) # Output: 2
print(flatten_list([[1, 2], [3, 4], [5]])) # Output: [1, 2, 3, 4, 5]
print(reverse_string("hello")) # Output: "olleh"
Live2dTk 1.0.1
live2d performance on tkinter based on live2d_py
Requires Python: <4,>=3.12
Keywords: tkinter, widget, live2d, TK, opengl

# Live2dTK

Live2d performance on tkinter based on live2d_py



使用前需要安装第三方库及其他附加库：

```ini
pip install Live2dTK
```

示例：

```python
from tkinter import Tk, Frame
from Live2dTK import Live2dFrame

demo = Tk()
demo.attributes('-transparent', 'black')	# 想要实现背景透明，必须有这一行
frame = Frame(demo)
frame.pack()
Debugging = Live2dFrame(frame, model_path=r"E:\IDE\Plugins\live2d\米塔\3.model3.json",
                        width=1000, height=1000)
Debugging.pack()
demo.mainloop()
```

模型位置不强求，但仍然建议构建规范的项目目录：

```ini
.scr
+-live2d
	+model_name
+py_file
```



结果：

![](https://pic1.imgdb.cn/item/67cd37e6066befcec6e1cd02.png)



其中，附加函数：

```python
def on_start_callback(cls, group: str, no: int):"""动作开始触发事件"""
def on_finish_callback(cls):"""动作结束调用函数"""
def end(cls):"""结束之后的资源释放事件"""
def touch(self):"""被点击事件"""

```



该模块主要集成的live2d功能来自[live2d-py](https://github.com/Arkueid/live2d-py) 可以根据改项目的其他方法改写以实现更多的可玩性，当前模块后续也会封装更多的api。

另附上一个Demo：[demo](https://github.com/Ashisheng2005/Live2dTK/blob/main/Demo/demo.py)

效果如下：

![](https://github.com/Ashisheng2005/Live2dTK/blob/main/Demo/demogif-1.gif)



加油啊，做黄油的大哥哥！



# 1.0.1更新内容

添加版本选择，初始化时可以根据模型版本选择2/3版本,默认为3

```python
Live2dFrame(master, model_versions=3, model_path=r"...", width=1000, height=1000)
```



添加帧数控制，当设置帧数大于等于120帧则忽略

```python
Live2dFrame(master, model_path=r"...", fps=120, width=1000, height=1000)
```



模型点击触发动作，前提是模型文件存在动作

```python
Debugging = Live2dFrame(master, model_path=r"...",fps=120, width=1000, height=1000)
Debugging.pack()
Debugging.bind("<Button-1>", lambda _: Debugging.model.StartRandomMotion())	# 左键点击时触发动作
```



修复Resources路径处理： RESOURCES_DIRECTORY
keypad-io 0.1.0
An event-based Python keypad library for the Raspberry Pi
Requires Python: >=3.11

# keypad-io

 An event-based Python keypad library for the Raspberry Pi

## Features
- Allows for **_secondary_** characters for _telephone styled_ keypads
- **Event-based** architecture via **callback**/**listener** functions
- Allows for key detection via **interruptions** or **polling**
- Can support arbitrarily sized keypads
- Allows for custom GPIO numbering choice
- Dependent only on `RPi.GPIO`
- Project is fully typed to reduce ambiguity and confusion during use
- Can be used with context managers for consistent clean-up

## Installation

`keypad-io` is available on `PyPi` and can be installed using:

```
pip install keypad-io
```

## Requirements
`keypad-io` only has the following dependencies:
- `>= Python 3.11`
- `RPi.GPIO`

## Usage
```Python

# Not needed, but convenient to keep example application alive
import signal

try:
  """
  keypad-io can work with your existing RPi.GPIO setup
  given input and output pins don't conflict with other uses

  It will also follow your existing GPIO numbering
  """
  GPIO.setwarnings(False)
  GPIO.setmode(GPIO.BCM)
  
  input_pins = #specify your input pins (these usually are called "Column" pins)
  output_pins = #specify your output pins (these usually are called "Row" pins)

  """
  Callback function to be invoked when a key press is detected
  """
  def key_l(c: str, out: int, inp: int):
    print(" ==> received: ", c, f" ({out}, {inp})")
  
  """
  Character mapping between input and output pin positions with their expected
  characters. 

  Note: See that there are multiple choices for the second row, second column key.
  This means if that key is pressed multiple times sequentially (within a set amount of miliseconds)
  it will return the next key of choice.

  (ex: '8' at the first key press, 'T' at the second, etc.. and wrapping back to '8')
  """
  char_map = [
    ['*', '0', '#'], 
    ['7', ('8', "T", "U", "V"), '9'], 
    ['4', '5', '6'], 
    ['1', '2', '3']
  ]

  """
  Creates a Keypad with out set input_pins and output_pins, as well as character mapping.
  By giving poll=True, this Keypad will rely on continually polling the provided pins
  for key presses.

  We set key_l as an initial listener, and we want characters to be detected via polling
  rather than interrupts (which is the default)
  """
  with Keypad(input_pins, output_pins, char_map, poll=True) as k:
    k.add_listener(key_l)
    signal.pause()
  
  """
  keypad will invoke RPi.GPIO.cleanup() on the given input and output pins, as well as
  removing interrupt listening if it's chosen as the detection method
  """
except KeyboardInterrupt:
  print("Application stopped!")
```