[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2187":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":15,"starSnapshotCount":15,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},2187,"pydantic","pydantic\u002Fpydantic","Data validation using Python type hints","https:\u002F\u002Fpydantic.dev\u002Fdocs\u002Fvalidation",null,"Python",28010,2688,141,528,0,10,72,281,53,120,"MIT License",false,"main",[25,26,27,5,28,29,30,31,32,33,34],"hints","json-schema","parsing","python","python310","python311","python312","python313","python39","validation","2026-06-12 04:00:13","# Pydantic Validation\n\n[![CI](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fpydantic\u002Fpydantic\u002Fci.yml?branch=main&logo=github&label=CI)](https:\u002F\u002Fgithub.com\u002Fpydantic\u002Fpydantic\u002Factions?query=event%3Apush+branch%3Amain+workflow%3ACI)\n[![Coverage](https:\u002F\u002Fcoverage-badge.samuelcolvin.workers.dev\u002Fpydantic\u002Fpydantic.svg)](https:\u002F\u002Fcoverage-badge.samuelcolvin.workers.dev\u002Fredirect\u002Fpydantic\u002Fpydantic)\n[![pypi](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fpydantic.svg)](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fpydantic)\n[![CondaForge](https:\u002F\u002Fimg.shields.io\u002Fconda\u002Fv\u002Fconda-forge\u002Fpydantic.svg)](https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Fpydantic)\n[![downloads](https:\u002F\u002Fstatic.pepy.tech\u002Fbadge\u002Fpydantic\u002Fmonth)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fpydantic)\n[![versions](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fpydantic.svg)](https:\u002F\u002Fgithub.com\u002Fpydantic\u002Fpydantic)\n[![license](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fpydantic\u002Fpydantic.svg)](https:\u002F\u002Fgithub.com\u002Fpydantic\u002Fpydantic\u002Fblob\u002Fmain\u002FLICENSE)\n[![Pydantic v2](https:\u002F\u002Fimg.shields.io\u002Fendpoint?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fpydantic\u002Fpydantic\u002Fmain\u002Fdocs\u002Fbadge\u002Fv2.json)](https:\u002F\u002Fdocs.pydantic.dev\u002Flatest\u002Fcontributing\u002F#badges)\n[![llms.txt](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fllms.txt-green)](https:\u002F\u002Fdocs.pydantic.dev\u002Flatest\u002Fllms.txt)\n\nData validation using Python type hints.\n\nFast and extensible, Pydantic plays nicely with your linters\u002FIDE\u002Fbrain.\nDefine how data should be in pure, canonical Python 3.10+; validate it with Pydantic.\n\n## Pydantic Logfire :fire:\n\nWe've launched Pydantic Logfire to help you monitor your applications.\n[Learn more](https:\u002F\u002Fpydantic.dev\u002Flogfire\u002F?utm_source=pydantic_validation)\n\n## Pydantic V1.10 vs. V2\n\nPydantic V2 is a ground-up rewrite that offers many new features, performance improvements, and some breaking changes compared to Pydantic V1.\n\nIf you're using Pydantic V1 you may want to look at the\n[pydantic V1.10 Documentation](https:\u002F\u002Fdocs.pydantic.dev\u002F) or,\n[`1.10.X-fixes` git branch](https:\u002F\u002Fgithub.com\u002Fpydantic\u002Fpydantic\u002Ftree\u002F1.10.X-fixes). Pydantic V2 also ships with the latest version of Pydantic V1 built in so that you can incrementally upgrade your code base and projects: `from pydantic import v1 as pydantic_v1`.\n\n## Help\n\nSee [documentation](https:\u002F\u002Fdocs.pydantic.dev\u002F) for more details.\n\n## Installation\n\nInstall using `pip install -U pydantic` or `conda install pydantic -c conda-forge`.\nFor more installation options to make Pydantic even faster,\nsee the [Install](https:\u002F\u002Fdocs.pydantic.dev\u002Finstall\u002F) section in the documentation.\n\n## A Simple Example\n\n```python\nfrom datetime import datetime\nfrom typing import Optional\nfrom pydantic import BaseModel\n\nclass User(BaseModel):\n    id: int\n    name: str = 'John Doe'\n    signup_ts: Optional[datetime] = None\n    friends: list[int] = []\n\nexternal_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}\nuser = User(**external_data)\nprint(user)\n#> User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]\nprint(user.id)\n#> 123\n```\n\n## Contributing\n\nFor guidance on setting up a development environment and how to make a\ncontribution to Pydantic, see\n[Contributing to Pydantic](https:\u002F\u002Fdocs.pydantic.dev\u002Fcontributing\u002F).\n\n## Reporting a Security Vulnerability\n\nSee our [security policy](https:\u002F\u002Fgithub.com\u002Fpydantic\u002Fpydantic\u002Fsecurity\u002Fpolicy).\n","Pydantic 是一个用于数据验证的 Python 库，利用 Python 的类型注解来确保数据结构符合预期。其核心功能包括快速的数据解析与验证、支持复杂的嵌套结构以及与 Python 3.10+ 版本的良好兼容性。此外，Pydantic V2 提供了更多新特性及性能优化，并且可以与旧版本共存以实现平滑过渡。该库非常适合需要处理外部输入（如 API 请求）的应用场景，能够有效防止因数据格式错误导致的问题，同时提高开发效率和代码质量。",2,"2026-06-11 02:48:42","top_language"]