Components
These classes are used to map data within items, and are not tied to any specific item type.
- class zyte_common_items.AdditionalProperty(**kwargs)
A name-value pair.
- class zyte_common_items.Address(**kwargs)
Address item.
- addressCountry: str | None
The country the place is located in.
The country name or the ISO 3166-1 alpha-2 country code.
- class zyte_common_items.AggregateRating(**kwargs)
Aggregate data about reviews and ratings.
At least one of
ratingValue
orreviewCount
is required.
- class zyte_common_items.Amenity(**kwargs)
An amenity that a business place has
- class zyte_common_items.Audio(**kwargs)
Audio.
See
Article.audios
.
- class zyte_common_items.Author(**kwargs)
Author of an article.
See
Article.authors
.
- class zyte_common_items.BaseSalary(**kwargs)
Base salary of a job offer.
- class zyte_common_items.Brand(**kwargs)
Brand.
See
Product.brand
.
- class zyte_common_items.Breadcrumb(**kwargs)
A breadcrumb from the breadcrumb trail of a webpage.
See
Product.breadcrumbs
.
- class zyte_common_items.Gtin(**kwargs)
GTIN type-value pair.
See
Product.gtin
.
- class zyte_common_items.Header(**kwargs)
An HTTP header
- class zyte_common_items.HiringOrganization(**kwargs)
Organization that is hiring for a job offer.
- class zyte_common_items.Image(**kwargs)
Image.
See for example
Product.images
andProduct.mainImage
.
- class zyte_common_items.JobLocation(**kwargs)
Location of a job offer.
- class zyte_common_items.Link(**kwargs)
A link from a webpage to another webpage.
- class zyte_common_items.NamedLink(**kwargs)
A link from a webpage to another webpage.
- class zyte_common_items.OpeningHoursItem(**kwargs)
Specification of opening hours of a business place.
- class zyte_common_items.ParentPlace(**kwargs)
If the place is located inside another place, these are the details of the parent place.
- class zyte_common_items.ProbabilityRequest(**kwargs)
A
Request
that includes a probability value.- metadata: ProbabilityMetadata | None
Data extraction process metadata.
- class zyte_common_items.Reactions(**kwargs)
Details of reactions to a post.
- class zyte_common_items.RealEstateArea(**kwargs)
Area of a place, with type, units, value and raw value.
- class zyte_common_items.Request(**kwargs)
Describe a web request to load a page
- cast(cls: Type[RequestT]) RequestT
Convert value, an instance of
Request
or a subclass, into cls, a different class that is also eitherRequest
or a subclass.
- to_scrapy(callback, **kwargs)
Convert a request to scrapy.Request. All kwargs are passed to scrapy.Request as-is.
- class zyte_common_items.SocialMediaPostAuthor(**kwargs)
Details of the author of a social media post.
- class zyte_common_items.StarRating(**kwargs)
Official star rating of a place.
- class zyte_common_items.Topic(**kwargs)
Topic that is discussed on the page.
- class zyte_common_items.Url(**kwargs)
A URL.
- class zyte_common_items.Video(**kwargs)
Video.
See
Article.videos
.
Item metadata components
- class zyte_common_items.Metadata(**kwargs)
Bases:
SearchMetadata
Generic metadata class.
It defines all attributes of metadata classes for specific item types, so that it can be used during extraction instead of a more specific class, and later converted to the corresponding, more specific metadata class.
- dateDownloaded: str | None
Date and time when the product data was downloaded, in UTC timezone and the following format:
YYYY-MM-DDThh:mm:ssZ
.
- probability: float | None
The probability (0 for 0%, 1 for 100%) that the resource features the expected data type.
For example, if the extraction of a product from a given URL is requested, and that URL points to the webpage of a product with complete certainty, the value should be 1. If with complete certainty the webpage features a job listing instead of a product, the value should be 0. When there is no complete certainty, the value could be anything in between (e.g. 0.96).
- class zyte_common_items.ProbabilityMetadata(**kwargs)
Bases:
BaseMetadata
Data extraction process metadata.
- probability: float | None
The probability (0 for 0%, 1 for 100%) that the resource features the expected data type.
For example, if the extraction of a product from a given URL is requested, and that URL points to the webpage of a product with complete certainty, the value should be 1. If with complete certainty the webpage features a job listing instead of a product, the value should be 0. When there is no complete certainty, the value could be anything in between (e.g. 0.96).
- class zyte_common_items.ListMetadata(**kwargs)
Bases:
BaseMetadata
Minimal metadata for list item classes, such as ProductList or ArticleList.
See
ArticleList.metadata
.
- class zyte_common_items.DetailsMetadata(**kwargs)
Bases:
ListMetadata
Minimal metadata for details item classes, such as Product or Article.
- dateDownloaded: str | None
Date and time when the product data was downloaded, in UTC timezone and the following format:
YYYY-MM-DDThh:mm:ssZ
.
- probability: float | None
The probability (0 for 0%, 1 for 100%) that the resource features the expected data type.
For example, if the extraction of a product from a given URL is requested, and that URL points to the webpage of a product with complete certainty, the value should be 1. If with complete certainty the webpage features a job listing instead of a product, the value should be 0. When there is no complete certainty, the value could be anything in between (e.g. 0.96).
- class zyte_common_items.SearchMetadata(**kwargs)
Bases:
DetailsMetadata
Minimal metadata for classes of items that can declare search metadata.
- dateDownloaded: str | None
Date and time when the product data was downloaded, in UTC timezone and the following format:
YYYY-MM-DDThh:mm:ssZ
.
- probability: float | None
The probability (0 for 0%, 1 for 100%) that the resource features the expected data type.
For example, if the extraction of a product from a given URL is requested, and that URL points to the webpage of a product with complete certainty, the value should be 1. If with complete certainty the webpage features a job listing instead of a product, the value should be 0. When there is no complete certainty, the value could be anything in between (e.g. 0.96).
Typing
- class zyte_common_items.components.metadata.MetadataT
TypeVar
forBaseMetadata
.alias of TypeVar(‘MetadataT’, bound=
BaseMetadata
)