Wikipedia-API 0.15.0__tar.gz → 0.16.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/CHANGES.rst +7 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/DESIGN.rst +4 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/PKG-INFO +28 -3
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/README.rst +25 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/README_processed.rst +25 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/pyproject.toml +14 -15
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_http_client/async_http_client.py +3 -1
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_http_client/base_http_client.py +4 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_http_client/sync_http_client.py +3 -1
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_version.py +1 -1
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_wikipedia/async_wikipedia.py +2 -1
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_wikipedia/wikipedia.py +2 -1
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/.gitignore +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/API.rst +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/CLI.rst +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/DEVELOPMENT.rst +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/LICENSE +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/SKILLS/README.md +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/SKILLS/bash.md +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/SKILLS/python-async.md +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/SKILLS/python-sync.md +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/examples/example_async.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/examples/example_cli.sh +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/examples/example_sync.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/coordinate_type.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/coordinates_prop.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/direction.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/geosearch_sort.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/globe.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/namespace.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/redirect_filter.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/search_info.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/search_prop.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/search_qi_profile.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/search_sort.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_enums/search_what.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_http_client/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_http_client/retry_after_wait.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_http_client/retry_utils.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_image/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_image/_base_wikipedia_image.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_image/async_wikipedia_image.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_image/wikipedia_image.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_page/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_page/_base_wikipedia_page.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_page/async_wikipedia_page.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_page/wikipedia_page.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_page/wikipedia_page_section.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_pages_dict/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_pages_dict/async_images_dict.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_pages_dict/async_pages_dict.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_pages_dict/base_pages_dict.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_pages_dict/images_dict.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_pages_dict/pages_dict.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/base_params.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/coordinates_params.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/geo_search_params.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/imageinfo_params.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/images_params.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/protocols.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/random_params.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_params/search_params.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_resources/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_resources/async_wikipedia_resource.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_resources/base_wikipedia_resource.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_resources/wikipedia_resource.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/coordinate.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/geo_box.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/geo_point.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/geo_search_meta.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/image_info.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/search_meta.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_types/search_results.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_wikipedia/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/cli.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/base.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/category_commands.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/geo_commands.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/image_commands.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/link_commands.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/page_commands.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/commands/search_commands.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/__init__.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_connection_error.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_http_error.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_http_timeout_error.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_invalid_json_error.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_rate_limit_error.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wikipedia_exception.py +0 -0
- {wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/extract_format.py +0 -0
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
0.16.0
|
|
5
|
+
----------
|
|
6
|
+
|
|
7
|
+
* Allow passing a custom ``transport`` to the underlying ``httpx`` client (e.g. a caching transport such as Hishel) - `PR 659`_
|
|
8
|
+
|
|
9
|
+
.. _PR 659: https://github.com/martin-majlis/Wikipedia-API/pull/659
|
|
10
|
+
|
|
4
11
|
0.15.0
|
|
5
12
|
----------
|
|
6
13
|
|
|
@@ -317,6 +317,8 @@ SyncHTTPClient
|
|
|
317
317
|
Provides a blocking ``_get(language, params) -> dict`` method in ``sync_http_client.py`` backed by
|
|
318
318
|
``httpx.Client``. Retry logic uses ``tenacity`` with exponential
|
|
319
319
|
backoff; ``Retry-After`` headers are honoured for HTTP 429 responses.
|
|
320
|
+
The client defaults to ``httpx.HTTPTransport`` but honours a caller-supplied
|
|
321
|
+
``transport`` kwarg (e.g. a caching transport).
|
|
320
322
|
|
|
321
323
|
AsyncHTTPClient
|
|
322
324
|
~~~~~~~~~~~~~~~
|
|
@@ -324,6 +326,8 @@ AsyncHTTPClient
|
|
|
324
326
|
Provides an ``async def _get(language, params) -> dict`` coroutine in ``async_http_client.py``
|
|
325
327
|
backed by ``httpx.AsyncClient``. Retry logic mirrors
|
|
326
328
|
``SyncHTTPClient`` but uses ``tenacity``'s ``AsyncRetrying``.
|
|
329
|
+
The client defaults to ``httpx.AsyncHTTPTransport`` but honours a caller-supplied
|
|
330
|
+
``transport`` kwarg.
|
|
327
331
|
|
|
328
332
|
Both clients construct the endpoint URL as::
|
|
329
333
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: Wikipedia-API
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Python Wrapper for Wikipedia
|
|
5
5
|
Project-URL: Homepage, https://github.com/martin-majlis/Wikipedia-API
|
|
6
6
|
Project-URL: Repository, https://github.com/martin-majlis/Wikipedia-API
|
|
@@ -26,7 +26,7 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
26
26
|
Classifier: Topic :: Communications :: Email
|
|
27
27
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
28
|
Requires-Python: >=3.10
|
|
29
|
-
Requires-Dist: click==8.
|
|
29
|
+
Requires-Dist: click==8.5.0
|
|
30
30
|
Requires-Dist: httpx==0.28.1
|
|
31
31
|
Requires-Dist: tenacity==9.1.4
|
|
32
32
|
Description-Content-Type: text/x-rst
|
|
@@ -1045,6 +1045,31 @@ The same options apply to both ``Wikipedia`` and ``AsyncWikipedia``.
|
|
|
1045
1045
|
max_retries=0,
|
|
1046
1046
|
)
|
|
1047
1047
|
|
|
1048
|
+
Custom HTTP Transport
|
|
1049
|
+
~~~~~~~~~~~~~~~~~~~~~~
|
|
1050
|
+
|
|
1051
|
+
Any keyword argument that is not recognised by ``Wikipedia`` / ``AsyncWikipedia`` is
|
|
1052
|
+
forwarded to the underlying ``httpx`` client. This includes ``transport``, which lets you
|
|
1053
|
+
plug in a custom transport such as a caching transport
|
|
1054
|
+
(e.g. `Hishel <https://hishel.com/httpx.html>`_). When ``transport`` is omitted, the default
|
|
1055
|
+
``httpx.HTTPTransport`` (sync) / ``httpx.AsyncHTTPTransport`` (async) is used.
|
|
1056
|
+
|
|
1057
|
+
.. code-block:: python
|
|
1058
|
+
|
|
1059
|
+
import hishel
|
|
1060
|
+
import httpx
|
|
1061
|
+
import wikipediaapi
|
|
1062
|
+
|
|
1063
|
+
# Cache responses so repeated lookups avoid hitting Wikipedia again
|
|
1064
|
+
wiki_wiki = wikipediaapi.Wikipedia(
|
|
1065
|
+
user_agent='MyProjectName (merlin@example.com)',
|
|
1066
|
+
language='en',
|
|
1067
|
+
transport=hishel.CacheTransport(transport=httpx.HTTPTransport()),
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1070
|
+
For ``AsyncWikipedia`` use an async transport (e.g.
|
|
1071
|
+
``hishel.AsyncCacheTransport(transport=httpx.AsyncHTTPTransport())``).
|
|
1072
|
+
|
|
1048
1073
|
How To See Underlying API Call
|
|
1049
1074
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1050
1075
|
|
|
@@ -1012,6 +1012,31 @@ The same options apply to both ``Wikipedia`` and ``AsyncWikipedia``.
|
|
|
1012
1012
|
max_retries=0,
|
|
1013
1013
|
)
|
|
1014
1014
|
|
|
1015
|
+
Custom HTTP Transport
|
|
1016
|
+
~~~~~~~~~~~~~~~~~~~~~~
|
|
1017
|
+
|
|
1018
|
+
Any keyword argument that is not recognised by ``Wikipedia`` / ``AsyncWikipedia`` is
|
|
1019
|
+
forwarded to the underlying ``httpx`` client. This includes ``transport``, which lets you
|
|
1020
|
+
plug in a custom transport such as a caching transport
|
|
1021
|
+
(e.g. `Hishel <https://hishel.com/httpx.html>`_). When ``transport`` is omitted, the default
|
|
1022
|
+
``httpx.HTTPTransport`` (sync) / ``httpx.AsyncHTTPTransport`` (async) is used.
|
|
1023
|
+
|
|
1024
|
+
.. code-block:: python
|
|
1025
|
+
|
|
1026
|
+
import hishel
|
|
1027
|
+
import httpx
|
|
1028
|
+
import wikipediaapi
|
|
1029
|
+
|
|
1030
|
+
# Cache responses so repeated lookups avoid hitting Wikipedia again
|
|
1031
|
+
wiki_wiki = wikipediaapi.Wikipedia(
|
|
1032
|
+
user_agent='MyProjectName (merlin@example.com)',
|
|
1033
|
+
language='en',
|
|
1034
|
+
transport=hishel.CacheTransport(transport=httpx.HTTPTransport()),
|
|
1035
|
+
)
|
|
1036
|
+
|
|
1037
|
+
For ``AsyncWikipedia`` use an async transport (e.g.
|
|
1038
|
+
``hishel.AsyncCacheTransport(transport=httpx.AsyncHTTPTransport())``).
|
|
1039
|
+
|
|
1015
1040
|
How To See Underlying API Call
|
|
1016
1041
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1017
1042
|
|
|
@@ -1012,6 +1012,31 @@ The same options apply to both ``Wikipedia`` and ``AsyncWikipedia``.
|
|
|
1012
1012
|
max_retries=0,
|
|
1013
1013
|
)
|
|
1014
1014
|
|
|
1015
|
+
Custom HTTP Transport
|
|
1016
|
+
~~~~~~~~~~~~~~~~~~~~~~
|
|
1017
|
+
|
|
1018
|
+
Any keyword argument that is not recognised by ``Wikipedia`` / ``AsyncWikipedia`` is
|
|
1019
|
+
forwarded to the underlying ``httpx`` client. This includes ``transport``, which lets you
|
|
1020
|
+
plug in a custom transport such as a caching transport
|
|
1021
|
+
(e.g. `Hishel <https://hishel.com/httpx.html>`_). When ``transport`` is omitted, the default
|
|
1022
|
+
``httpx.HTTPTransport`` (sync) / ``httpx.AsyncHTTPTransport`` (async) is used.
|
|
1023
|
+
|
|
1024
|
+
.. code-block:: python
|
|
1025
|
+
|
|
1026
|
+
import hishel
|
|
1027
|
+
import httpx
|
|
1028
|
+
import wikipediaapi
|
|
1029
|
+
|
|
1030
|
+
# Cache responses so repeated lookups avoid hitting Wikipedia again
|
|
1031
|
+
wiki_wiki = wikipediaapi.Wikipedia(
|
|
1032
|
+
user_agent='MyProjectName (merlin@example.com)',
|
|
1033
|
+
language='en',
|
|
1034
|
+
transport=hishel.CacheTransport(transport=httpx.HTTPTransport()),
|
|
1035
|
+
)
|
|
1036
|
+
|
|
1037
|
+
For ``AsyncWikipedia`` use an async transport (e.g.
|
|
1038
|
+
``hishel.AsyncCacheTransport(transport=httpx.AsyncHTTPTransport())``).
|
|
1039
|
+
|
|
1015
1040
|
How To See Underlying API Call
|
|
1016
1041
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1017
1042
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "Wikipedia-API"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.16.0"
|
|
8
8
|
description = "Python Wrapper for Wikipedia"
|
|
9
9
|
readme = {file = "README_processed.rst", content-type = "text/x-rst"}
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -32,29 +32,28 @@ classifiers = [
|
|
|
32
32
|
]
|
|
33
33
|
requires-python = ">=3.10"
|
|
34
34
|
dependencies = [
|
|
35
|
-
"click==8.
|
|
35
|
+
"click==8.5.0",
|
|
36
36
|
"httpx==0.28.1",
|
|
37
37
|
"tenacity==9.1.4",
|
|
38
38
|
]
|
|
39
39
|
|
|
40
40
|
[dependency-groups]
|
|
41
41
|
dev = [
|
|
42
|
-
"coverage==7.14.
|
|
43
|
-
"ruff
|
|
42
|
+
"coverage==7.14.3",
|
|
43
|
+
"ruff==0.16.5",
|
|
44
44
|
"ty==0.0.27",
|
|
45
45
|
"pre-commit==4.6.0",
|
|
46
|
-
"pygments==2.
|
|
46
|
+
"pygments==2.21.0",
|
|
47
47
|
"pyupgrade==3.21.2",
|
|
48
|
-
"pytest==9.
|
|
49
|
-
"pytest-asyncio==1.
|
|
48
|
+
"pytest==9.1.1",
|
|
49
|
+
"pytest-asyncio==1.4.0",
|
|
50
50
|
"pytest-cov==7.1.0",
|
|
51
|
-
"tox==4.
|
|
52
|
-
"anyio[trio]==4.
|
|
51
|
+
"tox==4.56.1",
|
|
52
|
+
"anyio[trio]==4.14.2",
|
|
53
53
|
"respx==0.23.1",
|
|
54
54
|
"types-setuptools==82.0.0.20260518",
|
|
55
|
-
"pytest-recording
|
|
56
|
-
"vcrpy
|
|
57
|
-
"ty>=0.0.27",
|
|
55
|
+
"pytest-recording==0.13.4",
|
|
56
|
+
"vcrpy==8.2.1",
|
|
58
57
|
]
|
|
59
58
|
doc = [
|
|
60
59
|
"sphinx==9.1.0; python_version >= '3.12'",
|
|
@@ -62,11 +61,11 @@ doc = [
|
|
|
62
61
|
build = [
|
|
63
62
|
"rst2html==2020.7.4",
|
|
64
63
|
"setuptools==82.0.1",
|
|
65
|
-
"twine
|
|
66
|
-
"wheel==0.
|
|
64
|
+
"twine==7.0.0",
|
|
65
|
+
"wheel==0.48.0",
|
|
67
66
|
]
|
|
68
67
|
testing = [
|
|
69
|
-
"anyio[trio]==4.
|
|
68
|
+
"anyio[trio]==4.14.2",
|
|
70
69
|
"respx==0.23.1",
|
|
71
70
|
]
|
|
72
71
|
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_http_client/async_http_client.py
RENAMED
|
@@ -48,10 +48,12 @@ class AsyncHTTPClient(BaseHTTPClient):
|
|
|
48
48
|
:class:`BaseHTTPClient`
|
|
49
49
|
"""
|
|
50
50
|
super().__init__(*args, **kwargs)
|
|
51
|
+
# Use a caller-supplied transport (e.g. a caching transport such as
|
|
52
|
+
# Hishel) if one was passed; otherwise fall back to the default.
|
|
53
|
+
self._client_kwargs.setdefault("transport", httpx.AsyncHTTPTransport())
|
|
51
54
|
self._client = httpx.AsyncClient(
|
|
52
55
|
headers=self._default_headers,
|
|
53
56
|
**self._client_kwargs,
|
|
54
|
-
transport=httpx.AsyncHTTPTransport(),
|
|
55
57
|
)
|
|
56
58
|
|
|
57
59
|
async def _do_get(self, url: str, params: dict[str, Any]) -> dict[str, Any]:
|
|
@@ -96,6 +96,10 @@ class BaseHTTPClient(ABC):
|
|
|
96
96
|
:param kwargs: forwarded to ``httpx`` client constructor
|
|
97
97
|
(e.g. ``timeout=30.0``, ``proxy={'https://': 'http://proxy.example.com:8080'}``,
|
|
98
98
|
``verify=False``, ``http2=True``); ``timeout`` defaults to ``10.0``.
|
|
99
|
+
A custom ``transport`` may also be supplied (e.g. a caching
|
|
100
|
+
transport such as `Hishel <https://hishel.com/httpx.html>`_); when
|
|
101
|
+
omitted, the default ``httpx.HTTPTransport`` /
|
|
102
|
+
``httpx.AsyncHTTPTransport`` is used.
|
|
99
103
|
**Advanced Usage**: These parameters provide direct access to httpx
|
|
100
104
|
capabilities. For standard Wikipedia API usage, prefer the
|
|
101
105
|
documented parameters above. Use httpx parameters only for
|
|
@@ -46,10 +46,12 @@ class SyncHTTPClient(BaseHTTPClient):
|
|
|
46
46
|
:class:`BaseHTTPClient`
|
|
47
47
|
"""
|
|
48
48
|
super().__init__(*args, **kwargs)
|
|
49
|
+
# Use a caller-supplied transport (e.g. a caching transport such as
|
|
50
|
+
# Hishel) if one was passed; otherwise fall back to the default.
|
|
51
|
+
self._client_kwargs.setdefault("transport", httpx.HTTPTransport())
|
|
49
52
|
self._client = httpx.Client(
|
|
50
53
|
headers=self._default_headers,
|
|
51
54
|
**self._client_kwargs,
|
|
52
|
-
transport=httpx.HTTPTransport(),
|
|
53
55
|
)
|
|
54
56
|
|
|
55
57
|
def _do_get(self, url: str, params: dict[str, Any]) -> dict[str, Any]:
|
|
@@ -66,7 +66,8 @@ class AsyncWikipedia(AsyncWikipediaResource, AsyncHTTPClient):
|
|
|
66
66
|
``1.0``.
|
|
67
67
|
:param kwargs: additional keyword arguments forwarded to
|
|
68
68
|
``httpx.AsyncClient`` (e.g. ``timeout=30.0``, ``proxies={…}``,
|
|
69
|
-
``verify=False``
|
|
69
|
+
``verify=False``, or a custom ``transport`` such as a caching
|
|
70
|
+
transport). **Advanced Usage**: These provide direct
|
|
70
71
|
access to httpx capabilities. For most use cases, prefer the
|
|
71
72
|
standard parameters above. Use httpx parameters only for specific
|
|
72
73
|
requirements like custom proxies, SSL configuration, or connection pooling.
|
|
@@ -58,7 +58,8 @@ class Wikipedia(WikipediaResource, SyncHTTPClient):
|
|
|
58
58
|
``1.0``.
|
|
59
59
|
:param kwargs: additional keyword arguments forwarded to
|
|
60
60
|
``httpx.Client`` (e.g. ``timeout=30.0``, ``proxies={…}``,
|
|
61
|
-
``verify=False``
|
|
61
|
+
``verify=False``, or a custom ``transport`` such as a caching
|
|
62
|
+
transport). **Advanced Usage**: These provide direct
|
|
62
63
|
access to httpx capabilities. For most use cases, prefer the
|
|
63
64
|
standard parameters above. Use httpx parameters only for specific
|
|
64
65
|
requirements like custom proxies, SSL configuration, or connection pooling.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_resources/async_wikipedia_resource.py
RENAMED
|
File without changes
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/_resources/base_wikipedia_resource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_connection_error.py
RENAMED
|
File without changes
|
|
File without changes
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_http_timeout_error.py
RENAMED
|
File without changes
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_invalid_json_error.py
RENAMED
|
File without changes
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wiki_rate_limit_error.py
RENAMED
|
File without changes
|
{wikipedia_api-0.15.0 → wikipedia_api-0.16.0}/wikipediaapi/exceptions/wikipedia_exception.py
RENAMED
|
File without changes
|
|
File without changes
|