typio 0.1__tar.gz → 0.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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  # Other Contributors
7
7
  ----------
8
- - [Gemini](https://gemini.google.com) ++
8
+ - [ChatGPT](https://chat.openai.com/) ++
9
9
 
10
10
  ++ Graphic designer
11
11
 
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
+ ## [0.2] - 2026-02-04
9
+ ### Changed
10
+ - `README.md` updated
11
+ - `end` parameter added to `type_print` function
12
+ - Test system modified
8
13
  ## [0.1] - 2026-01-31
9
14
  ### Added
10
15
  - `type_print` function
@@ -16,7 +21,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
16
21
  - `TYPEWRITER` mode
17
22
  - `ADAPTIVE` mode
18
23
 
19
- [Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.1...dev
24
+ [Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.2...dev
25
+ [0.2]: https://github.com/sepandhaghighi/typio/compare/v0.1...v0.2
20
26
  [0.1]: https://github.com/sepandhaghighi/typio/compare/750c00e...v0.1
21
27
 
22
28
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: typio
3
- Version: 0.1
3
+ Version: 0.2
4
4
  Summary: Typio: Make Your Terminal Type Like a Human
5
5
  Home-page: https://github.com/sepandhaghighi/typio
6
- Download-URL: https://github.com/sepandhaghighi/typio/tarball/v0.1
6
+ Download-URL: https://github.com/sepandhaghighi/typio/tarball/v0.2
7
7
  Author: Sepand Haghighi
8
8
  Author-email: me@sepand.tech
9
9
  License: MIT
@@ -53,6 +53,7 @@ Dynamic: summary
53
53
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
54
54
  <a href="https://github.com/sepandhaghighi/typio"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/sepandhaghighi/typio"></a>
55
55
  <a href="https://badge.fury.io/py/typio"><img src="https://badge.fury.io/py/typio.svg" alt="PyPI version"></a>
56
+ <a href="https://codecov.io/gh/sepandhaghighi/typio"><img src="https://codecov.io/gh/sepandhaghighi/typio/graph/badge.svg?token=UPhwanwQVw"></a>
56
57
  </div>
57
58
 
58
59
  ## Overview
@@ -87,16 +88,24 @@ Typio is a lightweight Python library that prints text to the terminal as if it
87
88
  </tr>
88
89
  </table>
89
90
 
91
+ <table>
92
+ <tr>
93
+ <td align="center">Code Quality</td>
94
+ <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/typio"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/typio/badge" alt="CodeFactor"></a></td>
95
+ <td align="center"><a href="https://app.codacy.com/gh/sepandhaghighi/typio/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/e047db39052a4be2859f299dd7f7ce3c"></a></td>
96
+ </tr>
97
+ </table>
98
+
90
99
  ## Installation
91
100
 
92
101
  ### Source Code
93
- - Download [Version 0.1](https://github.com/sepandhaghighi/typio/archive/v0.1.zip) or [Latest Source](https://github.com/sepandhaghighi/typio/archive/dev.zip)
102
+ - Download [Version 0.2](https://github.com/sepandhaghighi/typio/archive/v0.2.zip) or [Latest Source](https://github.com/sepandhaghighi/typio/archive/dev.zip)
94
103
  - `pip install .`
95
104
 
96
105
  ### PyPI
97
106
 
98
107
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
99
- - `pip install typio==0.1`
108
+ - `pip install typio==0.2`
100
109
 
101
110
 
102
111
  ## Usage
@@ -115,6 +124,7 @@ type_print(
115
124
  "Typing with style and personality.",
116
125
  delay=0.06,
117
126
  jitter=0.02,
127
+ end="\n",
118
128
  mode=TypeMode.ADAPTIVE,
119
129
  )
120
130
  ```
@@ -191,6 +201,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
191
201
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
192
202
 
193
203
  ## [Unreleased]
204
+ ## [0.2] - 2026-02-04
205
+ ### Changed
206
+ - `README.md` updated
207
+ - `end` parameter added to `type_print` function
208
+ - Test system modified
194
209
  ## [0.1] - 2026-01-31
195
210
  ### Added
196
211
  - `type_print` function
@@ -202,7 +217,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
202
217
  - `TYPEWRITER` mode
203
218
  - `ADAPTIVE` mode
204
219
 
205
- [Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.1...dev
220
+ [Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.2...dev
221
+ [0.2]: https://github.com/sepandhaghighi/typio/compare/v0.1...v0.2
206
222
  [0.1]: https://github.com/sepandhaghighi/typio/compare/750c00e...v0.1
207
223
 
208
224
 
@@ -5,6 +5,7 @@
5
5
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
6
6
  <a href="https://github.com/sepandhaghighi/typio"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/sepandhaghighi/typio"></a>
7
7
  <a href="https://badge.fury.io/py/typio"><img src="https://badge.fury.io/py/typio.svg" alt="PyPI version"></a>
8
+ <a href="https://codecov.io/gh/sepandhaghighi/typio"><img src="https://codecov.io/gh/sepandhaghighi/typio/graph/badge.svg?token=UPhwanwQVw"></a>
8
9
  </div>
9
10
 
10
11
  ## Overview
@@ -39,16 +40,24 @@ Typio is a lightweight Python library that prints text to the terminal as if it
39
40
  </tr>
40
41
  </table>
41
42
 
43
+ <table>
44
+ <tr>
45
+ <td align="center">Code Quality</td>
46
+ <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/typio"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/typio/badge" alt="CodeFactor"></a></td>
47
+ <td align="center"><a href="https://app.codacy.com/gh/sepandhaghighi/typio/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/e047db39052a4be2859f299dd7f7ce3c"></a></td>
48
+ </tr>
49
+ </table>
50
+
42
51
  ## Installation
43
52
 
44
53
  ### Source Code
45
- - Download [Version 0.1](https://github.com/sepandhaghighi/typio/archive/v0.1.zip) or [Latest Source](https://github.com/sepandhaghighi/typio/archive/dev.zip)
54
+ - Download [Version 0.2](https://github.com/sepandhaghighi/typio/archive/v0.2.zip) or [Latest Source](https://github.com/sepandhaghighi/typio/archive/dev.zip)
46
55
  - `pip install .`
47
56
 
48
57
  ### PyPI
49
58
 
50
59
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
51
- - `pip install typio==0.1`
60
+ - `pip install typio==0.2`
52
61
 
53
62
 
54
63
  ## Usage
@@ -67,6 +76,7 @@ type_print(
67
76
  "Typing with style and personality.",
68
77
  delay=0.06,
69
78
  jitter=0.02,
79
+ end="\n",
70
80
  mode=TypeMode.ADAPTIVE,
71
81
  )
72
82
  ```
@@ -4,8 +4,8 @@
4
4
 
5
5
  | Version | Supported |
6
6
  | ------------- | ------------------ |
7
- | 0.1 | :white_check_mark: |
8
- | < 0.1 | :x: |
7
+ | 0.2 | :white_check_mark: |
8
+ | < 0.2 | :x: |
9
9
 
10
10
  ## Reporting a Vulnerability
11
11
 
@@ -34,7 +34,7 @@ def read_description() -> str:
34
34
  setup(
35
35
  name='typio',
36
36
  packages=['typio'],
37
- version='0.1',
37
+ version='0.2',
38
38
  description='Typio: Make Your Terminal Type Like a Human',
39
39
  long_description=read_description(),
40
40
  long_description_content_type='text/markdown',
@@ -42,7 +42,7 @@ setup(
42
42
  author='Sepand Haghighi',
43
43
  author_email='me@sepand.tech',
44
44
  url='https://github.com/sepandhaghighi/typio',
45
- download_url='https://github.com/sepandhaghighi/typio/tarball/v0.1',
45
+ download_url='https://github.com/sepandhaghighi/typio/tarball/v0.2',
46
46
  keywords="terminal cli typing typewriter typing-effect console stdout ux",
47
47
  project_urls={
48
48
  'Source': 'https://github.com/sepandhaghighi/typio'
@@ -40,6 +40,11 @@ def test_invalid_mode():
40
40
  type_print("test", mode="char")
41
41
 
42
42
 
43
+ def test_invalid_end():
44
+ with pytest.raises(TypioError, match=r"`end` must be a str."):
45
+ type_print("test", end=1)
46
+
47
+
43
48
  def test_invalid_file():
44
49
  with pytest.raises(TypioError, match=r"`file` must be a file-like object."):
45
50
  type_print("test", file=123)
@@ -1,9 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import io
3
3
  import sys
4
- import unittest
5
-
6
- import pytest
7
4
 
8
5
  from typio import type_print, typestyle
9
6
  from typio import TypeMode
@@ -12,53 +9,59 @@ from typio import TypeMode
12
9
  def test_basic_print():
13
10
  buffer = io.StringIO()
14
11
  type_print("hello", file=buffer, delay=0)
15
- unittest.TestCase().assertEqual(buffer.getvalue(), "hello")
12
+ assert buffer.getvalue() == "hello\n"
13
+
14
+
15
+ def test_end():
16
+ buffer = io.StringIO()
17
+ type_print("hello", file=buffer, delay=0, end="\nqw")
18
+ assert buffer.getvalue() == "hello\nqw"
16
19
 
17
20
 
18
21
  def test_bytes_input():
19
22
  buffer = io.StringIO()
20
23
  type_print(b"hello", file=buffer, delay=0)
21
- unittest.TestCase().assertEqual(buffer.getvalue(), "hello")
24
+ assert buffer.getvalue() == "hello\n"
22
25
 
23
26
 
24
27
  def test_word_mode():
25
28
  buffer = io.StringIO()
26
29
  type_print("hello world", file=buffer, delay=0, mode=TypeMode.WORD)
27
- unittest.TestCase().assertEqual(buffer.getvalue(), "hello world")
30
+ assert buffer.getvalue() == "hello world\n"
28
31
 
29
32
 
30
33
  def test_line_mode():
31
34
  buffer = io.StringIO()
32
35
  text = "a\nb\nc\n"
33
36
  type_print(text, file=buffer, delay=0, mode=TypeMode.LINE)
34
- unittest.TestCase().assertEqual(buffer.getvalue(), text)
37
+ assert buffer.getvalue() == text + "\n"
35
38
 
36
39
 
37
40
  def test_sentence_mode():
38
41
  buffer = io.StringIO()
39
42
  text = "Hello! How are you?"
40
43
  type_print(text, file=buffer, delay=0, mode=TypeMode.SENTENCE)
41
- unittest.TestCase().assertEqual(buffer.getvalue(), text)
44
+ assert buffer.getvalue() == text + "\n"
42
45
 
43
46
 
44
47
  def test_typewriter_mode():
45
48
  buffer = io.StringIO()
46
49
  text = "Hello\nWorld\n"
47
50
  type_print(text, file=buffer, delay=0, mode=TypeMode.TYPEWRITER)
48
- unittest.TestCase().assertEqual(buffer.getvalue(), text)
51
+ assert buffer.getvalue() == text + "\n"
49
52
 
50
53
 
51
54
  def test_adaptive_mode():
52
55
  buffer = io.StringIO()
53
56
  text = "Hello, world!"
54
57
  type_print(text, file=buffer, delay=0, mode=TypeMode.ADAPTIVE)
55
- unittest.TestCase().assertEqual(buffer.getvalue(), text)
58
+ assert buffer.getvalue() == text + "\n"
56
59
 
57
60
 
58
61
  def test_default_stdout_capture(capsys):
59
62
  type_print("hello", delay=0)
60
63
  captured = capsys.readouterr()
61
- assert captured.out == "hello"
64
+ assert captured.out == "hello\n"
62
65
 
63
66
 
64
67
  def test_typestyle_decorator():
@@ -5,3 +5,4 @@ from .errors import TypioError
5
5
  from .functions import type_print, typestyle
6
6
 
7
7
  __version__ = TYPIO_VERSION
8
+ __all__ = ["TypeMode", "TypioError", "type_print", "typestyle"]
@@ -4,5 +4,5 @@
4
4
 
5
5
  class TypioError(Exception):
6
6
  """Base class for errors in Typio."""
7
-
7
+
8
8
  pass
@@ -11,6 +11,7 @@ from typing import Any, Callable, Optional
11
11
  from .params import TypeMode
12
12
  from .params import INVALID_TEXT_ERROR, INVALID_BYTE_ERROR, INVALID_DELAY_ERROR
13
13
  from .params import INVALID_JITTER_ERROR, INVALID_MODE_ERROR, INVALID_FILE_ERROR
14
+ from .params import INVALID_END_ERROR
14
15
  from .errors import TypioError
15
16
 
16
17
 
@@ -19,6 +20,7 @@ def _validate(
19
20
  delay: Any,
20
21
  jitter: Any,
21
22
  mode: Any,
23
+ end: Any,
22
24
  file: Any,
23
25
  ) -> str:
24
26
  """
@@ -28,6 +30,7 @@ def _validate(
28
30
  :param delay: base delay (in seconds) between emitted units
29
31
  :param jitter: random jitter added/subtracted from delay
30
32
  :param mode: typing mode controlling emission granularity
33
+ :param end: end character(s)
31
34
  :param file: output stream supporting a write() method
32
35
  """
33
36
  if not isinstance(text, (str, bytes)):
@@ -48,9 +51,12 @@ def _validate(
48
51
  if not isinstance(mode, TypeMode):
49
52
  raise TypioError(INVALID_MODE_ERROR)
50
53
 
54
+ if not isinstance(end, str):
55
+ raise TypioError(INVALID_END_ERROR)
56
+
51
57
  if file is not None and not hasattr(file, "write"):
52
58
  raise TypioError(INVALID_FILE_ERROR)
53
-
59
+ text = f"{text}{end}"
54
60
  return text
55
61
 
56
62
 
@@ -179,18 +185,20 @@ def type_print(
179
185
  *,
180
186
  delay: float = 0.04,
181
187
  jitter: float = 0,
188
+ end: str = "\n",
182
189
  mode: TypeMode = TypeMode.CHAR,
183
- file: Optional[TextIOBase] = None):
190
+ file: Optional[TextIOBase] = None) -> None:
184
191
  """
185
192
  Print text with typing effects.
186
193
 
187
194
  :param text: text to be printed
188
195
  :param delay: base delay (in seconds) between emitted units
189
196
  :param jitter: random jitter added/subtracted from delay
197
+ :param end: end character(s)
190
198
  :param mode: typing mode controlling emission granularity
191
199
  :param file: output stream supporting a write() method
192
200
  """
193
- text = _validate(text, delay, jitter, mode, file)
201
+ text = _validate(text, delay, jitter, mode, end, file)
194
202
  out = file or sys.stdout
195
203
 
196
204
  printer = _TypioPrinter(
@@ -204,9 +212,9 @@ def type_print(
204
212
 
205
213
 
206
214
  def typestyle(
207
- *,
208
- delay: float = 0.04,
209
- jitter: float = 0,
215
+ *,
216
+ delay: float = 0.04,
217
+ jitter: float = 0,
210
218
  mode: TypeMode = TypeMode.CHAR) -> Callable:
211
219
  """
212
220
  Apply typing effects to all print() calls inside the decorated function.
@@ -215,7 +223,7 @@ def typestyle(
215
223
  :param jitter: random jitter added/subtracted from delay
216
224
  :param mode: typing mode controlling emission granularity
217
225
  """
218
- _validate("", delay, jitter, mode, sys.stdout)
226
+ _validate("", delay, jitter, mode, "", sys.stdout)
219
227
 
220
228
  def decorator(func: Callable) -> Callable:
221
229
  @wraps(func)
@@ -2,12 +2,12 @@
2
2
  """typio params."""
3
3
  from enum import Enum
4
4
 
5
- TYPIO_VERSION = "0.1"
5
+ TYPIO_VERSION = "0.2"
6
6
 
7
7
 
8
8
  class TypeMode(Enum):
9
9
  """Type mode enum."""
10
-
10
+
11
11
  CHAR = "char"
12
12
  WORD = "word"
13
13
  LINE = "line"
@@ -21,4 +21,5 @@ INVALID_BYTE_ERROR = "bytes text must be UTF-8 decodable."
21
21
  INVALID_DELAY_ERROR = "`delay` must be a non-negative number."
22
22
  INVALID_JITTER_ERROR = "`jitter` must be a non-negative number."
23
23
  INVALID_MODE_ERROR = "`mode` must be a TypeMode enum value."
24
+ INVALID_END_ERROR = "`end` must be a str."
24
25
  INVALID_FILE_ERROR = "`file` must be a file-like object."
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: typio
3
- Version: 0.1
3
+ Version: 0.2
4
4
  Summary: Typio: Make Your Terminal Type Like a Human
5
5
  Home-page: https://github.com/sepandhaghighi/typio
6
- Download-URL: https://github.com/sepandhaghighi/typio/tarball/v0.1
6
+ Download-URL: https://github.com/sepandhaghighi/typio/tarball/v0.2
7
7
  Author: Sepand Haghighi
8
8
  Author-email: me@sepand.tech
9
9
  License: MIT
@@ -53,6 +53,7 @@ Dynamic: summary
53
53
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
54
54
  <a href="https://github.com/sepandhaghighi/typio"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/sepandhaghighi/typio"></a>
55
55
  <a href="https://badge.fury.io/py/typio"><img src="https://badge.fury.io/py/typio.svg" alt="PyPI version"></a>
56
+ <a href="https://codecov.io/gh/sepandhaghighi/typio"><img src="https://codecov.io/gh/sepandhaghighi/typio/graph/badge.svg?token=UPhwanwQVw"></a>
56
57
  </div>
57
58
 
58
59
  ## Overview
@@ -87,16 +88,24 @@ Typio is a lightweight Python library that prints text to the terminal as if it
87
88
  </tr>
88
89
  </table>
89
90
 
91
+ <table>
92
+ <tr>
93
+ <td align="center">Code Quality</td>
94
+ <td align="center"><a href="https://www.codefactor.io/repository/github/sepandhaghighi/typio"><img src="https://www.codefactor.io/repository/github/sepandhaghighi/typio/badge" alt="CodeFactor"></a></td>
95
+ <td align="center"><a href="https://app.codacy.com/gh/sepandhaghighi/typio/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/e047db39052a4be2859f299dd7f7ce3c"></a></td>
96
+ </tr>
97
+ </table>
98
+
90
99
  ## Installation
91
100
 
92
101
  ### Source Code
93
- - Download [Version 0.1](https://github.com/sepandhaghighi/typio/archive/v0.1.zip) or [Latest Source](https://github.com/sepandhaghighi/typio/archive/dev.zip)
102
+ - Download [Version 0.2](https://github.com/sepandhaghighi/typio/archive/v0.2.zip) or [Latest Source](https://github.com/sepandhaghighi/typio/archive/dev.zip)
94
103
  - `pip install .`
95
104
 
96
105
  ### PyPI
97
106
 
98
107
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
99
- - `pip install typio==0.1`
108
+ - `pip install typio==0.2`
100
109
 
101
110
 
102
111
  ## Usage
@@ -115,6 +124,7 @@ type_print(
115
124
  "Typing with style and personality.",
116
125
  delay=0.06,
117
126
  jitter=0.02,
127
+ end="\n",
118
128
  mode=TypeMode.ADAPTIVE,
119
129
  )
120
130
  ```
@@ -191,6 +201,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
191
201
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
192
202
 
193
203
  ## [Unreleased]
204
+ ## [0.2] - 2026-02-04
205
+ ### Changed
206
+ - `README.md` updated
207
+ - `end` parameter added to `type_print` function
208
+ - Test system modified
194
209
  ## [0.1] - 2026-01-31
195
210
  ### Added
196
211
  - `type_print` function
@@ -202,7 +217,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
202
217
  - `TYPEWRITER` mode
203
218
  - `ADAPTIVE` mode
204
219
 
205
- [Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.1...dev
220
+ [Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.2...dev
221
+ [0.2]: https://github.com/sepandhaghighi/typio/compare/v0.1...v0.2
206
222
  [0.1]: https://github.com/sepandhaghighi/typio/compare/750c00e...v0.1
207
223
 
208
224
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes