error-translator-cli-v2 1.0.6__tar.gz → 1.0.7__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.
- error_translator_cli_v2-1.0.7/PKG-INFO +132 -0
- error_translator_cli_v2-1.0.7/README.md +124 -0
- error_translator_cli_v2-1.0.7/error_translator_cli_v2.egg-info/PKG-INFO +132 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/pyproject.toml +1 -1
- error_translator_cli_v2-1.0.6/PKG-INFO +0 -78
- error_translator_cli_v2-1.0.6/README.md +0 -70
- error_translator_cli_v2-1.0.6/error_translator_cli_v2.egg-info/PKG-INFO +0 -78
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/__init__.py +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/ast_handlers.py +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/auto.py +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/cli.py +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/core.py +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/server.py +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator_cli_v2.egg-info/SOURCES.txt +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator_cli_v2.egg-info/dependency_links.txt +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator_cli_v2.egg-info/entry_points.txt +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator_cli_v2.egg-info/top_level.txt +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/setup.cfg +0 -0
- {error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/tests/test_core.py +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: error-translator-cli-v2
|
|
3
|
+
Version: 1.0.7
|
|
4
|
+
Summary: A CLI tool that explains Python errors in simple human language.
|
|
5
|
+
Author-email: Gourabananda Datta <gourabanandadatta@zohomail.com>
|
|
6
|
+
Requires-Python: >=3.7
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# Error Translator CLI
|
|
10
|
+
|
|
11
|
+
Error Translator CLI turns Python tracebacks into clear, actionable explanations. It is a local, rule-based tool that reads the final error line, matches it against a curated regex rule set, and returns a structured translation with the original file, line number, code context, and a suggested fix.
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- Runs locally with no model inference or external API calls during normal translation.
|
|
16
|
+
- Supports three entry points: automatic crash interception, CLI execution, and direct traceback translation.
|
|
17
|
+
- Extracts file and line information from standard Python tracebacks when available.
|
|
18
|
+
- Includes optional AST-based insight hooks for a few error families.
|
|
19
|
+
- Provides both machine-readable results and colorized terminal output.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Install the published package with pip:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install error-translator-cli-v2
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For local development or running the project from source, install the repository dependencies instead:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install -r requirements.txt
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
### 1. Automatic crash interception
|
|
38
|
+
|
|
39
|
+
Import `error_translator.auto` at the top of a script to replace Python's default exception hook with the translated output.
|
|
40
|
+
|
|
41
|
+
This is the project's magic import: once imported, any unhandled exception in that process is intercepted and formatted by the translator before Python prints the default traceback.
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import error_translator.auto
|
|
45
|
+
|
|
46
|
+
maximum_user_connections = 100
|
|
47
|
+
print(maximum_user_connectons)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Use this when you want the translation to happen automatically without wrapping your code in a custom try/except block.
|
|
51
|
+
|
|
52
|
+
### 2. CLI execution
|
|
53
|
+
|
|
54
|
+
Run a script through the CLI and let the tool translate crashes from `stderr`.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
explain-error run script.py
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You can also translate a raw traceback or error string directly:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
explain-error "TypeError: unsupported operand type(s) for +: 'int' and 'str'"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If you want to pipe a saved traceback into the tool, use the shell syntax for your terminal:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
Get-Content error.log | explain-error
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
cat error.log | explain-error
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Programmatic use
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from error_translator.core import translate_error
|
|
80
|
+
|
|
81
|
+
result = translate_error(traceback_text)
|
|
82
|
+
print(result["explanation"])
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 4. HTTP API
|
|
86
|
+
|
|
87
|
+
Start the FastAPI app with Uvicorn:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
uvicorn error_translator.server:app --reload
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`POST /translate` expects JSON in the form:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"traceback_setting": "Traceback (most recent call last): ..."
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## What the translator returns
|
|
102
|
+
|
|
103
|
+
The translation engine returns a dictionary with these fields when available:
|
|
104
|
+
|
|
105
|
+
- `explanation`
|
|
106
|
+
- `fix`
|
|
107
|
+
- `matched_error`
|
|
108
|
+
- `file`
|
|
109
|
+
- `line`
|
|
110
|
+
- `code`
|
|
111
|
+
- `ast_insight`
|
|
112
|
+
|
|
113
|
+
## Supported errors
|
|
114
|
+
|
|
115
|
+
The bundled rule set covers many common Python runtime, syntax, indentation, import, OS, encoding, and networking errors. The full list lives in `error_translator/rules.json` and can be expanded over time without changing the runtime engine.
|
|
116
|
+
|
|
117
|
+
## Project layout
|
|
118
|
+
|
|
119
|
+
- `error_translator/core.py` loads the rule set and performs the translation.
|
|
120
|
+
- `error_translator/cli.py` provides the `explain-error` command.
|
|
121
|
+
- `error_translator/auto.py` installs the automatic exception hook.
|
|
122
|
+
- `error_translator/server.py` exposes the HTTP API.
|
|
123
|
+
- `error_translator/ast_handlers.py` contains contextual suggestion hooks.
|
|
124
|
+
- `error_translator/rules.json` stores the rule database.
|
|
125
|
+
|
|
126
|
+
## Development notes
|
|
127
|
+
|
|
128
|
+
- `builder.py` can generate new rule drafts with Gemini when `GEMINI_API_KEY` is set.
|
|
129
|
+
- `scraper.py` refreshes the scraped exception dataset from the official Python documentation.
|
|
130
|
+
- `tests/test_core.py` contains the current regression coverage for the translation engine.
|
|
131
|
+
|
|
132
|
+
Built by Gourabananda Datta.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Error Translator CLI
|
|
2
|
+
|
|
3
|
+
Error Translator CLI turns Python tracebacks into clear, actionable explanations. It is a local, rule-based tool that reads the final error line, matches it against a curated regex rule set, and returns a structured translation with the original file, line number, code context, and a suggested fix.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Runs locally with no model inference or external API calls during normal translation.
|
|
8
|
+
- Supports three entry points: automatic crash interception, CLI execution, and direct traceback translation.
|
|
9
|
+
- Extracts file and line information from standard Python tracebacks when available.
|
|
10
|
+
- Includes optional AST-based insight hooks for a few error families.
|
|
11
|
+
- Provides both machine-readable results and colorized terminal output.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Install the published package with pip:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install error-translator-cli-v2
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For local development or running the project from source, install the repository dependencies instead:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install -r requirements.txt
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### 1. Automatic crash interception
|
|
30
|
+
|
|
31
|
+
Import `error_translator.auto` at the top of a script to replace Python's default exception hook with the translated output.
|
|
32
|
+
|
|
33
|
+
This is the project's magic import: once imported, any unhandled exception in that process is intercepted and formatted by the translator before Python prints the default traceback.
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import error_translator.auto
|
|
37
|
+
|
|
38
|
+
maximum_user_connections = 100
|
|
39
|
+
print(maximum_user_connectons)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use this when you want the translation to happen automatically without wrapping your code in a custom try/except block.
|
|
43
|
+
|
|
44
|
+
### 2. CLI execution
|
|
45
|
+
|
|
46
|
+
Run a script through the CLI and let the tool translate crashes from `stderr`.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
explain-error run script.py
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
You can also translate a raw traceback or error string directly:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
explain-error "TypeError: unsupported operand type(s) for +: 'int' and 'str'"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If you want to pipe a saved traceback into the tool, use the shell syntax for your terminal:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
Get-Content error.log | explain-error
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
cat error.log | explain-error
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 3. Programmatic use
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from error_translator.core import translate_error
|
|
72
|
+
|
|
73
|
+
result = translate_error(traceback_text)
|
|
74
|
+
print(result["explanation"])
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 4. HTTP API
|
|
78
|
+
|
|
79
|
+
Start the FastAPI app with Uvicorn:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
uvicorn error_translator.server:app --reload
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`POST /translate` expects JSON in the form:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"traceback_setting": "Traceback (most recent call last): ..."
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## What the translator returns
|
|
94
|
+
|
|
95
|
+
The translation engine returns a dictionary with these fields when available:
|
|
96
|
+
|
|
97
|
+
- `explanation`
|
|
98
|
+
- `fix`
|
|
99
|
+
- `matched_error`
|
|
100
|
+
- `file`
|
|
101
|
+
- `line`
|
|
102
|
+
- `code`
|
|
103
|
+
- `ast_insight`
|
|
104
|
+
|
|
105
|
+
## Supported errors
|
|
106
|
+
|
|
107
|
+
The bundled rule set covers many common Python runtime, syntax, indentation, import, OS, encoding, and networking errors. The full list lives in `error_translator/rules.json` and can be expanded over time without changing the runtime engine.
|
|
108
|
+
|
|
109
|
+
## Project layout
|
|
110
|
+
|
|
111
|
+
- `error_translator/core.py` loads the rule set and performs the translation.
|
|
112
|
+
- `error_translator/cli.py` provides the `explain-error` command.
|
|
113
|
+
- `error_translator/auto.py` installs the automatic exception hook.
|
|
114
|
+
- `error_translator/server.py` exposes the HTTP API.
|
|
115
|
+
- `error_translator/ast_handlers.py` contains contextual suggestion hooks.
|
|
116
|
+
- `error_translator/rules.json` stores the rule database.
|
|
117
|
+
|
|
118
|
+
## Development notes
|
|
119
|
+
|
|
120
|
+
- `builder.py` can generate new rule drafts with Gemini when `GEMINI_API_KEY` is set.
|
|
121
|
+
- `scraper.py` refreshes the scraped exception dataset from the official Python documentation.
|
|
122
|
+
- `tests/test_core.py` contains the current regression coverage for the translation engine.
|
|
123
|
+
|
|
124
|
+
Built by Gourabananda Datta.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: error-translator-cli-v2
|
|
3
|
+
Version: 1.0.7
|
|
4
|
+
Summary: A CLI tool that explains Python errors in simple human language.
|
|
5
|
+
Author-email: Gourabananda Datta <gourabanandadatta@zohomail.com>
|
|
6
|
+
Requires-Python: >=3.7
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# Error Translator CLI
|
|
10
|
+
|
|
11
|
+
Error Translator CLI turns Python tracebacks into clear, actionable explanations. It is a local, rule-based tool that reads the final error line, matches it against a curated regex rule set, and returns a structured translation with the original file, line number, code context, and a suggested fix.
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- Runs locally with no model inference or external API calls during normal translation.
|
|
16
|
+
- Supports three entry points: automatic crash interception, CLI execution, and direct traceback translation.
|
|
17
|
+
- Extracts file and line information from standard Python tracebacks when available.
|
|
18
|
+
- Includes optional AST-based insight hooks for a few error families.
|
|
19
|
+
- Provides both machine-readable results and colorized terminal output.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Install the published package with pip:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install error-translator-cli-v2
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For local development or running the project from source, install the repository dependencies instead:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install -r requirements.txt
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
### 1. Automatic crash interception
|
|
38
|
+
|
|
39
|
+
Import `error_translator.auto` at the top of a script to replace Python's default exception hook with the translated output.
|
|
40
|
+
|
|
41
|
+
This is the project's magic import: once imported, any unhandled exception in that process is intercepted and formatted by the translator before Python prints the default traceback.
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import error_translator.auto
|
|
45
|
+
|
|
46
|
+
maximum_user_connections = 100
|
|
47
|
+
print(maximum_user_connectons)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Use this when you want the translation to happen automatically without wrapping your code in a custom try/except block.
|
|
51
|
+
|
|
52
|
+
### 2. CLI execution
|
|
53
|
+
|
|
54
|
+
Run a script through the CLI and let the tool translate crashes from `stderr`.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
explain-error run script.py
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You can also translate a raw traceback or error string directly:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
explain-error "TypeError: unsupported operand type(s) for +: 'int' and 'str'"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If you want to pipe a saved traceback into the tool, use the shell syntax for your terminal:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
Get-Content error.log | explain-error
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
cat error.log | explain-error
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Programmatic use
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from error_translator.core import translate_error
|
|
80
|
+
|
|
81
|
+
result = translate_error(traceback_text)
|
|
82
|
+
print(result["explanation"])
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 4. HTTP API
|
|
86
|
+
|
|
87
|
+
Start the FastAPI app with Uvicorn:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
uvicorn error_translator.server:app --reload
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`POST /translate` expects JSON in the form:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"traceback_setting": "Traceback (most recent call last): ..."
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## What the translator returns
|
|
102
|
+
|
|
103
|
+
The translation engine returns a dictionary with these fields when available:
|
|
104
|
+
|
|
105
|
+
- `explanation`
|
|
106
|
+
- `fix`
|
|
107
|
+
- `matched_error`
|
|
108
|
+
- `file`
|
|
109
|
+
- `line`
|
|
110
|
+
- `code`
|
|
111
|
+
- `ast_insight`
|
|
112
|
+
|
|
113
|
+
## Supported errors
|
|
114
|
+
|
|
115
|
+
The bundled rule set covers many common Python runtime, syntax, indentation, import, OS, encoding, and networking errors. The full list lives in `error_translator/rules.json` and can be expanded over time without changing the runtime engine.
|
|
116
|
+
|
|
117
|
+
## Project layout
|
|
118
|
+
|
|
119
|
+
- `error_translator/core.py` loads the rule set and performs the translation.
|
|
120
|
+
- `error_translator/cli.py` provides the `explain-error` command.
|
|
121
|
+
- `error_translator/auto.py` installs the automatic exception hook.
|
|
122
|
+
- `error_translator/server.py` exposes the HTTP API.
|
|
123
|
+
- `error_translator/ast_handlers.py` contains contextual suggestion hooks.
|
|
124
|
+
- `error_translator/rules.json` stores the rule database.
|
|
125
|
+
|
|
126
|
+
## Development notes
|
|
127
|
+
|
|
128
|
+
- `builder.py` can generate new rule drafts with Gemini when `GEMINI_API_KEY` is set.
|
|
129
|
+
- `scraper.py` refreshes the scraped exception dataset from the official Python documentation.
|
|
130
|
+
- `tests/test_core.py` contains the current regression coverage for the translation engine.
|
|
131
|
+
|
|
132
|
+
Built by Gourabananda Datta.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: error-translator-cli-v2
|
|
3
|
-
Version: 1.0.6
|
|
4
|
-
Summary: A CLI tool that explains Python errors in simple human language.
|
|
5
|
-
Author-email: Gourabananda Datta <gourabanandadatta@zohomail.com>
|
|
6
|
-
Requires-Python: >=3.7
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
|
|
9
|
-
# Error Translator CLI
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
A lightweight, rule-based command-line tool designed to translate confusing Python traceback errors into plain, human-readable English and suggest actionable fixes.
|
|
13
|
-
|
|
14
|
-
## Key Features
|
|
15
|
-
- **No AI or LLMs Required:** Runs entirely locally using fast, regex-based pattern matching.
|
|
16
|
-
- **Beginner Friendly:** Explains the root cause of errors in simple English terminology, making debugging more approachable.
|
|
17
|
-
- **Actionable Guidance:** Provides practical, suggested fixes tailored to your specific code context.
|
|
18
|
-
- **Pinpoint Accuracy:** Extracts and highlights the exact file name and line number where the code encountered an issue.
|
|
19
|
-
- **Improved Readability:** Utilizes well-formatted, color-coded terminal output to make reading errors easier.
|
|
20
|
-
|
|
21
|
-
## Installation
|
|
22
|
-
You can install this tool globally on your machine using pip:
|
|
23
|
-
```bash
|
|
24
|
-
pip install error-translator-cli-v2
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Quick Start Guide
|
|
28
|
-
You can use the Error Translator in three distinct ways, depending on your preferred workflow:
|
|
29
|
-
|
|
30
|
-
### 1. Magic Import (Recommended)
|
|
31
|
-
Simply add this single import statement at the top of your Python script. If your script crashes, the tool will automatically intercept and translate the error.
|
|
32
|
-
|
|
33
|
-
```python
|
|
34
|
-
import error_translator.auto
|
|
35
|
-
|
|
36
|
-
# Your normal code...
|
|
37
|
-
math_is_broken = 10 / 0 # This crash will be automatically intercepted and translated
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### 2. Run Scripts via CLI
|
|
41
|
-
You can execute your Python files directly through the provided CLI tool. It will run your program normally and intercept any crashes if they occur.
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
explain-error run script.py
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 3. Translate Raw Error Strings
|
|
48
|
-
You can also pass raw error messages directly as a string or pipe them from another command.
|
|
49
|
-
|
|
50
|
-
**Pass directly:**
|
|
51
|
-
```bash
|
|
52
|
-
explain-error "TypeError: unsupported operand type(s) for +: 'int' and 'str'"
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Pipe from a file:**
|
|
56
|
-
```bash
|
|
57
|
-
cat error.log | explain-error
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Supported Errors
|
|
61
|
-
Currently, the tool can accurately diagnose and explain the following Python errors:
|
|
62
|
-
- NameError
|
|
63
|
-
- TypeError
|
|
64
|
-
- IndexError
|
|
65
|
-
- KeyError
|
|
66
|
-
- ZeroDivisionError
|
|
67
|
-
- ModuleNotFoundError
|
|
68
|
-
- AttributeError
|
|
69
|
-
|
|
70
|
-
*Note: More error definitions are actively being added to the database.*
|
|
71
|
-
|
|
72
|
-
## Cloud API
|
|
73
|
-
This tool includes a built-in FastAPI server so you can integrate the translation engine into your own web apps or VS Code extensions.
|
|
74
|
-
```bash
|
|
75
|
-
uvicorn error_translator.server:app --reload
|
|
76
|
-
```
|
|
77
|
-
---
|
|
78
|
-
Built by Gourabananda Datta.
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Error Translator CLI
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
A lightweight, rule-based command-line tool designed to translate confusing Python traceback errors into plain, human-readable English and suggest actionable fixes.
|
|
5
|
-
|
|
6
|
-
## Key Features
|
|
7
|
-
- **No AI or LLMs Required:** Runs entirely locally using fast, regex-based pattern matching.
|
|
8
|
-
- **Beginner Friendly:** Explains the root cause of errors in simple English terminology, making debugging more approachable.
|
|
9
|
-
- **Actionable Guidance:** Provides practical, suggested fixes tailored to your specific code context.
|
|
10
|
-
- **Pinpoint Accuracy:** Extracts and highlights the exact file name and line number where the code encountered an issue.
|
|
11
|
-
- **Improved Readability:** Utilizes well-formatted, color-coded terminal output to make reading errors easier.
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
You can install this tool globally on your machine using pip:
|
|
15
|
-
```bash
|
|
16
|
-
pip install error-translator-cli-v2
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick Start Guide
|
|
20
|
-
You can use the Error Translator in three distinct ways, depending on your preferred workflow:
|
|
21
|
-
|
|
22
|
-
### 1. Magic Import (Recommended)
|
|
23
|
-
Simply add this single import statement at the top of your Python script. If your script crashes, the tool will automatically intercept and translate the error.
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
import error_translator.auto
|
|
27
|
-
|
|
28
|
-
# Your normal code...
|
|
29
|
-
math_is_broken = 10 / 0 # This crash will be automatically intercepted and translated
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### 2. Run Scripts via CLI
|
|
33
|
-
You can execute your Python files directly through the provided CLI tool. It will run your program normally and intercept any crashes if they occur.
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
explain-error run script.py
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### 3. Translate Raw Error Strings
|
|
40
|
-
You can also pass raw error messages directly as a string or pipe them from another command.
|
|
41
|
-
|
|
42
|
-
**Pass directly:**
|
|
43
|
-
```bash
|
|
44
|
-
explain-error "TypeError: unsupported operand type(s) for +: 'int' and 'str'"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Pipe from a file:**
|
|
48
|
-
```bash
|
|
49
|
-
cat error.log | explain-error
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Supported Errors
|
|
53
|
-
Currently, the tool can accurately diagnose and explain the following Python errors:
|
|
54
|
-
- NameError
|
|
55
|
-
- TypeError
|
|
56
|
-
- IndexError
|
|
57
|
-
- KeyError
|
|
58
|
-
- ZeroDivisionError
|
|
59
|
-
- ModuleNotFoundError
|
|
60
|
-
- AttributeError
|
|
61
|
-
|
|
62
|
-
*Note: More error definitions are actively being added to the database.*
|
|
63
|
-
|
|
64
|
-
## Cloud API
|
|
65
|
-
This tool includes a built-in FastAPI server so you can integrate the translation engine into your own web apps or VS Code extensions.
|
|
66
|
-
```bash
|
|
67
|
-
uvicorn error_translator.server:app --reload
|
|
68
|
-
```
|
|
69
|
-
---
|
|
70
|
-
Built by Gourabananda Datta.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: error-translator-cli-v2
|
|
3
|
-
Version: 1.0.6
|
|
4
|
-
Summary: A CLI tool that explains Python errors in simple human language.
|
|
5
|
-
Author-email: Gourabananda Datta <gourabanandadatta@zohomail.com>
|
|
6
|
-
Requires-Python: >=3.7
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
|
|
9
|
-
# Error Translator CLI
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
A lightweight, rule-based command-line tool designed to translate confusing Python traceback errors into plain, human-readable English and suggest actionable fixes.
|
|
13
|
-
|
|
14
|
-
## Key Features
|
|
15
|
-
- **No AI or LLMs Required:** Runs entirely locally using fast, regex-based pattern matching.
|
|
16
|
-
- **Beginner Friendly:** Explains the root cause of errors in simple English terminology, making debugging more approachable.
|
|
17
|
-
- **Actionable Guidance:** Provides practical, suggested fixes tailored to your specific code context.
|
|
18
|
-
- **Pinpoint Accuracy:** Extracts and highlights the exact file name and line number where the code encountered an issue.
|
|
19
|
-
- **Improved Readability:** Utilizes well-formatted, color-coded terminal output to make reading errors easier.
|
|
20
|
-
|
|
21
|
-
## Installation
|
|
22
|
-
You can install this tool globally on your machine using pip:
|
|
23
|
-
```bash
|
|
24
|
-
pip install error-translator-cli-v2
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Quick Start Guide
|
|
28
|
-
You can use the Error Translator in three distinct ways, depending on your preferred workflow:
|
|
29
|
-
|
|
30
|
-
### 1. Magic Import (Recommended)
|
|
31
|
-
Simply add this single import statement at the top of your Python script. If your script crashes, the tool will automatically intercept and translate the error.
|
|
32
|
-
|
|
33
|
-
```python
|
|
34
|
-
import error_translator.auto
|
|
35
|
-
|
|
36
|
-
# Your normal code...
|
|
37
|
-
math_is_broken = 10 / 0 # This crash will be automatically intercepted and translated
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### 2. Run Scripts via CLI
|
|
41
|
-
You can execute your Python files directly through the provided CLI tool. It will run your program normally and intercept any crashes if they occur.
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
explain-error run script.py
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 3. Translate Raw Error Strings
|
|
48
|
-
You can also pass raw error messages directly as a string or pipe them from another command.
|
|
49
|
-
|
|
50
|
-
**Pass directly:**
|
|
51
|
-
```bash
|
|
52
|
-
explain-error "TypeError: unsupported operand type(s) for +: 'int' and 'str'"
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Pipe from a file:**
|
|
56
|
-
```bash
|
|
57
|
-
cat error.log | explain-error
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Supported Errors
|
|
61
|
-
Currently, the tool can accurately diagnose and explain the following Python errors:
|
|
62
|
-
- NameError
|
|
63
|
-
- TypeError
|
|
64
|
-
- IndexError
|
|
65
|
-
- KeyError
|
|
66
|
-
- ZeroDivisionError
|
|
67
|
-
- ModuleNotFoundError
|
|
68
|
-
- AttributeError
|
|
69
|
-
|
|
70
|
-
*Note: More error definitions are actively being added to the database.*
|
|
71
|
-
|
|
72
|
-
## Cloud API
|
|
73
|
-
This tool includes a built-in FastAPI server so you can integrate the translation engine into your own web apps or VS Code extensions.
|
|
74
|
-
```bash
|
|
75
|
-
uvicorn error_translator.server:app --reload
|
|
76
|
-
```
|
|
77
|
-
---
|
|
78
|
-
Built by Gourabananda Datta.
|
{error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/__init__.py
RENAMED
|
File without changes
|
{error_translator_cli_v2-1.0.6 → error_translator_cli_v2-1.0.7}/error_translator/ast_handlers.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
|