typio 0.0.0__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.
- typio-0.2/AUTHORS.md +12 -0
- typio-0.2/CHANGELOG.md +29 -0
- typio-0.2/LICENSE +21 -0
- typio-0.2/MANIFEST.in +6 -0
- typio-0.2/PKG-INFO +225 -0
- typio-0.2/README.md +147 -0
- typio-0.2/SECURITY.md +14 -0
- typio-0.2/dev-requirements.txt +6 -0
- typio-0.2/setup.py +73 -0
- typio-0.2/tests/test_errors.py +65 -0
- typio-0.2/tests/test_functions.py +91 -0
- typio-0.2/typio/__init__.py +8 -0
- typio-0.2/typio/__main__.py +5 -0
- typio-0.2/typio/errors.py +8 -0
- typio-0.2/typio/functions.py +245 -0
- typio-0.2/typio/params.py +25 -0
- typio-0.2/typio.egg-info/PKG-INFO +225 -0
- typio-0.2/typio.egg-info/SOURCES.txt +20 -0
- typio-0.2/typio.egg-info/top_level.txt +1 -0
- typio-0.0.0/PKG-INFO +0 -38
- typio-0.0.0/README.md +0 -4
- typio-0.0.0/__init__.py +0 -2
- typio-0.0.0/setup.py +0 -47
- typio-0.0.0/typio.egg-info/PKG-INFO +0 -38
- typio-0.0.0/typio.egg-info/SOURCES.txt +0 -7
- /typio-0.0.0/typio.egg-info/dependency_links.txt → /typio-0.2/requirements.txt +0 -0
- {typio-0.0.0 → typio-0.2}/setup.cfg +0 -0
- /typio-0.0.0/typio.egg-info/top_level.txt → /typio-0.2/typio.egg-info/dependency_links.txt +0 -0
typio-0.2/AUTHORS.md
ADDED
typio-0.2/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
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
|
|
13
|
+
## [0.1] - 2026-01-31
|
|
14
|
+
### Added
|
|
15
|
+
- `type_print` function
|
|
16
|
+
- `typestyle` decorator
|
|
17
|
+
- `CHAR` mode
|
|
18
|
+
- `WORD` mode
|
|
19
|
+
- `LINE` mode
|
|
20
|
+
- `SENTENCE` mode
|
|
21
|
+
- `TYPEWRITER` mode
|
|
22
|
+
- `ADAPTIVE` mode
|
|
23
|
+
|
|
24
|
+
[Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.2...dev
|
|
25
|
+
[0.2]: https://github.com/sepandhaghighi/typio/compare/v0.1...v0.2
|
|
26
|
+
[0.1]: https://github.com/sepandhaghighi/typio/compare/750c00e...v0.1
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
typio-0.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sepand Haghighi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
typio-0.2/MANIFEST.in
ADDED
typio-0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: typio
|
|
3
|
+
Version: 0.2
|
|
4
|
+
Summary: Typio: Make Your Terminal Type Like a Human
|
|
5
|
+
Home-page: https://github.com/sepandhaghighi/typio
|
|
6
|
+
Download-URL: https://github.com/sepandhaghighi/typio/tarball/v0.2
|
|
7
|
+
Author: Sepand Haghighi
|
|
8
|
+
Author-email: me@sepand.tech
|
|
9
|
+
License: MIT
|
|
10
|
+
Project-URL: Source, https://github.com/sepandhaghighi/typio
|
|
11
|
+
Keywords: terminal cli typing typewriter typing-effect console stdout ux
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Natural Language :: English
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Intended Audience :: Developers
|
|
24
|
+
Classifier: Intended Audience :: Education
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
26
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Classifier: Topic :: Utilities
|
|
29
|
+
Classifier: Topic :: Terminals
|
|
30
|
+
Requires-Python: >=3.8
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
License-File: AUTHORS.md
|
|
34
|
+
Dynamic: author
|
|
35
|
+
Dynamic: author-email
|
|
36
|
+
Dynamic: classifier
|
|
37
|
+
Dynamic: description
|
|
38
|
+
Dynamic: description-content-type
|
|
39
|
+
Dynamic: download-url
|
|
40
|
+
Dynamic: home-page
|
|
41
|
+
Dynamic: keywords
|
|
42
|
+
Dynamic: license
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
Dynamic: project-url
|
|
45
|
+
Dynamic: requires-python
|
|
46
|
+
Dynamic: summary
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div align="center">
|
|
50
|
+
<img src="https://github.com/sepandhaghighi/typio/raw/main/otherfiles/logo.png" width="320">
|
|
51
|
+
<h1>Typio: Make Your Terminal Type Like a Human</h1>
|
|
52
|
+
<br/>
|
|
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
|
+
<a href="https://github.com/sepandhaghighi/typio"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/sepandhaghighi/typio"></a>
|
|
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>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
## Overview
|
|
60
|
+
|
|
61
|
+
<p align="justify">
|
|
62
|
+
Typio is a lightweight Python library that prints text to the terminal as if it were being typed by a human. It supports multiple typing modes (character, word, line, sentence, typewriter, and adaptive), configurable delays and jitter for natural variation, and seamless integration with existing code via a simple function or a decorator. Typio is designed to be minimal, extensible, and safe, making it ideal for demos, CLIs, tutorials, and storytelling in the terminal.
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
<table>
|
|
66
|
+
<tr>
|
|
67
|
+
<td align="center">PyPI Counter</td>
|
|
68
|
+
<td align="center"><a href="http://pepy.tech/project/typio"><img src="http://pepy.tech/badge/typio"></a></td>
|
|
69
|
+
</tr>
|
|
70
|
+
<tr>
|
|
71
|
+
<td align="center">Github Stars</td>
|
|
72
|
+
<td align="center"><a href="https://github.com/sepandhaghighi/typio"><img src="https://img.shields.io/github/stars/sepandhaghighi/typio.svg?style=social&label=Stars"></a></td>
|
|
73
|
+
</tr>
|
|
74
|
+
</table>
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
<table>
|
|
79
|
+
<tr>
|
|
80
|
+
<td align="center">Branch</td>
|
|
81
|
+
<td align="center">main</td>
|
|
82
|
+
<td align="center">dev</td>
|
|
83
|
+
</tr>
|
|
84
|
+
<tr>
|
|
85
|
+
<td align="center">CI</td>
|
|
86
|
+
<td align="center"><img src="https://github.com/sepandhaghighi/typio/actions/workflows/test.yml/badge.svg?branch=main"></td>
|
|
87
|
+
<td align="center"><img src="https://github.com/sepandhaghighi/typio/actions/workflows/test.yml/badge.svg?branch=dev"></td>
|
|
88
|
+
</tr>
|
|
89
|
+
</table>
|
|
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
|
+
|
|
99
|
+
## Installation
|
|
100
|
+
|
|
101
|
+
### Source Code
|
|
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)
|
|
103
|
+
- `pip install .`
|
|
104
|
+
|
|
105
|
+
### PyPI
|
|
106
|
+
|
|
107
|
+
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
108
|
+
- `pip install typio==0.2`
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## Usage
|
|
112
|
+
|
|
113
|
+
### Function
|
|
114
|
+
|
|
115
|
+
Use `type_print` function to print text with human-like typing effects. You can control the typing speed, randomness, mode, and output stream.
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
from typio import type_print
|
|
119
|
+
from typio import TypeMode
|
|
120
|
+
|
|
121
|
+
type_print("Hello, world!")
|
|
122
|
+
|
|
123
|
+
type_print(
|
|
124
|
+
"Typing with style and personality.",
|
|
125
|
+
delay=0.06,
|
|
126
|
+
jitter=0.02,
|
|
127
|
+
end="\n",
|
|
128
|
+
mode=TypeMode.ADAPTIVE,
|
|
129
|
+
)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
You can also redirect the output to any file-like object:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
with open("output.txt", "w") as file:
|
|
136
|
+
type_print("Saved with typing effects.", file=file)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Decorator
|
|
140
|
+
|
|
141
|
+
Use the `@typestyle` decorator to apply typing effects to all `print` calls inside a function, without changing the function's implementation.
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
from typio import typestyle
|
|
145
|
+
from typio import TypeMode
|
|
146
|
+
|
|
147
|
+
@typestyle(delay=0.05, mode=TypeMode.TYPEWRITER)
|
|
148
|
+
def intro():
|
|
149
|
+
print("Welcome to Typio.")
|
|
150
|
+
print("Every print is typed.")
|
|
151
|
+
|
|
152
|
+
intro()
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Issues & Bug Reports
|
|
156
|
+
|
|
157
|
+
Just fill an issue and describe it. We'll check it ASAP!
|
|
158
|
+
|
|
159
|
+
- Please complete the issue template
|
|
160
|
+
|
|
161
|
+
## Show Your Support
|
|
162
|
+
|
|
163
|
+
<h3>Star This Repo</h3>
|
|
164
|
+
|
|
165
|
+
Give a ⭐️ if this project helped you!
|
|
166
|
+
|
|
167
|
+
<h3>Donate to Our Project</h3>
|
|
168
|
+
|
|
169
|
+
<h4>Bitcoin</h4>
|
|
170
|
+
1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy
|
|
171
|
+
<h4>Ethereum</h4>
|
|
172
|
+
0xcD4Db18B6664A9662123D4307B074aE968535388
|
|
173
|
+
<h4>Litecoin</h4>
|
|
174
|
+
Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ
|
|
175
|
+
<h4>Doge</h4>
|
|
176
|
+
DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh
|
|
177
|
+
<h4>Tron</h4>
|
|
178
|
+
TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7
|
|
179
|
+
<h4>Ripple</h4>
|
|
180
|
+
rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq
|
|
181
|
+
<h4>Binance Coin</h4>
|
|
182
|
+
bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef
|
|
183
|
+
<h4>Tether</h4>
|
|
184
|
+
0xcD4Db18B6664A9662123D4307B074aE968535388
|
|
185
|
+
<h4>Dash</h4>
|
|
186
|
+
Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s
|
|
187
|
+
<h4>Stellar</h4>
|
|
188
|
+
GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL
|
|
189
|
+
<h4>Zilliqa</h4>
|
|
190
|
+
zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5
|
|
191
|
+
<h4>Coffeete</h4>
|
|
192
|
+
<a href="http://www.coffeete.ir/opensource">
|
|
193
|
+
<img src="http://www.coffeete.ir/images/buttons/lemonchiffon.png" style="width:260px;" />
|
|
194
|
+
</a>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
# Changelog
|
|
198
|
+
All notable changes to this project will be documented in this file.
|
|
199
|
+
|
|
200
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
201
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
202
|
+
|
|
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
|
|
209
|
+
## [0.1] - 2026-01-31
|
|
210
|
+
### Added
|
|
211
|
+
- `type_print` function
|
|
212
|
+
- `typestyle` decorator
|
|
213
|
+
- `CHAR` mode
|
|
214
|
+
- `WORD` mode
|
|
215
|
+
- `LINE` mode
|
|
216
|
+
- `SENTENCE` mode
|
|
217
|
+
- `TYPEWRITER` mode
|
|
218
|
+
- `ADAPTIVE` mode
|
|
219
|
+
|
|
220
|
+
[Unreleased]: https://github.com/sepandhaghighi/typio/compare/v0.2...dev
|
|
221
|
+
[0.2]: https://github.com/sepandhaghighi/typio/compare/v0.1...v0.2
|
|
222
|
+
[0.1]: https://github.com/sepandhaghighi/typio/compare/750c00e...v0.1
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
typio-0.2/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://github.com/sepandhaghighi/typio/raw/main/otherfiles/logo.png" width="320">
|
|
3
|
+
<h1>Typio: Make Your Terminal Type Like a Human</h1>
|
|
4
|
+
<br/>
|
|
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
|
+
<a href="https://github.com/sepandhaghighi/typio"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/sepandhaghighi/typio"></a>
|
|
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>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
<p align="justify">
|
|
14
|
+
Typio is a lightweight Python library that prints text to the terminal as if it were being typed by a human. It supports multiple typing modes (character, word, line, sentence, typewriter, and adaptive), configurable delays and jitter for natural variation, and seamless integration with existing code via a simple function or a decorator. Typio is designed to be minimal, extensible, and safe, making it ideal for demos, CLIs, tutorials, and storytelling in the terminal.
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<table>
|
|
18
|
+
<tr>
|
|
19
|
+
<td align="center">PyPI Counter</td>
|
|
20
|
+
<td align="center"><a href="http://pepy.tech/project/typio"><img src="http://pepy.tech/badge/typio"></a></td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<td align="center">Github Stars</td>
|
|
24
|
+
<td align="center"><a href="https://github.com/sepandhaghighi/typio"><img src="https://img.shields.io/github/stars/sepandhaghighi/typio.svg?style=social&label=Stars"></a></td>
|
|
25
|
+
</tr>
|
|
26
|
+
</table>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<table>
|
|
31
|
+
<tr>
|
|
32
|
+
<td align="center">Branch</td>
|
|
33
|
+
<td align="center">main</td>
|
|
34
|
+
<td align="center">dev</td>
|
|
35
|
+
</tr>
|
|
36
|
+
<tr>
|
|
37
|
+
<td align="center">CI</td>
|
|
38
|
+
<td align="center"><img src="https://github.com/sepandhaghighi/typio/actions/workflows/test.yml/badge.svg?branch=main"></td>
|
|
39
|
+
<td align="center"><img src="https://github.com/sepandhaghighi/typio/actions/workflows/test.yml/badge.svg?branch=dev"></td>
|
|
40
|
+
</tr>
|
|
41
|
+
</table>
|
|
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
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
### Source Code
|
|
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)
|
|
55
|
+
- `pip install .`
|
|
56
|
+
|
|
57
|
+
### PyPI
|
|
58
|
+
|
|
59
|
+
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
|
|
60
|
+
- `pip install typio==0.2`
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
### Function
|
|
66
|
+
|
|
67
|
+
Use `type_print` function to print text with human-like typing effects. You can control the typing speed, randomness, mode, and output stream.
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from typio import type_print
|
|
71
|
+
from typio import TypeMode
|
|
72
|
+
|
|
73
|
+
type_print("Hello, world!")
|
|
74
|
+
|
|
75
|
+
type_print(
|
|
76
|
+
"Typing with style and personality.",
|
|
77
|
+
delay=0.06,
|
|
78
|
+
jitter=0.02,
|
|
79
|
+
end="\n",
|
|
80
|
+
mode=TypeMode.ADAPTIVE,
|
|
81
|
+
)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
You can also redirect the output to any file-like object:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
with open("output.txt", "w") as file:
|
|
88
|
+
type_print("Saved with typing effects.", file=file)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Decorator
|
|
92
|
+
|
|
93
|
+
Use the `@typestyle` decorator to apply typing effects to all `print` calls inside a function, without changing the function's implementation.
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
from typio import typestyle
|
|
97
|
+
from typio import TypeMode
|
|
98
|
+
|
|
99
|
+
@typestyle(delay=0.05, mode=TypeMode.TYPEWRITER)
|
|
100
|
+
def intro():
|
|
101
|
+
print("Welcome to Typio.")
|
|
102
|
+
print("Every print is typed.")
|
|
103
|
+
|
|
104
|
+
intro()
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Issues & Bug Reports
|
|
108
|
+
|
|
109
|
+
Just fill an issue and describe it. We'll check it ASAP!
|
|
110
|
+
|
|
111
|
+
- Please complete the issue template
|
|
112
|
+
|
|
113
|
+
## Show Your Support
|
|
114
|
+
|
|
115
|
+
<h3>Star This Repo</h3>
|
|
116
|
+
|
|
117
|
+
Give a ⭐️ if this project helped you!
|
|
118
|
+
|
|
119
|
+
<h3>Donate to Our Project</h3>
|
|
120
|
+
|
|
121
|
+
<h4>Bitcoin</h4>
|
|
122
|
+
1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy
|
|
123
|
+
<h4>Ethereum</h4>
|
|
124
|
+
0xcD4Db18B6664A9662123D4307B074aE968535388
|
|
125
|
+
<h4>Litecoin</h4>
|
|
126
|
+
Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ
|
|
127
|
+
<h4>Doge</h4>
|
|
128
|
+
DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh
|
|
129
|
+
<h4>Tron</h4>
|
|
130
|
+
TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7
|
|
131
|
+
<h4>Ripple</h4>
|
|
132
|
+
rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq
|
|
133
|
+
<h4>Binance Coin</h4>
|
|
134
|
+
bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef
|
|
135
|
+
<h4>Tether</h4>
|
|
136
|
+
0xcD4Db18B6664A9662123D4307B074aE968535388
|
|
137
|
+
<h4>Dash</h4>
|
|
138
|
+
Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s
|
|
139
|
+
<h4>Stellar</h4>
|
|
140
|
+
GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL
|
|
141
|
+
<h4>Zilliqa</h4>
|
|
142
|
+
zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5
|
|
143
|
+
<h4>Coffeete</h4>
|
|
144
|
+
<a href="http://www.coffeete.ir/opensource">
|
|
145
|
+
<img src="http://www.coffeete.ir/images/buttons/lemonchiffon.png" style="width:260px;" />
|
|
146
|
+
</a>
|
|
147
|
+
|
typio-0.2/SECURITY.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------------- | ------------------ |
|
|
7
|
+
| 0.2 | :white_check_mark: |
|
|
8
|
+
| < 0.2 | :x: |
|
|
9
|
+
|
|
10
|
+
## Reporting a Vulnerability
|
|
11
|
+
|
|
12
|
+
Please report security vulnerabilities by email to [me@sepand.tech](mailto:me@sepand.tech "me@sepand.tech").
|
|
13
|
+
|
|
14
|
+
If the security vulnerability is accepted, a dedicated bugfix release will be issued as soon as possible (depending on the complexity of the fix).
|
typio-0.2/setup.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""Setup module."""
|
|
3
|
+
from typing import List
|
|
4
|
+
try:
|
|
5
|
+
from setuptools import setup
|
|
6
|
+
except ImportError:
|
|
7
|
+
from distutils.core import setup
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_requires() -> List[str]:
|
|
11
|
+
"""Read requirements.txt."""
|
|
12
|
+
requirements = open("requirements.txt", "r").read()
|
|
13
|
+
return list(filter(lambda x: x != "", requirements.split()))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def read_description() -> str:
|
|
17
|
+
"""Read README.md and CHANGELOG.md."""
|
|
18
|
+
try:
|
|
19
|
+
with open("README.md") as r:
|
|
20
|
+
description = "\n"
|
|
21
|
+
description += r.read()
|
|
22
|
+
with open("CHANGELOG.md") as c:
|
|
23
|
+
description += "\n"
|
|
24
|
+
description += c.read()
|
|
25
|
+
return description
|
|
26
|
+
except Exception:
|
|
27
|
+
return '''Typio is a lightweight Python library that prints text to the terminal as if it were being typed by a human.
|
|
28
|
+
It supports multiple typing modes (character, word, line, sentence, typewriter, and adaptive),
|
|
29
|
+
configurable delays and jitter for natural variation, and seamless integration with existing code
|
|
30
|
+
via a simple function or a decorator. Typio is designed to be minimal, extensible, and safe,
|
|
31
|
+
making it ideal for demos, CLIs, tutorials, and storytelling in the terminal.'''
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
setup(
|
|
35
|
+
name='typio',
|
|
36
|
+
packages=['typio'],
|
|
37
|
+
version='0.2',
|
|
38
|
+
description='Typio: Make Your Terminal Type Like a Human',
|
|
39
|
+
long_description=read_description(),
|
|
40
|
+
long_description_content_type='text/markdown',
|
|
41
|
+
include_package_data=True,
|
|
42
|
+
author='Sepand Haghighi',
|
|
43
|
+
author_email='me@sepand.tech',
|
|
44
|
+
url='https://github.com/sepandhaghighi/typio',
|
|
45
|
+
download_url='https://github.com/sepandhaghighi/typio/tarball/v0.2',
|
|
46
|
+
keywords="terminal cli typing typewriter typing-effect console stdout ux",
|
|
47
|
+
project_urls={
|
|
48
|
+
'Source': 'https://github.com/sepandhaghighi/typio'
|
|
49
|
+
},
|
|
50
|
+
install_requires=get_requires(),
|
|
51
|
+
python_requires='>=3.8',
|
|
52
|
+
classifiers=[
|
|
53
|
+
'Development Status :: 3 - Alpha',
|
|
54
|
+
'Natural Language :: English',
|
|
55
|
+
'License :: OSI Approved :: MIT License',
|
|
56
|
+
'Operating System :: OS Independent',
|
|
57
|
+
'Programming Language :: Python :: 3.8',
|
|
58
|
+
'Programming Language :: Python :: 3.9',
|
|
59
|
+
'Programming Language :: Python :: 3.10',
|
|
60
|
+
'Programming Language :: Python :: 3.11',
|
|
61
|
+
'Programming Language :: Python :: 3.12',
|
|
62
|
+
'Programming Language :: Python :: 3.13',
|
|
63
|
+
'Programming Language :: Python :: 3.14',
|
|
64
|
+
'Intended Audience :: Developers',
|
|
65
|
+
'Intended Audience :: Education',
|
|
66
|
+
'Topic :: Software Development :: Libraries',
|
|
67
|
+
'Topic :: Software Development :: User Interfaces',
|
|
68
|
+
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
69
|
+
'Topic :: Utilities',
|
|
70
|
+
'Topic :: Terminals',
|
|
71
|
+
],
|
|
72
|
+
license='MIT',
|
|
73
|
+
)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
from typio import type_print, typestyle
|
|
5
|
+
from typio import TypioError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_invalid_text_type():
|
|
9
|
+
with pytest.raises(TypioError, match=r"`text` must be str or bytes."):
|
|
10
|
+
type_print(123, delay=0)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_invalid_bytes():
|
|
14
|
+
with pytest.raises(TypioError, match=r"bytes text must be UTF-8 decodable."):
|
|
15
|
+
type_print(b"\xff\xff", delay=0)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_negative_delay():
|
|
19
|
+
with pytest.raises(TypioError, match=r"`delay` must be a non-negative number."):
|
|
20
|
+
type_print("test", delay=-1)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_invalid_delay_type():
|
|
24
|
+
with pytest.raises(TypioError, match=r"`delay` must be a non-negative number."):
|
|
25
|
+
type_print("test", delay="fast")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_negative_jitter():
|
|
29
|
+
with pytest.raises(TypioError, match=r"`jitter` must be a non-negative number."):
|
|
30
|
+
type_print("test", jitter=-0.1)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_invalid_jitter_type():
|
|
34
|
+
with pytest.raises(TypioError, match=r"`jitter` must be a non-negative number."):
|
|
35
|
+
type_print("test", jitter="nope")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_invalid_mode():
|
|
39
|
+
with pytest.raises(TypioError, match=r"`mode` must be a TypeMode enum value."):
|
|
40
|
+
type_print("test", mode="char")
|
|
41
|
+
|
|
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
|
+
|
|
48
|
+
def test_invalid_file():
|
|
49
|
+
with pytest.raises(TypioError, match=r"`file` must be a file-like object."):
|
|
50
|
+
type_print("test", file=123)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_typestyle_invalid_mode():
|
|
54
|
+
with pytest.raises(TypioError, match=r"`mode` must be a TypeMode enum value."):
|
|
55
|
+
typestyle(mode="char")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def test_typestyle_invalid_delay():
|
|
59
|
+
with pytest.raises(TypioError, match=r"`delay` must be a non-negative number."):
|
|
60
|
+
typestyle(delay=-1)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_typestyle_invalid_jitter():
|
|
64
|
+
with pytest.raises(TypioError, match=r"`jitter` must be a non-negative number."):
|
|
65
|
+
typestyle(jitter=-0.5)
|