Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Change dynamically Pentaho database connections from kjb, ktr and xml files

Project Description

Change dynamically Pentaho database connections from kjb, ktr and xml files


pip install pentaho-db-changer

How to Use

Before execute the program you need to configure .ini file (config.ini) with your database settings.

You can follow this example:

First of all use a section ‘connect’ to select which database you will use.

connect = connect_local

Then, create a default section with the absolute path for pdi files.

path = /home/pdi

At last, create a section for each connection that you want to use and change easily.

server = xxxxxx
username = xxxxxx
password = my_pass

server = localhost
username = root
password = other_pass

Just execute file as follow:

cd set_db_pdi

Using as a Module

Download this project with:

git clone

All modules are in set_db_pdi folder and you can copy this folder and put inside your modules folder.

Then, import using:

from set_db_pdi import SetDB

You can set a custom configuration file name using:


If your password is encrypted (using right pdi format), then call:


If not, then:

SetDB().write_file_pdi() # this is default call when you execute file

You know if it is encrypted if password in config.ini is in format:

password = Encrypted 1ad32da2de2da7886

Using in reports

It works with Pentaho Report Designer’s files (.prpt) too, but only using encrypt=False since this issue was solved:

Just unzip .prpt files and get file datasourcessql-ds.xml

This file (sql-ds.xml) is like .kjb and .ktr files and use same connection names.

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(3.9 kB) Copy SHA256 Hash SHA256
Source None Mar 16, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers