Skip to main content

A python API for Outline Wiki.

Project description

Outline Wiki API

A minimalist library providing python API for Outline Wiki

[!WARNING] Relevant for version 0.82.0


Installation

python3 -m pip install outline-wiki-api

Usage

Creating a new document

Let's create a document in a Welcome collection:

from outline_wiki_api import OutlineWiki

OUTLINE_URL = "https://my.outline.com"
OUTLINE_TOKEN = "mysecrettoken"

app = OutlineWiki(url=OUTLINE_URL, token=OUTLINE_TOKEN)
my_collection_name = "Welcome"

# Search for the Welcome collection to create a new doc there
for collection in app.collections.list().data:
    if collection.name == my_collection_name:
        print(collection)
        new_doc = app.documents.create(
            title="New Document Created From Outline Wiki API",
            text="""Some Markdown text here
Visit [outline-wiki-api GitHub](https://github.com/eppv/outline-wiki-api)
""",
            collection_id=collection.id,
            publish=True
        )
        print(f"New document created in collection {my_collection_name}:\n{new_doc}")

Searching documents

from outline_wiki_api import OutlineWiki

# You can also set OUTLINE_URL and OUTLINE_TOKEN as environment variables
app = OutlineWiki()

# Execute the search query
search_results = app.documents.search(query='outline').data

# Look at the results
for result in search_results:
    print(f"ranking: {result.ranking}")
    print(f"context: {result.context}")
    print(f"document: {result.document}")

Contacts

Feel free to contact me if you want to improve this lib.

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

outline_wiki_api-0.2.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

outline_wiki_api-0.2.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file outline_wiki_api-0.2.0.tar.gz.

File metadata

  • Download URL: outline_wiki_api-0.2.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for outline_wiki_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 942436b4f3ecf6d35f8150f3935c4f299a500e92dceca6f2f2c81ab235a23a75
MD5 1f7ce50df66756839469f304f87ef6a3
BLAKE2b-256 ad0a72f3d1924df90238d113174dae6838b2034bcb3bbc8b12812d09a629a860

See more details on using hashes here.

File details

Details for the file outline_wiki_api-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for outline_wiki_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89b2ec44145cc9d02a55c931d3d8fad486f95cbc124e696491087f8f54b22257
MD5 985b9868971645252c399aa1559c866c
BLAKE2b-256 2f168d6c394509d0db328e41d7d9abbe2fa57084ed98dd189721ec0e69e26bf8

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