semvec/pypi-packages huggingface dataset:
start-end-logging 0.1.7
A very simple logging library that logs the start and end of a process step and, in particular, indicates the elapsed time.
Requires Python: >=3.8

# start-end-logging

A very simple Python logging library that logs the start and end of a process step and, in particular, indicates the
elapsed time.

## Installation

```pip install start-end-logging``` or ```poetry add start-end-logging```

## Usage

```
import logging
import time

from start_end_logging.start_end_logging import log_start, log_end, init_logging

log = logging.getLogger(__name__)

if __name__ == "__main__":
    init_logging("../logs", "log.log")
    log_start("main process", log)
    log_start("preparing something", log)
    time.sleep(0.15)
    log_end()
    log_start("preparing something other", log)
    time.sleep(0.05)
    log_end()
    time.sleep(0.25)
    log_end()
```

Output:

```
2024-01-23 20:38:09,305 - __main__ - INFO - (1) start main process.
2024-01-23 20:38:09,305 - __main__ - INFO - (2) start preparing something.
2024-01-23 20:38:09,456 - __main__ - INFO - (2) end preparing something. time elapsed: 00:00:00.151.
2024-01-23 20:38:09,456 - __main__ - INFO - (2) start preparing something other.
2024-01-23 20:38:09,508 - __main__ - INFO - (2) end preparing something other. time elapsed: 00:00:00.052.
2024-01-23 20:38:09,758 - __main__ - INFO - (1) end main process. time elapsed: 00:00:00.453.
```
general-util 0.1.2
general operator for fastapi write sql and redis
Requires Python: >=3.8

# node_object_module version 2.3.3

* API node rule
  1. API node 包含四張表(node, node_base, device_info, third_dimension_instance)一對一關係
  2. 只能透過API node的update去修改或新增device_info和third_dimension_instance這兩張表
  3. node只能有一個parent node, 可以有多個child nodes
  4. 跟node groups的關係是多對多
  5. 刪除node會連同底下所有的child nodes和所有此node和child nodes底下的object都刪除
     ![node_delete.png](image/node_delete.png)
* API object rule
  1. API object 包含四張表(object, object_base, fake_data_config, fake_data_config_base)一對一關係
  2. 只能透過API object的update去修改或新增其他一對一的表
  3. object只能綁定一個node
  4. 跟object groups的關係是多對多
  5. insert object的value會完全取代原本的value, 只修改redis的表, 不修改sql
* API object value
  1. history value儲存在influxDB
  2. latest value存redis和influxDB
  3. 取得history value從influxDB讀取
  4. 取得latest value從redis取
  5. 取得即時有改變的資料使用websocket連線(ws://{host}:{port}/ws/)
* API control href group
  1. create 可以創建group 和 item
  2. update 如果item有帶id就是修改, 如果沒有帶id就是創建新的item, 如果帶負數id會刪除此item
  3. delete 會連同底下item一起刪除

## Design

![design.png](image/design.png)

### General Table Operate CRUD

Read Data
![Read.png](image/Read.png)

Create Data
![Create.png](image/Create.png)

Update Data
![Update.png](image/Update.png)

Delete Data
![Delete.png](image/Delete.png)

## DB diagram

[DB schemas](https://dbdiagram.io/d/63073decf1a9b01b0fdf20a3)

![db_node_object.png](image/db_node_object.png)

## Deploy

#### 1. Use docker-compose

1. install mysql, redis and influxdb

   `docker pull mssql`

   `docker pull redis`

    `docker pull influxdb`
2. start docker-compose.yaml

   `docker-compose up --build -d`

#### 2. Use Dockerfile

需要先啟動mysql, redis, influxdb
可用環境變數db_host, redis_host去改變sql和redis的連線ip

1. build docker image "node_object"

   `docker build -t node_object:latest .`
2. run node_object image

   `docker run --name node_object --network="host" -p 9330:9330 node_object:latest`

    有環境變數
   `docker run --name node_object --network="host" -e db_host=192.168.1.11 -e redis_host=192.168.1.11 -e influx_host=192.168.1.11 -p 9330:9330 -d node_object:latest`

## Swagger API Document

http://{host}:{port}/docs
![swagger.png](image/swagger.png)
img2bow 0.1.0
Get logos Strip-ready
Requires Python: >=3.7

# img2bow

A PyPi library to convert images to black and white (no gray) to use as custom logos on Stripe credit cards. 

**Processing Pipeline:** Applies a slight Gaussian blur, resizes it to fit a maximum dimension of 1000×200 pixels, and centers it on a white canvas.

## Installation

1. Clone this repository or download the files.
2. In the same directory as `setup.py`, run:
   ```bash
   pip install .
   ```

   or to install in editable mode:

   ```bash
   pip install -e .
   ```

## Usage

```py
from img2bow.converter import convert_to_black_and_white

# Convert an image to black & white and save it
convert_to_black_and_white("input_image.png", "output_image.png", threshold=128)
```

---

## How to Install and Use

1. **Install**  
   In your terminal, change directory (`cd`) into the location of `setup.py`, then run:
   ```bash
   pip install .
   ```

2. **Import and Call**  
   In your Python script or REPL:
    ```py
    from img2bow.converter import convert_to_black_and_white

    convert_to_black_and_white("input.png", "output.png", threshold=128)
    ```
dock-worker 0.0.0
Fork Docker images between registries using GitHub Actions
Requires Python: >=3.10
Keywords: docker, github-actions, registry, cli

# Docker Images Pusher

使用Github Action将国外的Docker镜像转存到阿里云私有仓库，供国内服务器使用，免费易用<br>

- 支持DockerHub, gcr.io, k8s.io, ghcr.io等任意仓库<br>
- 支持最大40GB的大型镜像<br>
- 使用阿里云的官方线路，速度快<br>

---

## leo03w 20240830

新增 `api_hook.yaml` 带参workflow, 支持api方式启动github action, 可传 `原始镜像地址` 和 `目的镜像地址` 两个参数

- 支持 `streamlit` 形式提供web界面
- 支持 `cli.py` 命令行工具调用

## 使用方式

```bash
pip install .
```

```bash
export github_token=your_token
```

```bash
docker-image-forker --help
```

### 配置文件

在项目根目录下创建 `.env` 配置文件, 参考 `config.py` 中定义的配置项进行设置

token为必须配置, 参考
[workflow rest api doc](https://docs.github.com/zh/rest/actions/workflows?apiVersion=2022-11-28)
生成你的访问令牌, 建议 `细粒度的个人访问令牌`

配置 owner为你的github用户名, repo为你克隆此项目后的项目命名

[workflow 触发及参数文档](https://docs.github.com/zh/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch)

### todo

- [x] `cli.py` 支持单位置参数
- [ ] 外部调用 `cli.py` 配置文件读取不到问题
- [x] 镜像目标位置 名称中 `/` 替换为 `-`
- [ ] 客户端工具, 输入镜像名称, 自动从阿里云仓库克隆, 并重命名
- [ ] 封装可执行文件

---


视频教程：https://www.bilibili.com/video/BV1Zn4y19743/

作者：**[技术爬爬虾](https://github.com/tech-shrimp/me)**<br>
B站，抖音，Youtube全网同名，转载请注明作者<br>

## 使用方式

### 配置阿里云

登录阿里云容器镜像服务<br>
https://cr.console.aliyun.com/<br>
启用个人实例，创建一个命名空间（**ALIYUN_NAME_SPACE**）
![](/doc/命名空间.png)

访问凭证–>获取环境变量<br>
用户名（**ALIYUN_REGISTRY_USER**)<br>
密码（**ALIYUN_REGISTRY_PASSWORD**)<br>
仓库地址（**ALIYUN_REGISTRY**）<br>

![](/doc/用户名密码.png)

### Fork本项目

Fork本项目<br>

#### 启动Action

进入您自己的项目，点击Action，启用Github Action功能<br>

#### 配置环境变量

进入Settings->Secret and variables->Actions->New Repository secret
![](doc/配置环境变量.png)
将上一步的**四个值**<br>
ALIYUN_NAME_SPACE,ALIYUN_REGISTRY_USER，ALIYUN_REGISTRY_PASSWORD，ALIYUN_REGISTRY<br>
配置成环境变量

### 添加镜像

打开images.txt文件，添加你想要的镜像
可以加tag，也可以不用(默认latest)<br>
可添加 --platform=xxxxx 的参数指定镜像架构<br>
可使用 k8s.gcr.io/kube-state-metrics/kube-state-metrics 格式指定私库<br>
可使用 #开头作为注释<br>
![](doc/images.png)
文件提交后，自动进入Github Action构建

### 使用镜像

回到阿里云，镜像仓库，点击任意镜像，可查看镜像状态。(可以改成公开，拉取镜像免登录)
![](doc/开始使用.png)

在国内服务器pull镜像, 例如：<br>

```
docker pull registry.cn-hangzhou.aliyuncs.com/shrimp-images/alpine
```

registry.cn-hangzhou.aliyuncs.com 即 ALIYUN_REGISTRY(阿里云仓库地址)<br>
shrimp-images 即 ALIYUN_NAME_SPACE(阿里云命名空间)<br>
alpine 即 阿里云中显示的镜像名<br>

### 多架构

需要在images.txt中用 --platform=xxxxx手动指定镜像架构
指定后的架构会以前缀的形式放在镜像名字前面
![](doc/多架构.png)

### 镜像重名

程序自动判断是否存在名称相同, 但是属于不同命名空间的情况。
如果存在，会把命名空间作为前缀加在镜像名称前。
例如:

```
xhofe/alist
xiaoyaliu/alist
```

![](doc/镜像重名.png)

### 定时执行

修改/.github/workflows/docker.yaml文件
添加 schedule即可定时执行(此处cron使用UTC时区)
![](doc/定时执行.png)


## 备注

### 通过API调用后，获取run_id

https://stackoverflow.com/questions/69479400/get-run-id-after-triggering-a-github-workflow-dispatch-event

https://github.com/orgs/community/discussions/17389

## PyPi packaging

twine==6.1.0 版本太新, 导致

```bash
❯ python -m twine check dist/*
Checking dist/dock_worker-0.0.0-py3-none-any.whl: ERROR    InvalidDistribution: Invalid distribution metadata: unrecognized or malformed field 'license-file' 
```

```bash
pip install "twine<6.0" -U
```

降到 5.1.1 好了
rajdeepghosh 0.1.0
A package to open Rajdeep Ghosh's portfolio website
Requires Python: >=3.6

# rajdeepghosh

A simple Python package to open Rajdeep Ghosh's portfolio website.

## Installation

```bash
pip install rajdeepghosh
```

## Usage

```python
from rajdeepghosh import website

website()  # Opens Rajdeep's portfolio website in your default browser
```

## License
MIT
sberpm 3.4.0
Library that is intended to operate with various process mining tasks.

![](https://github.com/SPM-MLTeam/process-mining-spm/blob/main/imgs/Logo.png?raw=true)

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sberpm)](https://pypi.org/project/sberpm)
[![PyPI - Version](https://img.shields.io/pypi/v/sberpm)](https://pypi.org/project/sberpm)
![PyPI - Downloads](https://img.shields.io/pypi/dm/sberpm)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
### [Documentation](https://process-mining-spm.readthedocs.io/en/latest/)  |  [Installation](#installation) | [Quick start](#quick-start)
# SberProcessMining (SberPM) – Process Mining Python framework
SberPM is an open-source Python library for conducting a comprehensive analysis of business processes with the use of process mining and machine learning techniques. By implementing this tool, objective and deep insights into the process on all levels can be revealed. These insights are then used to detect problems such as bottlenecks and deviations and identify potential opportunities for process improvement and optimization.

Authors: Sber Process Mining Team.

# Installation

To install SberPM framework on your machine from PyPI:
```bash
pip install sberpm
```
To install from sources:
```bash
git clone https://github.com/SberProcessMining/Sber_Process_Mining.git

cd Sber_Process_Mining
pip install .
```

Additionally, you have to install graphviz executables and add the path to the executables to PATH variable:  
https://graphviz.org/download/

# Quick start

There are some steps for quick start for your process log analysis:
* Create a DataHolder object:
```python
from sberpm import SuccessInputs, DurationUnits

path = "example_data.xlsx"
data_holder = DataHolder(
    data=path,
    col_case="id",
    col_stage="action",
    col_start_time="start_time",
    col_end_time="end_time",
    col_user="user_id",
    col_text="text",
    success_inputs=SuccessInputs(entries={"Подписание документов ", "Принято"}),
)

data_holder.data.head()
```
* Apply AutoInsights:
```python
from sberpm.autoinsights import AutoInsights

auto_insights = AutoInsights(data_holder, successful_stage="Принято")
auto_insights.apply()
```

# License
This project is released under the [MIT License](https://github.com/SPM-MLTeam/process-mining-spm/blob/main/LICENSE).
python-elasticsearch-logging 2.0.8
Minimalistic Elasticsearch logging handler
Requires Python: <4,>=3.9
Keywords: elasticsearch, logging

# elasticsearch-logging-handler

This is a minimalistic Elasticsearch logging handler for python. This handler uses only url as an authentication method. For more robust authentication consider [CMRESHandler](https://github.com/cmanaha/python-elasticsearch-logger).

Package on PyPI - https://pypi.org/project/elasticsearch-logging-handler/

Parameters for **ElasticHandler**:
| Name | Type | Required | Default | Description | Example | 
| --- | --- | --- | --- | --- | --- |
| host | str | True | - | Url for Elasticsearch cluster. Currently, this handler support only basic authentication through providing user and password in the url. | https://user:password@my-cluster.es:9200, https://my-cluster.es:9200 |
| index | str | True | - | Name of the Index to write in. | preprocessing-logs |
| level | int | False | 0 (NOTSET) | Minimal logging level for the handler. Handler will only process messages with level larger than this parameter. | 20, logging.WARNING |
| batch_size | int | False | 1000 | Size of the buffer that stores logs before sending to Elasticsearch. If buffer is full, send batch immediately, without waiting for the **flush_period** | 2000 - send batches of maximum size 2000 |
| flush_period | float | False | 1.0 | Period during which handler will accumulate logs into batch before sending it ot the cluster. | 10.0 - wait 10 seconds before sending |
| timezone | str | False | None | Timezone for which to transform @timestamp for the record. | 'Europe/Amsterdam', 'Australia/Sydney' |

**ElasticHandler** is nonblocking, meaning any logging call e.g. **logging.exception** will not block calling thread. which is useful in the case of high logging load.

## Install

```shell
pip install python-elasticsearch-logging
```
## Build
``` 
poetry build -f wheel
```

## Uses
 logging.ini file
``` 
[loggers]
keys = root

[handlers]
keys = file, console, elasticsearch

[formatters]
keys = default

[logger_root]
level = DEBUG
handlers = file, console, elasticsearch

[handler_console]
class = StreamHandler
level = DEBUG
formatter = default
args = (sys.stdout,)

[handler_file]
class = handlers.RotatingFileHandler
level = DEBUG
formatter = default
args = ("service.log","a",10000000,10,"utf-8")
;args = [filename,mode,maxBytes,backupCount,encoding}

[handler_elasticsearch]
class = python_elasticsearch_logging.ElasticHandler
args = ('http://elastic:changeme@localhost:9200','pylogger')
level = DEBUG
formatter = default

[formatter_default]
format = %(asctime)s - %(name)s-%(threadName)-10s-%(levelname)s - %(message)s
datefmt =
class = logging.Formatter
```