semvec/pypi-packages huggingface dataset:
pycactus 0.3.0
Adapter to run an Azure Function Application with a WSGI Web Server.
Keywords: Azure Function, Web App

# Cactus
Adapter to run an Azure Function Application with a WSGI Web Server.

#### How it works
Given the path of a folder containing a Function App, it builds a WSGI App parsing the Function settings. The app simply calls the Function main according to the route/methods settings.

#### Supported Function
This software is meant to support only Function which use binding httpTrigger as input and http as output. No other binding types. This is not an Azure emulator.

#### Function App structure
##### V1
```
FunctionApp
|-- host.json
|-- function_1
|	|-- function.json
|	|-- __init__.py
|-- function_2
|	|-- function.json
|	|-- __init__.py
```
##### V2
```
FunctionApp
|-- host.json
|-- local.settings.json
|-- function_app.py
```

#### Installing
```
pip install pycactus
pip install pycactus[flask] # to use Flask as web framework
```

#### How to run

###### Create a file "wsgi.py"
```
from cactus.appfactory import build_app
app = build_app("YourFunctionAppFolder")
```
Or, to use Flask as web framework:
```
from cactus.flask import build_app
app = build_app("YourFunctionAppFolder")
```
Or, for V2 projects:
```
from cactus.flask import build_app_v2
app = build_app_v2("YourFunctionAppFolder")
```
###### Run it with a WSGI Web Server
```
gunicorn wsgi:app
uwsgi --http localhost:7071 --module wsgi:app
```
Checkout the [examples](https://github.com/Claudjos/cactus/tree/main/examples) for more.

#### Using Flask blueprints
```
from cactus.flask import build_blueprint
from cactus.route_info import parse_project

app = flask.Flask(__name__)
b = build_blueprint("myfunctionapp", parse_project("/path"))
app.register_blueprint(b)
```
Or, for V2 projects:
```
from cactus.flask import build_blueprint
from cactus.route_info import parse_project_v2

app = flask.Flask(__name__)
b = build_blueprint("myfunctionapp", parse_project_v2("/path"))
app.register_blueprint(b)
```

#### Testing
This module is tested using [Fir](https://pypi.org/project/pyfir/) WSGI client.
```
# Create a virtual environment 
python3 -m venv venv
source venv/bin/activate
# Install requirements
pip install -r requirements -r test-requirements
# Run tests with coverage
python -m pytest tests --cov=cactus
```
torch-ms-adapter 0.1.4
A PyTorch adapter running on MindSpore
Requires Python: >=3.7

# torch-ms-adapter

[![PyPI version](https://badge.fury.io/py/torch-ms-adapter.svg)](https://pypi.org/project/torch-ms-adapter/)
[![Python](https://img.shields.io/pypi/pyversions/torch-ms-adapter.svg)](https://pypi.org/project/torch-ms-adapter/)
[![License](https://img.shields.io/github/license/your-github-username/torch-ms-adapter.svg)](LICENSE)

torch-ms-adapter 是一个在 MindSpore 上模拟 PyTorch API 的适配器库。  
目标是让你几乎无需修改 PyTorch 代码，就能在 MindSpore 上运行。

## 特性
- 支持 nn.Module, Conv2d, Linear, ReLU, CrossEntropyLoss
- 封装了 DataLoader 和 Trainer（底层使用 MindSpore）
- 提供 torch.nn.functional 基本操作
- 自动屏蔽 PyTorch，兼容原始导入语句

## 安装
```bash
pip install torch-ms-adapter
```
## 使用示例
```
import torch_ms_adapter as torch
import torch_ms_adapter.nn as nn
import torch_ms_adapter.functional as F

class LeNet5(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(1, 6, 5)
        self.fc1 = nn.Linear(16*4*4, 120)
        self.fc2 = nn.Linear(120, 10)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        x = torch.flatten(x, 1)
        x = self.fc2(F.relu(self.fc1(x)))
        return x
```
运行方式与pytorch一致，只需替换
```
import torch
```
为
```
import torch_ms_adapter as torch
```
## 路线图
- 支持基础层（linear,Conv2d,ReLU)
- 支持Loss函数
- 封装Optimizer
- 支持更多PyTorch模块（YOLO，ResNet）
- 完善Autograd

## 贡献
欢迎提交issue和PR，一起完善torch-ms-adopter
datagrok-celery-task 0.1.8
Celery Task wrapper to integrate Python functions into the Datagrok platform.
Requires Python: >=3.8

# Datagrok Python Celery Task Library

This package provides a Celery task wrapper for integrating Python functions into the [Datagrok](https://datagrok.ai) platform. It enables logging, progress tracking, and seamless communication between Celery workers and Datagrok’s infrastructure.

Refer to the [Datagrok Help](https://datagrok.ai/help/datagrok) for more information about the platform.

---

## Installation

Install the package using [pip](https://pypi.org/project/pip/):

```bash
pip install datagrok-celery-task
```

## Usage

To define tasks compatible with Datagrok, use the DatagrokTask base class and configure your Celery app with the provided Settings class.

```python
from celery import Celery
from datagrok_celery_task import DatagrokTask, Settings
import logging

# Always create a Settings object. Provide properties manually only if not launched by Datagrok.
settings = Settings(log_level=logging.DEBUG)

# Create a Celery app
app = Celery(settings.celery_name, broker=settings.broker_url)

# Define a simple Datagrok task
@app.task(base=DatagrokTask)
def echo(c, **kwargs):
    print("Received USER_API_KEY:", kwargs.get("USER_API_KEY", "empty"))
    print("Received data:", c)

# Define a task that reports progress
@app.task(bind=True, base=DatagrokTask)
def progress_task(self: DatagrokTask, a):
    self.update_state(meta={"percent": 10, "description": "Starting"})
    print(a)
    return "Task completed"
```

### Notes

* When Datagrok manages the Celery worker, environment variables will auto-populate Settings.
* Prins will appear in Datagrok log messages of the FuncCall. Please note, that it will work only when Celery `prefork worker pool` is used.
* Bind task `bind=True` and use `self.update_state` to manually update platform's progress bar.
* Tasks can return results or raise Exception.

## License

See [License.md](https://github.com/datagrok-ai/public/blob/master/LICENSE.md).