semvec/pypi-packages huggingface dataset:
erp-apis-temp 1.0.33
erp_apis_temp
License: MIT
Keywords: erp_apis_temp



## 1.项目简介

 

erp_sdk_python对聚水潭常用的一些api进行了封装

 

 

### 安装

 pip install erp_apis





#### 案例：获取订单数据

    # 获取订单数据

    from apis.user import login

    from apis.order import OrderList

    from erp_apis.request import Session



    session = Session()



    session.erpSend(login(

        username="erp账号",

        password="erp密码"

    ))



    res = session.erpSend(OrderList())

    print(res)
cron-threads 0.1.4
Python Module to enable running tasks inside threads based on cron schedule
License: MIT


# Cron Threads

A Python module whose goal is to simplify working with threads which need to trigger it`s internal tasks via a cron schedule.




## Working Modes

- Command : used to run os specific commands in a shell in a separate thread
- File : import a specific python script and run a function within it as a separate thread. Very good for running scripts based on template
- Internal : run just an internal function in a separate thread

## Schedules
- If a schedule is provided in cron format, it will execute whatever is specified based on that specific schedule
- If no schedule is provided or is left empty, then it will work as oneshot, were after the work is done, the thread will be deleted.

## Workflow logic
- Rather than start a thread directly which you have to manage manually, a thread manager has been created which holds references to each thread it was created by it.
- The Manager has a function which enables management of threads, specifically monitoring for when threads exit or for when the tasks inside threads finish executing and relay-ing that info to the main thread.
- The thread will always stay online if possible if a cron schedule is provided, an internal timer will just suspend the thread until it is time for whatever needes to be run to be executed again.

## Thread Output
- Ideally the task given to the thread should always return 3 things : exit code(int), output(str) and error(str), in that specific order
- If the task has no return statements, or it returns less that the 3 mentioned items, it will suppliment with None returns
- If more than 3 items are returned, it will throw an error mentioning that only 3 items can be returned.



## Usage/Examples

```python
from cron_threads import ThreadManager, WorkerModes 

def internal(group):
    """example function to just print whatever is given as argument"""
    print(group)

manager = ThreadManager()
manager.begin_manage()
# Example usage
manager.start_thread("thread1", "* * * * *",WorkerModes.COMMAND,"dir") # run the dir command as a separate shell
manager.start_thread("thread2", "* * * * *",WorkerModes.FILE,"file_name",func_name="run") # run a separate function from within another python script
manager.start_thread("thread3", None, WorkerModes.INTERNAL, internal, None, "123") # use an internal function as the task of the thread

manager.stop_thread("thread1") # will send a signal to the tread to close. If the task of the thread is running, it will wait for the task to finish, then close the thread

# simple while true logic to monitor what is going on with the threads
while True:
    while manager.have_threads_exited() > 0:
        print(manager.get_thread_exit_info())
    while manager.have_tasks_exited() > 0:
        print(manager.get_task_exit_info())    
    if some_test_here_is_true:
        manager.stop_manage() # this will kill all threads as well

```


## Future improvements

- Force kill thread even when task is running
- Resource locking
- Community Requests which make sense
- TBD
nonebot-plugin-mcsmanager 0.1.0
mcsm for nonebot2
License: MIT
Requires Python: >=3.9

# nonebot-plugin-mcsmanager

摸

还没写完

## 工作思路

### mcsm已有用户

```mermaid
flowchart TD
    用户在mcsm上创建APIKEY
        --> 绑定mcsm面板端
        --> d["即可使用所有功能(包括授权)"]
```

### 授权个人

```mermaid
flowchart TD
    非mcsm用户
        --> 让已绑定的用户主动进行授权
        --> a[即可使用基本功能包括]
    a --> b["开关重启实例(需授权)"]
    a --> c[查看实例列表]
    a --> d["向实例发送指令(需授权)"]
```

## 基本指令

使用 `mcsm --help` 查询，相关指令也可以用类似的方法，例如 `mcsm admin --help` 等

## 绑定

- 超级管理员使用 `mcsm bind [url] [apikey] [userid]` 来绑定某人/自己为实例管理
  - 需要自行获取 mcsm 的 apikey
  - userid 为该平台的指定用户ID，例如QQ号，可以填写自己或别人的
- 绑定完成后，使用 `mcsm admin add_user [name] [remote_uuid] [instance_uuid] [userid]`
  - name 为自己起的名字，方便区分以及后续使用开关指令
  - remote_uuid 为节点ID 可在实例页面中复制
  - instance_uuid 为实例ID 可在实例页面中复制
  - userid 为该平台的指定用户ID，例如QQ号，可以填写自己或别人的
  - 实例管理也需要绑定这些信息

## 解绑用户绑定

~~还没做~~

## 获取服务器信息

~~还没做~~

## 开关服务器

- `mcsm on [name]`
  - name 之前起的名字
  - name 可选，可以不写直接 `mcsm on` 会打印列表供选择，根据提示回复即可
- `mcsm off/restart` 等同上

## 向服务器发送指令

~~还没做~~



## TODO

- [ ] 修改架构，使其可以直接接管mcsm的普通用户所有实例
- [ ] 完善功能