Welcome to Confluence REST API’s documentation!

Build status PyPI version Code coverage stats Requirements status Documentation status

Confluence Python Library

This is a simple wrapper around the REST API which the Confluence provides. Consider the API to be stable as of v1.0.0 (now released)

c.f. endpoints.md for a list of endpoints and whether this library supports them yet. Please do send pull requests if you want an endpoint that isn’t covered!

Installation

pip install confluence-rest-library

Usage

from confluence.client import Confluence
with Confluence('https://site:8080/confluence', ('user', 'pass')) as c:
    pages = c.search('ID=1')

Development and Deployment

See the Contribution guidelines for this project for details on how to make changes to this library.

Testing Locally

There are two sets of tests included. A suite of unit tests that verify the models can be built correctly and a suite of integration tests that run against a local instance of confluence. The unit tests can be run by simply invoking: .. code:

python setup.py test --addopts "tests"

The integration tests are more complex and require the developer to take the following steps:

  • Install the Atlassian SDK
  • Run atlas-run-standalone --product confluence --version 6.6.0 --server localhost
  • Wait for the server to complete starting up
  • Run integration tests using python setup.py test --addopts "integration_tests"

How to contribute

You’re very welcome to make bug fixes or enhancements to this library. This document lays out the guidelines for how to get those changes into the main package repository.

Getting Started

  1. Fork the repository on github: https://github.com/DaveTCode/confluence-python-lib
  2. Make changes
  3. Send pull request

Using your changes before they’re live

You may want to use the changes you’ve made to this library before the merging/review process has been completed. To do this you can install it into the global python environment by running this command from the top level directory.

pip install . --upgrade

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

Added

  • Nothing

Changed

  • Nothing

`1.0.1`_ - 2018-08-17

Added

  • Added support for handling 401 errors and wrapping them in specific exceptions

Changed

  • Nothing

1.0.0 - 2018-06-02

Added

  • Additional functional tests to bring coverage up to ~90%

Changed

  • The API for getting labels has been changed so that the prefix is now an enum as the HTTP API expects.

0.15.0 - 2018-05-25

Added

  • Option to update content without sending notifications

Changed

  • Added lots of extra docstrings

0.14.0 - 2018-04-06

Added

  • Get content by identifier

Changed

  • Fixed update_content and added integration tests for it

`0.13.2`_ - 2018-04-04

Added

  • Nothing

Changed

  • Fixed content body implementation to contain the correct data and added integration tests to verify it

0.13.1 - 2018-04-04

Added

  • Nothing

Changed

  • Fixed context managed client to return itself

0.13.0 - 2018-03-26

Added

  • Added functionality for handling content properties

Changed

  • Nothing

0.12.0 - 2018-03-18

Added

  • Added support for creating new content (blogs & pages)
  • Added functional tests for creating new content and various space functions

Changed

  • hidden is now optional when viewing a Version object

0.11.0 - 2018-03-11

Added

  • Added support for deleting content
  • Added support for creating, updating and deleting labels

Changed

  • Nothing

0.10.0 - 2018-03-10

Added

  • Added support for all endpoints relating to space properties

Changed

  • Complete overhaul of the way that failed responses are handled, all of them now raise custom exceptions.

0.9.0 - 2018-03-09

Added

  • Added partial support for space properties

Changed

  • Nothing

0.8.0 - 2018-03-09

Added

  • Added full support for manipulating watches on space and content

Changed

  • Nothing

0.7.0 - 2018-01-30

Added

  • Added basic support for updating content
  • Many more of the fields on content objects are now stored when they’re expanded

Changed

  • Major overhaul of the content based objects to better match the API provided

0.6.0 - 2018-01-26

Added

  • Added longtask endpoints
  • A markdown file containing all endpoints with their current state

Changed

  • client.spaces is renamed to client.get_spaces in keeping with other endpoints

0.5.0 - 2018-01-26

Added

  • Added support for python 2.7 & 3.5
  • Added unit tests to verify the models are basically created how you’d expect

Changed

  • Nothing

0.3.0 - 2018-01-18

Added

  • Can now be treated as a context manager holding a single session for the duration of the class.
  • README converted to RST for pypi

Changed

  • Nothing

0.2.2 - 2018-01-18

Added

  • Nothing

Changed

  • requests.get isn’t a context manager…

0.2.1 - 2018-01-18

Added

  • Nothing

Changed

  • Bug fix so we don’t hold a session for quite so long when running large queries

0.2.0 - 2018-01-15

Added

  • API call /content/search
  • API call /content

Changed

  • Nothing

Indices and tables