semvec/pypi-packages huggingface dataset:
veli-kafka-client 1.0.0
Veli Kafka Client

### Kafka Client for VELI.STORE

### Description

This module helps you to integration kafka messaging into your apps.
Supported frameworks: FastAPI, (Django coming soon :D)

### How to use (FastAPI):

* Producer

```python
app = FastAPI()


def produce_event(topic, event):
    producer = app.state.producer
    producer.produce_event(topic, event)


@app.on_event("startup")
async def startup_event():
    bootstrap_servers = ['localhost:9092', 'localhost:9093']
    producer = KafkaEventProducer(bootstrap_servers)
    await producer.start()
    app.state.producer = producer

@app.on_event("shutdown")
async def shutdown_event():
    await app.state.producer.stop()

@app.post("/products")
async def save_product(product_info: ProductInfo):
    product = save_product(product_info)
    produce_event(KafkaTopic.PAGE_VIEWS, product)
    return product
```

* Consumer

```python
app = FastAPI()


@app.on_event("startup")
async def startup_event():
    # Define the configuration variables
    topics = [KafkaTopic.USER_REGISTRATIONS, KafkaTopic.PAGE_VIEWS]
    bootstrap_servers = ['localhost:9092', 'localhost:9093']
    group_id = 'app_id'

    consumer = AsyncKafkaConsumer(topics, bootstrap_servers, group_id)
    app.state.consumer = consumer
    await consumer.start()
    # start the consume_events coroutine in the background
    asyncio.create_task(consumer.consume())


@app.on_event("shutdown")
async def shutdown_event():
    await app.state.consumer.stop()
```
mailx 0.0.7
make it easy to use mail

# mailx

#### 介绍
快捷使用mail模块

#### 软件架构
软件架构说明


#### 安装教程

1.  pip安装
```shell script
pip install mailx
```
2.  pip安装（使用阿里云镜像加速）
```shell script
pip install mailx -i https://mirrors.aliyun.com/pypi/simple
```


#### 使用说明

1.  demo
```python
import mailx
res = mailx.send_text(sub='test sub', content='test content', to_addrs=['test@test.com'])
```

2. 常用设置
- mail.env：
```text
smtp_host={your smtp_host}
smtp_port={your smtp_port}
from_name={your from_name}
smtp_username={your smtp_username}
smtp_password={your_smtp_username}
to_addrs={your smtp_username, split by ","}
```
- SMTP服务端口号：25或80或465(SSL加密)