Datamode uses YAML files to store and organize database connector and config information. Simply get started by creating a file named
datamode.yml in one of three places:
DATAMODE_CONFIG_DIR- An environment variable set that contains a directory path to any location you can access.
- The directory where you plan to execute your transforms.
~.datamode/- On OSX this is equivalent to your
$HOMEdirectory and on Windows this can be
$USERPROFILEif set. See Python’s documentation for more information.
Once you’re in the directory you wish to save your
datamode.yml simply create the file:
Use your favorite text editor to create the following structure (or copy and paste the below). Be sure to replace
my_connection with how you want to reference this connection:
connections: my_connection: type: host: port: user: password: dbname: schema: default:
For example, let’s say I would like to create a connection configuration for a MySQL database in
DEV. I may use the following setup:
1 2 3 4 5 6 7 8 9 10
connections: mysql_dev: type: mysql host: internal-mysql.host.name.com port: 3306 user: dev_user password: mypass!! dbname: science schema: default: True
You must define
dbname. The port will use the database specific default (
3306 for MySQL,
5432 for Postgres).
You can also define
default to be
True if you have multiple connection profiles in your
datamode.yml and do not want to specify it every time you run a
The first time you run Datamode a file named
datamode.info will be saved in either
DATAMODE_CONFIG_DIR (if set) or
~.datamode/. This file contains an anonymized unique identifier and expiry that is used for analytics.
You can disable sending anonymized analytics but you should not delete or alter this file. Altering the file may result in annoying warnings appearing in the logs.