PyLinks 0.1.2__tar.gz → 0.1.3__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.
- {pylinks-0.1.2 → pylinks-0.1.3}/PKG-INFO +1 -1
- {pylinks-0.1.2 → pylinks-0.1.3}/pyproject.toml +1 -1
- {pylinks-0.1.2 → pylinks-0.1.3}/src/PyLinks.egg-info/PKG-INFO +1 -1
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/exception/api.py +5 -2
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/exception/base.py +2 -1
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/exception/media_type.py +2 -2
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/exception/uri.py +1 -2
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/site/binder.py +2 -1
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/site/conda.py +2 -3
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/site/github.py +2 -3
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/site/lib_io.py +2 -2
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/site/pypi.py +2 -3
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/site/readthedocs.py +2 -5
- {pylinks-0.1.2 → pylinks-0.1.3}/setup.cfg +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/PyLinks.egg-info/SOURCES.txt +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/PyLinks.egg-info/dependency_links.txt +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/PyLinks.egg-info/not-zip-safe +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/PyLinks.egg-info/requires.txt +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/PyLinks.egg-info/top_level.txt +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/__init__.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/_settings.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/api/__init__.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/api/doi.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/api/github.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/api/orcid.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/api/zenodo.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/exception/__init__.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/http.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/media_type.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/site/__init__.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/string.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/uri/__init__.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/uri/data.py +0 -0
- {pylinks-0.1.2 → pylinks-0.1.3}/src/pylinks/url.py +0 -0
|
@@ -5,8 +5,6 @@ from __future__ import annotations as _annotations
|
|
|
5
5
|
import json
|
|
6
6
|
from typing import TYPE_CHECKING as _TYPE_CHECKING
|
|
7
7
|
|
|
8
|
-
import mdit as _mdit
|
|
9
|
-
|
|
10
8
|
from pylinks.exception.base import PyLinksError
|
|
11
9
|
|
|
12
10
|
if _TYPE_CHECKING:
|
|
@@ -23,6 +21,7 @@ class WebAPIError(PyLinksError):
|
|
|
23
21
|
|
|
24
22
|
class WebAPIRequestError(WebAPIError):
|
|
25
23
|
def __init__(self, request_error: RequestException) -> None:
|
|
24
|
+
import mdit as _mdit
|
|
26
25
|
self.request = request_error.request
|
|
27
26
|
self.response = request_error.response
|
|
28
27
|
self.error = request_error
|
|
@@ -47,6 +46,7 @@ class WebAPIStatusCodeError(WebAPIError):
|
|
|
47
46
|
"""
|
|
48
47
|
|
|
49
48
|
def __init__(self, response: Response) -> None:
|
|
49
|
+
import mdit as _mdit
|
|
50
50
|
self.request = response.request
|
|
51
51
|
self.response = response
|
|
52
52
|
response_summary, response_details = _process_response(response)
|
|
@@ -97,6 +97,7 @@ class GraphQLResponseError(WebAPIError):
|
|
|
97
97
|
"""Exception class for GraphQL."""
|
|
98
98
|
|
|
99
99
|
def __init__(self, response: dict, query: str) -> None:
|
|
100
|
+
import mdit as _mdit
|
|
100
101
|
if "errors" in response:
|
|
101
102
|
intro = "GraphQL response contains errors."
|
|
102
103
|
elif "data" not in response:
|
|
@@ -121,6 +122,7 @@ class GraphQLResponseError(WebAPIError):
|
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
def _process_response(response: Response):
|
|
125
|
+
import mdit as _mdit
|
|
124
126
|
# Decode error reason from server
|
|
125
127
|
# This part is adapted from `requests` library; See PR #3538 on their GitHub
|
|
126
128
|
if isinstance(response.reason, bytes):
|
|
@@ -160,6 +162,7 @@ def _process_response(response: Response):
|
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
def _process_request(request: Request | PreparedRequest):
|
|
165
|
+
import mdit as _mdit
|
|
163
166
|
request_info = []
|
|
164
167
|
request_summary = _mdit.element.field_list()
|
|
165
168
|
for title, attr_name in (
|
|
@@ -5,7 +5,6 @@ from __future__ import annotations as _annotations
|
|
|
5
5
|
from functools import partial as _partial
|
|
6
6
|
from typing import TYPE_CHECKING as _TYPE_CHECKING
|
|
7
7
|
|
|
8
|
-
import mdit as _mdit
|
|
9
8
|
from exceptionman import ReporterException as _ReporterException
|
|
10
9
|
|
|
11
10
|
if _TYPE_CHECKING:
|
|
@@ -24,6 +23,7 @@ class PyLinksError(_ReporterException):
|
|
|
24
23
|
intro,
|
|
25
24
|
details=None,
|
|
26
25
|
) -> None:
|
|
26
|
+
import mdit as _mdit
|
|
27
27
|
sphinx_config = {"html_title": "PyLinks Error Report"}
|
|
28
28
|
sphinx_target_config = _mdit.target.sphinx(
|
|
29
29
|
renderer=_partial(
|
|
@@ -46,6 +46,7 @@ class PyLinksFileNotFoundError(PyLinksError):
|
|
|
46
46
|
"""File not found error."""
|
|
47
47
|
|
|
48
48
|
def __init__(self, path: Path) -> None:
|
|
49
|
+
import mdit as _mdit
|
|
49
50
|
super().__init__(
|
|
50
51
|
title="File Not Found Error",
|
|
51
52
|
intro=_mdit.inline_container(
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import mdit as _mdit
|
|
2
|
-
|
|
3
1
|
from pylinks.exception.base import PyLinksError as _PyLinksError
|
|
4
2
|
|
|
5
3
|
|
|
@@ -7,6 +5,7 @@ class PyLinksMediaTypeParseError(_PyLinksError):
|
|
|
7
5
|
"""Error parsing a media type."""
|
|
8
6
|
|
|
9
7
|
def __init__(self, problem: str, media_type: str) -> None:
|
|
8
|
+
import mdit as _mdit
|
|
10
9
|
super().__init__(
|
|
11
10
|
title="Media Type Parse Error",
|
|
12
11
|
intro=_mdit.inline_container(
|
|
@@ -24,6 +23,7 @@ class PyLinksMediaTypeGuessError(_PyLinksError):
|
|
|
24
23
|
"""Error guessing the media type of a data URI."""
|
|
25
24
|
|
|
26
25
|
def __init__(self, path: str) -> None:
|
|
26
|
+
import mdit as _mdit
|
|
27
27
|
super().__init__(
|
|
28
28
|
title="Media Type Guess Error",
|
|
29
29
|
intro=_mdit.inline_container(
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import mdit as _mdit
|
|
2
|
-
|
|
3
1
|
from pylinks.exception.base import PyLinksError as _PyLinksError
|
|
4
2
|
|
|
5
3
|
|
|
@@ -7,6 +5,7 @@ class PyLinksDataURIParseError(_PyLinksError):
|
|
|
7
5
|
"""Error parsing a data URI."""
|
|
8
6
|
|
|
9
7
|
def __init__(self, problem: str, data_uri: str) -> None:
|
|
8
|
+
import mdit as _mdit
|
|
10
9
|
super().__init__(
|
|
11
10
|
title="Data URI Parse Error",
|
|
12
11
|
intro=_mdit.inline_container(
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"""URLs for Conda packages."""
|
|
2
2
|
|
|
3
|
-
# Standard libraries
|
|
4
3
|
import re
|
|
5
4
|
|
|
6
|
-
# Non-standard libraries
|
|
7
5
|
import requests
|
|
8
6
|
|
|
9
7
|
import pylinks as _pylinks
|
|
8
|
+
import pylinks.url as _url
|
|
10
9
|
|
|
11
|
-
BASE_URL =
|
|
10
|
+
BASE_URL = _url.create(url="https://anaconda.org")
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
class Package:
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"""URLs for GitHub users, repositories, branches, and more."""
|
|
2
2
|
|
|
3
|
-
# Standard libraries
|
|
4
3
|
import re
|
|
5
4
|
from typing import Literal
|
|
6
5
|
|
|
7
|
-
# Non-standard libraries
|
|
8
6
|
import requests
|
|
9
7
|
|
|
10
8
|
import pylinks as _pylinks
|
|
9
|
+
import pylinks.url as _url
|
|
11
10
|
|
|
12
|
-
BASE_URL =
|
|
11
|
+
BASE_URL = _url.create(url="https://github.com")
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
class User:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"""URLs for the Libraries.io website."""
|
|
2
2
|
|
|
3
|
-
# Non-standard libraries
|
|
4
3
|
import requests
|
|
5
4
|
|
|
6
5
|
import pylinks as _pylinks
|
|
6
|
+
import pylinks.url as _url
|
|
7
7
|
|
|
8
|
-
BASE_URL =
|
|
8
|
+
BASE_URL = _url.create(url="https://libraries.io")
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Package:
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"""URLs for PyPI packages."""
|
|
2
2
|
|
|
3
|
-
# Standard libraries
|
|
4
3
|
import re
|
|
5
4
|
|
|
6
|
-
# Non-standard libraries
|
|
7
5
|
import requests
|
|
8
6
|
|
|
9
7
|
import pylinks as _pylinks
|
|
8
|
+
import pylinks.url as _url
|
|
10
9
|
|
|
11
|
-
BASE_URL =
|
|
10
|
+
BASE_URL = _url.create("https://pypi.org")
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
class Package:
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"""URLs for ReadTheDocs websites."""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
# Standard libraries
|
|
5
|
-
|
|
6
|
-
# Non-standard libraries
|
|
7
3
|
import requests
|
|
8
4
|
|
|
9
5
|
import pylinks as _pylinks
|
|
6
|
+
import pylinks.url as _url
|
|
10
7
|
|
|
11
|
-
BASE_URL =
|
|
8
|
+
BASE_URL = _url.create(url="https://readthedocs.org")
|
|
12
9
|
|
|
13
10
|
|
|
14
11
|
class Project:
|
|
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
|