Registry / devops / ethpm-types

ethpm-types

JSON →
library0.6.31pypypi✓ verified 83d ago

Implementation of EIP-2678 (Ethereum Package Manager types) for building, validating, and consuming Ethereum smart contract packages. Current version 0.6.31, weekly releases on PyPI. Requires Python >=3.10, <4.

pip install ethpm-types
INSTALL
IMPORT
SIG · ETHPM-TYPES
E
ethpm-types
devopspythonv0.6.31
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

PackageMeta
from ethpm_types import PackageMeta
standard import path
PNGSource
from ethpm_types.source import PNGSource
import from submodule

Basic usage: load a package manifest JSON and create a validated PackageMeta object.

from ethpm_types import PackageMeta import json # Load a package manifest from a JSON file with open('package.json', 'r') as f: manifest_data = json.load(f) # Create a PackageMeta object (validation happens automatically) pkg = PackageMeta(**manifest_data) print(pkg.name, pkg.version)
Debug
Known issues
breakingv0.6.x dropped support for Python 3.8 and 3.9. If you are still using these versions, pin to ethpm-types<0.6.
fix
Upgrade to Python >=3.10 or use ethpm-types==0.5.x.
affects: >=0.6.0
deprecatedSome source types (e.g., `PNGSource`) were deprecated in v0.6 and may be removed in future releases. Check the migration guide.
fix
Use `from ethpm_types.source import PNGSource` instead of `from ethpm_types.package import PNGSource`.
affects: >=0.6.0
gotchaWhen loading from a JSON string, ensure the data is a dictionary, not a string. `PackageMeta` does not accept a JSON string directly.
fix
Always parse JSON string with `json.loads()` first before passing to `PackageMeta`.
affects: *
Errors
Common errors & fixes
TypeError: PackageMeta() argument after ** must be a mapping, not str
Passing a raw JSON string instead of a dictionary to PackageMeta.
fix
Use `json.loads(json_string)` to convert the string to a dict first.
ImportError: cannot import name 'PNGSource' from 'ethpm_types'
Importing deprecated submodule path.
fix
Use `from ethpm_types.source import PNGSource`.
PydanticValidationError: ... extra fields not permitted ...
The manifest JSON contains unexpected fields not defined in the model.
fix
Validate your manifest against EIP-2678 schema and remove extra fields.
Upgrade
Version history
0.6.31latest on PyPI · released May 29, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources