various-api-tools 0.3.1__tar.gz → 0.3.2__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: various-api-tools
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: A lightweight utility package for common API-related tasks in Python, including JSON and Pydantic error translators that provide user-friendly Russian messages.
5
5
  Author-Email: dkurchigin <kurchigin.dmitry@yandex.ru>
6
6
  License: MIT
@@ -20,31 +20,11 @@ Requires-Dist: pydantic>=2.11.7
20
20
  Requires-Dist: psycopg2-binary>=2.9.10
21
21
  Description-Content-Type: text/markdown
22
22
 
23
- # various_api_tools
23
+ # Various_api_tools
24
24
 
25
- A lightweight utility package for common API-related tasks in Python, including JSON and Pydantic error translators that provide user-friendly Russian messages.
25
+ **A lightweight utility package for common API-related tasks in Python, including JSON and Pydantic error translators that provide user-friendly Russian messages.**
26
26
 
27
- ---
28
-
29
- ## 📦 Features
30
-
31
- - ✅ **JSON Error Translator** – Translates `JSONDecodeError` into clear Russian messages.
32
- - ✅ **Pydantic Validation Error Translator** – Converts Pydantic validation errors into human-readable Russian strings.
33
- - ✅ **Easy to integrate** – Designed for use in web APIs and data validation pipelines.
34
-
35
- ---
36
-
37
- ## 🐍 Installation
38
-
39
- Install using pip from source or a private repository:
40
-
41
- ```bash
42
- pip install various_api_tools
43
- ```
44
-
45
- ## 🧪 Basic Usage
46
-
47
- ### Translate JSON Decode Errors
27
+ ### Basic Usage
48
28
 
49
29
  ```python
50
30
  import json
@@ -61,10 +41,6 @@ except json.JSONDecodeError as e:
61
41
  # Описание: не правильно используются двойные кавычки.
62
42
  ```
63
43
 
64
- ---
65
-
66
- ### Translate Pydantic Validation Errors
67
-
68
44
  ```python
69
45
  from pydantic import BaseModel, ValidationError
70
46
  from various_api_tools.translators.pydantic import ValidationErrorTranslator
@@ -81,20 +57,24 @@ except ValidationError as e:
81
57
  # Поле: "email". Ошибка: "Невалидное строковое значение(str)";
82
58
  ```
83
59
 
84
- ---
85
60
 
86
- ## 📄 License
61
+ ### Installation
62
+ ```bash
63
+ pip install various_api_tools
64
+ ```
87
65
 
88
- MIT License — feel free to use it in any project! 🎉
66
+ ### License
89
67
 
90
- ---
68
+ MIT License — feel free to use it in any project! 🎉
91
69
 
92
- ## 🧑‍💻 Made with ❤️ by [@dkurchigin](https://gitverse.ru/dkurchigin)
70
+ ### Documentation
93
71
 
94
- Have questions? Open an issue or contribute to the repo!
72
+ [https://various-api-tools.dkurchigin.ru/](https://various-api-tools.dkurchigin.ru/)
95
73
 
74
+ ### Author
96
75
 
97
- ## 🐙 GITVERSE
76
+ Made with ❤️ by [@dkurchigin](https://gitverse.ru/dkurchigin)
98
77
 
78
+ ### Gitverse
99
79
 
100
- 🔗 [https://gitverse.ru/dkurchigin/various-api-tools](https://gitverse.ru/dkurchigin/various-api-tools)
80
+ [https://gitverse.ru/dkurchigin/various-api-tools](https://gitverse.ru/dkurchigin/various-api-tools)
@@ -0,0 +1,58 @@
1
+ # Various_api_tools
2
+
3
+ **A lightweight utility package for common API-related tasks in Python, including JSON and Pydantic error translators that provide user-friendly Russian messages.**
4
+
5
+ ### Basic Usage
6
+
7
+ ```python
8
+ import json
9
+ from various_api_tools.translators.json import DecodeErrorTranslator
10
+
11
+ try:
12
+ json.loads('{"name": "Alice",}')
13
+ except json.JSONDecodeError as e:
14
+ print(DecodeErrorTranslator.translate(e))
15
+
16
+ # Output:
17
+ # Ошибка конвертации в формате JSON.
18
+ # Позиция: 16.
19
+ # Описание: не правильно используются двойные кавычки.
20
+ ```
21
+
22
+ ```python
23
+ from pydantic import BaseModel, ValidationError
24
+ from various_api_tools.translators.pydantic import ValidationErrorTranslator
25
+
26
+ class User(BaseModel):
27
+ email: str
28
+
29
+ try:
30
+ User(email=123)
31
+ except ValidationError as e:
32
+ print(ValidationErrorTranslator.translate(e.errors()))
33
+
34
+ # Output:
35
+ # Поле: "email". Ошибка: "Невалидное строковое значение(str)";
36
+ ```
37
+
38
+
39
+ ### Installation
40
+ ```bash
41
+ pip install various_api_tools
42
+ ```
43
+
44
+ ### License
45
+
46
+ MIT License — feel free to use it in any project! 🎉
47
+
48
+ ### Documentation
49
+
50
+ [https://various-api-tools.dkurchigin.ru/](https://various-api-tools.dkurchigin.ru/)
51
+
52
+ ### Author
53
+
54
+ Made with ❤️ by [@dkurchigin](https://gitverse.ru/dkurchigin)
55
+
56
+ ### Gitverse
57
+
58
+ [https://gitverse.ru/dkurchigin/various-api-tools](https://gitverse.ru/dkurchigin/various-api-tools)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "various-api-tools"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "A lightweight utility package for common API-related tasks in Python, including JSON and Pydantic error translators that provide user-friendly Russian messages."
5
5
  authors = [
6
6
  { name = "dkurchigin", email = "kurchigin.dmitry@yandex.ru" },
@@ -1,78 +0,0 @@
1
- # various_api_tools
2
-
3
- A lightweight utility package for common API-related tasks in Python, including JSON and Pydantic error translators that provide user-friendly Russian messages.
4
-
5
- ---
6
-
7
- ## 📦 Features
8
-
9
- - ✅ **JSON Error Translator** – Translates `JSONDecodeError` into clear Russian messages.
10
- - ✅ **Pydantic Validation Error Translator** – Converts Pydantic validation errors into human-readable Russian strings.
11
- - ✅ **Easy to integrate** – Designed for use in web APIs and data validation pipelines.
12
-
13
- ---
14
-
15
- ## 🐍 Installation
16
-
17
- Install using pip from source or a private repository:
18
-
19
- ```bash
20
- pip install various_api_tools
21
- ```
22
-
23
- ## 🧪 Basic Usage
24
-
25
- ### Translate JSON Decode Errors
26
-
27
- ```python
28
- import json
29
- from various_api_tools.translators.json import DecodeErrorTranslator
30
-
31
- try:
32
- json.loads('{"name": "Alice",}')
33
- except json.JSONDecodeError as e:
34
- print(DecodeErrorTranslator.translate(e))
35
-
36
- # Output:
37
- # Ошибка конвертации в формате JSON.
38
- # Позиция: 16.
39
- # Описание: не правильно используются двойные кавычки.
40
- ```
41
-
42
- ---
43
-
44
- ### Translate Pydantic Validation Errors
45
-
46
- ```python
47
- from pydantic import BaseModel, ValidationError
48
- from various_api_tools.translators.pydantic import ValidationErrorTranslator
49
-
50
- class User(BaseModel):
51
- email: str
52
-
53
- try:
54
- User(email=123)
55
- except ValidationError as e:
56
- print(ValidationErrorTranslator.translate(e.errors()))
57
-
58
- # Output:
59
- # Поле: "email". Ошибка: "Невалидное строковое значение(str)";
60
- ```
61
-
62
- ---
63
-
64
- ## 📄 License
65
-
66
- MIT License — feel free to use it in any project! 🎉
67
-
68
- ---
69
-
70
- ## 🧑‍💻 Made with ❤️ by [@dkurchigin](https://gitverse.ru/dkurchigin)
71
-
72
- Have questions? Open an issue or contribute to the repo!
73
-
74
-
75
- ## 🐙 GITVERSE
76
-
77
-
78
- 🔗 [https://gitverse.ru/dkurchigin/various-api-tools](https://gitverse.ru/dkurchigin/various-api-tools)