Metadata-Version: 2.3
Name: trilium-client
Version: 0.2.1
Summary: Trilium ETAPI client generated by OpenAPI Generator
Author: mm21
Author-email: mm21.dev@gmail.com
Requires-Python: >=3.12,<4.0
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Requires-Dist: pydantic (>=2.11)
Requires-Dist: python-dateutil (>=2.8.2)
Requires-Dist: typing-extensions (>=4.7.1)
Requires-Dist: urllib3 (>=2.1.0,<3.0.0)
Project-URL: Homepage, https://github.com/mm21/trilium-client
Description-Content-Type: text/markdown

# trilium-client

This is an auto-generated client for [Trilium Notes](https://github.com/zadam/trilium). 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:

```sh
pip install trilium-client
```

To build, activate a shell: (recommended)

```sh
poetry shell
````

Then run:

```sh
poetry install --with=dev
scons
````

To clean, run:

```sh
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](https://openapi-generator.tech) 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](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:

```sh
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:
```python
import trilium_client
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import trilium_client
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

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.ApplicationApi(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:
        # Create a backup
        api_instance.create_backup(backup_name)
    except ApiException as e:
        print("Exception when calling ApplicationApi->create_backup: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *http://localhost:37740/etapi*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ApplicationApi* | [**create_backup**](docs/ApplicationApi.md#create_backup) | **PUT** /backup/{backupName} | Create a backup
*ApplicationApi* | [**get_app_info**](docs/ApplicationApi.md#get_app_info) | **GET** /app-info | Get application info
*ApplicationApi* | [**get_metrics**](docs/ApplicationApi.md#get_metrics) | **GET** /metrics | Get instance metrics
*AttachmentsApi* | [**delete_attachment_by_id**](docs/AttachmentsApi.md#delete_attachment_by_id) | **DELETE** /attachments/{attachmentId} | Delete an attachment
*AttachmentsApi* | [**get_attachment_by_id**](docs/AttachmentsApi.md#get_attachment_by_id) | **GET** /attachments/{attachmentId} | Get an attachment
*AttachmentsApi* | [**get_attachment_content**](docs/AttachmentsApi.md#get_attachment_content) | **GET** /attachments/{attachmentId}/content | Get the content of an attachment
*AttachmentsApi* | [**get_note_attachments**](docs/AttachmentsApi.md#get_note_attachments) | **GET** /notes/{noteId}/attachments | List the attachments of a note
*AttachmentsApi* | [**patch_attachment_by_id**](docs/AttachmentsApi.md#patch_attachment_by_id) | **PATCH** /attachments/{attachmentId} | Update an attachment
*AttachmentsApi* | [**post_attachment**](docs/AttachmentsApi.md#post_attachment) | **POST** /attachments | Create an attachment
*AttachmentsApi* | [**put_attachment_content_by_id**](docs/AttachmentsApi.md#put_attachment_content_by_id) | **PUT** /attachments/{attachmentId}/content | Replace the content of an attachment
*AttributesApi* | [**delete_attribute_by_id**](docs/AttributesApi.md#delete_attribute_by_id) | **DELETE** /attributes/{attributeId} | Delete an attribute
*AttributesApi* | [**get_attribute_by_id**](docs/AttributesApi.md#get_attribute_by_id) | **GET** /attributes/{attributeId} | Get an attribute
*AttributesApi* | [**patch_attribute_by_id**](docs/AttributesApi.md#patch_attribute_by_id) | **PATCH** /attributes/{attributeId} | Update an attribute
*AttributesApi* | [**post_attribute**](docs/AttributesApi.md#post_attribute) | **POST** /attributes | Create an attribute
*BranchesApi* | [**delete_branch_by_id**](docs/BranchesApi.md#delete_branch_by_id) | **DELETE** /branches/{branchId} | Delete a branch
*BranchesApi* | [**get_branch_by_id**](docs/BranchesApi.md#get_branch_by_id) | **GET** /branches/{branchId} | Get a branch
*BranchesApi* | [**patch_branch_by_id**](docs/BranchesApi.md#patch_branch_by_id) | **PATCH** /branches/{branchId} | Update a branch
*BranchesApi* | [**post_branch**](docs/BranchesApi.md#post_branch) | **POST** /branches | Create a branch
*BranchesApi* | [**post_refresh_note_ordering**](docs/BranchesApi.md#post_refresh_note_ordering) | **POST** /refresh-note-ordering/{parentNoteId} | Refresh the order of child notes
*CalendarApi* | [**get_day_note**](docs/CalendarApi.md#get_day_note) | **GET** /calendar/days/{date} | Get a day note
*CalendarApi* | [**get_inbox_note**](docs/CalendarApi.md#get_inbox_note) | **GET** /inbox/{date} | Get the inbox note
*CalendarApi* | [**get_month_note**](docs/CalendarApi.md#get_month_note) | **GET** /calendar/months/{month} | Get a month note
*CalendarApi* | [**get_week_first_day_note**](docs/CalendarApi.md#get_week_first_day_note) | **GET** /calendar/week-first-day/{date} | Get the day note starting the week
*CalendarApi* | [**get_week_note**](docs/CalendarApi.md#get_week_note) | **GET** /calendar/weeks/{week} | Get a week note
*CalendarApi* | [**get_year_note**](docs/CalendarApi.md#get_year_note) | **GET** /calendar/years/{year} | Get a year note
*NotesApi* | [**create_note**](docs/NotesApi.md#create_note) | **POST** /create-note | Create a note
*NotesApi* | [**delete_note_by_id**](docs/NotesApi.md#delete_note_by_id) | **DELETE** /notes/{noteId} | Delete a note
*NotesApi* | [**export_note_subtree**](docs/NotesApi.md#export_note_subtree) | **GET** /notes/{noteId}/export | Export a subtree
*NotesApi* | [**get_note_by_id**](docs/NotesApi.md#get_note_by_id) | **GET** /notes/{noteId} | Get a note
*NotesApi* | [**get_note_content**](docs/NotesApi.md#get_note_content) | **GET** /notes/{noteId}/content | Get the content of a note
*NotesApi* | [**get_note_history**](docs/NotesApi.md#get_note_history) | **GET** /notes/history | List recent changes
*NotesApi* | [**import_zip**](docs/NotesApi.md#import_zip) | **POST** /notes/{noteId}/import | Import a ZIP archive
*NotesApi* | [**patch_note_by_id**](docs/NotesApi.md#patch_note_by_id) | **PATCH** /notes/{noteId} | Update a note
*NotesApi* | [**put_note_content_by_id**](docs/NotesApi.md#put_note_content_by_id) | **PUT** /notes/{noteId}/content | Replace the content of a note
*NotesApi* | [**search_notes**](docs/NotesApi.md#search_notes) | **GET** /notes | Search notes
*NotesApi* | [**undelete_note**](docs/NotesApi.md#undelete_note) | **POST** /notes/{noteId}/undelete | Restore a deleted note
*RevisionsApi* | [**create_revision**](docs/RevisionsApi.md#create_revision) | **POST** /notes/{noteId}/revision | Create a revision
*RevisionsApi* | [**get_note_revisions**](docs/RevisionsApi.md#get_note_revisions) | **GET** /notes/{noteId}/revisions | List the revisions of a note
*RevisionsApi* | [**get_revision_by_id**](docs/RevisionsApi.md#get_revision_by_id) | **GET** /revisions/{revisionId} | Get a revision
*RevisionsApi* | [**get_revision_content**](docs/RevisionsApi.md#get_revision_content) | **GET** /revisions/{revisionId}/content | Get the content of a revision
*TokensApi* | [**login**](docs/TokensApi.md#login) | **POST** /auth/login | Log in
*TokensApi* | [**logout**](docs/TokensApi.md#logout) | **POST** /auth/logout | Log out


## Documentation For Models

 - [AppInfo](docs/AppInfo.md)
 - [Attachment](docs/Attachment.md)
 - [Attribute](docs/Attribute.md)
 - [Branch](docs/Branch.md)
 - [CreateAttachment](docs/CreateAttachment.md)
 - [CreateNoteDef](docs/CreateNoteDef.md)
 - [Error](docs/Error.md)
 - [Login201Response](docs/Login201Response.md)
 - [LoginRequest](docs/LoginRequest.md)
 - [Metrics](docs/Metrics.md)
 - [MetricsDatabase](docs/MetricsDatabase.md)
 - [MetricsStatistics](docs/MetricsStatistics.md)
 - [MetricsVersion](docs/MetricsVersion.md)
 - [Note](docs/Note.md)
 - [NoteWithBranch](docs/NoteWithBranch.md)
 - [RecentChange](docs/RecentChange.md)
 - [Revision](docs/Revision.md)
 - [SearchResponse](docs/SearchResponse.md)
 - [UndeleteNote200Response](docs/UndeleteNote200Response.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="EtapiTokenAuth"></a>
### EtapiTokenAuth

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header

<a id="EtapiBasicAuth"></a>
### EtapiBasicAuth

- **Type**: HTTP basic authentication


## Author

contact@eliandoran.me



