codetype 1.0.0 → 1.0.1
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.
- package/LICENSE +21 -0
- package/README.md +82 -25
- package/package.json +3 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 rohan4naik
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,17 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# ⌨️ CodeType
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Offline terminal code-typing practice — sharpen your speed on real code.**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/codetype)
|
|
8
|
+
[](https://www.npmjs.com/package/codetype)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
[](https://www.python.org/)
|
|
11
|
+
|
|
12
|
+
A fast, distraction-free typing trainer that runs entirely in your terminal.
|
|
13
|
+
Practice on real snippets across nine languages, track your WPM, and beat your
|
|
14
|
+
own records — no browser, no accounts, no network.
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## ✨ Features
|
|
21
|
+
|
|
22
|
+
- **Real code, nine languages** — Python, JavaScript, TypeScript, C, Go, Rust, Java, SQL, and Bash.
|
|
23
|
+
- **Speed-test mode** — a fresh block of common words each run for raw typing speed.
|
|
24
|
+
- **Live metrics** — WPM, accuracy, and a timer that starts on your first keystroke.
|
|
25
|
+
- **Smart indentation** — leading whitespace on new lines auto-skips, so you type code, not spaces.
|
|
26
|
+
- **Persistent stats** — every run is saved locally; view your history and per-language bests anytime.
|
|
27
|
+
- **Fully offline** — pure Python standard library (`curses`). No dependencies, no telemetry.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🚀 Installation
|
|
32
|
+
|
|
33
|
+
### Via npm (recommended)
|
|
8
34
|
|
|
9
35
|
```sh
|
|
10
|
-
|
|
36
|
+
npm install -g codetype
|
|
11
37
|
codetype
|
|
12
38
|
```
|
|
13
39
|
|
|
14
|
-
|
|
40
|
+
> Requires **Python 3.8+** on your `PATH`. The npm package ships a small Node
|
|
41
|
+
> launcher that runs the bundled Python game. On Windows the launcher will
|
|
42
|
+
> prompt you to `pip install windows-curses` if needed.
|
|
43
|
+
|
|
44
|
+
### Via pip / pipx
|
|
45
|
+
|
|
46
|
+
If you prefer a native Python install:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
pipx install codetype-cli
|
|
50
|
+
codetype
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or from a clone:
|
|
15
54
|
|
|
16
55
|
```sh
|
|
17
56
|
git clone https://github.com/rohan4naik/codetype-cli
|
|
@@ -20,36 +59,54 @@ pip install .
|
|
|
20
59
|
codetype
|
|
21
60
|
```
|
|
22
61
|
|
|
23
|
-
|
|
62
|
+
### No install
|
|
63
|
+
|
|
64
|
+
Run straight from a clone:
|
|
24
65
|
|
|
25
66
|
```sh
|
|
26
67
|
python3 -m codetype
|
|
27
68
|
```
|
|
28
69
|
|
|
29
|
-
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🎮 How to play
|
|
73
|
+
|
|
74
|
+
1. **Pick a mode** from the menu — a language, `sentences (speed test)`, or `random`.
|
|
75
|
+
2. **Type the snippet exactly.** Correct characters turn green; mistakes flash red and must be
|
|
76
|
+
backspaced before you can continue.
|
|
77
|
+
3. **Press Enter** at the end of each line — indentation on the next line is skipped for you.
|
|
78
|
+
4. **Watch your stats** update live in the header, then review your result on the finish screen.
|
|
30
79
|
|
|
31
|
-
|
|
80
|
+
Select `history` from the menu to see your last 15 runs and all-time bests per language.
|
|
32
81
|
|
|
33
|
-
|
|
34
|
-
- Or pick **sentences (speed test)** — a fresh block of random common words every run, for raw typing speed. Space or Enter both work at line wraps.
|
|
35
|
-
- Type the snippet exactly. Correct chars turn green, mistakes show red and must be backspaced before you can continue.
|
|
36
|
-
- Press Enter at end of line — leading indentation of the next line is auto-skipped (shown dim, not counted toward WPM).
|
|
37
|
-
- Live WPM, accuracy, and timer in the header. Timer starts on your first keystroke.
|
|
38
|
-
- `history` in the menu shows your last 15 runs and per-language bests.
|
|
82
|
+
---
|
|
39
83
|
|
|
40
|
-
## Keys
|
|
84
|
+
## ⌨️ Keys
|
|
41
85
|
|
|
42
86
|
| Key | Action |
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
| Backspace | Fix mistake |
|
|
47
|
-
|
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| `↑` `↓` / `k` `j` | Navigate menu |
|
|
89
|
+
| `Enter` | Select / new line / next snippet |
|
|
90
|
+
| `Backspace` | Fix a mistake |
|
|
91
|
+
| `Tab` | Restart current snippet |
|
|
92
|
+
| `Esc` | Back to menu / quit |
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 📊 Stats
|
|
97
|
+
|
|
98
|
+
Every completed run is appended to `~/.codetype/stats.json` — WPM, accuracy, errors, time, and
|
|
99
|
+
date. The results screen highlights a **★ new best** whenever you beat your record for that language.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 🧩 Adding your own snippets
|
|
48
104
|
|
|
49
|
-
|
|
105
|
+
Edit [`codetype/snippets.py`](./codetype/snippets.py) — append strings to any language list, or add a
|
|
106
|
+
new language key. Use spaces for indentation, not tabs.
|
|
50
107
|
|
|
51
|
-
|
|
108
|
+
---
|
|
52
109
|
|
|
53
|
-
##
|
|
110
|
+
## 📄 License
|
|
54
111
|
|
|
55
|
-
|
|
112
|
+
[MIT](./LICENSE) © [rohan4naik](https://github.com/rohan4naik)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codetype",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Offline terminal code-typing practice game (Python-powered)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"bin/",
|
|
11
11
|
"codetype/**/*.py",
|
|
12
|
-
"README.md"
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
13
14
|
],
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">=14"
|