A sql robot logger
Creates and updates a robot state logging database.
This program allows you to log information to different topics stored in a database file, extract subsets based on certain condition, as well as converting such selections into pandas dataframes.
Create a config.yml file in the home directory that mirrors the following
log_info: database_name: robot_id: sql_database: host: password: port: user:
- if robot_id is left blank, then one is assigned based on the next available robot_id in the database
Create the state logger object and give it a unique id and a database to write to (if left blank, one will automatically be created)
import robot_logger.robot_logger as rl robot_logger = rl.RobotLogger()
Add a topic and its respective data type
Add integer message with the topic and allow for local backup
robot_logger.write("test_topic", 1234, str(__file__), True)
Create the database inspector
import robot_inspector.robot_inspector as ri robot_inspector = ri.SQLInspector()
Generate a query from the log table that match a custom condition
query = robot_inspector.get_query("log","topic_id = 1")
Display the list of matches
Generate a pandas data frame from the query
df = q.get()
Note, only tested with Python 3
Clone the repository
git clone email@example.com:adamhamden/aws-sql-logger-interface.git
Go in the cloned directory
Start a virtual environment
virtualenv -p python3 venv source venv/bin/activate
Install the requirements
pip install -r requirements.txt
Check that the tests run
python -m unittest test.py
Import and use the module!
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size sql_robot_logger-0.1.1.tar.gz (5.7 kB)||File type Source||Python version None||Upload date||Hashes View hashes|