Blockbot needs support for persistent data across restarts, in order to add features for common use-cases.
Initially, a Postgres database was planned to be added as a dependency, but given the scope of the bot and the data requirement, an SQLite database was decided as a more appropriate solution.
In order to interact with the database using an object-oriented pattern, an object relational mapper (ORM) is required. For our use case, the Peewee module seems to be a suitable solution for a Python ORM.
Requirements
Install the latest version of peewee, with:
pip install peewee
pip freeze > requirements.txt
Create a blockbot.db file (the database) in the root directory.
In main.py, open and verify a connection to the database before starting the bot client.
Blockbot needs support for persistent data across restarts, in order to add features for common use-cases.
Initially, a Postgres database was planned to be added as a dependency, but given the scope of the bot and the data requirement, an SQLite database was decided as a more appropriate solution.
In order to interact with the database using an object-oriented pattern, an object relational mapper (ORM) is required. For our use case, the Peewee module seems to be a suitable solution for a Python ORM.
Requirements
blockbot.db
file (the database) in the root directory.main.py
, open and verify a connection to the database before starting the bot client.Resources