Name | confluenpy JSON |
Version |
0.1.20
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2024-06-08 12:40:40 |
maintainer | None |
docs_url | None |
author | Matteo Giani |
requires_python | <4.0,>=3.9 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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.
[](https://opensource.org/licenses/Apache-2.0)



# Example usage
```python
# 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:
```bash
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](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html).
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:
```markdown
# 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:
```confluence
h1. Header
h2. Header
* list level 1
** list level 2
# numbered list 1
## numbered list 2
[here|https://www.google.com]
![excalidraw|excalidraw.png]
```
Raw data
{
"_id": null,
"home_page": null,
"name": "confluenpy",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Matteo Giani",
"author_email": "matteo.giani.87@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/bb/3b/6766fc4a26948650bfc887460b613b3b72063a6a70dae27ce96002b6efed/confluenpy-0.1.20.tar.gz",
"platform": null,
"description": "# ConfluenPy\n\nConfluenPy is a Python package that allows you to interact with Atlassian Confluence via the REST API to programmatically create and update documentation pages content.\n\n[](https://opensource.org/licenses/Apache-2.0)\n\n\n\n\n# Example usage\n\n```python\n # Example usage\n confluence = atlassian.Confluence(\n url='https://example.atlassian.net/',\n username='your.user@company.com',\n password=os.getenv('CONFLUENCE_API_TOKEN')\n )\n\n page = Page(title='WonderDocs', space='IsVast', confluence=confluence)\n\n # Add a table of contents\n page.body.toc()\n # Add a horizontal rule\n page.body.horizontal_rule()\n # Takes the Readme.md file and converts it to confluence format\n with open('README.md', encoding='utf-8') as markdown_text:\n markdown = MarkdownToConfluenceConverter.convert(markdown_text.read())\n # Only takes the second section of the markdown file\n page.body.content += markdown.section(2)\n\n # Upload any local images referenced in the markdown\n for file in MarkdownToConfluenceConverter.local_images_to_be_uploaded:\n page.attach_content(\n content=file.open(\"rb\"),\n name=file.name,\n )\n\n # Adds some more content\n page.body.heading('h1', \"Biggest heading\")\n page.body.block_quote('This is a paragraph')\n page.body.code_block(title='tt', content='Wonderful code')\n\n # Update the page\n page.update()\n```\n\n# Installation\n\nSimply install the package using pip:\n\n```bash\npip install confluenpy\n```\n\n# Usage\n\nConfluence pages are represented by the `Page` class. The page content is handled by a `PageBody` object, which represents it in the [confluence wiki markup](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html).\nThe following confluence macros are also supported via the wiki markup (see the `MacroMixin` class for details):\n - `toc`\n - `code block`\n\n## Markup support\nThe `MarkdownToConfluenceConverter` class allows to convert markdown to confluence wiki markup. The following markdown elements are supported:\n\n - headings\n - code blocks\n - images (both public and local to the repository, see the example above)\n - links\n - lists (ordered and unordered)\n\nRegular markup notation is also supported (bold, italic..).\n\n### Example:\n\nThis content:\n\n```markdown\n# Header\n\n## Header\n\n- list level 1\n- list level 2\n\n1. numbered list 1\n2. numbered list 2\n\n[here](https://www.google.com)\n\n```\n\nwill be converted to:\n\n```confluence\nh1. Header\n\nh2. Header\n\n* list level 1\n** list level 2\n\n# numbered list 1\n## numbered list 2\n\n[here|https://www.google.com]\n![excalidraw|excalidraw.png]\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.1.20",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cd9cccacced26c0a3f8aca4b96400d63ed0600eefa32ed9e3f13e4252d29e505",
"md5": "06695155c50da1c36b533e4e02784ef7",
"sha256": "22dd1ae3e68629d2de24ff1f88e645e232be8433e80528de7d94c8d6c251fe90"
},
"downloads": -1,
"filename": "confluenpy-0.1.20-py3-none-any.whl",
"has_sig": false,
"md5_digest": "06695155c50da1c36b533e4e02784ef7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 13062,
"upload_time": "2024-06-08T12:40:39",
"upload_time_iso_8601": "2024-06-08T12:40:39.241276Z",
"url": "https://files.pythonhosted.org/packages/cd/9c/ccacced26c0a3f8aca4b96400d63ed0600eefa32ed9e3f13e4252d29e505/confluenpy-0.1.20-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bb3b6766fc4a26948650bfc887460b613b3b72063a6a70dae27ce96002b6efed",
"md5": "2c05a8dad25ef82eefaf3099f5a6bd2a",
"sha256": "b86612bbbff2e1eacef5762ffe4fddc4b723619a8f82b5ddb57a4d23eae665cf"
},
"downloads": -1,
"filename": "confluenpy-0.1.20.tar.gz",
"has_sig": false,
"md5_digest": "2c05a8dad25ef82eefaf3099f5a6bd2a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 13195,
"upload_time": "2024-06-08T12:40:40",
"upload_time_iso_8601": "2024-06-08T12:40:40.841635Z",
"url": "https://files.pythonhosted.org/packages/bb/3b/6766fc4a26948650bfc887460b613b3b72063a6a70dae27ce96002b6efed/confluenpy-0.1.20.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-08 12:40:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "confluenpy"
}