{"repo":"scrapy/itemadapter","free":true,"listed":false,"github":"https://github.com/scrapy/itemadapter","clone":"git clone https://github.com/scrapy/itemadapter.git","description":"Common interface for data container classes","language":"Python","stars":69,"topics":["python","python3","scrapy","python-dataclasses","python-attrs","metadata","hacktoberfest"],"license":"BSD-3-Clause","category":"deployment-docker-iac","readme_excerpt":"itemadapter The ItemAdapter class is a wrapper for data container objects, providing a common interface to handle objects of different types in an uniform manner, regardless of their underlying implementation. Currently supported types are: scrapy.item.Item dict dataclass -based classes attrs -based classes pydantic -based classes Additionally, interaction with arbitrary types is supported, by implementing a pre-defined interface (see extending itemadapter ). --- Requirements Python 3.10+, either the CPython implementation (default) or the PyPy implementation scrapy 2.2+: optional, needed to interact with scrapy items attrs 20.1.0+: optional, needed to interact with attrs -based items pydantic 1.8+: optional, needed to interact with pydantic -based items --- Installation itemadapter is available on PyPI , it can be installed with pip : For attrs , pydantic and scrapy support, install the corresponding extra to ensure that a supported version of the corresponding dependencies is installed. For example: Mind that you can install multiple extras as needed. For example: --- License itemadapter is distributed under a BSD-3 license. --- Basic usage The following is a simple example using a dataclass object. Consider the following type definition: An ItemAdapter object can be treated much like a dictionary: The wrapped object is modified in-place: Converting to dict The ItemAdapter class provides the asdict method, which converts nested items recursively. Consider the following exam","default_branch":null,"files":null,"tree":[],"storefront":"/r/scrapy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/scrapy/itemadapter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}