You can interact with the Wiki of each project through the API.

Getting the DSSWiki object#

You must first retrieve the DSSWiki through the get_wiki() method

project = client.get_project("MYPROJECT")
wiki = project.get_wiki()

Retrieving and modifying the content of an article#

article = wiki.get_article("article_name")
article_data = article.get_data()

# Modify the content of the article data
current_markdown_content = article_data.get_body()
article_data.set_body("# My new Markdown content")

# And save the modified content

Deleting an article#

article = wiki.get_article("article_name")

Getting the list of all articles#

This prints the content of all articles in the Wiki

for article in wiki.list_articles():
        print("Article: %s" % article.article_id)
        article_data = article.get_data()

Uploading an attachment to an article#

After upload, the attachment can be referenced through the Markdown syntax

article = wiki.get_article("article_name")

with open("myimage.jpg") as f:
        article.upload_attachment(f, "myimage.jpg")

Download an attachment of an article#

After being uploaded, the attachment of an article can be retrieve through its upload id

article_metadata = article.get_data().get_metadata().values()
upload_attachment_id = article_metadata[0]["smartId"]

attachment_res = wiki_article.get_uploaded_file(upload_attachment_id)

Moving an article in the taxonomy#

You can change the parent of an article

settings = wiki.get_settings()
settings.move_article_in_taxonomy("article_name", "new_parent_of_the_article")

Changing the home article of the wiki#

settings = wiki.get_settings()

Reference documentation#, project_key)

A handle to manage the wiki of a project, ...)

Global settings for the wiki, including taxonomy., ...)

A handle to manage an article

A handle to manage an article