From 99a571c25aef215bc1fb5cd3e8697fedac5cff71 Mon Sep 17 00:00:00 2001 From: Aedial Date: Thu, 18 May 2023 23:21:11 +0200 Subject: [PATCH] [MISC] Document the CLI commands --- README.md | 25 +++++++++++++++++++++++-- README_TEMPLATE.md | 25 +++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c59e068..244c498 100644 --- a/README.md +++ b/README.md @@ -19,16 +19,37 @@ Download via [pip](https://pypi.org/project/novelai-api): pip install novelai-api ``` +## Using the module via Command Line + +### Get access key +Get the access key for your account. This key is used to login to the API through the /login endpoint. +```bash +python -m novelai_api get_access_key +``` + +### Get access token +Login to the API and get the access token. This token is valid 30 days and is required to use most of the API. +```bash +python -m novelai_api get_access_token +``` + +### Sanity check +Run a sanity check on your user content. It will print what content couldn't be decrypted. +```bash +python -m novelai_api sanity_check +``` + +## Using the module in your code A full list of examples is available in the [example](example) directory The API works through the NovelAIAPI object. It is split in 2 groups: NovelAIAPI.low_level and NovelAIAPI.high_level -## low_level +### low_level The low level interface is a strict implementation of the official API (). It only checks for input types via assert, and output schema if NovelAIAPI.low_level.is_schema_validation_enabled is True -## high_level +### high_level The high level interface builds on the low level one for easier handling of complex settings. It handles many tasks from the frontend diff --git a/README_TEMPLATE.md b/README_TEMPLATE.md index d305907..025e488 100644 --- a/README_TEMPLATE.md +++ b/README_TEMPLATE.md @@ -19,16 +19,37 @@ Download via [pip](https://pypi.org/project/novelai-api): pip install novelai-api ``` +## Using the module via Command Line + +### Get access key +Get the access key for your account. This key is used to login to the API through the /login endpoint. +```bash +python -m novelai_api get_access_key +``` + +### Get access token +Login to the API and get the access token. This token is valid 30 days and is required to use most of the API. +```bash +python -m novelai_api get_access_token +``` + +### Sanity check +Run a sanity check on your user content. It will print what content couldn't be decrypted. +```bash +python -m novelai_api sanity_check +``` + +## Using the module in your code A full list of examples is available in the [example](example) directory The API works through the NovelAIAPI object. It is split in 2 groups: NovelAIAPI.low_level and NovelAIAPI.high_level -## low_level +### low_level The low level interface is a strict implementation of the official API (). It only checks for input types via assert, and output schema if NovelAIAPI.low_level.is_schema_validation_enabled is True -## high_level +### high_level The high level interface builds on the low level one for easier handling of complex settings. It handles many tasks from the frontend