Skip to main content

A Python wrapper for BookStack's API

Project description

bookstack

version: 0.1.0-beta

Please note that this project is currently in an unstable state. Please be patient.

A Python wrapper for BookStack's API

Installation

To install bookstack, run:

pip install bookstack

Setup

To use BookStack's API, you'll need to get a token ID and secret.

You can find how to get these values from your BookStack instance's doc page at http[s]://<example.com>/api/docs

Note: Your account's user group must have API usage priveleges enabled.

Usage

Once you've acquired your token ID and secret, you're ready to rock.

>>> import bookstack

# Input the appropriate values for these three variables
>>> base_url = 'http[s]://<example.com>'
>>> token_id = '<token_id>'
>>> token_secret = '<token_secret>'

>>> api = bookstack.BookStack(base_url, token_id=token_id, token_secret=token_secret)

This wrapper dynamically generates its API calls at runtime. To have the wrapper generate the methods, use:

>>> api.generate_api_methods()

>>> api.available_api_methods
{'get_books_export_pdf', 'get_shelves_list', 'post_books_create', 'get_docs_display', 'delete_shelves_delete', 'get_books_list', 'get_docs_json', 'delete_books_delete', 'get_books_read', 'get_shelves_read', 'put_books_update', 'get_books_export_plain_text', 'get_books_export_html', 'post_shelves_create', ...}

The above are then the methods available to you, for example:

>>> books_list = api.get_books_list()
>>> books_list['data'][0]['name']
'Mathematics'

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

bookstack-0.1.0b0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

bookstack-0.1.0b0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file bookstack-0.1.0b0.tar.gz.

File metadata

  • Download URL: bookstack-0.1.0b0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for bookstack-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 56ef7c9f7e6c89e3418cfa323f27d02e0640454b6e97f81d7065e6921fc6647b
MD5 38242e7e159218abf1991d42be7881d4
BLAKE2b-256 c28dd949cb210f821f580a122a60fe0170342685584e66b90188904d67708edc

See more details on using hashes here.

File details

Details for the file bookstack-0.1.0b0-py3-none-any.whl.

File metadata

  • Download URL: bookstack-0.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for bookstack-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4bc92ac2e26673d546f76b144de1ba0a2113e630954dd53cac7b8242c8a11a
MD5 3063c2cfdc3ff7ff873020d7393e524b
BLAKE2b-256 3db1360188ce275a3f41c854064d928cdb3322604ddc6c30c205dba35f72ca04

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