kmlog
A sleek and lightweight Python TUI application to collect typing dynamics data from real people
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.5%) to scientific vocabulary
Keywords
Repository
A sleek and lightweight Python TUI application to collect typing dynamics data from real people
Basic Info
Statistics
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 5
- Releases: 2
Topics
Metadata Files
README.md

KMLog
KMLog is an interactive cli application for interfacing with tools which collect typing dynamics
⚠️ Disclaimer ⚠️
I am very much aware that KMLogger can be used for nefarious purposes. This project is used solely for controlled data collection purposes. Do not use this for illegal purposes, period. Please read the LICENSE for licensing information
Table of Contents
Rationale
Code Breakdown
MySQL Installation
MySQL Setup
User Information Storage in YAML
Usage
Using the Headless Keylogger
Testing the HTML Pages
License
Contributing
Media
Credits
Participate
Rationale
The goal of this project is to create a sleek and lightweight interface to collect specific typing dynamics data from real people
Code Breakdown
The "base" folder
This folder holds python files for the project's core functionality:
- csv_writer.py: A wrapper class that allows for writing data to a csv file
- log.py: This is a wrapper class of the loguru module for more colorful and expressive logging
- util.py: This file holds some utility functions to make the tui prettier and more functional.
- backends: This folder hold files that wrap specific subsystems, one of which, the project uses (or could use) for operations (querying, storage, etc...)
- sql_driver.py: This file holds a wrapper class to make some sql operations nicer
- yaml_driver.py: This file holds a wrapper class to make yaml operations nicer
- user_ops: This folder holds files that wrap specific user-related functions and operations
- generic_ops.py: A set of generic functions to get user information and properly format it
- sql_ops.py: A specialized set of MySQL specific functions and operations to properly add and retrieve user information from a MySQL database
- yml_ops.py: A specialized set of YAML specific functions and operations to properly add and retrieve user information from a YAML file
The "tools" folder
This folder holds the keylogger and mouse tracker to collect typing dynamics data.
The "logs" folder
This folder holds the log and csv files generated by the keylogger and the mouse tracker
The ".env" file
The use of the .env file was a strategic decision to allow for future users of this code base to be able to adapt it to their needs with as little code modifications as possible. The use of the .env file also improves the secrecy and security associated with connecting to the mysql database as none of the connection information is written into the code, but rather read in from created environment variables. The .env file contains the following variables:
- KM_USER: The username to connect to the database
- PASSWORD: The password to connect to the database
- DB_HOST: The host used to connect to the database
- DB_NAME: The name of the database which will be operated on
- TABLE: The name of the database table which will be operated on
See sample.env for an example .env configuration
diff
NOTE: If you decide to change the names of the environment variables make sure that they do not conflict with an Operating System specific predefined variables. For example USER in MacOS and USERNAME in Windows -
MySQL Installation
Homebrew
For macs install homebrew and run:
sh
brew install mysql
MySQL Installer
The MySQL documentation recommends using the MySQL Installer for Windows
MySQL Setup
To ensure that mysql is installed correctly run:
sh
mysql --version
Windows
The MySQL installer should take care of everything To start the mysql interactive cli run:
sh
mysql -u [YOUR_USERNAME] -p
MacOS
Start MySQL server by running:
sh
brew services start mysql
Secure installation of MySQL Server:
sh
mysql_secure_installation
Like for Windows, to start the MySQL cli run:
sh
mysql -u [YOUR_USERNAME] -p
User Information Storage in YAML
The YAML backed system is a simpler local storage alternative to the MySQL database The YAML system uses the users inputted user-id to search through the "users" folder to see if a YAML file already exists with a matching file name. If it does we know the user already exists in the "database" and we can just pull their information from the file. If the file does not exist, we can create one and add it to the "database" The YAML file stores data in the following format:
yaml
user_id: Integer
first_name: String
last_name: String
age: Integer
gender: String
handedness: String
education: String
platform: String
See 123.yaml for more details
Usage
Build with pip
- Clone this repository.
bash
git clone https://github.com/AlvinKuruvilla/kmlog.git
- Install dependencies
bash
pip3 -r requirements.txt
- Run the main file
bash
python3 kmlog.py
Automated Build
- Clone this repository.
bash
git clone https://github.com/AlvinKuruvilla/kmlog.git
- Install dependencies
bash
pip3 -r requirements.txt
- Create the kmlog.spec file and build the executable
bash
./build.sh
This puts the executable in the dist/ folder
- Run kmlog
bash
./kmlog
To fix any problems with input recording, give your terminal or the executable Input Monitoring access
On Apple devices, navigate to System Preferences > Go to Privacy and Security > Go to the Input Monitoring tab > Select your terminal application or kmlog executable (if they are not already there) and then toggle one of them on.
Running from Github release
Download the binary from the release page.
Change the permissions of the binary file so it is executable
- This could be done with a command like:
bash
chmod 777 kmlog
- If your shell kills the executable when trying to run it, this is because Apple does not allow programs to run which are from unidentifiable developers. To fix this, navigate to System Preferences > Go to Privacy and Security > Go to the General tab > Click Run Anyway
License
Contributing
See Contributing
Media
The logo was designed from Hatchful by Shopify
Credits
Participate
⚠️ NOTE: To avoid any potential issues with browser caching and cookie retention, it is recommended to use a fresh private browser instance
Click here to participate in data collection
Owner
- Name: Fake Profile Detection
- Login: FakeProfileDetection
- Kind: organization
- Email: sol@solofai.com
- Location: United States of America
- Repositories: 1
- Profile: https://github.com/FakeProfileDetection
Research on fake profile detection in social mediat
GitHub Events
Total
- Issues event: 1
- Push event: 13
Last Year
- Issues event: 1
- Push event: 13
Dependencies
- art *
- black *
- clint *
- colorama *
- loguru *
- prettytable *
- psutil *
- pyautogui *
- pynput *
- rich *
- setproctitle *
- mysql-connector-python *
- python-dotenv *
- PyYAML *
- PyYAML *
- art *
- black *
- clint *
- colorama *
- loguru *
- mysql-connector-python *
- prettytable *
- psutil *
- pyautogui *
- pynput *
- python-dotenv *
- rich *
- setproctitle *
- actions/checkout v2 composite
- psf/black stable composite
- actions/checkout v2 composite
- actions/setup-python v2 composite