semvec/pypi-packages huggingface dataset:
sqlmodel-serializers 0.0.2
Model serializer for SQLModel
Requires Python: >=3.9
Keywords: python,sqlmodel,pydantic,sqlalchemy,orm,serializer


# sqlmodel-serializers

DRF like SQLModel serializer which allows us to create valid response schemes and easily add dynamic fields in responses


# Installation

```bash
pip install sqlmodel-serializers
```


# Usage


```python
from sqlmodel_serializers import SQLModelSerializer


from .models import Hero


class HeroUpdate(SQLModelSerializer):
    class Meta:
        model = Hero

        optional = '__all__'

        fields = ('name', 'secret_name', 'age')


class HeroRead(SQLModelSerializer):
    id: int
    full_name: str

    class Meta:
        model = Hero


class HeroCreate(SQLModelSerializer):
    class Meta:
        model = Hero

        fields = ('name', 'secret_name', 'age')
```

Now you can create your routes like this:


```python
from typing import List

from sqlmodel import Session, select
from fastapi import FastAPI, HTTPException, status

from .models import engine, Hero, create_tables
from .serializers import HeroRead, HeroCreate, HeroUpdate


app = FastAPI()


@app.on_event("startup")
def on_startup():
    create_tables(engine)


@app.post("/heroes", response_model=HeroRead)
def create_hero(data: HeroCreate):
    hero = Hero(**data.dict())

    with Session(engine) as session:
        session.add(hero)

        session.commit()

        session.refresh(hero)

        return hero


@app.get("/heroes", response_model=List[HeroRead])
def read_heroes():
    with Session(engine) as session:
        heroes = session.exec(select(Hero)).all()
        return heroes


@app.get('/heroes/pk', response_model=HeroRead)
def retrieve_hero(pk: int):
    with Session(engine) as session:
        instance  = session.get(Hero, pk)

        if not instance:
            raise HTTPException(
                detail='Hero not found',
                status_code=status.HTTP_404_NOT_FOUND
            )

        return instance

@app.patch('/heroes/{pk}', response_model=HeroRead)
def update_hero(pk: int, data: HeroUpdate):
    with Session(engine) as session:
        instance  = session.get(Hero, pk)

        if not instance:
            raise HTTPException(
                detail='Hero not found',
                status_code=status.HTTP_404_NOT_FOUND
            )

        hero_data = data.dict(exclude_unset=True)

        for key, value in hero_data.items():
            setattr(instance, key, value)

        session.add(instance)

        session.commit()

        session.refresh(instance)

        return instance

```

This results in these schemes

![Schemes](https://notabug.org/kapustlo/sqlmodel-serializers/raw/master/images/schemes.webp?raw=true "Schemes")
KITTI-Iterator 1.4.0
KITTI Iterator

# KITTI Iterator

![pylint workflow](https://github.com/AdityaNG/kitti_iterator/actions/workflows/pylint.yml/badge.svg)
![pypi workflow](https://github.com/AdityaNG/kitti_iterator/actions/workflows/pypi.yml/badge.svg)
![pytest workflow](https://github.com/AdityaNG/kitti_iterator/actions/workflows/pytest.yml/badge.svg)

Example usage:

```python
from kitti_iterator import kitti_multimodal_iterator

# Load in the mini dataset
k_raw = KittiRaw(
    kitti_raw_base_path="kitti_raw_mini",
    date_folder="2011_09_26",
    sub_folder="2011_09_26_drive_0001_sync"
)

# Iterate
for data in k_raw:
    image_00, image_01, image_02, image_03, velodyine_points, occupancy_grid = data

# Indexing
image_00, image_01, image_02, image_03, velodyine_points, occupancy_grid = k_raw[3]
```

## Install

```bash
pip install kitti_iterator
```

To install the latest (might be unstable):
```bash
pip install git+https://github.com/AdityaNG/kitti_iterator
```

## Dataset Structre

Download the full dataset at <a href="https://www.cvlibs.net/datasets/kitti/raw_data.php">www.cvlibs.net/datasets/kitti/raw_data.php</a>

```bash
kitti_raw_mini/
└── 2011_09_26
    ├── 2011_09_26_drive_0001_sync
    │   ├── image_00
    │   │   ├── data
    │   │   │   ├── 0000000000.png
    │   │   │   ├── 0000000001.png
    │   │   │   ├── 0000000002.png
    │   │   │   ├── 0000000003.png
    │   │   │   └── 0000000004.png
    │   │   └── timestamps.txt
    │   ├── image_01
    │   │   ├── data
    │   │   │   ├── 0000000000.png
    │   │   │   ├── 0000000001.png
    │   │   │   ├── 0000000002.png
    │   │   │   ├── 0000000003.png
    │   │   │   └── 0000000004.png
    │   │   └── timestamps.txt
    │   ├── image_02
    │   │   ├── data
    │   │   │   ├── 0000000000.png
    │   │   │   ├── 0000000001.png
    │   │   │   ├── 0000000002.png
    │   │   │   ├── 0000000003.png
    │   │   │   └── 0000000004.png
    │   │   └── timestamps.txt
    │   ├── image_03
    │   │   ├── data
    │   │   │   ├── 0000000000.png
    │   │   │   ├── 0000000001.png
    │   │   │   ├── 0000000002.png
    │   │   │   ├── 0000000003.png
    │   │   │   └── 0000000004.png
    │   │   └── timestamps.txt
    │   ├── oxts
    │   │   ├── data
    │   │   │   ├── 0000000000.txt
    │   │   │   ├── 0000000001.txt
    │   │   │   ├── 0000000002.txt
    │   │   │   ├── 0000000003.txt
    │   │   │   └── 0000000004.txt
    │   │   ├── dataformat.txt
    │   │   └── timestamps.txt
    │   └── velodyne_points
    │       ├── data
    │       │   ├── 0000000000.bin
    │       │   ├── 0000000001.bin
    │       │   ├── 0000000002.bin
    │       │   ├── 0000000003.bin
    │       │   └── 0000000004.bin
    │       ├── timestamps_end.txt
    │       ├── timestamps_start.txt
    │       └── timestamps.txt
    ├── calib_cam_to_cam.txt
    ├── calib_imu_to_velo.txt
    └── calib_velo_to_cam.txt
```
uni-char-count-VVS 0.0.1
A small app, that count unique character in string
Requires Python: >=3.7

# Unique_characters_count

App that count unique characters in the string.

Works as an imported module and also through command line arguments.

As an imported module usage:
number_of_uni_char('your_string')
number_of_uni_chars('list_of_your_string')

Command line usage:
"--string 'your string'"
"--file 'patch to you file, that contains the string'"

-- Added by Vitaly Solomatin 12.12.2022. Thanks to Eugene Chernyshov for finding the correct way.

'Dev, email': veha1337@gmail.com
'Dev, git': https://git.foxminded.com.ua/foxstudent103470/task-5-create-the-python-package
al-utils-almirai 0.1.0
Python common basic utilities for almirai projects.
Requires Python: >=3.6

# Python common utils

## async lrc cache

LRU cache for asyncio

[async_lru 1.0.3](https://pypi.org/project/async-lru/)

```python
from al_utils.alru import alru_cache

@alru_cache(maxsize=128, typed=False)
def test():
    pass
```

## sync to async

Make sync function as async

```python
from al_utils.async_util import async_wrap

@async_wrap
def test():
    pass

# equals to
async_wrap(test())

# equals to
async def test():
    pass
```

## async to sync

Make async function as sync

```python
from al_utils.async_util import run_async
@run_async
async def test():
    pass

# equals to
run_async(test())

# equals to
def test():
    pass
```

## logger

Create logger easier to print log to console and save logs at the same time.

Logger name is current package name split by dot.

It contains a default logger config.

It will save infos to `./logs/info/` and errors to `./logs/error/`. Log files split in each week.

```py
from al_utils.logger import Logger

logger = Logger(class_name='').logger
```

## singleton

Singleton container.

Support multiple container.

```py
from al_utils.singleton import Singleton

# set class to container
class Test(Singleton):
    pass


from al_utils.singleton import resolve

test = resolve(Test)
```

If meta class conflict, using `merge_meta` to resolve it.

```py
from al_utils.singleton import Singleton
from al_utils.meta import merge_meta

class Test(merge_meta(Singleton, AnothClass)):
    pass
```

Or, without extends, add class or instance in low-level functions.

```py
from al_utils.singleton import add, add_type

class Test1:
    pass

test1 = Test1()
add(test1)

class Test2:
    pass

add_type(Test2)
```

## print colored messages

Print message to console with custome color(text color, background color) and style(light, normal, bold, ...)

```py
from al_utils.console import ColoredConsole

# light
ColoredConsole.debug('This is a debug.')
# green
ColoredConsole.success('This is a success.')
# yellow
ColoredConsole.warn('This is a warning.')
# red, stderr
ColoredConsole.error('This is a error.')

# custome colored text

# set io(stdout or stderr) start colored.
ColoredConsole.set(style, text_color, bg_color, io)

# print custome colored text
ColoredConsole.print('Costome color text.')

# unset, clear all style and color sets.
ColoredConsole.unset(io)
```
figment-tut-zh 2022.12.12.0
Figment 中文系列教程
Requires Python: >=3.6

# Figment 中文系列教程

> 原文：[Figment Tutorials](https://learn.figment.io/tutorials)
> 
> 协议：[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
> 
> 阶段：机翻（1）
> 
> 勇敢的人你可愿，为这份信念肩并肩？在这街垒的那一边，光明的未来可望见。你可听到这歌声？听鼓声在远方回响。未来与新希望同在，曙光在前方。——《悲惨世界》终曲
> 
> 列に入れよ、我らの味方に。砦の向こうに、憧れの世界。皆聞こえるか？ドラムの響が。彼ら夢見た明日が来るよ。
> 
> Will you joinin our crusade? Who will be strong and stand with me? Somewhere beyond the barricade, is there a world you long to see? Do you hear the people sing? Say, do youhear the distant drums? It is the future that they bring when tomorrow comes!

* [在线阅读](https://figment.apachecn.org)
* [在线阅读（Gitee）](https://apachecn.gitee.io/doc-template/)
* [ApacheCN 学习资源](http://docs.apachecn.org/)
* [ApacheCN 翻译校对兼职群 713436582](https://jq.qq.com/?_wv=1027&k=VSNtgpjb)

## 贡献指南

为了不断改进翻译质量，我们特此启动了【翻译、校对、笔记整理活动】，开设了多个校对项目。贡献者校对一章之后可以领取千字2\~4元的奖励。进行中的校对活动请见[活动列表](https://home.apachecn.org/#/docs/activity/docs-activity)。更多详情请联系飞龙（Q562826179，V:wizardforcel）。

## 联系方式

### 负责人

* [飞龙](https://github.com/wizardforcel): 562826179

### 其他

*   在我们的 [apachecn/figment-tut-zh](https://github.com/apachecn/figment-tut-zh) github 上提 issue.
*   发邮件到 Email: `apachecn@163.com`.
*   在我们的 [组织学习交流群](https://www.apachecn.org/#/docs/join) 中联系群主/管理员即可.

## 下载

### Docker

```
docker pull apachecn0/figment-tut-zh
docker run -tid -p <port>:80 apachecn0/figment-tut-zh
# 访问 http://localhost:{port} 查看文档
```

### PYPI

```
pip install figment-tut-zh
figment-tut-zh <port>
# 访问 http://localhost:{port} 查看文档
```

### NPM

```
npm install -g figment-tut-zh
figment-tut-zh <port>
# 访问 http://localhost:{port} 查看文档
```

## 其它协议

霞鹜文楷采用 [SIL 开放字体协议 1.1](https://github.com/lxgw/LxgwWenKai/blob/main/SIL_Open_Font_License_1.1.txt)。

## 赞助我们

![](http://data.apachecn.org/img/about/donate.jpg)