semvec/pypi-packages huggingface dataset:
siunitpy 0.1.1
A package for SI unit, quantity and uncertainty
Requires Python: >=3.9

# siunitpy

SI-Unit-Py is a Python package for dealing with units. 

This package implements [NIST (National Institute of Standards and Technology)](https://www.nist.gov/pml/owm/metric-si/si-units) 
official unit definitions. 

Moreover, it introduce uncertainty.

## Installation

pip installable package: [pypi: siunitpy](https://pypi.org/project/siunitpy/)

```shell
pip install siunitpy
```

## Quickstart: module `siunitpy.SI`

import module `siunitpy.SI` to use 3 very useful classes: `SI`, `si` and `prefix`.

### `SI`: common physical constants

use physical constants through class `SI`:

```python
>>> from siunitpy.SI import SI
>>> SI.c
Constant(value=299792458, uncertainty=0, unit=m/s)
>>> print(SI.me)
9.1093837015e-31 ± 2.8e-40 kg
>>> print(SI.me * SI.c**2)
8.187105776823886e-14 ± 2.516514500463089e-23 J
```

constant class `SI` provide physical constants defined by (or derived from) SI unit system.

### `si`: common SI units

use units through class `si`:

```python
>>> from siunitpy.SI import si
>>> print(1 * si.kg * si.m / si.s**2)
1.0 N
>>> print(760 * si.mmHg.to("Pa"))
101325.0 Pa
```

### `prefix`: unit prefix factor

class `prefix` contains prefix from quetta(Q, = 1e30) to quecto(q, = 1e-30), and byte prefix like ki(2^10, 1024), Mi(2^20), Gi(2^30)... It's just a number factor, not Quantity.
```python
>>> from siunitpy.SI import prefix
>>> prefix.mega
1000000.0
>>> prefix.Pi  # 2**50
1125899906842624
```

## Define Quantity

import `siunit` to define a `Quantity` object:
```python
>>> from siunitpy import Quantity
>>> F = Quantity(1, 'kg.m/s2')
>>> L = Quantity(1, 'm', 1e-4)  # with uncertainty
```

where `F` is a Quantity object, and it has properties:

```python
>>> F.value
1
>>> F.unit
Unit(kg·m/s², dim=T⁻²LM, value=1)
>>> F.dimension
Dimension(T=-2, L=1, M=1, I=0, H=0, N=0, J=0)
>>> L.uncertainty
1e-4
```

objects in `SI` are also Quantity objects.

Quantity objects can make unit conversion and operate with number or Quantity:

```python
>>> print(SI.me.to("keV/c2"))  # unit conversion
510.99894999616424 ± 1.5706848090652466e-07 keV/c²
>>> print(F / (1 * si.m)**2)
1.0 Pa
```
tkutils 1.1.2
Python tkinter utilities.
Requires Python: <4.0,>=3.8

# Welcome to TkUtils

`tkutils` is a package offering some additional logic and syntactic sugar when using `tkinter`.
The main goal is to fill some gaps of tkinter, which might make it very annoying to use.

Online version of the help documentation: http://frederic-zinelli.gitlab.io/tkutils/



## Features


### Additional logic: two-way binding, with [`Binder`](http://frederic-zinelli.gitlab.io/tkutils/binder/binder_overview/)

The [`Binder`](http://frederic-zinelli.gitlab.io/tkutils/binder/binder_overview/) class is  to setup a transparent two-way
binding reactivity between widgets and underlying object properties from the model/logic layer
of the application.

Several advantages come with this:

* Changes of bound properties in the model layer are cascading in the GUI automatically.
* The model layer of the application becomes (finally) totally independent from the presentation
  layer. This means it becomes very easy to build and test the model layer, without any need to
  think about its integration with `tkinter` itself.



### Syntactic sugar


#### [`GridLayout`](http://frederic-zinelli.gitlab.io/tkutils/grid_layout/grid_layout/)

A grid layout manager which is abstracting away all the naughty `widget.grid(...)` calls and
rows/columns grid configuration. Positioning widgets in the grid and controlling their "spanning"
becomes very easy, without extra typing.


#### [`MenuBuilder`](http://frederic-zinelli.gitlab.io/tkutils/menu_builder/menu_builder/)

A helper to build menus and to abstract away all the technicalities encountered when creating menus through
`tkinter`, which quickly make the declarations very unclear. Using the [`MenuBuilder`](http://frederic-zinelli.gitlab.io/tkutils/menu_builder/menu_builder/), the actual `Menu` hierarchy becomes very obvious: "what you see is what you get".


#### [`Event`](http://frederic-zinelli.gitlab.io/tkutils/event/)

A utility to build event strings with auto-completion/IDE suggestions support.


#### [`KeySym`](http://frederic-zinelli.gitlab.io/tkutils/key_sym/)

A utility to get all keysym information with auto-completion/IDE suggestions (providing string,
keycode and keysym_num values).


#### [`images`](http://frederic-zinelli.gitlab.io/tkutils/images/images/)

Various factories related to images to:

* Simplify and reduce the typing needed,
* Handle file conversions automatically,
* Register automatically the image object on the host for the user (to avoid garbage collection).




## Requirements

- python 3.8+
- Pillow



## Installation

* Through [PyPi](https://pypi.org/project/tkutils/):

```bash
pip install tkutils
```

* Using an archive file (with the appropriate version number):

```bash
pip install tkutils.1.0.2.tar.gz
```

* Cloning the [GitLab repository](https://gitlab.com/frederic-zinelli/tkutils).
check-params-by-swagger 1.0.3
check param by swagger
Requires Python: >=3.7

# api 参数校验

代码功能：

从swagger文档中获取接口的入参，从必填项、数据类型、数据范围对API进行校验，完成校验后将结果保存到指定表格。

功能实现步骤:

1. 从指定的swagger地址中，获取接口数据
2. 对接口数据使用`swagger_spec_validator.validator20.validate_spec`进行规范行校验
3. 使用`swagger_parser.SwaggerParser`对接口数据进行解析
4. 遍历`SwaggerParser.paths`，实现对每个接口的每个参数，从必填项、数据类型、取值范围进行验证
   * 必填项：如果是必填参数，即`required=True`，调用接口时，将该参数中请求体中删除
   * 数据类型：如果参数类型为`String`，则调用接口时，设置该参数为`非String`类型的值...
   * 取值范围：如果参数取值范围为`[2，3]`，则调用接口时，该参数的取值为 `1`,`4`分别进行验证

代码使用示例：
```python
from check_params_by_swagger.check import NecessaryParamMissExpected
from check_params_by_swagger.check import CheckApiParam

# 1. 修改必填项、数据类型、取值范围异常时，接口返回的错误码
NecessaryParamMissExpected.CODES = [110]
# 2. 指定测试的swagger文档地址
c = CheckApiParam(swagger_doc_url="http://localhost:")
# 2.1 对地址中所有的接口进行检查
c.check_api_parameter()
# 2.2 对指定的url进行检查
c.check_api_parameter(urls=['/user/add'])
# 2.3 只检查必填参数
c.check_api_parameter(urls=[], check_required=True, check_type=False, check_range=False)
c.save_result()
```
keylight 0.1.3
A CLI to control an Elgato Key Light
Requires Python: <3.13,>=3.12

# Keylight

A CLI to control an [Elgato Key Light](https://www.elgato.com/en/gaming/key-light) for Linux, macOS, and Windows.

Leverages the [pyleglight](https://gitlab.com/obviate.io/pyleglight) library.

## Requirements

* Python >= 3.6

## Installation

Keylight can be downloaded from [pypi.org](https://pypi.org/project/keylight/).

```bash
pip3 install keylight
```

## Usage

```
$ keylight
usage: keylight [-h] [-b BRIGHTNESS] [-c COLOR] [--host HOST] [--on] [--off]

A CLI to control an Elgato Key Light

optional arguments:
  -h, --help            show this help message and exit
  -b BRIGHTNESS, --brightness BRIGHTNESS
                        0 <= brightness <= 100
  -c COLOR, --color COLOR
                        2900 <= color temperature <= 6987
  --host HOST           hostname of the Key Light (omit to use auto-discovery)
  --on                  turn the Key Light on
  --off                 turn the Key Light off
```

### Examples

```
$ keylight --brightness 45 --color 5500 --on
Auto-discovering Key Light ...
Connected to: Elgato Light @ 192.168.1.100:9123
Brightness: 45%
Color: 5500k
Turning On

$ keylight --host=keylight --off
Connected to: Elgato Light @ keylight:9123
Turning Off
```

#### Aliases

You may find it convenient to use shell aliases:

```
alias koff='keylight --host keylight --off'
alias kon='keylight --host keylight --on'
```

Example usage:

```
# Turn on and set brightness to 20%
$ kon -b20
Connected to: Elgato Light BW42J1A06055 @ keylight:9123
Brightness: 20%
Turning On
```

## Developing

```bash
poetry shell

poetry build

poetry run keylight --on

poetry version patch
poetry publish
```