Wikis#

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
article_data.save()

Deleting an article#

article = wiki.get_article("article_name")
article.delete()

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()
        print("Content:")
        print(article_data.get_body())

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")

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")
settings.save()

Changing the home article of the wiki#

settings = wiki.get_settings()
settings.set_home_article_id("new_home_article")
settings.save()

Reference documentation#

dataikuapi.dss.wiki.DSSWiki(client, project_key)

A handle to manage the wiki of a project

dataikuapi.dss.wiki.DSSWikiSettings(client, ...)

Global settings for the wiki, including taxonomy.

dataikuapi.dss.wiki.DSSWikiArticle(client, ...)

A handle to manage an article

dataikuapi.dss.wiki.DSSWikiArticleData(...)

A handle to manage an article