项目
在 GitHub 查看
koxudaxi/pydantic-pycharm-plugin
关于
适用于 pydantic 的 PyCharm 插件。提供自动补全、检查、类型检查、插入未填写的参数等功能。
网站与应用开发实测星标增长
- 24小时
- +1
- 7天
- +1
- 15天
- +2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Pydantic PyCharm Plugin
A JetBrains PyCharm plugin for pydantic.
Interview
I got interviewed about this plugin for JetBrains' PyCharm Blog.
Help
See documentation for more details.
Sponsors
|
OpenAI |
Quick Installation
The plugin is in Jetbrains repository (Pydantic Plugin Page)
You can install the stable version on PyCharm's Marketplace (Preference -> Plugins -> Marketplace) Official Documentation
The plugin requires PyCharm 2020.2 or later (include other JetBrains IDEs)

Demo

Features
Implemented
pydantic.BaseModel
- Model-specific
__init__-signature inspection and autocompletion for subclasses ofpydantic.BaseModel - Model-specific
__init__-arguments type-checking for subclasses ofpydantic.BaseModel - Refactor support for renaming fields for subclasses of
BaseModel- (If the field name is refactored from the model definition or
__init__call keyword arguments, PyCharm will present a dialog offering the choice to automatically rename the keyword where it occurs in a model initialization call.)
- (If the field name is refactored from the model definition or
- Search related-fields by class attributes and keyword arguments of
__init__withCtrl+BandCmd+B - Provide an inspection for type-checking which is compatible with pydantic. the inspection supports
parsable-type. the detail is at Inspection for type-checking section - Insert unfilled arguments with a QuickFix for subclasses of
pydantic.BaseModel - Support typing.Annotated (PEP 593)
- Regex arguments in
Fieldandconstrare treated as Python's regex string literals - Config/ConfigDict support
- Auto-completion for Config/ConfigDict
- Read Model config such
frozen=Truefrom Config/ConfigDict
- validator/field_validator support
- respect first argument is
clsof the method - Auto-completion for field name arguments of validator/field_validator
- Associate validator/field_validator with field
- Support refactoring/jumping
- Validate field name on validator arguments
- respect first argument is
pydantic.generics.GenericModel
- Support same features as
pydantic.BaseModel- (This plugin version 0.3.1 or later)
pydantic.dataclasses.dataclass
- Support same features as
pydantic.BaseModel- (After PyCharm 2020.2 and this plugin version 0.1.0, PyCharm treats
pydantic.dataclasses.dataclassas third-party dataclass.)
- (After PyCharm 2020.2 and this plugin version 0.1.0, PyCharm treats
pydantic.create_model [experimental]
- Support minimum features for a model which is created by create_model
sqlmodel.SQLModel
- Support same features as
pydantic.BaseModel- (This plugin version 0.3.12 or later)
Supported Pydantic major versions
- v0
- v1
- v2
Contribute
We are waiting for your contributions to pydantic-pycharm-plugin.
Links
JetBrains Plugin Page
Motivation
Auto-completion when instantiating BaseModel objects #650
Other PyCharm plugin projects
This project is currently in an experimental phase
探索相关项目
加载中…