class documentation

class Item(MutableMapping, object_ref): (source)

View In Hierarchy

Base class for scraped items. In Scrapy, an object is considered an ``item`` if it is an instance of either :class:`Item` or :class:`dict`, or any subclass. For example, when the output of a spider callback is evaluated, only instances of :class:`Item` or :class:`dict` are passed to :ref:`item pipelines <topics-item-pipeline>`. If you need instances of a custom class to be considered items by Scrapy, you must inherit from either :class:`Item` or :class:`dict`. Items must declare :class:`Field` attributes, which are processed and stored in the ``fields`` attribute. This restricts the set of allowed field names and prevents typos, raising ``KeyError`` when referring to undefined fields. Additionally, fields can be used to define metadata and control the way data is processed internally. Please refer to the :ref:`documentation about fields <topics-items-fields>` for additional information. Unlike instances of :class:`dict`, instances of :class:`Item` may be :ref:`tracked <topics-leaks-trackrefs>` to debug memory leaks.

Method __delitem__ Undocumented
Method __getattr__ Undocumented
Method __getitem__ Undocumented
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method __setattr__ Undocumented
Method __setitem__ Undocumented
Method copy Undocumented
Method deepcopy Return a :func:`~copy.deepcopy` of this item.
Method keys Undocumented
Class Variable fields Undocumented
Instance Variable _values Undocumented

Inherited from object_ref:

Method __new__ Undocumented
Class Variable __slots__ Undocumented
def __delitem__(self, key): (source)

Undocumented

def __getattr__(self, name): (source)

Undocumented

def __getitem__(self, key): (source)

Undocumented

def __init__(self, *args, **kwargs): (source)

Undocumented

def __iter__(self): (source)

Undocumented

def __len__(self): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def __setattr__(self, name, value): (source)

Undocumented

def __setitem__(self, key, value): (source)

Undocumented

def copy(self): (source)

Undocumented

def deepcopy(self): (source)

Return a :func:`~copy.deepcopy` of this item.

def keys(self): (source)

Undocumented

fields: Dict[str, Field] = (source)

Undocumented

Undocumented