Skip to content
プロジェクト

koxudaxi/pydantic-pycharm-plugin

GitHubで見る

概要

pydantic用のPyCharmプラグインです。コード補完、検査、型チェック、未入力の引数の挿入などに対応しています。

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
+1
7日間
+1
15日間
+2
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Pydantic PyCharm Plugin

Build JetBrains IntelliJ plugins JetBrains IntelliJ Plugins License: MIT

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 Logo

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)

search plugin

Demo

demo1

Features

Implemented

pydantic.BaseModel

  • Model-specific __init__-signature inspection and autocompletion for subclasses of pydantic.BaseModel
  • Model-specific __init__-arguments type-checking for subclasses of pydantic.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.)
  • Search related-fields by class attributes and keyword arguments of __init__ with Ctrl+B and Cmd+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 Field and constr are treated as Python's regex string literals
  • Config/ConfigDict support
    • Auto-completion for Config/ConfigDict
    • Read Model config such frozen=True from Config/ConfigDict
  • validator/field_validator support
    • respect first argument is cls of 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

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.dataclass as third-party dataclass.)

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

Pydantic Plugin Page

Motivation

Auto-completion when instantiating BaseModel objects #650

Other PyCharm plugin projects

Poetry PyCharm Plugin

This project is currently in an experimental phase

関連プロジェクトを探す

読み込み中…