Switch branches/tags
Nothing to show
Find file
245a5d5 Nov 17, 2009
99 lines (70 sloc) 2.9 KB


Theoretically you should be able to type the following after checking out the source:

sudo python install

You can also just install using easy_install like so:

sudo easy_install python-googleanalytics

Alternatively you may choose to use python-googleanalytics in a large project (most likely). You can pass "python-googleanalytics" to any dependency manager (pip, buildout) to pull it into your development, production, or virtual environment for whatever reason you like.


I'm trying to use Buildout, so you can start helping out with development by checking out the source and typing the following:

git clone git://
python && ./bin/buildout

Once you've done these steps, you should be able to run a Python interpreter that has access to our module with the following command:


It should work like so:

(python-googleanalytics)[master][~/src/python-googleanalytics] ./bin/python

>>> import googleanalytics

The system Python interpreter would not be able to pick up the module unless installed systemwide:

[~] python
Python 2.5.1 (r251:54863, Jul 23 2008, 11:00:16) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import googleanalytics
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named googleanalytics


I strongly suggest developing in a virtual environment using virtualenv with its own Python interpreter. You don't have to, but you might find your python development experience is a little nicer.

If you plan on using virtualenv, I then highly reccomend you get Doug Hellmann's virtualenvwrapper running which simplified the process of creating and managing virtual environment like so:

Switching to a new environment:

[~] workon python-googleanalytics

Listing environments:

(python-googleanalytics)[~] workon

Creating new environments:

(python-googleanalytics)[~] mkvirtualenv test2
New python executable in test2/bin/python
Installing setuptools............done.


You will need to create a .pythongoogleanalytics configuration file in your home directory with the following settings (replacing the values with a valid Google Analytics account and profile ids) in order for the tests to run:

google_account_email =
google_account_password = yourpassword

test_profile_ids = 1234 5678

Run tests as follows (once you've bootstrapped buildout or installed the module globally):