No project description provided
Project description
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]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file confluenpy-0.1.25.tar.gz.
File metadata
- Download URL: confluenpy-0.1.25.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f79dbcc638c144d5f29434680a40861bd16f5affbfcabf532eaf1649a0f55e35
|
|
| MD5 |
0dad984e22048dcc5ac5db53f2d00950
|
|
| BLAKE2b-256 |
8a27f8c696207e3ecac18ad85ba802bd5182a6b76df4eddefbc47d5d3fdccbc9
|
File details
Details for the file confluenpy-0.1.25-py3-none-any.whl.
File metadata
- Download URL: confluenpy-0.1.25-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfed0a735cbc839da5af755e0017d742bf368fcd9e19804d14e46d24a28e4b70
|
|
| MD5 |
b87b4fd8c4c3411647a7d0a722ded434
|
|
| BLAKE2b-256 |
b8eb294eef3fc8d4832aae1937e4cd781c5e5558f9864f861c90524599236f56
|