Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koxudaxi/pydantic-pycharm-plugin
PyCharm plugin for pydantic. This plugin provides autocompletion, inspection, type-checking, inserting unfilled argument, and more.
https://github.com/koxudaxi/pydantic-pycharm-plugin
autocomplete fastapi inspection intellij intellij-plugin jetbrains kotlin pycharm pycharm-plugin pydantic
Last synced: about 17 hours ago
JSON representation
PyCharm plugin for pydantic. This plugin provides autocompletion, inspection, type-checking, inserting unfilled argument, and more.
- Host: GitHub
- URL: https://github.com/koxudaxi/pydantic-pycharm-plugin
- Owner: koxudaxi
- License: mit
- Created: 2019-07-15T15:41:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T16:19:43.000Z (3 months ago)
- Last Synced: 2024-10-29T17:35:34.665Z (3 months ago)
- Topics: autocomplete, fastapi, inspection, intellij, intellij-plugin, jetbrains, kotlin, pycharm, pycharm-plugin, pydantic
- Language: Kotlin
- Homepage: https://koxudaxi.github.io/pydantic-pycharm-plugin/
- Size: 7.31 MB
- Stars: 455
- Watchers: 5
- Forks: 16
- Open Issues: 70
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-pydantic - Pydantic PyCharm Plugin - A JetBrains PyCharm plugin for pydantic. (Utilities)
- awesome-pydantic - Pydantic PyCharm Plugin - A JetBrains PyCharm plugin for pydantic. (Utilities)
README
# Pydantic PyCharm Plugin
[![Build](https://github.com/koxudaxi/pydantic-pycharm-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/koxudaxi/pydantic-pycharm-plugin/actions/workflows/build.yml)
[![](https://img.shields.io/jetbrains/plugin/v/12861)](https://plugins.jetbrains.com/plugin/12861-pydantic)
![JetBrains IntelliJ plugins](https://img.shields.io/jetbrains/plugin/d/12861-pydantic)
![JetBrains IntelliJ Plugins](https://img.shields.io/jetbrains/plugin/r/rating/12861-pydantic)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)[A JetBrains PyCharm plugin](https://plugins.jetbrains.com/plugin/12861-pydantic) for [`pydantic`](https://github.com/samuelcolvin/pydantic).
## Interview
I got interviewed about this plugin for [JetBrains' PyCharm Blog](https://blog.jetbrains.com/pycharm/2020/04/interview-koudai-aono-author-of-pydantic-plugin-for-pycharm/).## Help
See [documentation](https://koxudaxi.github.io/pydantic-pycharm-plugin/) for more details.## Sponsors
[![JetBrains](https://avatars.githubusercontent.com/u/60931315?s=200&v=4)](https://github.com/JetBrainsOfficial)## Quick Installation
The plugin is in Jetbrains repository ([Pydantic Plugin Page](https://plugins.jetbrains.com/plugin/12861-pydantic))
You can install the stable version on PyCharm's `Marketplace` (Preference -> Plugins -> Marketplace) [Official Documentation](https://www.jetbrains.com/help/idea/managing-plugins.html)
**The plugin requires PyCharm 2020.2 or later (include other JetBrains IDEs)**
![search plugin](https://raw.githubusercontent.com/koxudaxi/pydantic-pycharm-plugin/main/docs/search_plugin.png)
## Demo
![demo1](https://raw.githubusercontent.com/koxudaxi/pydantic-pycharm-plugin/main/docs/demo1.gif)## 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](https://koxudaxi.github.io/pydantic-pycharm-plugin/type-checking/)
* 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](https://github.com/tiangolo/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](https://plugins.jetbrains.com/plugin/12861-pydantic)### Motivation
[Auto-completion when instantiating BaseModel objects #650](https://github.com/samuelcolvin/pydantic/issues/650)### Other PyCharm plugin projects
[Poetry PyCharm Plugin](https://github.com/koxudaxi/poetry-pycharm-plugin/)## This project is currently in an experimental phase