You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: Implement PostgreSQL Database for Capturing Useful Statistics and Anonymous User Data Using Tortoise-ORM
Problem Description
At present, the bot doesn't keep track of useful statistics and user data that could be crucial for improving user experience and analyzing usage patterns. We would like to capture and store this data in a PostgreSQL database.
Objective 🎯
The aim is to implement a PostgreSQL database using Tortoise-ORM to store statistics and user metrics, while ensuring that all data is anonymized for user privacy.
Suggested Changes
You can divide these into separate PullRequests, to make the task easier:
Implement basic data saving:
Use Tortoise-ORM to create database models that align with the metrics and data points you identified.
Implement data capture and storage in the database within the bot's existing command handlers and states.
Make sure all stored data is anonymized and not traceable to individual users.
Suggestions on what to save:
the Triggering of specific commands with datetime
Average interaction length.
Interface language of users
Do something with the data:
Create a module to analyze the data in general
Analyze the most popular time of the day and day of the week using a graph (matplotlib)
Use a barplot to visualize Interface languages of users
❕ Important: this functionality should be optional, as the usage of a sophisticated database and statistical analysis can be unnecessary for some projects.
Code Snippet
Below is a hypothetical Python code snippet that demonstrates how you might use Tortoise-ORM to interact with a PostgreSQL database:
fromtortoiseimportTortoise, fieldsfromtortoise.modelsimportModelclassUserStatistics(Model):
id=fields.IntField(pk=True)
command_used=fields.CharField(max_length=50)
session_length=fields.FloatField()
# any other fieldsTortoise.init(
db_url='postgres://username:password@localhost:5432/mydatabase',
modules={'models': ['your_project.models']}
)
asyncdeftrack_start_command(user_id: int):
awaitUserStatistics.create(command_used='start', session_length=0.0)
# other logic
Acceptance Criteria
Data is properly captured and stored in a PostgreSQL database.
All stored data is anonymized.
The database setup should be modular and easily extendable for capturing more metrics in the future.
Testing
Add unit tests to verify that the database is capturing and storing the data as expected.
Manually review entries to ensure that they are anonymized and not traceable to individual users.
Please feel free to contribute by making a Pull Request to address this issue. Thank you! 📈🔒
Note: Make sure to adhere to privacy guidelines and policies such as GDPR when implementing this feature.
You can divide this task by creating multiple pull requests! No need to do all this work at once ♥
The text was updated successfully, but these errors were encountered:
Issue: Implement PostgreSQL Database for Capturing Useful Statistics and Anonymous User Data Using Tortoise-ORM
Problem Description
At present, the bot doesn't keep track of useful statistics and user data that could be crucial for improving user experience and analyzing usage patterns. We would like to capture and store this data in a PostgreSQL database.
Objective 🎯
The aim is to implement a PostgreSQL database using Tortoise-ORM to store statistics and user metrics, while ensuring that all data is anonymized for user privacy.
Suggested Changes
You can divide these into separate PullRequests, to make the task easier:
Implement basic data saving:
Suggestions on what to save:
Do something with the data:
matplotlib
)❕ Important: this functionality should be optional, as the usage of a sophisticated database and statistical analysis can be unnecessary for some projects.
Code Snippet
Below is a hypothetical Python code snippet that demonstrates how you might use Tortoise-ORM to interact with a PostgreSQL database:
Acceptance Criteria
Note: Make sure to adhere to privacy guidelines and policies such as GDPR when implementing this feature.
You can divide this task by creating multiple pull requests! No need to do all this work at once ♥
The text was updated successfully, but these errors were encountered: