bookstack
A Python wrapper for BookStack's API
Current version: 0.2.0-post1
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'
And to POST you can follow this example:
>>> api.post_books_create({'name': 'Sample Book', 'description': 'Sample Description', 'tags': [{ 'name': 'Sample-Name', 'value': 'Sample-Value' }] })
Metadata
Release files for bookstack 0.2.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bookstack-0.2.0.post1.tar.gz | 4.3 kB | Without provenance | Details for bookstack-0.2.0.post1.tar.gz |
Release files / bookstack-0.2.0.post1.tar.gz
| Download URL | bookstack-0.2.0.post1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0b8be2646fa5d130c2a238c8ebc6c1ddd3acf457c9afdea01798ef25bce6a82
|
|
BLAKE2b-256 checksum How to use checksums |
de187c4ea915b475d9cd3eff835c67bd39b27f1f8cf54e31488a14137c7de924
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Security for bookstack 0.2.0.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.