PyTermint 0.0.1__tar.gz → 0.0.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.
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyTermint
3
+ Version: 0.0.3
4
+ Summary: A terminal interface that abstracts it into a tilemap with 3 bit rgb support for charecter fore/background.
5
+ Project-URL: Homepage, https://github.com/Antlar256/PyTerm
6
+ Project-URL: Issues, https://github.com/Antlar256/PyTerm/issues
7
+ Author-email: Antlar256 <antonio0granell2@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+
15
+ # PyTerm
16
+ This is a cross-platform terminal abstraction that converts a tile map to a non-flickering terminal output with 3 bit rgb support using escape codes. It also has significant amounts of input automation for things like typing and movement. It clocks in at around 26.5k bytes (k is 1024) and has no significant dependencies outside of the [***Python Standard Library***](https://docs.python.org/3/library/index.html) (*other than evdev for linux input but it handles the lack of this automatically*).
17
+ ***
18
+ * **Install with "*pip install PyTermint*"**
19
+ * **Import as "*import PyTerm*"**
20
+ * **Create a *init()* function that takes *screen* and returns the inital state of the tile map (*a list of lists addresable as arr[y][x] or [y0 [x0, x1, x2...], y1 [x0, x1, x2...]...]*), a dictionary holding all variables that should persist after the end of a frame and a optional command string**
21
+ * **Create a *tick()* command that takes as inputs *tick(screen, vars, keys)*. Screen is an array, vars is the dict you initialized in *init* and keys which is a set of every key thats pressed**
22
+ * **Call the *run(tick_func, init_func)***
23
+ ***
24
+ ```w
25
+ import PyTerm as pt
26
+ from PyTerm import clear, blit, color, TILE_SET, HEIGHT, WIDTH, pressed
27
+
28
+ def init(screen):
29
+ return (screen, {
30
+ 'text': '',
31
+ 'cpos': (0, 0),
32
+ })
33
+
34
+ def tick(screen, v, keys):
35
+ pt.clear(screen, pt.color(0, bg=1))
36
+ pt.handle_input(v, keys)
37
+ if "alt" in keys and "q" in keys: return "quit"
38
+ pt.blit(screen, pt.str_to_arr(v["text"], pt.color(0)), 0, 0)
39
+ # Cursor rendering
40
+ x, y = v['cpos']
41
+ if pt.inside(screen, (x, y)):
42
+ screen[y][x] = pt.color(8, fg=1, bg=2)
43
+
44
+ if __name__ == "__main__":
45
+ pt.run(tick, init, False)
46
+ ```
47
+ * ***A small text editor for PyTerm***
48
+
49
+ ***
50
+ [GitHub Home page link](https://github.com/Antlar256/PyTerm)
@@ -0,0 +1,36 @@
1
+ # PyTerm
2
+ This is a cross-platform terminal abstraction that converts a tile map to a non-flickering terminal output with 3 bit rgb support using escape codes. It also has significant amounts of input automation for things like typing and movement. It clocks in at around 26.5k bytes (k is 1024) and has no significant dependencies outside of the [***Python Standard Library***](https://docs.python.org/3/library/index.html) (*other than evdev for linux input but it handles the lack of this automatically*).
3
+ ***
4
+ * **Install with "*pip install PyTermint*"**
5
+ * **Import as "*import PyTerm*"**
6
+ * **Create a *init()* function that takes *screen* and returns the inital state of the tile map (*a list of lists addresable as arr[y][x] or [y0 [x0, x1, x2...], y1 [x0, x1, x2...]...]*), a dictionary holding all variables that should persist after the end of a frame and a optional command string**
7
+ * **Create a *tick()* command that takes as inputs *tick(screen, vars, keys)*. Screen is an array, vars is the dict you initialized in *init* and keys which is a set of every key thats pressed**
8
+ * **Call the *run(tick_func, init_func)***
9
+ ***
10
+ ```w
11
+ import PyTerm as pt
12
+ from PyTerm import clear, blit, color, TILE_SET, HEIGHT, WIDTH, pressed
13
+
14
+ def init(screen):
15
+ return (screen, {
16
+ 'text': '',
17
+ 'cpos': (0, 0),
18
+ })
19
+
20
+ def tick(screen, v, keys):
21
+ pt.clear(screen, pt.color(0, bg=1))
22
+ pt.handle_input(v, keys)
23
+ if "alt" in keys and "q" in keys: return "quit"
24
+ pt.blit(screen, pt.str_to_arr(v["text"], pt.color(0)), 0, 0)
25
+ # Cursor rendering
26
+ x, y = v['cpos']
27
+ if pt.inside(screen, (x, y)):
28
+ screen[y][x] = pt.color(8, fg=1, bg=2)
29
+
30
+ if __name__ == "__main__":
31
+ pt.run(tick, init, False)
32
+ ```
33
+ * ***A small text editor for PyTerm***
34
+
35
+ ***
36
+ [GitHub Home page link](https://github.com/Antlar256/PyTerm)
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "PyTermint"
3
- version = "0.0.1"
3
+ version = "0.0.3"
4
4
  authors = [
5
5
  { name="Antlar256", email="antonio0granell2@gmail.com" },
6
6
  ]
7
- description = "A terminal interface that abstracts it into a tilemap."
7
+ description = "A terminal interface that abstracts it into a tilemap with 3 bit rgb support for charecter fore/background."
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.9"
10
10
  classifiers = [
pytermint-0.0.1/PKG-INFO DELETED
@@ -1,17 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: PyTermint
3
- Version: 0.0.1
4
- Summary: A terminal interface that abstracts it into a tilemap.
5
- Project-URL: Homepage, https://github.com/Antlar256/PyTerm
6
- Project-URL: Issues, https://github.com/Antlar256/PyTerm/issues
7
- Author-email: Antlar256 <antonio0granell2@gmail.com>
8
- License-Expression: MIT
9
- License-File: LICENSE
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.9
13
- Description-Content-Type: text/markdown
14
-
15
- # PyTerm
16
- This is a cross-platform terminal abstraction that converts a tile map to a non-flickering terminal output with 3 bit rgb support using escape codes.
17
- [GitHub Home page link](https://github.com/Antlar256/PyTerm)
pytermint-0.0.1/README.md DELETED
@@ -1,3 +0,0 @@
1
- # PyTerm
2
- This is a cross-platform terminal abstraction that converts a tile map to a non-flickering terminal output with 3 bit rgb support using escape codes.
3
- [GitHub Home page link](https://github.com/Antlar256/PyTerm)
File without changes