PYCOF is a library to group some useful functions on Python. The library helps running SQL queries or send emails in a much simpler way.

The library is pip-installable and the source code is available on my Git. For any question or suggestion of improvement, please contact me.


You can get PYCOF from PyPI with:

pip3 install pycof

The library is supported on Windows, Linux and MacOS.


The functions pycof.sql.remote_execute_sql() and pycof.format.send_email() will, by default, look for the credentials located in /etc/.pycof/config.json. On Windows, save the config file as C:/Users/<username>/.pycof/config.json.

The file follows the below structure:

"DB_USER": "",
"DB_HOST": "",
"DB_PORT": "3306",
"__COMMENT_1__": "Email specific, send_email",
"EMAIL_PORT": "587",
"__COMMENT_2__": "IAM specific, if connection='SSH' in remote_execute_sql",
"REGION": "eu-east-3",
"__COMMENT_3__": "SSH specific",
"SSH_USER": "",
"SSH_KEY": "",

On Unix based system, run:

sudo nano /etc/.pycof/config.json

and paste the above json after filling the empty strings (pre-filled values are standard default values).

Reminder: To save the file, with nano press CTRL + O, confirm with ENTER then CTRL + X to exit.

On Windows, use the path C:/Users/<username>/.pycof/config.json.

Release and FAQ

Indices and tables