itemadapter
Common interface for data container classes
Decision gist · record as of 2026-08-14
Yes. ItemAdapter is actively maintained, has no runtime dependencies, installs with low friction, carries no security vulnerabilities, and solves a real problem for anyone working with multiple data container types. It's particularly valuable in Scrapy projects but useful anywhere you need a uniform interface across dicts, dataclasses, attrs, and pydantic models.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9+; optional dependencies (scrapy, attrs, pydantic) needed only if working with those specific item types.
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained with recent commits; last release 218 days ago.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
last release 2026-01-08 (218 days) · last repo commit 2026-08-08 · 69 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,948,020 downloads/mo, #2,812 on PyPI
Alternatives
Verify before relying
from dataclasses import dataclass
from itemadapter import ItemAdapter
@dataclass
class Item:
name: str
price: float
obj = Item(name='foo', price=20.5)
adapter = ItemAdapter(obj)
adapter['name'] = 'bar'
print(adapter.asdict())- Whether the package is actively used in production Scrapy pipelines or primarily in standalone data-handling contexts.
- Performance characteristics when adapting deeply nested or large item structures.
What it is and what it does
ItemAdapter is a wrapper class that normalizes access to different data container types—dicts, dataclasses, attrs objects, pydantic models, and Scrapy items—under a single dict-like interface. You wrap an object in ItemAdapter and then read, modify, and query it using standard dictionary operations (indexing, get, update, len) regardless of whether the underlying object is a plain dict, a dataclass, or a Scrapy Item.
The package is designed for code that needs to handle multiple container types uniformly, particularly in data pipelines and web scraping workflows. It implements Python's MutableMapping protocol, so adapters feel like dictionaries. It also provides utility methods like asdict() for recursive conversion to plain dicts, and class-level methods to inspect field names and metadata from item classes before instantiation.
Use it for
- Normalize access to Scrapy items and plain dicts in a single pipeline without type-checking branches.
- Build generic data transformation code that works with dataclasses, attrs, or pydantic models interchangeably.
- Extract and convert nested item structures to plain dicts for JSON serialization or logging.
- Inspect field metadata and names from dataclass or pydantic models at runtime for validation or schema generation.
- Write middleware or utilities that accept multiple item types and treat them uniformly.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
ItemAdapter is actively maintained, has no runtime dependencies, installs with low friction, carries no security vulnerabilities, and solves a real problem for anyone working with multiple data container types. It's particularly valuable in Scrapy projects but useful anywhere you need a uniform interface across dicts, dataclasses, attrs, and pydantic models.
Install
itemadapter on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits; last release 218 days ago.
Requires Python 3.9+; optional dependencies (scrapy, attrs, pydantic) needed only if working with those specific item types.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
from dataclasses import dataclass
from itemadapter import ItemAdapter
@dataclass
class Item:
name: str
price: float
obj = Item(name='foo', price=20.5)
adapter = ItemAdapter(obj)
adapter['name'] = 'bar'
print(adapter.asdict())
Verify before relying
- Whether the package is actively used in production Scrapy pipelines or primarily in standalone data-handling contexts.
- Performance characteristics when adapting deeply nested or large item structures.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 218 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,948,020 / month, #2,812 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaFramework :: ScrapyIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python Modules |
Evidence: itemadapter-0.13.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “uniform interface for data containers”
- itemadapterItemAdapter wraps data container objects (dicts, dataclasses, attrs,…
- slicerProvides a uniform slicing interface for tensor-like objects (numpy,…
- colorcetColorcet provides a collection of perceptually uniform colormaps…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also itemloaders · dataclass-factory · adaptix · jax-dataclasses · databind.json · databind · databind.core · serpyco-rs · dataclass-wizard · pyserde