Skip to main content
Help us improve Python packaging – donate today!

Load kissmetrics website analytics data from an s3 bucket into a postgres database

Project Description


Load raw kissmetrics data from specified s3 bucket into specified postgres database.

To install

In this directory, run the following command:

python install

To use

Once installed, a new script, named km2pg should now be available in PATH, which can be used as follows:

-b name_of_s3_bucket -m postgres_hostname -p postgres_port -d postgres_dbname -u postgres_username -w postgres_passwd -a aws_access_key -s aws_secret_key

For more details, see km2pg –help.


  • boto: Python library for AWS
  • psycopg: postgres Python client library


This script can safely be run from an Amazon spot instance, where checkpointing is important, since the script can be interrupted at any moment.


kissmetrics deposits raw data into multiple json files:

1.json 2.json … N.json

kissmetrics provides an ‘index’ file at:


This index file lists all the json files that kissmetrics has currently deposited in the ‘revisions’ folder above.

Our strategy is to process the json files in the order they appear in index.csv (which happens to be in order of increasing time).

In our postgres instance, we will maintain our progress through index.csv. This approach assumes that kissmetrics only ever appends to index.csv, and never edits.

Release history Release notifications

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
km2pg- (7.9 kB) Copy SHA256 hash SHA256 Source None Dec 19, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page