* fixing coverage by simplifying Annotated import logic, fix #2367 * avoid checking against annotated if it's None * make typing-extensions required WIP * more making typing-extensions required * fix docs and get_origin for python 3.6 * fix mypy test * fix docs * update docs, cleanup and add change * clean docs/examples/schema_annotated.py * move AnnotatedTypeNames
1.8 KiB
Installation is as simple as:
pip install pydantic
pydantic has no required dependencies except python 3.6, 3.7, 3.8, or 3.9,
typing-extensions, and the
dataclasses backport package for python 3.6.
If you've got python 3.6+ and pip installed, you're good to go.
Pydantic is also available on conda under the conda-forge channel:
conda install pydantic -c conda-forge
pydantic can optionally be compiled with cython which should give a 30-50% performance improvement.
Binaries are available from PyPI for Linux, MacOS and 64bit Windows.
If you're installing manually, install cython before installing pydantic and compilation should happen automatically.
To test if pydantic is compiled run:
import pydantic
print('compiled:', pydantic.compiled)
pydantic has three optional dependencies:
- If you require email validation you can add email-validator
- dotenv file support with
Settingsrequires python-dotenv
To install these along with pydantic:
pip install pydantic[email]
# or
pip install pydantic[dotenv]
# or just
pip install pydantic[email,dotenv]
Of course, you can also install these requirements manually with pip install email-validator and/or pip install.
And if you prefer to install pydantic directly from the repository:
pip install git+git://github.com/samuelcolvin/pydantic@master#egg=pydantic
# or with extras
pip install git+git://github.com/samuelcolvin/pydantic@master#egg=pydantic[email,dotenv]