Skip to main content

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.

License pylint Build/Release Coverage

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
    with open('README.md', encoding='utf-8') as markdown_text:
        markdown = MarkdownToConfluenceConverter.convert(markdown_text.read())
        # 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)
![excalidraw](excalidraw.png)

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]
![excalidraw|excalidraw.png]

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

confluenpy-0.1.21.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confluenpy-0.1.21-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file confluenpy-0.1.21.tar.gz.

File metadata

  • Download URL: confluenpy-0.1.21.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for confluenpy-0.1.21.tar.gz
Algorithm Hash digest
SHA256 a8c30109a996dcf67484a7b4edcbe12ba6d03362c601a8fe65d1a4aeaecfb6aa
MD5 e3493f07243ef2dde833b2538b9aafc5
BLAKE2b-256 dabde8c6b11977cf8c01a544e3d224c9b3acf0ca49880f8847b79839797ed874

See more details on using hashes here.

File details

Details for the file confluenpy-0.1.21-py3-none-any.whl.

File metadata

  • Download URL: confluenpy-0.1.21-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for confluenpy-0.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 7b201af43363748f269e3285407dc22ea30386eec4bc8e46ea61195c45a96645
MD5 8c2d2170abd77013f0bc619bc45c1303
BLAKE2b-256 3be608b0246551d127205e688e42bf45c99e5ba8f95321421deaa464204f05f6

See more details on using hashes here.

Supported by

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