Python API for the NovelAI REST API
Project description
novelai-api
Python API for the NovelAI REST API
This module is intended to be used by developers as a helper for using NovelAI's REST API.
Category | Badges |
---|---|
Pypi | |
Quality checking | |
Stats | |
Activity |
Prerequisites
Before anything, ensure that nox is installed (pip install poetry). For logging in, credentials are needed (NAI_USERNAME and NAI_PASSWORD). They should be passed via the environment variables.
Examples
The examples are in the example folder. Each example is standalone and can be used as a test.
Examples should be ran with nox -s run -- python example/<name>.py
.
Some tests act as example. The full list is as follows :
- decryption and re-encryption: tests/test_decrypt_encrypt_integrity_check.py
- diverse generations: tests/test_generate.py
- parallel generations: tests/test_generate_parallel.py
Usage
The source and all the required functions are located in the novelai-api folder. The examples and tests showcase how this API should be used and can be regarded as the "right way" to use it. However, it doesn't mean one can't use the "low level" part, which is a thin implementation of the REST endpoints, while the "high level" part is an abstraction built on that low level.
Contributing
You can contribute features and enhancements through PR. Any PR should pass the tests and the pre-commits before submission.
The tests against the API can be ran with nox -s test_api
. Note that having node.js installed is required for the test to run properly
/!\ WIP /!\ The tests against the mocked backend can be ran with nox -s test_mock
.
To install and run the pre-commit hook, run nox -s pre-commit
. This hook should be installed before committing anything.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for novelai_api-0.10.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0303e937157ed0342e98fe23e4413d25c9d5faeb2018c24a913e316d43be10f8 |
|
MD5 | cc78cdb5853e4c0968ff64d4e6ea9634 |
|
BLAKE2b-256 | 44e6b970f10c8c2afdf2df92d033ac333339dbaa17c3e1108de06ee2ff1d5a96 |