trilium-client
This is an auto-generated client for Trilium Notes. It builds an API client using the etapi.openapi.yaml provided by Trilium.
The generated trilium_client, docs, and README.md artifacts are packaged and many unused files are ignored.
To install, run:
pip install trilium-client
To build, activate a shell: (recommended)
poetry shell
Then run:
poetry install --with=dev
scons
To clean, run:
scons --clean
Following is the README produced by the generator.
trilium-client
External Trilium API
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.24.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://triliumnotes.org
Requirements.
Python 3.10+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/mm21/trilium-client.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/mm21/trilium-client.git)
Then import the package:
import trilium_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import trilium_client
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import trilium_client
from trilium_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:37740/etapi
# See configuration.py for a list of all supported configuration parameters.
configuration = trilium_client.Configuration(
host = "http://localhost:37740/etapi"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: EtapiTokenAuth
configuration.api_key['EtapiTokenAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['EtapiTokenAuth'] = 'Bearer'
# Configure HTTP basic authorization: EtapiBasicAuth
configuration = trilium_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with trilium_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = trilium_client.DefaultApi(api_client)
backup_name = 'backup_name_example' # str | If the backupName is e.g. \"now\", then the backup will be written to \"backup-now.db\" file
try:
api_instance.create_backup(backup_name)
except ApiException as e:
print("Exception when calling DefaultApi->create_backup: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://localhost:37740/etapi
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | create_backup | PUT /backup/{backupName} | |
| DefaultApi | create_note | POST /create-note | |
| DefaultApi | create_revision | POST /notes/{noteId}/revision | |
| DefaultApi | delete_attachment_by_id | DELETE /attachments/{attachmentId} | |
| DefaultApi | delete_attribute_by_id | DELETE /attributes/{attributeId} | |
| DefaultApi | delete_branch_by_id | DELETE /branches/{branchId} | |
| DefaultApi | delete_note_by_id | DELETE /notes/{noteId} | |
| DefaultApi | export_note_subtree | GET /notes/{noteId}/export | |
| DefaultApi | get_app_info | GET /app-info | |
| DefaultApi | get_attachment_by_id | GET /attachments/{attachmentId} | |
| DefaultApi | get_attachment_content | GET /attachments/{attachmentId}/content | |
| DefaultApi | get_attribute_by_id | GET /attributes/{attributeId} | |
| DefaultApi | get_branch_by_id | GET /branches/{branchId} | |
| DefaultApi | get_day_note | GET /calendar/days/{date} | |
| DefaultApi | get_inbox_note | GET /inbox/{date} | |
| DefaultApi | get_month_note | GET /calendar/months/{month} | Get a month note |
| DefaultApi | get_note_attachments | GET /notes/{noteId}/attachments | |
| DefaultApi | get_note_by_id | GET /notes/{noteId} | |
| DefaultApi | get_note_content | GET /notes/{noteId}/content | |
| DefaultApi | get_note_history | GET /notes/history | |
| DefaultApi | get_note_revisions | GET /notes/{noteId}/revisions | |
| DefaultApi | get_revision_by_id | GET /revisions/{revisionId} | |
| DefaultApi | get_revision_content | GET /revisions/{revisionId}/content | |
| DefaultApi | get_week_note | GET /calendar/weeks/{week} | Get a week note |
| DefaultApi | get_year_note | GET /calendar/years/{year} | Get a year note |
| DefaultApi | import_zip | POST /notes/{noteId}/import | |
| DefaultApi | login | POST /auth/login | |
| DefaultApi | logout | POST /auth/logout | |
| DefaultApi | patch_attachment_by_id | PATCH /attachments/{attachmentId} | |
| DefaultApi | patch_attribute_by_id | PATCH /attributes/{attributeId} | |
| DefaultApi | patch_branch_by_id | PATCH /branches/{branchId} | |
| DefaultApi | patch_note_by_id | PATCH /notes/{noteId} | |
| DefaultApi | post_attachment | POST /attachments | |
| DefaultApi | post_attribute | POST /attributes | |
| DefaultApi | post_branch | POST /branches | |
| DefaultApi | post_refresh_note_ordering | POST /refresh-note-ordering/{parentNoteId} | |
| DefaultApi | put_attachment_content_by_id | PUT /attachments/{attachmentId}/content | |
| DefaultApi | put_note_content_by_id | PUT /notes/{noteId}/content | |
| DefaultApi | search_notes | GET /notes | |
| DefaultApi | undelete_note | POST /notes/{noteId}/undelete |
Documentation For Models
- AppInfo
- Attachment
- Attribute
- Branch
- CreateAttachment
- CreateNoteDef
- Error
- Login201Response
- LoginRequest
- Note
- NoteWithBranch
- RecentChange
- Revision
- SearchResponse
- UndeleteNote200Response
Documentation For Authorization
Authentication schemes defined for the API:
EtapiTokenAuth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
EtapiBasicAuth
- Type: HTTP basic authentication
Author
Metadata
Release files for trilium-client 0.2.0
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 |
|---|---|---|---|---|
| trilium_client-0.2.0.tar.gz | 42.9 kB | Without provenance | Details for trilium_client-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trilium_client-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for trilium_client-0.2.0-py3-none-any.whl |
Total release size: 107.3 kB
Release files / trilium_client-0.2.0.tar.gz
| Download URL | trilium_client-0.2.0.tar.gz |
|---|---|
| Size | 42.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1cfed86ccf59a16a90ed5584528cdd92cae6afdcac295e464befb7be6b4dda24
|
|
BLAKE2b-256 checksum How to use checksums |
77d52cbbed6ae2cada1a79158fb244d5b2eeea60de96da7c4a5f0f6c651451ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Linux/5.10.16.3-microsoft-standard-WSL2
|
Release files / trilium_client-0.2.0-py3-none-any.whl
| Download URL | trilium_client-0.2.0-py3-none-any.whl |
|---|---|
| Size | 64.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d03ce899420e6a939e20d7e0afebdea8542e7ebe1d0a4c7774cc43960695f5a3
|
|
BLAKE2b-256 checksum How to use checksums |
6062359a3ecc55c41e4f433cb201f32c528a12bbe141b58ad6afc9521bb70486
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Linux/5.10.16.3-microsoft-standard-WSL2
|
Security for trilium-client 0.2.0
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.