Skip to main content

Python interface to Zyte API

Project description

PyPI Version Supported Python Versions Build Status Coverage report

Python client libraries for Zyte API.

Command-line utility and asyncio-based library are provided by this package.

Installation

pip install zyte-api

zyte-api requires Python 3.7+.

API key

Make sure you have an API key for the Zyte API service. You can set ZYTE_API_KEY environment variable with the key to avoid passing it around explicitly.

Read the documentation for more information.

License is BSD 3-clause.

Changes

0.4.8 (2023-11-02)

  • Include the Zyte API request ID value in a new .request_id attribute in zyte_api.aio.errors.RequestError.

0.4.7 (2023-09-26)

  • AsyncClient now lets you set a custom user agent to send to Zyte API.

0.4.6 (2023-09-26)

  • Increased the client timeout to match the server’s.

  • Mentioned the api_key parameter of AsyncClient in the docs example.

0.4.5 (2023-01-03)

  • w3lib >= 2.1.1 is required in install_requires, to ensure that URLs are escaped properly.

  • unnecessary requests library is removed from install_requires

  • fixed tox 4 support

0.4.4 (2022-12-01)

  • Fixed an issue with submitting URLs which contain unescaped symbols

  • New “retrying” argument for AsyncClient.__init__, which allows to set custom retrying policy for the client

  • --dont-retry-errors argument in the CLI tool

0.4.3 (2022-11-10)

  • Connections are no longer reused between requests. This reduces the amount of ServerDisconnectedError exceptions.

0.4.2 (2022-10-28)

  • Bump minimum aiohttp version to 3.8.0, as earlier versions don’t support brotli decompression of responses

  • Declared Python 3.11 support

0.4.1 (2022-10-16)

  • Network errors, like server timeouts or disconnections, are now retried for up to 15 minutes, instead of 5 minutes.

0.4.0 (2022-09-20)

  • Require to install Brotli as a dependency. This changes the requests to have Accept-Encoding: br and automatically decompress brotli responses.

0.3.0 (2022-07-29)

Internal AggStats class is cleaned up:

  • AggStats.n_extracted_queries attribute is removed, as it was a duplicate of AggStats.n_results

  • AggStats.n_results is renamed to AggStats.n_success

  • AggStats.n_input_queries is removed as redundant and misleading; AggStats got a new AggStats.n_processed property instead.

This change is backwards incompatible if you used stats directly.

0.2.1 (2022-07-29)

  • aiohttp.client_exceptions.ClientConnectorError is now treated as a network error and retried accordingly.

  • Removed the unused zyte_api.sync module.

0.2.0 (2022-07-14)

  • Temporary download errors are now retried 3 times by default. They were not retried in previous releases.

0.1.4 (2022-05-21)

This release contains usability improvements to the command-line script:

  • Instead of python -m zyte_api you can now run it as zyte-api;

  • the type of the input file (--intype argument) is guessed now, based on file extension and content; .jl, .jsonl and .txt files are supported.

0.1.3 (2022-02-03)

  • Minor documenation fix

  • Remove support for Python 3.6

  • Added support for Python 3.10

0.1.2 (2021-11-10)

  • Default timeouts changed

0.1.1 (2021-11-01)

  • CHANGES.rst updated properly

0.1.0 (2021-11-01)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zyte-api-0.4.8.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

zyte_api-0.4.8-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file zyte-api-0.4.8.tar.gz.

File metadata

  • Download URL: zyte-api-0.4.8.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for zyte-api-0.4.8.tar.gz
Algorithm Hash digest
SHA256 1a7543a0cbe1abd8317a680db904c08478beefa12ead889e0f1768eae30b6632
MD5 f75946a2d05cc3a1c00edbfee65b1560
BLAKE2b-256 8c2be43264efc3b219528052641044e8383675c04355b1c93fa3aa9b8fc32f60

See more details on using hashes here.

File details

Details for the file zyte_api-0.4.8-py3-none-any.whl.

File metadata

  • Download URL: zyte_api-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for zyte_api-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 201971251b0c3182ca6c3af5a8dc7c0883ad736201ea4ad240f6979c26a9277c
MD5 414f26f3070fce7d6b30a77b54e99ddd
BLAKE2b-256 0124eeef1b2914d23b464b60ad55209bd18a9bf0dc6d7001b6fe0204449a9219

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page