--- id: bump-pydantic version: "0.8.0" license: unclear license_treatment: permissive maintenance: abandoned --- # bump-pydantic — Convert Pydantic from V1 to V2 ♻ License: permissive · Maintenance: abandoned · Downloads: 229.3K/mo ## What it is and what it does Bump Pydantic is a command-line tool that automates the migration of Pydantic V1 code to V2 by applying nine transformation rules (BP001–BP009). It handles common refactoring tasks such as replacing the Config class with model_config, updating Field parameters, converting validators to their V2 equivalents, and replacing deprecated constraint functions with Annotated types. The tool uses libcst for safe AST-based code transformation and provides a --diff flag to preview changes before applying them. The tool is designed for developers maintaining Pydantic V1 projects who need to upgrade to V2 but face large codebases where manual refactoring is impractical. It covers the majority of straightforward migration patterns, though complex custom types and protocol functions may require manual follow-up (flagged with TODO comments). The project is archived and no longer actively maintained, so it will not evolve with future Pydantic V2 releases. Use it for: - Bulk-migrate a Pydantic V1 codebase to V2 by running the tool on your package directory and reviewing the generated diff. - Automate replacement of Config classes with model_config and Field parameter updates across multiple files. - Convert V1 validators (@validator, @root_validator) to their V2 equivalents (@field_validator, @model_validator) in one pass. - Replace constraint functions (constr, conint, etc.) with Annotated type hints across a large project. - Identify and mark custom type methods (__get_validators__, __modify_schema__) that require manual V2 migration with TODO comments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A CLI tool that automatically refactors Pydantic V1 code to V2 by applying targeted transformation rules to imports, field definitions, validators, and configuration patterns. Yes, if you have a Pydantic V1 codebase to migrate and need to automate routine refactoring tasks. The tool handles the majority of straightforward patterns and is low-friction to install. However, be aware that the project is archived and no longer maintained—it will not adapt to new Pydantic V2 features or Python versions, and complex migrations may still require manual work. Use it as a starting point rather than a complete solution. ## Install pip install bump-pydantic uv add bump-pydantic poetry add bump-pydantic ## Installing bump-pydantic Before you install: Low install friction with a pure-Python wheel and four lightweight dependencies. However, the project is archived and has not been updated since late 2023, meaning it will not receive fixes for new Pydantic V2 patterns or Python versions beyond 3.12. License in practice: MIT license (permissive) allows free use, modification, and distribution with minimal restrictions, suitable for both open-source and commercial projects. Quickstart: pip install bump-pydantic bump-pydantic /path/to/my_package # Or check diff first: bump-pydantic --diff /path/to/my_package Requires Python 3.8 or later; the tool operates on source files in place or via diff, so a version control system is recommended to review and revert changes if needed. Verify before relying: - Whether the tool correctly handles all edge cases in real-world Pydantic V1 codebases, given the project is no longer maintained. - Performance and accuracy on large projects with complex validator chains or custom type definitions. - Compatibility with Pydantic V2 minor versions released after the tool's last update in December 2023. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 229.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pydantic v1 to v2 migration, pydantic code refactoring tool, automated pydantic upgrade, pydantic v2 migration cli, convert pydantic models v1 v2, pydantic-migration, code-refactoring, cli-tool [View on SkillFed](https://skillfed.io/packages/bump-pydantic) · [View on PyPI](https://pypi.org/project/bump-pydantic/)