ConfluenPy
ConfluenPy is a Python package that allows you to interact with Atlassian Confluence via the REST API to programmatically create and update documentation pages content.
Example usage
# Example usage
confluence = atlassian.Confluence(
url="https://example.atlassian.net/",
username="your.user@company.com",
password=os.getenv("CONFLUENCE_API_TOKEN"),
)
page = Page(title="WonderDocs", space="IsVast", confluence=confluence)
# Add a table of contents
page.body.toc()
# Add a horizontal rule
page.body.horizontal_rule()
# Takes the Readme.md file and converts it to confluence format
markdown = MarkdownToConfluenceConverter.convert_file(
Path(__file__).parent / "README.md"
)
# Only takes the second section of the markdown file
page.body.content += markdown.section(2)
# Upload any local images referenced in the markdown
for file in MarkdownToConfluenceConverter.local_images_to_be_uploaded:
page.attach_content(
content=file.open("rb"),
name=file.name,
)
# Adds some more content
page.body.heading("h1", "Biggest heading")
page.body.block_quote("This is a paragraph")
page.body.code_block(title="tt", content="Wonderful code")
# Update the page
page.update()
Installation
Simply install the package using pip:
pip install confluenpy
Usage
Confluence pages are represented by the Page class. The page content is handled by a PageBody object, which represents it in the confluence wiki markup.
The following confluence macros are also supported via the wiki markup (see the MacroMixin class for details):
- toc
- code block
Markup support
The MarkdownToConfluenceConverter class allows to convert markdown to confluence wiki markup. The following markdown elements are supported:
- headings
- code blocks
- images (both public and local to the repository, see the example above)
- links
- lists (ordered and unordered)
Regular markup notation is also supported (bold, italic..).
Example:
This content:
# Header
## Header
- list level 1
- list level 2
1. numbered list 1
2. numbered list 2
[here](https://www.google.com)

will be converted to:
h1. Header
h2. Header
* list level 1
** list level 2
# numbered list 1
## numbered list 2
[here|https://www.google.com]
![python|python.png]
Metadata
Release files for confluenpy 0.1.26
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| confluenpy-0.1.26.tar.gz | 12.1 kB | Without provenance | Details for confluenpy-0.1.26.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| confluenpy-0.1.26-py3-none-any.whl | Python 3 | none | any | Details for confluenpy-0.1.26-py3-none-any.whl |
Total release size: 25.4 kB
Release files / confluenpy-0.1.26.tar.gz
| Download URL | confluenpy-0.1.26.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e36ce5c610bef22b1e8feb881ef09fb4cbb53362c4785eb2da05bf8db51e89b5
|
|
BLAKE2b-256 checksum How to use checksums |
bac75ac9253c9cbba6391ce724f12ad318744477566661416a7e39f34537ed71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / confluenpy-0.1.26-py3-none-any.whl
| Download URL | confluenpy-0.1.26-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e3d314c03896f7dbf56226e30c204e13f429ffd3ccd086f8dcf7cf280696480
|
|
BLAKE2b-256 checksum How to use checksums |
0baba97fd90c7f5ce797738dce75db83d99fb40bbc70428d60bac58fc1b29934
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for confluenpy 0.1.26
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.