Merge Debian packaging for release “4.2+dfsg.1-2”.
[debian_python-coverage.git] / doc / api.rst
blob26db06ef74e1d0b32639a9300a13ad5399db5ce1
1 .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2 .. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
4 .. _api:
6 ===============
7 Coverage.py API
8 ===============
10 .. :history: 20090524T134300, brand new docs.
11 .. :history: 20090613T164000, final touches for 3.0
12 .. :history: 20100221T151500, docs for 3.3 (on the plane back from PyCon)
13 .. :history: 20100725T211700, updated for 3.4.
14 .. :history: 20121111T235800, added a bit of clarification.
15 .. :history: 20140819T132600, change class name to Coverage
18 The API to coverage.py is very simple, contained in a module called `coverage`.
19 Most of the interface is in the :class:`coverage.Coverage` class.  Methods on
20 the Coverage object correspond roughly to operations available in the command
21 line interface. For example, a simple use would be::
23     import coverage
25     cov = coverage.Coverage()
26     cov.start()
28     # .. call your code ..
30     cov.stop()
31     cov.save()
33     cov.html_report()
35 The :class:`coverage.CoverageData` class provides access to coverage data
36 stored in coverage.py data files.
38 .. toctree::
39     :maxdepth: 1
41     api_coverage
42     api_coveragedata
43     api_plugin