Giter Club home page Giter Club logo

pydantic-pycharm-plugin's Introduction

Pydantic PyCharm Plugin

Build Status 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.

Quick Installation

The plugin is in Jetbrains repository (Pydantic Plugin Page)

You can install the stable version on PyCharm's Marketplace (Preference -> Plugins -> Marketplace) Offical Document

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

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.)
    • Exclude a feature which is inserting unfilled arguments with a QuickFix

pydantic.create_model [experimental]

  • Support minimum features for a model which is created by create_model

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.