core-https 1.1.1__tar.gz → 1.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.
@@ -1,12 +1,13 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: core-https
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: This project/library contains common elements related to HTTP & API services...
5
5
  Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
6
6
  Maintainer: Alejandro Cora González
7
7
  License: MIT
8
8
  Project-URL: Homepage, https://gitlab.com/bytecode-solutions/core/core-https
9
9
  Project-URL: Repository, https://gitlab.com/bytecode-solutions/core/core-https
10
+ Project-URL: Documentation, https://core-https.readthedocs.io/en/latest/
10
11
  Project-URL: Issues, https://gitlab.com/bytecode-solutions/core/core-https/-/issues
11
12
  Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-https/-/blob/master/CHANGELOG.md
12
13
  Classifier: License :: OSI Approved :: MIT License
@@ -31,37 +32,42 @@ Requires-Dist: urllib3>=2.2.3; python_version >= "3.8"
31
32
  Requires-Dist: urllib3>=1.26.20; python_version >= "3.7" and python_version < "3.8"
32
33
  Requires-Dist: typing-extensions>=4.8.0; python_version >= "3.8" and python_version < "3.11"
33
34
  Requires-Dist: typing-extensions>=4.2.0; python_version >= "3.7" and python_version < "3.8"
35
+ Provides-Extra: docs
36
+ Requires-Dist: pydata-sphinx-theme==0.16.1; extra == "docs"
37
+ Requires-Dist: Sphinx==8.2.3; extra == "docs"
38
+ Dynamic: license-file
34
39
 
35
40
  # core-https
36
41
  _______________________________________________________________________________
37
42
 
38
- This project/library contains common elements related to HTTP & API services...
43
+ This project/library contains common elements related to HTTP...
39
44
 
40
45
  ## Execution Environment
41
46
 
42
47
  ### Install libraries
43
- ```commandline
48
+ ```shell
44
49
  pip install --upgrade pip
45
50
  pip install virtualenv
46
51
  ```
47
52
 
48
53
  ### Create the Python Virtual Environment.
49
- ```commandline
54
+ ```shell
55
+ virtualenv --python={{python-version}} .venv
50
56
  virtualenv --python=python3.11 .venv
51
57
  ```
52
58
 
53
59
  ### Activate the Virtual Environment.
54
- ```commandline
60
+ ```shell
55
61
  source .venv/bin/activate
56
62
  ```
57
63
 
58
64
  ### Install required libraries.
59
- ```commandline
65
+ ```shell
60
66
  pip install .
61
67
  ```
62
68
 
63
69
  ### Check tests and coverage...
64
- ```commandline
70
+ ```shell
65
71
  python manager.py run-test
66
72
  python manager.py run-coverage
67
73
  ```
@@ -1,33 +1,34 @@
1
1
  # core-https
2
2
  _______________________________________________________________________________
3
3
 
4
- This project/library contains common elements related to HTTP & API services...
4
+ This project/library contains common elements related to HTTP...
5
5
 
6
6
  ## Execution Environment
7
7
 
8
8
  ### Install libraries
9
- ```commandline
9
+ ```shell
10
10
  pip install --upgrade pip
11
11
  pip install virtualenv
12
12
  ```
13
13
 
14
14
  ### Create the Python Virtual Environment.
15
- ```commandline
15
+ ```shell
16
+ virtualenv --python={{python-version}} .venv
16
17
  virtualenv --python=python3.11 .venv
17
18
  ```
18
19
 
19
20
  ### Activate the Virtual Environment.
20
- ```commandline
21
+ ```shell
21
22
  source .venv/bin/activate
22
23
  ```
23
24
 
24
25
  ### Install required libraries.
25
- ```commandline
26
+ ```shell
26
27
  pip install .
27
28
  ```
28
29
 
29
30
  ### Check tests and coverage...
30
- ```commandline
31
+ ```shell
31
32
  python manager.py run-test
32
33
  python manager.py run-coverage
33
34
  ```
@@ -1,12 +1,13 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: core-https
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: This project/library contains common elements related to HTTP & API services...
5
5
  Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
6
6
  Maintainer: Alejandro Cora González
7
7
  License: MIT
8
8
  Project-URL: Homepage, https://gitlab.com/bytecode-solutions/core/core-https
9
9
  Project-URL: Repository, https://gitlab.com/bytecode-solutions/core/core-https
10
+ Project-URL: Documentation, https://core-https.readthedocs.io/en/latest/
10
11
  Project-URL: Issues, https://gitlab.com/bytecode-solutions/core/core-https/-/issues
11
12
  Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-https/-/blob/master/CHANGELOG.md
12
13
  Classifier: License :: OSI Approved :: MIT License
@@ -31,37 +32,42 @@ Requires-Dist: urllib3>=2.2.3; python_version >= "3.8"
31
32
  Requires-Dist: urllib3>=1.26.20; python_version >= "3.7" and python_version < "3.8"
32
33
  Requires-Dist: typing-extensions>=4.8.0; python_version >= "3.8" and python_version < "3.11"
33
34
  Requires-Dist: typing-extensions>=4.2.0; python_version >= "3.7" and python_version < "3.8"
35
+ Provides-Extra: docs
36
+ Requires-Dist: pydata-sphinx-theme==0.16.1; extra == "docs"
37
+ Requires-Dist: Sphinx==8.2.3; extra == "docs"
38
+ Dynamic: license-file
34
39
 
35
40
  # core-https
36
41
  _______________________________________________________________________________
37
42
 
38
- This project/library contains common elements related to HTTP & API services...
43
+ This project/library contains common elements related to HTTP...
39
44
 
40
45
  ## Execution Environment
41
46
 
42
47
  ### Install libraries
43
- ```commandline
48
+ ```shell
44
49
  pip install --upgrade pip
45
50
  pip install virtualenv
46
51
  ```
47
52
 
48
53
  ### Create the Python Virtual Environment.
49
- ```commandline
54
+ ```shell
55
+ virtualenv --python={{python-version}} .venv
50
56
  virtualenv --python=python3.11 .venv
51
57
  ```
52
58
 
53
59
  ### Activate the Virtual Environment.
54
- ```commandline
60
+ ```shell
55
61
  source .venv/bin/activate
56
62
  ```
57
63
 
58
64
  ### Install required libraries.
59
- ```commandline
65
+ ```shell
60
66
  pip install .
61
67
  ```
62
68
 
63
69
  ### Check tests and coverage...
64
- ```commandline
70
+ ```shell
65
71
  python manager.py run-test
66
72
  python manager.py run-coverage
67
73
  ```
@@ -10,8 +10,6 @@ core_https.egg-info/SOURCES.txt
10
10
  core_https.egg-info/dependency_links.txt
11
11
  core_https.egg-info/requires.txt
12
12
  core_https.egg-info/top_level.txt
13
- core_https/decorators/__init__.py
14
- core_https/decorators/response_wrapper.py
15
13
  core_https/requesters/__init__.py
16
14
  core_https/requesters/base.py
17
15
  core_https/requesters/url_lib3.py
@@ -10,3 +10,7 @@ urllib3>=2.2.3
10
10
 
11
11
  [:python_version >= "3.8" and python_version < "3.11"]
12
12
  typing-extensions>=4.8.0
13
+
14
+ [docs]
15
+ pydata-sphinx-theme==0.16.1
16
+ Sphinx==8.2.3
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
9
9
  [project]
10
10
  name = "core-https"
11
11
  description = "This project/library contains common elements related to HTTP & API services..."
12
- version = "1.1.1"
12
+ version = "1.1.3"
13
13
 
14
14
  authors = [
15
15
  {name = "Alejandro Cora González", email = "alek.cora.glez@gmail.com"}
@@ -49,11 +49,15 @@ dependencies = [
49
49
  "typing-extensions>=4.2.0; python_version >= '3.7' and python_version < '3.8'"
50
50
  ]
51
51
 
52
- #[project.optional-dependencies]
53
- #test = []
52
+ [project.optional-dependencies]
53
+ docs = [
54
+ "pydata-sphinx-theme==0.16.1",
55
+ "Sphinx==8.2.3"
56
+ ]
54
57
 
55
58
  [project.urls]
56
59
  Homepage = "https://gitlab.com/bytecode-solutions/core/core-https"
57
60
  Repository = "https://gitlab.com/bytecode-solutions/core/core-https"
61
+ Documentation = "https://core-https.readthedocs.io/en/latest/"
58
62
  Issues = "https://gitlab.com/bytecode-solutions/core/core-https/-/issues"
59
63
  Changelog = "https://gitlab.com/bytecode-solutions/core/core-https/-/blob/master/CHANGELOG.md"
@@ -1,3 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- from .response_wrapper import wrapp_response
@@ -1,85 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- from functools import wraps
4
- from typing import Any, Callable, Tuple
5
-
6
- try:
7
- from http import HTTPStatus
8
-
9
- except ImportError:
10
- from core_https.utils import HTTPStatus
11
-
12
- from core_https import StatusInfo
13
- from core_https.exceptions import AuthorizationException
14
- from core_https.exceptions import InternalServerError
15
- from core_https.exceptions import ServiceException
16
-
17
-
18
- def wrapp_response(fnc: Callable[..., Tuple[HTTPStatus, Any]]):
19
- """
20
- This decorator provides a generic mechanism to return the response payload
21
- for the endpoints in the same format. This way each router or controller does not
22
- need to take care of it. It returns the response into the below format...
23
-
24
- Response payload:
25
- {
26
- "code": 2XX | 4XX | 5XX,
27
- "status": "success" | "error" | "failure",
28
- "result": ...
29
- "error": ...,
30
- }
31
-
32
- Where:
33
- code:
34
- - 2XX -> For success responses.
35
- - 4XX -> For service-managed errors.
36
- - 5XX -> For unmanaged or internal server errors.
37
-
38
- status:
39
- Contains the text: "success", "failure", or "error". Where "failure" is for HTTP status
40
- response values from 500 to 599, "error" is for statuses from 400 to 499, and "success" is
41
- for everything else (e.g. 1XX, 2XX and 3XX responses).
42
-
43
- result:
44
- Contains the result.
45
-
46
- error:
47
- Only used for "failure" and "error" statuses, and it contains the error information.
48
- """
49
-
50
- @wraps(fnc)
51
- def wrapper(*args, **kwargs):
52
- try:
53
- code, result = fnc(*args, **kwargs)
54
-
55
- return {
56
- "code": code,
57
- "result": result,
58
- "status": StatusInfo.SUCCESS
59
- }
60
-
61
- except (AuthorizationException, ServiceException) as error:
62
- return {
63
- "code": error.status_code,
64
- "status": StatusInfo.ERROR,
65
- "error": error.get_error_info()
66
- }
67
-
68
- except InternalServerError as error:
69
- return {
70
- "code": error.status_code,
71
- "status": StatusInfo.FAILURE,
72
- "error": error.get_error_info()
73
- }
74
-
75
- except Exception as error:
76
- return {
77
- "code": HTTPStatus.INTERNAL_SERVER_ERROR,
78
- "status": StatusInfo.FAILURE,
79
- "error": {
80
- "type": error.__class__.__name__,
81
- "details": str(error)
82
- }
83
- }
84
-
85
- return wrapper
File without changes
File without changes
File without changes