Skip to main content

Python interface to API

Project description Wheel Status

This package provides a module to interface with the API.


Using pip:

$ pip install python-coveralls

…Or simply add it to your requirements.


If you’re not using Travis, Coveralls for Python uses a .coveralls.yml file at the root level of your repository to configure options. The only required option is repo_token (found on your repository’s page on Coveralls) to specify which project on Coveralls your project maps to. Another important option is is service_name which allows you to specify where Coveralls should look to find additional information about your builds. This can be any string, but using travis-ci or travis-pro will allow Coveralls to fetch branch data, comment on pull requests, and more. A .coveralls.yml file configured for Travis Pro:

repo_token: abcdef1234569abdcef
service_name: travis-pro
parallel: true # if the CI is running your build in parallel

if you don’t want the repo_token under source control, set it in your coveralls command:

COVERALLS_REPO_TOKEN=abcdef1234569abdcef coveralls


Create a .coverage file and you can use coverage, pytest-cov, or nosexcover. Then you can add in the after_success step:


It should look like something like:

language: python
  - "2.6"
  - "2.7"
  - pip install -e . --use-mirrors
  - pip install -r test_requirements.txt --use-mirrors
  - git clone
  - cd python-coveralls-example
  - git checkout -qf 17b8119796516195527dcb4f454a2ebd41d60244
  - py.test example/ --cov=example
  - cd -
  - py.test coveralls/ --doctest-modules --pep8 coveralls -v --cov coveralls --cov-report term-missing
  - coveralls


You probably don’t need to configure anything, but if you customize some option of coverage you would add it to coveralls too:

$ coveralls -h
usage: coveralls [-h] [--coveralls_url COVERALLS_URL] [--base_dir BASE_DIR]
                 [--data_file DATA_FILE] [--config_file CONFIG_FILE]
                 [--coveralls_yaml COVERALLS_YAML] [--ignore-errors]
                 [--merge_file MERGE_FILE] [--nogit]

optional arguments:
  -h, --help            show this help message and exit
  --coveralls_url COVERALLS_URL, -u COVERALLS_URL
               api url
  --base_dir BASE_DIR, -b BASE_DIR
                        project root directory
  --data_file DATA_FILE, -d DATA_FILE
                        coverage file name
  --config_file CONFIG_FILE, -c CONFIG_FILE
                        coverage config file name
  --coveralls_yaml COVERALLS_YAML, -y COVERALLS_YAML
                        coveralls yaml file name
  --ignore-errors, -i   ignore errors while reading source files
  --merge_file MERGE_FILE, -m MERGE_FILE
                        json file containing coverage data to be merged (for
                        merging javascript coverage)
  --nogit               do not gather git repo info
Bitdeli badge

Project details

Download files

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

Source Distribution

python-coveralls-2.9.3.tar.gz (9.0 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page