nit-tui 0.1.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.
- nit_tui-0.1.0/LICENSE +201 -0
- nit_tui-0.1.0/MANIFEST.in +13 -0
- nit_tui-0.1.0/NOTICE +11 -0
- nit_tui-0.1.0/PKG-INFO +240 -0
- nit_tui-0.1.0/README.md +203 -0
- nit_tui-0.1.0/nit_tui/__init__.py +2 -0
- nit_tui-0.1.0/nit_tui/__main__.py +20 -0
- nit_tui-0.1.0/nit_tui/app.py +682 -0
- nit_tui-0.1.0/nit_tui/app.tcss +119 -0
- nit_tui-0.1.0/nit_tui/cache.py +102 -0
- nit_tui-0.1.0/nit_tui/data.py +130 -0
- nit_tui-0.1.0/nit_tui/diary.py +177 -0
- nit_tui-0.1.0/nit_tui/paths.py +20 -0
- nit_tui-0.1.0/nit_tui/people.py +54 -0
- nit_tui-0.1.0/nit_tui/settings.py +26 -0
- nit_tui-0.1.0/nit_tui/vault.py +50 -0
- nit_tui-0.1.0/nit_tui.egg-info/PKG-INFO +240 -0
- nit_tui-0.1.0/nit_tui.egg-info/SOURCES.txt +31 -0
- nit_tui-0.1.0/nit_tui.egg-info/dependency_links.txt +1 -0
- nit_tui-0.1.0/nit_tui.egg-info/entry_points.txt +2 -0
- nit_tui-0.1.0/nit_tui.egg-info/requires.txt +11 -0
- nit_tui-0.1.0/nit_tui.egg-info/top_level.txt +1 -0
- nit_tui-0.1.0/pyproject.toml +58 -0
- nit_tui-0.1.0/scripts/check_release.py +119 -0
- nit_tui-0.1.0/setup.cfg +4 -0
- nit_tui-0.1.0/tests/test_app.py +85 -0
- nit_tui-0.1.0/tests/test_cache.py +106 -0
- nit_tui-0.1.0/tests/test_live_adapter.py +26 -0
- nit_tui-0.1.0/tests/test_login_restore.py +124 -0
- nit_tui-0.1.0/tests/test_paths.py +23 -0
- nit_tui-0.1.0/tests/test_people.py +60 -0
- nit_tui-0.1.0/tests/test_vault.py +27 -0
- nit_tui-0.1.0/tests/test_week_diary.py +107 -0
nit_tui-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 deltaaa00
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
include README.md LICENSE NOTICE pyproject.toml
|
|
2
|
+
recursive-include nit_tui *.py *.tcss
|
|
3
|
+
recursive-include tests *.py
|
|
4
|
+
recursive-include scripts *.py
|
|
5
|
+
prune .git
|
|
6
|
+
prune .venv
|
|
7
|
+
prune .sessions
|
|
8
|
+
prune .nit-cache
|
|
9
|
+
prune reports
|
|
10
|
+
prune homework
|
|
11
|
+
prune artifacts
|
|
12
|
+
prune screenshots
|
|
13
|
+
global-exclude __pycache__ *.py[cod] .DS_Store .env .env.* .nit-auth* *.enc *.key *.pem *.log
|
nit_tui-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
NIT TUI
|
|
2
|
+
Copyright 2026 deltaaa00
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0.
|
|
5
|
+
|
|
6
|
+
Uses nit-tools, Copyright 2026 deltaaa00, licensed under Apache-2.0.
|
|
7
|
+
https://github.com/deltaaa00/NIT-Tools
|
|
8
|
+
|
|
9
|
+
NIT TUI is an independent, unofficial project and is not affiliated with,
|
|
10
|
+
endorsed by, or maintained by NIT or the operators of nit.school.
|
|
11
|
+
NIT names and marks belong to their respective owners.
|
nit_tui-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nit-tui
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Keyboard-first terminal app for the NIT school diary
|
|
5
|
+
Author: deltaaa00
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/deltaaa00/nit-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/deltaaa00/nit-cli
|
|
9
|
+
Project-URL: Issues, https://github.com/deltaaa00/nit-cli/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/deltaaa00/nit-cli/releases
|
|
11
|
+
Keywords: nit,school,diary,tui,textual,grades
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Education
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
License-File: NOTICE
|
|
26
|
+
Requires-Dist: textual<9,>=8.2
|
|
27
|
+
Requires-Dist: cryptography>=44
|
|
28
|
+
Requires-Dist: keyring>=25
|
|
29
|
+
Requires-Dist: platformdirs>=4
|
|
30
|
+
Requires-Dist: nit-tools<0.4,>=0.3.0
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
|
|
34
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
35
|
+
Requires-Dist: twine>=6; extra == "dev"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<a href="https://nit.school">
|
|
40
|
+
<img src="docs/assets/nit-logo.svg" alt="НІТ — Навчання і Технології" width="176" height="120">
|
|
41
|
+
</a>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
# NIT TUI
|
|
45
|
+
|
|
46
|
+
**Your school diary, in the terminal.**
|
|
47
|
+
|
|
48
|
+
[](https://github.com/deltaaa00/nit-cli/actions/workflows/ci.yml)
|
|
49
|
+
[](https://www.python.org/downloads/)
|
|
50
|
+
[](LICENSE)
|
|
51
|
+
[](https://textual.textualize.io/)
|
|
52
|
+
|
|
53
|
+
An English-language terminal app for the student-facing NIT school diary, built
|
|
54
|
+
with [Textual](https://textual.textualize.io/) and
|
|
55
|
+
[nit-tools](https://github.com/deltaaa00/NIT-Tools) 0.3.x. Browse a week of lessons,
|
|
56
|
+
check marks and homework, find class contacts, and export Excel reports without
|
|
57
|
+
leaving the keyboard.
|
|
58
|
+
|
|
59
|
+
This is an independent, unofficial project. It is not affiliated with NIT or the
|
|
60
|
+
operators of nit.school.
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
Requires **Python 3.11+** and a terminal with Unicode and color support.
|
|
65
|
+
|
|
66
|
+
### From source
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
git clone https://github.com/deltaaa00/nit-cli.git
|
|
70
|
+
cd nit-cli
|
|
71
|
+
python3 -m venv .venv
|
|
72
|
+
source .venv/bin/activate
|
|
73
|
+
python -m pip install -e '.[dev]'
|
|
74
|
+
python -m playwright install chromium
|
|
75
|
+
nit-tui
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
On Windows, activate the environment with `.venv\Scripts\Activate.ps1` in
|
|
79
|
+
PowerShell instead of `source .venv/bin/activate`.
|
|
80
|
+
|
|
81
|
+
### From PyPI
|
|
82
|
+
|
|
83
|
+
After the first app release has been published:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
python -m pip install nit-tui
|
|
87
|
+
python -m playwright install chromium
|
|
88
|
+
nit-tui
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Chromium is required for real sign-in. Demo mode needs no NIT account or browser
|
|
92
|
+
installation.
|
|
93
|
+
|
|
94
|
+
## Sign in
|
|
95
|
+
|
|
96
|
+
Normal startup always uses the **real-account mode**. Enter your NIT email and
|
|
97
|
+
password in **Login**, then select **Sign in**. Authentication runs headlessly;
|
|
98
|
+
a progress panel shows the current application stage and elapsed time. If the
|
|
99
|
+
school requires an interaction the headless flow cannot complete, the app shows
|
|
100
|
+
a sign-in error.
|
|
101
|
+
|
|
102
|
+
Leave **Remember encrypted credentials and sign in on restart** enabled to
|
|
103
|
+
restore your session automatically on later launches. Remembering credentials
|
|
104
|
+
requires an unlocked, supported OS credential vault. There is no plaintext
|
|
105
|
+
password fallback.
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
nit-tui # Real account; restore a remembered login
|
|
109
|
+
nit-tui --login # Open Login without automatically connecting
|
|
110
|
+
nit-tui --demo # Synthetic data; no saved credentials or NIT API access
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`python -m nit_tui` accepts the same options. Login failures stay in real mode;
|
|
114
|
+
they do not silently substitute demo data.
|
|
115
|
+
|
|
116
|
+
## Explore
|
|
117
|
+
|
|
118
|
+
| Section | What you can do |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| **Diary** | Pick a day in a Monday–Sunday week. Read lesson topics, homework, marks, attachment names, and submission status. Open a lesson for full details. |
|
|
121
|
+
| **Grades** | Browse a subject-by-date journal with a frozen subject column. Multiple marks stay in one cell; each subject has an unweighted average. |
|
|
122
|
+
| **Homework** | Browse assignments, including those with attachments but no homework text. |
|
|
123
|
+
| **Schedule** | View dated lessons and topics. |
|
|
124
|
+
| **My Class / Teachers** | Select a person to see available email, phone, address, school, and class or subjects. A click or Enter loads additional profile contacts when NIT permits it. |
|
|
125
|
+
| **Reports** | Export Excel reports for an inclusive period using Detailed, Summary, or Combo layouts and Simple or Styled formatting. |
|
|
126
|
+
| **Login** | Connect, load or forget remembered credentials, or explicitly switch to demo mode. |
|
|
127
|
+
|
|
128
|
+
Diary marks have individual colored badges: **10–12 blue**, **7–9 purple**,
|
|
129
|
+
**4–6 yellow**, and **1–3 red**. Non-numeric marks remain neutral. Missing contact
|
|
130
|
+
fields display `Not provided`. Teacher subjects returned by NIT may be
|
|
131
|
+
school-wide rather than specific to your class.
|
|
132
|
+
|
|
133
|
+
Reports default to September 1 of the current academic year through today.
|
|
134
|
+
The app displays the saved file's path; demo report filenames start with
|
|
135
|
+
`demo_`. Grade averages are descriptive, not official semester grades.
|
|
136
|
+
|
|
137
|
+
## Keyboard
|
|
138
|
+
|
|
139
|
+
| Key | Action |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| Arrow keys | Navigate rows and cells; left/right changes the selected day when Diary is focused |
|
|
142
|
+
| `Tab` / `Shift+Tab` | Move focus |
|
|
143
|
+
| `Enter` | Select a person or open a focused lesson |
|
|
144
|
+
| `/` | Search the current section |
|
|
145
|
+
| `Esc` | Clear search or close lesson details |
|
|
146
|
+
| `r` | Refresh the current data |
|
|
147
|
+
| `e` | Open Reports |
|
|
148
|
+
| `1` / `2` / `3` | Open Diary / Grades / Homework |
|
|
149
|
+
| `Ctrl+P` | Open the command palette |
|
|
150
|
+
| `q` | Quit |
|
|
151
|
+
|
|
152
|
+
Text inputs keep normal typing behavior. Use the date field and **Today** to
|
|
153
|
+
jump to a day, or the header arrows to move by week in Diary and by month in
|
|
154
|
+
the other dated views. Report and journal date ranges are independent.
|
|
155
|
+
|
|
156
|
+
## Cache and local data
|
|
157
|
+
|
|
158
|
+
The diary sections share a per-date cache; class lists and profiles are cached
|
|
159
|
+
separately. Successful results are reused for up to 24 hours within a session,
|
|
160
|
+
including empty days. Concurrent requests share work, and errors are not cached.
|
|
161
|
+
Every successful sign-in clears the current account's diary disk cache before
|
|
162
|
+
loading fresh data. Press `r` to refresh explicitly. **Last updated** in the
|
|
163
|
+
bottom bar changes after a successful data load, not a cache-only view switch.
|
|
164
|
+
|
|
165
|
+
Source/editable installs keep data in the repository root. An installed wheel
|
|
166
|
+
uses the OS application-data directory reported by
|
|
167
|
+
`platformdirs.user_data_path("nit-tui", appauthor=False)`. Set `NIT_TUI_HOME` to
|
|
168
|
+
choose an explicit data directory, for example:
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
NIT_TUI_HOME="$HOME/.nit-tui" nit-tui
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The selected data directory contains:
|
|
175
|
+
|
|
176
|
+
| Path | Contents |
|
|
177
|
+
| --- | --- |
|
|
178
|
+
| `.sessions/credentials.enc` | Encrypted email and password, if remembering is enabled |
|
|
179
|
+
| `.sessions/preferences.json` | Automatic sign-in preference, without credentials |
|
|
180
|
+
| `.nit-auth.json` | NIT access token and session metadata in the library's native JSON format |
|
|
181
|
+
| `.nit-cache/` | Identity-scoped diary cache |
|
|
182
|
+
| `reports/` | Generated Excel files |
|
|
183
|
+
|
|
184
|
+
Email and password use authenticated Fernet encryption. The random encryption
|
|
185
|
+
key stays in the OS secure vault under the service name `nit-tui`: macOS
|
|
186
|
+
Keychain, Windows Credential Locker, or Linux Secret Service. **The NIT session
|
|
187
|
+
file and diary cache are not encrypted by this app.** Session files use
|
|
188
|
+
owner-only permissions where supported. The app does not log credentials or
|
|
189
|
+
raw API errors.
|
|
190
|
+
|
|
191
|
+
**Forget saved credentials** removes the encrypted credentials and their key,
|
|
192
|
+
and disables automatic sign-in. It does not remove the NIT session, cache, or
|
|
193
|
+
reports. **Use demo** also disables automatic sign-in. To remove local account
|
|
194
|
+
data, quit the app and delete the files and directories listed above. Losing
|
|
195
|
+
the vault key requires signing in again. These paths are excluded from Git.
|
|
196
|
+
|
|
197
|
+
## Development
|
|
198
|
+
|
|
199
|
+
```sh
|
|
200
|
+
python -m pip install -e '.[dev]'
|
|
201
|
+
python -m pytest -q
|
|
202
|
+
python -m build
|
|
203
|
+
python -m twine check dist/*
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Tests use synthetic data and mocked networking, including headless TUI
|
|
207
|
+
navigation, credential encryption, cache behavior, contact selection, and all
|
|
208
|
+
six Excel report type/style combinations. They do not require a NIT account or
|
|
209
|
+
a downloaded Chromium browser.
|
|
210
|
+
|
|
211
|
+
The app uses the library's threaded `AsyncNITClient`, so network requests and
|
|
212
|
+
exports do not block the interface. Closing may wait for an HTTP request or
|
|
213
|
+
browser login already in progress. Automatic change polling and attachment
|
|
214
|
+
downloads are not implemented.
|
|
215
|
+
|
|
216
|
+
## Releases
|
|
217
|
+
|
|
218
|
+
GitHub Actions runs tests on Python 3.12 on every push and pull request using
|
|
219
|
+
the declared package dependencies. Release tests also run on Python 3.12.
|
|
220
|
+
The package requires Python 3.11+, but CI currently tests only Python 3.12. Publishing a GitHub Release triggers
|
|
221
|
+
the PyPI workflow, which checks the release version, runs tests, builds the
|
|
222
|
+
distributions, and publishes through PyPI Trusted Publishing.
|
|
223
|
+
|
|
224
|
+
Before the first publication:
|
|
225
|
+
|
|
226
|
+
1. Create the GitHub environment **`pypi`** in this repository.
|
|
227
|
+
2. Register a [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/)
|
|
228
|
+
for project **`nit-tui`**, owner **`deltaaa00`**, repository **`nit-cli`**,
|
|
229
|
+
workflow **`publish.yml`**, and environment **`pypi`**. For a new PyPI project,
|
|
230
|
+
create a pending publisher from your account's publishing settings.
|
|
231
|
+
3. Update `version` in `pyproject.toml`, commit and push the change, then publish
|
|
232
|
+
a GitHub Release whose tag matches that version, such as **`v0.1.0`**.
|
|
233
|
+
|
|
234
|
+
No PyPI API token is stored in the repository. A published version cannot be
|
|
235
|
+
replaced; use a new version and matching release tag for each publication.
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
[Apache License 2.0](LICENSE). See [NOTICE](NOTICE) for attribution.
|
|
240
|
+
NIT names and marks belong to their respective owners.
|
nit_tui-0.1.0/README.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://nit.school">
|
|
3
|
+
<img src="docs/assets/nit-logo.svg" alt="НІТ — Навчання і Технології" width="176" height="120">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# NIT TUI
|
|
8
|
+
|
|
9
|
+
**Your school diary, in the terminal.**
|
|
10
|
+
|
|
11
|
+
[](https://github.com/deltaaa00/nit-cli/actions/workflows/ci.yml)
|
|
12
|
+
[](https://www.python.org/downloads/)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://textual.textualize.io/)
|
|
15
|
+
|
|
16
|
+
An English-language terminal app for the student-facing NIT school diary, built
|
|
17
|
+
with [Textual](https://textual.textualize.io/) and
|
|
18
|
+
[nit-tools](https://github.com/deltaaa00/NIT-Tools) 0.3.x. Browse a week of lessons,
|
|
19
|
+
check marks and homework, find class contacts, and export Excel reports without
|
|
20
|
+
leaving the keyboard.
|
|
21
|
+
|
|
22
|
+
This is an independent, unofficial project. It is not affiliated with NIT or the
|
|
23
|
+
operators of nit.school.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
Requires **Python 3.11+** and a terminal with Unicode and color support.
|
|
28
|
+
|
|
29
|
+
### From source
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
git clone https://github.com/deltaaa00/nit-cli.git
|
|
33
|
+
cd nit-cli
|
|
34
|
+
python3 -m venv .venv
|
|
35
|
+
source .venv/bin/activate
|
|
36
|
+
python -m pip install -e '.[dev]'
|
|
37
|
+
python -m playwright install chromium
|
|
38
|
+
nit-tui
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
On Windows, activate the environment with `.venv\Scripts\Activate.ps1` in
|
|
42
|
+
PowerShell instead of `source .venv/bin/activate`.
|
|
43
|
+
|
|
44
|
+
### From PyPI
|
|
45
|
+
|
|
46
|
+
After the first app release has been published:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
python -m pip install nit-tui
|
|
50
|
+
python -m playwright install chromium
|
|
51
|
+
nit-tui
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Chromium is required for real sign-in. Demo mode needs no NIT account or browser
|
|
55
|
+
installation.
|
|
56
|
+
|
|
57
|
+
## Sign in
|
|
58
|
+
|
|
59
|
+
Normal startup always uses the **real-account mode**. Enter your NIT email and
|
|
60
|
+
password in **Login**, then select **Sign in**. Authentication runs headlessly;
|
|
61
|
+
a progress panel shows the current application stage and elapsed time. If the
|
|
62
|
+
school requires an interaction the headless flow cannot complete, the app shows
|
|
63
|
+
a sign-in error.
|
|
64
|
+
|
|
65
|
+
Leave **Remember encrypted credentials and sign in on restart** enabled to
|
|
66
|
+
restore your session automatically on later launches. Remembering credentials
|
|
67
|
+
requires an unlocked, supported OS credential vault. There is no plaintext
|
|
68
|
+
password fallback.
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
nit-tui # Real account; restore a remembered login
|
|
72
|
+
nit-tui --login # Open Login without automatically connecting
|
|
73
|
+
nit-tui --demo # Synthetic data; no saved credentials or NIT API access
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`python -m nit_tui` accepts the same options. Login failures stay in real mode;
|
|
77
|
+
they do not silently substitute demo data.
|
|
78
|
+
|
|
79
|
+
## Explore
|
|
80
|
+
|
|
81
|
+
| Section | What you can do |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| **Diary** | Pick a day in a Monday–Sunday week. Read lesson topics, homework, marks, attachment names, and submission status. Open a lesson for full details. |
|
|
84
|
+
| **Grades** | Browse a subject-by-date journal with a frozen subject column. Multiple marks stay in one cell; each subject has an unweighted average. |
|
|
85
|
+
| **Homework** | Browse assignments, including those with attachments but no homework text. |
|
|
86
|
+
| **Schedule** | View dated lessons and topics. |
|
|
87
|
+
| **My Class / Teachers** | Select a person to see available email, phone, address, school, and class or subjects. A click or Enter loads additional profile contacts when NIT permits it. |
|
|
88
|
+
| **Reports** | Export Excel reports for an inclusive period using Detailed, Summary, or Combo layouts and Simple or Styled formatting. |
|
|
89
|
+
| **Login** | Connect, load or forget remembered credentials, or explicitly switch to demo mode. |
|
|
90
|
+
|
|
91
|
+
Diary marks have individual colored badges: **10–12 blue**, **7–9 purple**,
|
|
92
|
+
**4–6 yellow**, and **1–3 red**. Non-numeric marks remain neutral. Missing contact
|
|
93
|
+
fields display `Not provided`. Teacher subjects returned by NIT may be
|
|
94
|
+
school-wide rather than specific to your class.
|
|
95
|
+
|
|
96
|
+
Reports default to September 1 of the current academic year through today.
|
|
97
|
+
The app displays the saved file's path; demo report filenames start with
|
|
98
|
+
`demo_`. Grade averages are descriptive, not official semester grades.
|
|
99
|
+
|
|
100
|
+
## Keyboard
|
|
101
|
+
|
|
102
|
+
| Key | Action |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| Arrow keys | Navigate rows and cells; left/right changes the selected day when Diary is focused |
|
|
105
|
+
| `Tab` / `Shift+Tab` | Move focus |
|
|
106
|
+
| `Enter` | Select a person or open a focused lesson |
|
|
107
|
+
| `/` | Search the current section |
|
|
108
|
+
| `Esc` | Clear search or close lesson details |
|
|
109
|
+
| `r` | Refresh the current data |
|
|
110
|
+
| `e` | Open Reports |
|
|
111
|
+
| `1` / `2` / `3` | Open Diary / Grades / Homework |
|
|
112
|
+
| `Ctrl+P` | Open the command palette |
|
|
113
|
+
| `q` | Quit |
|
|
114
|
+
|
|
115
|
+
Text inputs keep normal typing behavior. Use the date field and **Today** to
|
|
116
|
+
jump to a day, or the header arrows to move by week in Diary and by month in
|
|
117
|
+
the other dated views. Report and journal date ranges are independent.
|
|
118
|
+
|
|
119
|
+
## Cache and local data
|
|
120
|
+
|
|
121
|
+
The diary sections share a per-date cache; class lists and profiles are cached
|
|
122
|
+
separately. Successful results are reused for up to 24 hours within a session,
|
|
123
|
+
including empty days. Concurrent requests share work, and errors are not cached.
|
|
124
|
+
Every successful sign-in clears the current account's diary disk cache before
|
|
125
|
+
loading fresh data. Press `r` to refresh explicitly. **Last updated** in the
|
|
126
|
+
bottom bar changes after a successful data load, not a cache-only view switch.
|
|
127
|
+
|
|
128
|
+
Source/editable installs keep data in the repository root. An installed wheel
|
|
129
|
+
uses the OS application-data directory reported by
|
|
130
|
+
`platformdirs.user_data_path("nit-tui", appauthor=False)`. Set `NIT_TUI_HOME` to
|
|
131
|
+
choose an explicit data directory, for example:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
NIT_TUI_HOME="$HOME/.nit-tui" nit-tui
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The selected data directory contains:
|
|
138
|
+
|
|
139
|
+
| Path | Contents |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| `.sessions/credentials.enc` | Encrypted email and password, if remembering is enabled |
|
|
142
|
+
| `.sessions/preferences.json` | Automatic sign-in preference, without credentials |
|
|
143
|
+
| `.nit-auth.json` | NIT access token and session metadata in the library's native JSON format |
|
|
144
|
+
| `.nit-cache/` | Identity-scoped diary cache |
|
|
145
|
+
| `reports/` | Generated Excel files |
|
|
146
|
+
|
|
147
|
+
Email and password use authenticated Fernet encryption. The random encryption
|
|
148
|
+
key stays in the OS secure vault under the service name `nit-tui`: macOS
|
|
149
|
+
Keychain, Windows Credential Locker, or Linux Secret Service. **The NIT session
|
|
150
|
+
file and diary cache are not encrypted by this app.** Session files use
|
|
151
|
+
owner-only permissions where supported. The app does not log credentials or
|
|
152
|
+
raw API errors.
|
|
153
|
+
|
|
154
|
+
**Forget saved credentials** removes the encrypted credentials and their key,
|
|
155
|
+
and disables automatic sign-in. It does not remove the NIT session, cache, or
|
|
156
|
+
reports. **Use demo** also disables automatic sign-in. To remove local account
|
|
157
|
+
data, quit the app and delete the files and directories listed above. Losing
|
|
158
|
+
the vault key requires signing in again. These paths are excluded from Git.
|
|
159
|
+
|
|
160
|
+
## Development
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
python -m pip install -e '.[dev]'
|
|
164
|
+
python -m pytest -q
|
|
165
|
+
python -m build
|
|
166
|
+
python -m twine check dist/*
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Tests use synthetic data and mocked networking, including headless TUI
|
|
170
|
+
navigation, credential encryption, cache behavior, contact selection, and all
|
|
171
|
+
six Excel report type/style combinations. They do not require a NIT account or
|
|
172
|
+
a downloaded Chromium browser.
|
|
173
|
+
|
|
174
|
+
The app uses the library's threaded `AsyncNITClient`, so network requests and
|
|
175
|
+
exports do not block the interface. Closing may wait for an HTTP request or
|
|
176
|
+
browser login already in progress. Automatic change polling and attachment
|
|
177
|
+
downloads are not implemented.
|
|
178
|
+
|
|
179
|
+
## Releases
|
|
180
|
+
|
|
181
|
+
GitHub Actions runs tests on Python 3.12 on every push and pull request using
|
|
182
|
+
the declared package dependencies. Release tests also run on Python 3.12.
|
|
183
|
+
The package requires Python 3.11+, but CI currently tests only Python 3.12. Publishing a GitHub Release triggers
|
|
184
|
+
the PyPI workflow, which checks the release version, runs tests, builds the
|
|
185
|
+
distributions, and publishes through PyPI Trusted Publishing.
|
|
186
|
+
|
|
187
|
+
Before the first publication:
|
|
188
|
+
|
|
189
|
+
1. Create the GitHub environment **`pypi`** in this repository.
|
|
190
|
+
2. Register a [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/)
|
|
191
|
+
for project **`nit-tui`**, owner **`deltaaa00`**, repository **`nit-cli`**,
|
|
192
|
+
workflow **`publish.yml`**, and environment **`pypi`**. For a new PyPI project,
|
|
193
|
+
create a pending publisher from your account's publishing settings.
|
|
194
|
+
3. Update `version` in `pyproject.toml`, commit and push the change, then publish
|
|
195
|
+
a GitHub Release whose tag matches that version, such as **`v0.1.0`**.
|
|
196
|
+
|
|
197
|
+
No PyPI API token is stored in the repository. A published version cannot be
|
|
198
|
+
replaced; use a new version and matching release tag for each publication.
|
|
199
|
+
|
|
200
|
+
## License
|
|
201
|
+
|
|
202
|
+
[Apache License 2.0](LICENSE). See [NOTICE](NOTICE) for attribution.
|
|
203
|
+
NIT names and marks belong to their respective owners.
|