Registry / serialization / emmet-core

emmet-core

JSON →
library0.87.2pypypi✓ verified 23d ago

Emmet Core is the foundational Python library for the Materials Project data ecosystem. It provides Pydantic models and serializers for representing diverse materials science data, including crystallographic structures, VASP calculations, and associated metadata. This library ensures data standardization and interoperability within the materials science domain. It is currently at version 0.86.3, with an active development cycle often releasing pre-release versions.

pip install emmet-core
INSTALL
IMPORT
SIG · EMMET-CORE
E
emmet-core
serializationpythonv0.87.2
Install
31.4s avg
Import
Disk
620MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.85.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 31.4s · import 0.000s · 579MB
620MB installed
● package 620MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MaterialsDoc
from emmet.materials import MaterialsDoc
from emmet.materials import MaterialsDoc

This example demonstrates how to create a basic `MaterialsDoc` instance by first generating a `pymatgen` structure and then populating the Pydantic model with required and some optional fields. This showcases the core data modeling capabilities of `emmet-core`.

from datetime import datetime from pymatgen.core import Structure, Lattice, Species from emmet_core.models.materials import MaterialsDoc # Create a simple structure using pymatgen lattice = Lattice.cubic(4) species = [Species("Fe"), Species("O")] coords = [[0, 0, 0], [0.5, 0.5, 0.5]] structure = Structure(lattice, species, coords) # Create a MaterialsDoc instance material_doc = MaterialsDoc( material_id="mp-12345", structure=structure, formula_pretty="FeO", last_updated=datetime.utcnow(), # Many other fields exist but are optional for a basic doc nsites=len(structure), volume=structure.volume, density=structure.density, nelements=len(structure.composition.elements), elements=[str(el) for el in structure.composition.elements], composition=structure.composition.as_dict(), chemsys="Fe-O", symmetry={"space_group_number": 225, "point_group": "m-3m"} ) print(f"Created MaterialsDoc for {material_doc.formula_pretty} with ID: {material_doc.material_id}") print(f"Structure volume: {material_doc.volume:.2f} Å^3")
Debug
Known issues
breakingEmmet-core requires Python 3.11 or newer. Attempting to install or run with older Python versions will result in dependency resolution failures or runtime errors.
fix
Upgrade your Python environment to 3.11 or later.
affects: <0.86.0
breakingEmmet-core relies exclusively on Pydantic V2 for its data models. If your project uses Pydantic V1, you will encounter compatibility issues, as Pydantic V1 and V2 are not backward-compatible.
fix
Ensure your project's dependencies are compatible with Pydantic V2, or isolate emmet-core in a separate environment if V1 is strictly required elsewhere.
affects: >=0.80.0
gotchaAs a data modeling library for a large scientific project, emmet-core's schemas can evolve. While efforts are made for stability, schema changes may occur, especially in minor or pre-release versions, potentially breaking backward compatibility for stored data.
fix
Always review the changelog when upgrading, particularly for changes in data model fields or types, and validate existing data against new schemas.
affects: All versions
gotchaEmmet-core provides Pydantic models for data structuring. For functionality like data building, API interactions, or database integration (e.g., MongoDB), you typically need to install the broader 'emmet' library or 'emmet-builder', not just 'emmet-core'.
fix
If you need more than just the data models, install `pip install emmet` or `pip install emmet-builder` depending on your use case.
affects: All versions
Upgrade
Version history
0.87.2latest on PyPI · released Aug 17, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.11 or higher.
pydanticrequiredCore data models are built using Pydantic V2.
pymatgenrequiredUsed for crystallographic structures and other materials objects.
montyrequiredCommon utilities library.
Agent activity
21 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
emmet-core — pip install emmet-core · libregistry