Skip to main content

Use the Elasticsearch DSL with Pydantic models.

Project description

PyPi CI Code coverage Python Issues Commit activity Downloads License

🔍 elasticsearch-pydantic

Use the Elasticsearch DSL with Pydantic models.

This minimal library is for those who...

To interconnect the Elasticsearch DSL and Pydantic, we override a limited set of methods from the Elasticsearch Document and InnerDoc base classes with Pydantic's BaseModel functionality. Elasticsearch field types are inferred from the model's type annotations and can be overridden by using Annotated type hints.

Installation

Install the package from PyPI:

pip install elasticsearch-pydantic

Usage

TODO

Examples

More examples can be found in the examples directory.

Compatibility

This library works fine with any of the following Pip packages installed:

  • elasticsearch8
  • elasticsearch-dsl
  • elasticsearch6-dsl
  • elasticsearch7-dsl
  • elasticsearch8-dsl

The elasticsearch-pydantic library will automatically detect which Elasticsearch DSL is installed.

Development

To build this package and contribute to its development you need to install the build, setuptools and wheel packages:

pip install build setuptools wheel

(On most systems, these packages are already pre-installed.)

Development installation

Install package and test dependencies:

pip install -e .[tests]

Testing

Verify your changes against the test suite to verify.

ruff check .  # Code format and LINT
mypy .        # Static typing
pytest .      # Unit tests

Please also add tests for your newly developed code.

Build wheels

Wheels for this package can be built with:

python -m build

Support

If you have any problems using this package, please file an issue. We're happy to help!

License

This repository is released under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elasticsearch_pydantic-0.1.1.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elasticsearch_pydantic-0.1.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file elasticsearch_pydantic-0.1.1.tar.gz.

File metadata

  • Download URL: elasticsearch_pydantic-0.1.1.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for elasticsearch_pydantic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c36ab0d5b2a221dc4d176d4071e8dc44abc0dc4e7dc84f5c64305c1da9fa72c0
MD5 2db8fdebc7430089135dc53a1796fcb7
BLAKE2b-256 2512843826c1ddab610550d3cce9c8d8469fbc09fed7254328701d0ad04571b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for elasticsearch_pydantic-0.1.1.tar.gz:

Publisher: ci.yml on janheinrichmerker/elasticsearch-pydantic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file elasticsearch_pydantic-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for elasticsearch_pydantic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 623b77963c9326868be21cf4f5c1ad2520b05fbef02ff7243bf48c20f54b03b1
MD5 ccf30deefee973fdf04fac6330e2cee8
BLAKE2b-256 7a6228e4674d94ce258135639ea89ec99b12a6900df0336e3af5c3a60bee8c4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for elasticsearch_pydantic-0.1.1-py3-none-any.whl:

Publisher: ci.yml on janheinrichmerker/elasticsearch-pydantic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page