alvinkuruvilla / kmlog Goto Github PK
View Code? Open in Web Editor NEWA sleek and lightweight Python TUI application to collect typing dynamics data from real people
License: MIT License
A sleek and lightweight Python TUI application to collect typing dynamics data from real people
License: MIT License
The project should handle incomplete file creation, ie the user stopped the program before finishing inputting their info, or the keylogger made a file but the user did not type into it or stopped immediately after, a little better. To implement this we could consider the watchdog package
Pick can allow us to create interactive keyboard-based menus rather than rely on user-input
After submitting the information needed to create a new user, KMLogger tries to display the information as a PrettyTable
. The same is also true when displaying a returning user's saved information. When running locally this seems to work without issue. However, when running as a standalone shell executable or on Windows this functionality results in:
Traceback (most recent call last):
File "tui.py", line 164, in <module>
File "tui.py", line 135, in run
File "base/user_ops/yml_ops.py", line 111, in create_user
File "base/user_ops/yml_ops.py", line 65, in tuple_to_dict
TypeError: list indices must be integers or slices, not tuple
It could be good for project longevity to support alternative backends to store user information. But we must only store the bare minimum user information. To support these backends I think the best approach to this at the moment is to create thin wrapper classes around them, similar to what I did for YAML and MySQL. Some ideas for other backends include but are not limited to:
There is some code at the beginning of the TUI run() method that should have created those directories if they didn't already exist, but I think they are iffy. We should move that code block into a separate file and function that we can just call in __main__
. Then we should export those paths as string constants like this
Suppose the user selects another for the gender and completes the rest of the registration procedure. In that case, the app crashes before displaying the final table of user information with the following exception:
UnboundLocalError: local variable 'expanded_gender' referenced before assignment
Rich can make the project have better prompts for user input. There is also a table module which is better than prettytable
It would simplify our implementation if we made the PID printer run only when passing in a debug flag
It's obnoxious to have to manually install dependencies. Especially with the MySQL connector dependency, because if the wrong one is installed kmlog will still fail to build
It could also be interesting if there was some form of conditional installation because if MySQL is not installed on the host system, that could mean that the user does not want to use it, so why should we force them to install it anyway?
A neat addition is if we could integrate tools like mdcat to make looking at the integrity output more pleasant
The logs folder does not get automatically created the first time the project is run. However, the users folder does
Currently at any point where we wait for user keyboard input, if the user provides any whitespace as part of their input or just presses enter, we crash the application because we directly convert the user's input to an int with int()
. Rather than crashing we should swallow the error, display an error to the user about bad input, and then just re-prompt them.
We may want to try experimenting with multiple-choice style options t register user information
I think this is the best option: https://github.com/magmax/python-inquirer
But windows support is still experimental so we may want to wait a little bit longer before integrating
My idea behind this is to use localhost.run to expose kmlog so clients on other computers can connect to a unique URL and we can collect keystrokes that way. This will allow them to run our data collection protocol directly from their computer and we can just intercept their keystrokes as web requests to our URL (or at least that's my initial idea). To collect their metadata we can just expose a web interface asking for some personal information which we will store securely as normal
This video shows how we can expose the service to the internet
https://www.youtube.com/watch?v=111ZDMKVTL4
We probably want to make a binary release on Github and possibly on PyPI.
https://the-coding-lab.com/2021/8-publishing-at-pypi/
This should be a step towards that
I try to follow the Numpy doc style
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.