Configure db2twitterΒΆ

As a prerequisite to use db2twitter, you need a Twitter app. Log in Twitter, go to, create an app and generate the access token.

In order to configure db2twitter, you need to create a db2twitter.ini file (or any name you prefer, finishing with the extension .ini) with the following parameters:

tweet={} hires a {}{}

; use the following for PostgreSQL - you need mysql_connector_python
; use the following for PostgreSQL - you need psycopg2 python library
; dbconnector=postgresql+psycopg2



For the [twitter] section:

  • consumer_key: the Twitter consumer key (see your webpage)
  • consumer_secret: the Twitter consumer secret key (see your webpage)
  • access_token: the Twitter access token key (see your webpage)
  • access_token_secret: the Twitter access token secret key (see your webpage)
  • tweet: your tweet template. Should be a Python string format (see
  • hashtags: a # will be added to these words in your tweets
  • upper_first_char: use true if you want the first character of your tweets is upper case, false otherwise

For the [database] section:

  • dbconnector: the Sqlalchemy connector to use to access your database (see examples)
  • dbhost: the host where the database runs
  • database: the name of the database
  • dbuser: the user name to access the database
  • dbpass: the password to access the database
  • dbtables: a comma-separated list of tables to use to get data from
  • jobs_rows: you should replace the jobs_rows field by a [your table]_rows field. You should have as much fields as the number of specified dbtables. This field contains a comma-separated name of the row to get data from
  • jobs_sqlfilter: a string to pass to SqlAlchemy filter() function in order to be a new filter condition on the table you want to parse. Useful e.g if you want to ignore some rows of your table

For the [sqlite] section:

  • sqlitepath: the path to the sqlite3 database

For the [timer] section:

  • days: weekdays (mon for monday, thu for thursday, wed for wednesday, tue for tuesday, fri for friday, sat for saturday, sun for sunday) when db2twitter is authorized to send tweets
  • hours: hours of the day (0 to 23) when db2twitter is authorized to send tweets