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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file novelai_api-0.10.3.tar.gz.
File metadata
- Download URL: novelai_api-0.10.3.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.7 Linux/5.15.74-3-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5243f30276b4e6d6af7dac8381358796a2519a68895229cb4cde857a93b45a26
|
|
| MD5 |
2c2f15e95d91b8fb44e46c07f23ed0d2
|
|
| BLAKE2b-256 |
c219bfb69394c0dbe68efadfb2020e3dd35d926e92cf7fc9f610294a9d8f55f7
|
File details
Details for the file novelai_api-0.10.3-py3-none-any.whl.
File metadata
- Download URL: novelai_api-0.10.3-py3-none-any.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.7 Linux/5.15.74-3-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1afb1e0b7d7dabd579587908788c3bfc272361b425e962c76304a6c5aefb6ac7
|
|
| MD5 |
6d47fac323d0e9d7923178ebda50a22f
|
|
| BLAKE2b-256 |
bc8a8a653d27107dac77dac206f4914d1319c2f7f6fa7fffd0d5d3d3c9f4b398
|