Pythoner 0.1.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.
@@ -0,0 +1,32 @@
1
+ Metadata-Version: 2.3
2
+ Name: Pythoner
3
+ Version: 0.1.0
4
+ Summary: A custom python REPL
5
+ Author: Cade
6
+ Author-email: Cade <cadey.matignas@gmail.com>
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Dist: prompt-toolkit>=3.0.38
11
+ Requires-Dist: pygments>=2.16.1
12
+ Requires-Dist: termcolor>=2.4.0
13
+ Requires-Python: >=3.8
14
+ Project-URL: Homepage, https://github.com/cadeymatignas-source/pysh
15
+ Description-Content-Type: text/markdown
16
+
17
+ # Pythoner
18
+
19
+ ## A custom python REPL
20
+
21
+ Pythoner is a custom python REPL extracted from Pysh (You should go check that out too. Link is homepage) It has
22
+
23
+ - cls/clear function
24
+ - pip and uv intregration
25
+ - block handling
26
+ - syntax highlighting
27
+
28
+ ### Notes
29
+
30
+ - It is not a calculator
31
+ - You have to manually indent
32
+ - It is like writing a python file
@@ -0,0 +1,16 @@
1
+ # Pythoner
2
+
3
+ ## A custom python REPL
4
+
5
+ Pythoner is a custom python REPL extracted from Pysh (You should go check that out too. Link is homepage) It has
6
+
7
+ - cls/clear function
8
+ - pip and uv intregration
9
+ - block handling
10
+ - syntax highlighting
11
+
12
+ ### Notes
13
+
14
+ - It is not a calculator
15
+ - You have to manually indent
16
+ - It is like writing a python file
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.12.21,<0.13"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "Pythoner"
7
+ version = "0.1.0"
8
+ description = "A custom python REPL"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ classifiers = [
12
+ "Programming Language :: Python :: 3",
13
+ "License :: OSI Approved :: MIT License",
14
+ "Operating System :: OS Independent",
15
+ ]
16
+ dependencies = [
17
+ "prompt_toolkit>=3.0.38",
18
+ "pygments>=2.16.1",
19
+ "termcolor>=2.4.0",
20
+ ]
21
+
22
+ [[project.authors]]
23
+ name = "Cade"
24
+ email = "cadey.matignas@gmail.com"
25
+
26
+ [project.urls]
27
+ Homepage = "https://github.com/cadeymatignas-source/pysh"
28
+
29
+ [project.scripts]
30
+ pythoner = "pythoner.cli:main"
@@ -0,0 +1,28 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.12.21,<0.13"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "Pythoner"
7
+ version = "0.1.0"
8
+ authors = [{ name = "Cade", email = "cadey.matignas@gmail.com" }]
9
+ description = "A custom python REPL"
10
+ readme = "README.md"
11
+ requires-python = ">=3.8"
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: OS Independent",
16
+ ]
17
+ dependencies = [
18
+ "prompt_toolkit>=3.0.38",
19
+ "pygments>=2.16.1",
20
+ "termcolor>=2.4.0",
21
+ ]
22
+
23
+ [project.urls]
24
+ Homepage = "https://github.com/cadeymatignas-source/pysh"
25
+
26
+
27
+ [project.scripts]
28
+ pythoner = "pythoner.cli:main"
File without changes
@@ -0,0 +1,55 @@
1
+ import sys
2
+ from os import name
3
+ from subprocess import run
4
+
5
+ from prompt_toolkit import prompt
6
+ from prompt_toolkit.lexers import PygmentsLexer
7
+ from pygments.lexers import PythonLexer
8
+ from termcolor import colored
9
+
10
+
11
+ def main():
12
+ platform = name
13
+
14
+ print(sys.version)
15
+
16
+ while True:
17
+ pyi = prompt("> ", lexer=PygmentsLexer(PythonLexer))
18
+
19
+ if pyi.lower() in ("exit", "exit()"):
20
+ break
21
+
22
+ elif pyi.lower() in ("cls", "clear"):
23
+ if platform == "nt":
24
+ run("cls", shell=True)
25
+ else:
26
+ run("clear", shell=True)
27
+
28
+ elif pyi.startswith(("pip ", "uv ")):
29
+ run(
30
+ pyi,
31
+ shell=True,
32
+ stdin=sys.stdin,
33
+ stdout=sys.stdout,
34
+ stderr=sys.stderr,
35
+ )
36
+
37
+ else:
38
+ try:
39
+ exec(pyi)
40
+
41
+ except IndentationError:
42
+ block = [pyi]
43
+
44
+ while True:
45
+ extra = prompt("-> ", lexer=PygmentsLexer(PythonLexer))
46
+
47
+ if not extra:
48
+ break
49
+
50
+ block.append(extra)
51
+
52
+ exec("\n".join(block))
53
+
54
+ except Exception as e:
55
+ print(colored(f"{type(e).__name__}: {e}", "red"))