Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release notes for 0.23.0. #220

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changes
=======

0.23.0 (YYYY-MM-DD)
-------------------

* Added support for :ref:`custom attribute extraction <custom-attrs>`.
* Added the :class:`~scrapy_zyte_api.LocationSessionConfig` class.

0.22.1 (2024-08-30)
-------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/reference/inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ Built-in input annotations
:members:

.. autofunction:: scrapy_zyte_api.actions

.. autofunction:: scrapy_zyte_api.custom_attrs
9 changes: 5 additions & 4 deletions docs/usage/scrapy-poet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ Custom attribute extraction
---------------------------

You can request custom attribute extraction by using either a
:class:`scrapy_zyte_api.CustomAttributes` dependency (if you need both the
:class:`zyte_common_items.CustomAttributes` dependency (if you need both the
attribute values and the attribute extraction metadata) or a
:class:`scrapy_zyte_api.CustomAttributesValues` dependency (if you only need
:class:`zyte_common_items.CustomAttributesValues` dependency (if you only need
the values). You need to annotate it with input data as a dictionary and, if
needed, a dictionary with extraction options. You should use the
:func:`scrapy_zyte_api.custom_attrs` function to create the annotation:
Expand All @@ -148,7 +148,8 @@ needed, a dictionary with extraction options. You should use the

from typing import Annotated

from scrapy_zyte_api import CustomAttributes, custom_attrs
from scrapy_zyte_api import custom_attrs
from zyte_common_items import CustomAttributes


@attrs.define
Expand All @@ -168,7 +169,7 @@ You can then access the results as the dependency value:

def parse_page(self, response: DummyResponse, page: MyPageObject):
...
for k, v in page.custom_attributes.items():
for k, v in page.custom_attributes.values.items():
...


Expand Down