semvec/pypi-packages huggingface dataset:
fastapi-extend 0.1.3
fastapi extend
Requires Python: >=3.8
Keywords: fastapi

### 1、install
``` pip install fastapi_extend ```
### 2、use
```python
from sqlalchemy import Column, String, Integer, Float, DateTime
from sqlalchemy.ext.declarative import declarative_base  # ORM(对象关系映射)的基类
Base = declarative_base()
from fastapi_extend.serializer import Serializer

class Trade(Base):
    __tablename__ = "trade"
    id = Column(Integer, primary_key=True)
    account = Column(String(20), default=None, nullable=False)
    trade_datetime = Column(DateTime)
    volume = Column(Float, default=None, nullable=False)
    price = Column(Float, default=0, nullable=False)
    order_id = Column(String(20))

class TradeSer(Serializer):
    account: str
    trade_datetime = Column(DateTime)
    volume: float
    price: float
    order_id: str
```
#### 1）、Pagination
```python
from fastapi_extend.pagenator import PageNumberPagination

from pydantic import validator
from sqlalchemy import Column, String, Integer, Float, DateTime

paginator = PageNumberPagination(
            params,
            Trade,
            TradeSer,
            exclude={"start", "end"},
        )
query = paginator.get_queryset()
if params.start:
    query = query.where(Trade.trade_datetime >= params.start)
if params.end:
    query = query.where(Trade.trade_datetime <= params.end)
data = await paginator.paginate_query(query, session)
```
#### 2)、Serializer
```python
from fastapi_extend.serializer import Serializer
from pydantic import validator

class TradeSer(Serializer):
    account: str
    volume: float
    price: float
    order_id: str

    @validator("price")
    def price_add(cls, v):
        return v + 10

data_ser = TradeSer.dump(result.scalars(), many=True)

```
django-settings-json 1.0.3
Django Settings JSON helps you handle environment variables when can't use them directly from the operational system.
Requires Python: >=2.7,<=3.12

# django-settings-json

Sample `settings.json` file:

```json
{
  "DEBUG": true, 
  "TIME_ZONE": "America/New_York"
}
```

Usage
--

Use `get_setting()` when retrieving environment variables on your `settings.py` file:

```python
from settings_json import get_setting

DEBUG = get_setting('DEBUG')
TIME_ZONE = get_setting('TIME_ZONE')
```

GitIgnore
--

Remember to add `settings.json` into your `.gitignore`, so it don't get tracked.

```
settings.json
```

Missing Variables
--

If you forget to add a variable on your `settings.json`, it'll raise an error like the one below:

`Set the TIME_ZONE environment variable on settings.json`
pynanovnav2-tspspi 0.0.1
NanoVNA2 Python libraries and tools (unofficial)
Requires Python: >=3.6

# Unofficial NanoVNA v2 USB Python library and tools

__This library is work in progress__

This is a small library that allows to access the NanoVNA v2 vector network
analyzer using Python. It implements the ```VectorNetworkAnalyzer```
base class of [pylabdevs](https://github.com/tspspi/pylabdevs) (since this
is work in progress there is currently an unfinished copy in this repository).

## Tools

### ```nanovnav2fetch```

The ```nanovnav2fetch``` is a very simple command line utility that
allows one to fetch the S00 and S01 parameters as well as phases
from the NanoVNA v2. Note that this utility always depends on ```numpy```
and requires ```matplotlib``` to plot or show the traces.

```
$ nanovnav2fetch --help
usage: nanovnav2fetch [-h] [--port PORT] [--debug] [--s00] [--s01] [--phases]
                      [--show] [--plot [PLOT ...]] [--plottitle PLOTTITLE]
                      [--label00 LABEL00] [--label01 LABEL01] [--npz NPZ]
                      [--start START] [--end END] [--step STEP]

NanoVNA v2 USB fetching utility

optional arguments:
  -h, --help            show this help message and exit
  --port PORT           Port to access the NanoVNA v2 (default: /dev/ttyU0)
  --debug               Enable debug mode on the NanoVNA v2
  --s00                 Gather S00 values
  --s01                 Gather S01 values
  --phases              Gather phases for all enabled channels
  --show                Display the rendered graphics (requires matplotlib)
  --plot [PLOT ...]     Supply filename that will be used to plot graphics
                        (required matplotlib)
  --plottitle PLOTTITLE
                        Title for the plot
  --label00 LABEL00     Label for the S00 parameter
  --label01 LABEL01     Label for the S01 parameter
  --npz NPZ             Dump data into supplied NPZ file
  --start START         Start frequency in Hz (default: 50 MHz)
  --end END             End frequency in Hz (default: 4.4 GHz)
  --step STEP           Step size in Hz (default: 1 kHz)
```
sphinx_mochi_theme 0.1.0
a simple, plain, solid sphinx theme 
Requires Python: >=3.8

# sphinx-mochi-theme

<p align="center">
  <img src="https://github.com/cobapen/sphinx-mochi-theme/blob/master/docs/source/_static/logo.png" />
</p>

sphinx-mochi-theme is a simple sphinx theme for general use.

Documentation: https://cobapen.github.io/sphinx-mochi-theme
FineEx.Cloud.Middle.Message 1.0.3
发网供应链消息推送组件
Requires Python: >=3.7

# 发网消息通知组件

## 发送企业微信消息
```python
from FineEx.Middleware.Message.pywechat import WorkChatSender
def weChat():
    corpid = 'corpid'
    corpsecret = 'corpsecret'
    agentid = '1000039'
    workSender = WorkChatSender(corpid=corpid, corpsecret=corpsecret, agentid=agentid)
    workSender.send_text("hello", touser='91237')
    subject = '测试异常'
    message = f"""
        >**测试信息异常** 
        请尽快处理！
        查看详情，请点击：[FineEx](https://www.fineex.net)
        """
    workSender.send_markdown(subject + "\n" + message.strip())
    workSender.send_image(r"iamge_path", touser='receiver')
    workSender.send_file(r"file_path", touser='receiver')
    workSender.send_video(r"video_path", touser='receiver')
    workSender.send_voice(r"voice_path", touser='receiver')
```
[企业微信消息通知官方文档](https://developer.work.weixin.qq.com/document/path/90248)
## 发送网易邮件
```python
from FineEx.Middleware.Message.pyemail import MailSender
def Mail():
    # 普通文本邮件
    sml1 = MailSender('sender', 'yourpassword', 'smtp.qiye.163.com:465')
    sml1.setMailInfo('receiver', '测试标题', '测试正文', 'plain')
    sml1.sendMail()

    # html文件带文件
    sml2 = MailSender('sender', 'yourpassword', 'smtp.qiye.163.com:465')
    content = sml2.generateHtml('告警', '测试告警标题', '张三', '测试告警内容')
    sml2.setMailInfo('receiver', '测试标题', content, 'html', r'file_path')
    sml2.sendMail()
```
## 发送pushdeer消息
```python
from FineEx.Middleware.Message.pypushdeer import PushDeerSender
def pushDeer():
    pushdeer = PushDeerSender(pushkey="pushkey")
    pushdeer.send_text("hello world", desp="optional description")
    pushdeer.send_markdown("# hello world", desp="**optional** description in markdown")
    pushdeer.send_image("https://github.com/easychen/pushdeer/raw/main/doc/image/clipcode.png")
    pushdeer.send_image(
        "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=")
```
[pushdeer项目地址](https://github.com/easychen/pushdeer)
## 通过阿里云短信服务发送消息
```python
from FineEx.Middleware.Message.pysms import SmsSender
def Sms():
    ACCESS_KEY_ID = ''
    ACCESS_KEY_SECRET = ''
    SIGN_NAME = ''
    template_code = ''
    PhoneNumber = ''
    msg = {
        "mgs": "服务器192.168.1.1异常，系统CPU过高，当前值100%",
        "outer": "test"
    }
    sms = SmsSender(ACCESS_KEY_ID, ACCESS_KEY_SECRET, SIGN_NAME, template_code)
    sms.sendSms(PhoneNumber, **msg)
```
[阿里云短息服务地址](https://next.api.aliyun.com/api/Dysmsapi/2017-05-25/SendSms?spm=5176.25163407.overview-index-9c3d4_4cfbe_0.25.545abb6e1aS01u&sdkStyle=dara&tab=DOC&lang=PYTHON)
## 电话通知
```python
from FineEx.Middleware.Message.pyphone import PhoneCaller
def Call():
    caller = PhoneCaller('account', 'password')
    msg = '机房温度异常：嘉合机房当前温度30度，请尽快安排人员排查情况'
    mobile = '17601234567'
    print(caller.call(msg, mobile))
```
[互亿无线](https://www.ihuyi.com/api/voice_notice.html)
ffonons 0.1.0
A Python package for benchmarking phonon predictions from ML force fields
Requires Python: >=3.11
Keywords: chemistry,force-fields,interatomic-potentials,machine-learning,materials-science,phonons,physics

<h1 align="center">
  <slot name="logo">
    <img src="site/static/ffonons.svg" alt="FFonons logo" width="100" /><br />
  </slot>
  FFonons
</h1>

Analysis of foundation model force fields (FF) to predict harmonic phonons.

See [janosh.github.io/ffonons](https://janosh.github.io/ffonons). Very much work in progress! 🚧

Example: Phonon bands and DOS for [mp-2691](https://legacy.materialsproject.org/materials/mp-2691) comparing [CHGNet v0.3.3](https://github.com/CederGroupHub/chgnet/releases/tag/v0.3.3) and [MACE-MP-0](https://arxiv.org/abs/2401.00096) with PBE reference data from Togo's PhononDB (excluding Born non-analytic corrections):

![
  mp-2691-bs-dos-chgnet-v0.3.3-mace-y7uhwpje-pbe
](https://github.com/materialsproject/pymatgen/assets/30958850/d4a3f264-31cb-4033-8a51-979fd031d08e)