awatch 1.0.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.
awatch-1.0.0/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ashish
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.
awatch-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,248 @@
1
+ Metadata-Version: 2.4
2
+ Name: awatch
3
+ Version: 1.0.0
4
+ Summary: Terminal TUI dashboard for real-time log monitoring
5
+ Author-email: Ashish <your@email.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Ashish
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23
+
24
+ Project-URL: Homepage, https://github.com/ashishnxt/awatch
25
+ Project-URL: Repository, https://github.com/ashishnxt/awatch
26
+ Project-URL: Bug Tracker, https://github.com/ashishnxt/awatch/issues
27
+ Keywords: log,monitoring,tui,terminal,dashboard,syslog
28
+ Classifier: Development Status :: 4 - Beta
29
+ Classifier: Environment :: Console :: Curses
30
+ Classifier: Intended Audience :: System Administrators
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Operating System :: POSIX :: Linux
34
+ Classifier: Operating System :: MacOS
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.8
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Topic :: System :: Logging
42
+ Classifier: Topic :: System :: Monitoring
43
+ Classifier: Topic :: Terminals
44
+ Requires-Python: >=3.8
45
+ Description-Content-Type: text/markdown
46
+ License-File: LICENSE
47
+ Dynamic: license-file
48
+
49
+ # awatch 🖥️
50
+
51
+ > **A** **W**atchful **T**erminal **A**nalytics for **C**ontinuous **H**osting logs
52
+
53
+ Real-time TUI (Terminal UI) log monitoring dashboard for Linux and macOS. Monitor any log file live — with severity filtering, text search, bar charts, and a scrollable detail view — all inside your terminal.
54
+
55
+ ---
56
+
57
+ ## Screenshot
58
+
59
+ ```
60
+ ╭──────────────────────────────────────────────────────────────────────────────────────╮
61
+ │ ╭─────────────────────────────────────────────────────────────────────────────────╮ │
62
+ │ │ STATUS: LIVE LAST LOG: 2026-01-02T14:32:01 TIME: 2026-01-02 ... │ │
63
+ │ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
64
+ │ ╭─ SYSTEM INFO ─────────────────────────╮ ╭─ CRITICAL ──╮ ╭─ WARNINGS ──╮ │
65
+ │ │ SYSTEM: prod-server-01 SIZE: 42.3MB │ │ Count: 2 │ │ Count: 14 │ │
66
+ │ │ TOTAL: 8432 | CRIT:2 ERR:11 WARN:14 │ │ | | │ │ | || | │ │
67
+ │ │ Range: 2026-01-01 to 2026-01-02 │ ╰─────────────╯ ╰─────────────╯ │
68
+ │ ╰───────────────────────────────────────╯ │
69
+ │ ╭─ RECENT LOGS ──────────────────────── [Filtered: 120/8432] l:details | ↑↓:scroll ─╮│
70
+ │ │ [Jan 2 14:32:01] [CRIT] kernel: BIOS bug: ... ││
71
+ │ │ [Jan 2 14:31:55] [ERR ] nginx: connect() failed (111: Connection refused) ││
72
+ │ │ [Jan 2 14:31:40] [WARN] systemd: Unit ssh.service is degraded. ││
73
+ │ │ [Jan 2 14:31:22] [INFO] sshd[2341]: Accepted publickey for ashish ││
74
+ │ ╰────────────────────────────────────────────────────────────────────────────────────╯│
75
+ ╰──────────────────────────────────────────────────────────────────────────────────────╯
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Features
81
+
82
+ - **Live tail** — monitors any log file in real-time, handles file rotation and truncation automatically
83
+ - **Severity detection** — auto-classifies each line as `CRITICAL`, `ALERT`, `ERROR`, `WARN`, `INFO`, or `DEBUG` using regex pattern matching
84
+ - **Text search** — filter logs by any keyword with highlighted matches
85
+ - **Severity filter** — show only the severity level you care about
86
+ - **Bar charts** — live sparkline-style bar charts for CRITICAL, WARNINGS, ERRORS, and INFO counts (visible on wide terminals ≥ 130 cols)
87
+ - **Detail view** — full-width table with timestamp, severity, and message columns; searchable separately
88
+ - **Scroll** — scroll through history in both main and detail views
89
+ - **Date range** — shows the date range of logs currently loaded
90
+ - **File rotation handling** — detects truncation/rotation and re-opens the file automatically
91
+ - **No-limit mode** — load the entire log file instead of the default last 10,000 lines
92
+ - **Zero dependencies** — uses only Python stdlib (`curses`, `threading`, `re`, `collections`)
93
+
94
+ ---
95
+
96
+ ## Install
97
+
98
+ ```bash
99
+ pip install awatch
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Usage
105
+
106
+ ```bash
107
+ # Monitor default syslog
108
+ awatch
109
+
110
+ # Monitor a specific file
111
+ awatch /var/log/nginx/error.log
112
+ awatch /var/log/auth.log
113
+ awatch /var/log/postgresql/postgresql.log
114
+
115
+ # Load entire file (no 10,000 line cap)
116
+ awatch --no-limit
117
+ awatch /var/log/syslog --no-limit
118
+
119
+ # Check version
120
+ awatch -v
121
+ awatch --version
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Keybindings
127
+
128
+ ### Main View
129
+
130
+ | Key | Action |
131
+ |-----|--------|
132
+ | `t` | Enter text search — type keyword, press `Enter` to apply |
133
+ | `v` | Filter by severity — type `ERROR`, `WARN`, `INFO`, `CRITICAL`, `DEBUG`, or `ALERT` |
134
+ | `c` | Clear all active filters |
135
+ | `l` | Open detail view (full table with all fields) |
136
+ | `r` | Reload — re-reads file from disk |
137
+ | `p` | Change log file path — type new path, press `Enter` |
138
+ | `↑` | Scroll up (older logs) |
139
+ | `↓` | Scroll down (newer logs) |
140
+ | `q` | Quit |
141
+ | `ESC` | Cancel current input |
142
+
143
+ ### Detail View
144
+
145
+ | Key | Action |
146
+ |-----|--------|
147
+ | `s` | Search within detail view |
148
+ | `c` | Clear detail search |
149
+ | `↑` / `↓` | Scroll one line |
150
+ | `PgUp` / `PgDn` | Scroll ten lines |
151
+ | `ESC` or `b` | Back to main dashboard |
152
+ | `q` | Quit |
153
+
154
+ ---
155
+
156
+ ## Severity Levels
157
+
158
+ | Level | Color | Matches |
159
+ |-------|-------|---------|
160
+ | `CRITICAL` | 🔴 Red | `CRITICAL`, `CRIT`, `FATAL`, `EMERG`, `EMERGENCY` |
161
+ | `ALERT` | 🟣 Magenta | `ALERT` |
162
+ | `ERROR` | 🔴 Red | `ERROR`, `ERR`, `FAILURE`, `FAILED` |
163
+ | `WARN` | 🟡 Yellow | `WARN`, `WARNING` |
164
+ | `INFO` | 🔵 Cyan | `INFO`, `INFORMATION`, `NOTICE` |
165
+ | `DEBUG` | 🔷 Blue | `DEBUG`, `TRACE` |
166
+
167
+ ---
168
+
169
+ ## Supported Log Formats
170
+
171
+ awatch parses standard syslog format automatically:
172
+
173
+ ```
174
+ Jan 2 14:32:01 hostname process[pid]: message
175
+ 2026-01-02T14:32:01.123Z hostname process[pid]: message
176
+ ```
177
+
178
+ Any line that doesn't match syslog format is still displayed — the full raw line is shown as the message. This means awatch works with any plain-text log file.
179
+
180
+ ---
181
+
182
+ ## Terminal Requirements
183
+
184
+ | Requirement | Minimum |
185
+ |-------------|---------|
186
+ | Terminal size | 80 × 30 |
187
+ | Terminal size (with graphs) | 130+ columns wide |
188
+ | OS | Linux, macOS |
189
+ | Python | 3.8+ |
190
+
191
+ ---
192
+
193
+ ## Performance
194
+
195
+ | Mode | Behavior |
196
+ |------|----------|
197
+ | Default | Reads last 2MB of file → keeps last 10,000 lines in memory |
198
+ | `--no-limit` | Reads entire file from start, no line cap |
199
+
200
+ New lines are polled every 50ms. Screen redraws are throttled to once per second minimum unless new data arrives.
201
+
202
+ ---
203
+
204
+ ## Common Log Files
205
+
206
+ ```bash
207
+ # System
208
+ awatch /var/log/syslog
209
+ awatch /var/log/messages
210
+ awatch /var/log/kern.log
211
+
212
+ # Auth
213
+ awatch /var/log/auth.log
214
+ awatch /var/log/secure
215
+
216
+ # Web servers
217
+ awatch /var/log/nginx/error.log
218
+ awatch /var/log/nginx/access.log
219
+ awatch /var/log/apache2/error.log
220
+
221
+ # Database
222
+ awatch /var/log/postgresql/postgresql-16-main.log
223
+ awatch /var/log/mysql/error.log
224
+
225
+ # Application / Docker
226
+ awatch /var/log/myapp/app.log
227
+ awatch /var/lib/docker/containers/<id>/<id>-json.log
228
+ ```
229
+
230
+ ---
231
+
232
+ ## Requirements
233
+
234
+ - Python 3.8 or higher
235
+ - Linux or macOS (Windows not supported — `curses` is unavailable)
236
+ - No third-party packages required
237
+
238
+ ---
239
+
240
+ ## License
241
+
242
+ MIT License — see [LICENSE](LICENSE) for details.
243
+
244
+ ---
245
+
246
+ ## Author
247
+
248
+ Built by **Ashish** — [github.com/ashishnxt](https://github.com/ashishnxt)
awatch-1.0.0/README.md ADDED
@@ -0,0 +1,200 @@
1
+ # awatch 🖥️
2
+
3
+ > **A** **W**atchful **T**erminal **A**nalytics for **C**ontinuous **H**osting logs
4
+
5
+ Real-time TUI (Terminal UI) log monitoring dashboard for Linux and macOS. Monitor any log file live — with severity filtering, text search, bar charts, and a scrollable detail view — all inside your terminal.
6
+
7
+ ---
8
+
9
+ ## Screenshot
10
+
11
+ ```
12
+ ╭──────────────────────────────────────────────────────────────────────────────────────╮
13
+ │ ╭─────────────────────────────────────────────────────────────────────────────────╮ │
14
+ │ │ STATUS: LIVE LAST LOG: 2026-01-02T14:32:01 TIME: 2026-01-02 ... │ │
15
+ │ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
16
+ │ ╭─ SYSTEM INFO ─────────────────────────╮ ╭─ CRITICAL ──╮ ╭─ WARNINGS ──╮ │
17
+ │ │ SYSTEM: prod-server-01 SIZE: 42.3MB │ │ Count: 2 │ │ Count: 14 │ │
18
+ │ │ TOTAL: 8432 | CRIT:2 ERR:11 WARN:14 │ │ | | │ │ | || | │ │
19
+ │ │ Range: 2026-01-01 to 2026-01-02 │ ╰─────────────╯ ╰─────────────╯ │
20
+ │ ╰───────────────────────────────────────╯ │
21
+ │ ╭─ RECENT LOGS ──────────────────────── [Filtered: 120/8432] l:details | ↑↓:scroll ─╮│
22
+ │ │ [Jan 2 14:32:01] [CRIT] kernel: BIOS bug: ... ││
23
+ │ │ [Jan 2 14:31:55] [ERR ] nginx: connect() failed (111: Connection refused) ││
24
+ │ │ [Jan 2 14:31:40] [WARN] systemd: Unit ssh.service is degraded. ││
25
+ │ │ [Jan 2 14:31:22] [INFO] sshd[2341]: Accepted publickey for ashish ││
26
+ │ ╰────────────────────────────────────────────────────────────────────────────────────╯│
27
+ ╰──────────────────────────────────────────────────────────────────────────────────────╯
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Features
33
+
34
+ - **Live tail** — monitors any log file in real-time, handles file rotation and truncation automatically
35
+ - **Severity detection** — auto-classifies each line as `CRITICAL`, `ALERT`, `ERROR`, `WARN`, `INFO`, or `DEBUG` using regex pattern matching
36
+ - **Text search** — filter logs by any keyword with highlighted matches
37
+ - **Severity filter** — show only the severity level you care about
38
+ - **Bar charts** — live sparkline-style bar charts for CRITICAL, WARNINGS, ERRORS, and INFO counts (visible on wide terminals ≥ 130 cols)
39
+ - **Detail view** — full-width table with timestamp, severity, and message columns; searchable separately
40
+ - **Scroll** — scroll through history in both main and detail views
41
+ - **Date range** — shows the date range of logs currently loaded
42
+ - **File rotation handling** — detects truncation/rotation and re-opens the file automatically
43
+ - **No-limit mode** — load the entire log file instead of the default last 10,000 lines
44
+ - **Zero dependencies** — uses only Python stdlib (`curses`, `threading`, `re`, `collections`)
45
+
46
+ ---
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ pip install awatch
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Usage
57
+
58
+ ```bash
59
+ # Monitor default syslog
60
+ awatch
61
+
62
+ # Monitor a specific file
63
+ awatch /var/log/nginx/error.log
64
+ awatch /var/log/auth.log
65
+ awatch /var/log/postgresql/postgresql.log
66
+
67
+ # Load entire file (no 10,000 line cap)
68
+ awatch --no-limit
69
+ awatch /var/log/syslog --no-limit
70
+
71
+ # Check version
72
+ awatch -v
73
+ awatch --version
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Keybindings
79
+
80
+ ### Main View
81
+
82
+ | Key | Action |
83
+ |-----|--------|
84
+ | `t` | Enter text search — type keyword, press `Enter` to apply |
85
+ | `v` | Filter by severity — type `ERROR`, `WARN`, `INFO`, `CRITICAL`, `DEBUG`, or `ALERT` |
86
+ | `c` | Clear all active filters |
87
+ | `l` | Open detail view (full table with all fields) |
88
+ | `r` | Reload — re-reads file from disk |
89
+ | `p` | Change log file path — type new path, press `Enter` |
90
+ | `↑` | Scroll up (older logs) |
91
+ | `↓` | Scroll down (newer logs) |
92
+ | `q` | Quit |
93
+ | `ESC` | Cancel current input |
94
+
95
+ ### Detail View
96
+
97
+ | Key | Action |
98
+ |-----|--------|
99
+ | `s` | Search within detail view |
100
+ | `c` | Clear detail search |
101
+ | `↑` / `↓` | Scroll one line |
102
+ | `PgUp` / `PgDn` | Scroll ten lines |
103
+ | `ESC` or `b` | Back to main dashboard |
104
+ | `q` | Quit |
105
+
106
+ ---
107
+
108
+ ## Severity Levels
109
+
110
+ | Level | Color | Matches |
111
+ |-------|-------|---------|
112
+ | `CRITICAL` | 🔴 Red | `CRITICAL`, `CRIT`, `FATAL`, `EMERG`, `EMERGENCY` |
113
+ | `ALERT` | 🟣 Magenta | `ALERT` |
114
+ | `ERROR` | 🔴 Red | `ERROR`, `ERR`, `FAILURE`, `FAILED` |
115
+ | `WARN` | 🟡 Yellow | `WARN`, `WARNING` |
116
+ | `INFO` | 🔵 Cyan | `INFO`, `INFORMATION`, `NOTICE` |
117
+ | `DEBUG` | 🔷 Blue | `DEBUG`, `TRACE` |
118
+
119
+ ---
120
+
121
+ ## Supported Log Formats
122
+
123
+ awatch parses standard syslog format automatically:
124
+
125
+ ```
126
+ Jan 2 14:32:01 hostname process[pid]: message
127
+ 2026-01-02T14:32:01.123Z hostname process[pid]: message
128
+ ```
129
+
130
+ Any line that doesn't match syslog format is still displayed — the full raw line is shown as the message. This means awatch works with any plain-text log file.
131
+
132
+ ---
133
+
134
+ ## Terminal Requirements
135
+
136
+ | Requirement | Minimum |
137
+ |-------------|---------|
138
+ | Terminal size | 80 × 30 |
139
+ | Terminal size (with graphs) | 130+ columns wide |
140
+ | OS | Linux, macOS |
141
+ | Python | 3.8+ |
142
+
143
+ ---
144
+
145
+ ## Performance
146
+
147
+ | Mode | Behavior |
148
+ |------|----------|
149
+ | Default | Reads last 2MB of file → keeps last 10,000 lines in memory |
150
+ | `--no-limit` | Reads entire file from start, no line cap |
151
+
152
+ New lines are polled every 50ms. Screen redraws are throttled to once per second minimum unless new data arrives.
153
+
154
+ ---
155
+
156
+ ## Common Log Files
157
+
158
+ ```bash
159
+ # System
160
+ awatch /var/log/syslog
161
+ awatch /var/log/messages
162
+ awatch /var/log/kern.log
163
+
164
+ # Auth
165
+ awatch /var/log/auth.log
166
+ awatch /var/log/secure
167
+
168
+ # Web servers
169
+ awatch /var/log/nginx/error.log
170
+ awatch /var/log/nginx/access.log
171
+ awatch /var/log/apache2/error.log
172
+
173
+ # Database
174
+ awatch /var/log/postgresql/postgresql-16-main.log
175
+ awatch /var/log/mysql/error.log
176
+
177
+ # Application / Docker
178
+ awatch /var/log/myapp/app.log
179
+ awatch /var/lib/docker/containers/<id>/<id>-json.log
180
+ ```
181
+
182
+ ---
183
+
184
+ ## Requirements
185
+
186
+ - Python 3.8 or higher
187
+ - Linux or macOS (Windows not supported — `curses` is unavailable)
188
+ - No third-party packages required
189
+
190
+ ---
191
+
192
+ ## License
193
+
194
+ MIT License — see [LICENSE](LICENSE) for details.
195
+
196
+ ---
197
+
198
+ ## Author
199
+
200
+ Built by **Ashish** — [github.com/ashishnxt](https://github.com/ashishnxt)
@@ -0,0 +1,5 @@
1
+ """awatch - Terminal log monitoring dashboard."""
2
+ __version__ = "1.0.0"
3
+ __author__ = "Ashish"
4
+
5
+ from .dashboard import main