Skip to main content

The python package for Revornix API.

Project description

Revornix Python Library

English | 简体中文

Python SDK and CLI for the Revornix API.

📕 API Documentation: revornix/api

Ask DeepWiki

Full Application

The full Revornix application is available here:

Qingyon-AI/Revornix

Introduction

Installation

Install from PyPI:

pip install revornix

Install from source for local development:

pip install -e .

Authentication

Both the Python SDK and CLI require:

  • base_url: your Revornix API base URL
  • api_key: your Revornix API key

For CLI usage, these environment variables are supported:

export REVORNIX_BASE_URL="YOUR_API_PREFIX"
export REVORNIX_API_KEY="YOUR_API_KEY"

CLI

After installation, the revornix command is available.

Show help:

revornix --help

You can pass credentials with flags:

revornix --base-url "YOUR_API_PREFIX" --api-key "YOUR_API_KEY" --help

Or use environment variables:

export REVORNIX_BASE_URL="YOUR_API_PREFIX"
export REVORNIX_API_KEY="YOUR_API_KEY"
revornix --help

CLI Quick Start

Upload a file:

revornix files upload \
  --local-file-path ./tests/fixtures/test.txt \
  --remote-file-path uploads/test.txt

Create a quick note document:

revornix documents create-quick-note \
  --content "hello world" \
  --section 1 \
  --section 2 \
  --label 10 \
  --auto-summary

Create a website document:

revornix documents create-website \
  --url https://www.google.com \
  --section 1 \
  --label 10

Create a file document:

revornix documents create-file \
  --file-name demo.pdf \
  --section 1 \
  --label 10

Create an audio document:

revornix documents create-audio \
  --file-name demo.mp3 \
  --section 1 \
  --label 10 \
  --auto-transcribe

Upload a local file and create a file document in one step:

revornix documents upload-create-file \
  --local-file-path ./tests/fixtures/test.txt \
  --remote-file-path uploads/test.txt \
  --section 1 \
  --label 10

Create a document label:

revornix labels create-document-label --name research

Create a section label:

revornix labels create-section-label --name tutorial

List all document labels:

revornix labels list-document-labels

List all sections:

revornix sections list

Get document detail:

revornix documents detail --document-id 123

Search my documents:

revornix documents search-mine --keyword notes --label 10 --desc true

Run document vector search:

revornix documents search-vector --query "retrieval augmented generation"

Create a section:

revornix sections create \
  --title "AI Notes" \
  --description "Knowledge base for AI" \
  --process-task-trigger-type 1 \
  --label 10 \
  --auto-publish

Get section detail:

revornix sections detail --section-id 12

Publish a section:

revornix sections publish --section-id 12 --status true

CLI Command Reference

files

Upload a local file:

revornix files upload \
  --local-file-path ./demo.txt \
  --remote-file-path uploads/demo.txt \
  --content-type text/plain

documents

Create a file document:

revornix documents create-file \
  --file-name demo.pdf \
  --title "Demo File" \
  --description "Imported from uploaded file" \
  --section 1 \
  --label 10 \
  --auto-summary

Create a website document:

revornix documents create-website \
  --url https://example.com \
  --title "Example Website" \
  --section 1 \
  --label 10 \
  --auto-summary

Create a quick note document:

revornix documents create-quick-note \
  --content "Meeting notes" \
  --title "Meeting Notes" \
  --section 1 \
  --label 10

Create an audio document:

revornix documents create-audio \
  --file-name call.mp3 \
  --title "Customer Call" \
  --section 1 \
  --label 10 \
  --auto-transcribe \
  --auto-summary

Upload a file and create a file document in one command:

revornix documents upload-create-file \
  --local-file-path ./demo.pdf \
  --remote-file-path uploads/demo.pdf \
  --title "Demo File" \
  --section 1 \
  --label 10

Upload an audio file and create an audio document in one command:

revornix documents upload-create-audio \
  --local-file-path ./call.mp3 \
  --remote-file-path uploads/call.mp3 \
  --title "Customer Call" \
  --section 1 \
  --label 10 \
  --auto-transcribe

Get document detail:

revornix documents detail --document-id 123

Update document metadata:

revornix documents update \
  --document-id 123 \
  --title "Updated Title" \
  --section 1 \
  --label 10

Delete documents:

revornix documents delete --document-id 123 --document-id 124

Search my documents:

revornix documents search-mine \
  --keyword notes \
  --label 10 \
  --start 0 \
  --limit 20 \
  --desc true

Run document vector search:

revornix documents search-vector --query "retrieval augmented generation"

labels

List document labels:

revornix labels list-document-labels

Create a document label:

revornix labels create-document-label --name article

Create a section label:

revornix labels create-section-label --name collection

List section labels:

revornix labels list-section-labels

Delete document labels:

revornix labels delete-document-labels --label-id 10 --label-id 11

Delete section labels:

revornix labels delete-section-labels --label-id 20 --label-id 21

sections

List sections:

revornix sections list

Create a section:

revornix sections create \
  --title "Weekly Digest" \
  --description "Weekly curated content" \
  --process-task-trigger-type 1 \
  --process-task-trigger-scheduler "0 0 * * 1" \
  --label 10

Get section detail:

revornix sections detail --section-id 12

List section documents:

revornix sections documents --section-id 12 --start 0 --limit 20 --desc true

Search my sections:

revornix sections search-mine --keyword digest --label 10 --desc true

Update a section:

revornix sections update \
  --section-id 12 \
  --title "Weekly Digest" \
  --auto-podcast true \
  --auto-illustration false

Delete a section:

revornix sections delete --section-id 12

Get publish status:

revornix sections get-publish --section-id 12

Publish or unpublish:

revornix sections publish --section-id 12 --status true
revornix sections publish --section-id 12 --status false

Republish:

revornix sections republish --section-id 12

CLI Notes

  • Use repeated --section options to pass multiple sections.
  • Use repeated --label options to pass multiple labels.
  • --section and --label expect numeric IDs.
  • CLI responses are printed as JSON.
  • documents upload-create-file and documents upload-create-audio upload the local file first, then create the corresponding document.
  • documents search-vector requires the target documents to already have embeddings generated on the server side. Example:
revornix documents create-quick-note \
  --content "hello" \
  --section 1 \
  --section 2 \
  --label 10 \
  --label 11

Python SDK

Create a Session

from revornix import Session

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

Import Schema Models

from revornix.schema import DocumentSchema, SectionSchema

Upload a File

from revornix import Session

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

res = session.upload_file(
    local_file_path="./tests/fixtures/test.txt",
    remote_file_path="uploads/test.txt",
)

Create a Document Label

from revornix import Session
from revornix.schema import DocumentSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = DocumentSchema.LabelAddRequest(name="test")
res = session.create_document_label(data=data)

Create a Section Label

from revornix import Session
from revornix.schema import SectionSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = SectionSchema.LabelAddRequest(name="test")
res = session.create_section_label(data=data)

Create a Section

from revornix import Session
from revornix.schema import SectionSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = SectionSchema.SectionCreateRequest(
    title="test",
    description="test",
    cover="test.png",
    labels=[],
    auto_publish=False,
    auto_podcast=False,
    auto_illustration=False,
    process_task_trigger_type=1,
    process_task_trigger_scheduler=None,
)

res = session.create_section(data=data)

Get All Document Labels

from revornix import Session

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

res = session.get_mine_all_document_labels()

Get All Sections

from revornix import Session

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

res = session.get_mine_all_sections()

Create a Quick Note Document

from revornix import Session
from revornix.schema import DocumentSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = DocumentSchema.QuickNoteDocumentParameters(
    title="Quick Note",
    description="Created from SDK",
    cover=None,
    sections=[1, 2],
    labels=[10],
    content="test",
    auto_summary=False,
    auto_podcast=False,
    auto_tag=False,
)

res = session.create_quick_note_document(data=data)

Create a Website Document

from revornix import Session
from revornix.schema import DocumentSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = DocumentSchema.WebsiteDocumentParameters(
    title="Website Import",
    description="Created from URL",
    cover=None,
    sections=[1],
    labels=[10],
    url="https://www.google.com",
    auto_summary=False,
    auto_podcast=False,
    auto_tag=False,
)

res = session.create_website_document(data=data)

Create a File Document

from revornix import Session
from revornix.schema import DocumentSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = DocumentSchema.FileDocumentParameters(
    title="File Import",
    description="Created from uploaded file",
    cover=None,
    sections=[1],
    labels=[10],
    file_name="demo.pdf",
    auto_summary=False,
    auto_podcast=False,
    auto_tag=False,
)

res = session.create_file_document(data=data)

Create an Audio Document

from revornix import Session
from revornix.schema import DocumentSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = DocumentSchema.AudioDocumentParameters(
    title="Audio Import",
    description="Created from uploaded audio",
    cover=None,
    sections=[1],
    labels=[10],
    file_name="demo.mp3",
    auto_summary=False,
    auto_podcast=False,
    auto_transcribe=True,
    auto_tag=False,
)

res = session.create_audio_document(data=data)

Run Document Vector Search

from revornix import Session
from revornix.schema import DocumentSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = DocumentSchema.VectorSearchRequest(query="retrieval augmented generation")
res = session.search_document_vector(data=data)

Delete Documents

from revornix import Session
from revornix.schema import DocumentSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = DocumentSchema.DocumentDeleteRequest(document_ids=[123, 124])
res = session.delete_document(data=data)

Delete a Section

from revornix import Session
from revornix.schema import SectionSchema

session = Session(
    base_url="YOUR_API_PREFIX",
    api_key="YOUR_API_KEY",
)

data = SectionSchema.SectionDeleteRequest(section_id=12)
res = session.delete_section(data=data)

Available SDK Methods

The current Session methods are:

  • upload_file
  • create_file_document
  • create_website_document
  • create_quick_note_document
  • create_audio_document
  • get_mine_all_document_labels
  • create_document_label
  • delete_document_label
  • get_document_detail
  • update_document
  • delete_document
  • search_mine_documents
  • search_document_vector
  • create_section_label
  • get_mine_all_section_labels
  • delete_section_label
  • create_section
  • update_section
  • delete_section
  • get_section_detail
  • get_section_documents
  • get_mine_all_sections
  • search_mine_sections
  • publish_section
  • get_section_publish
  • republish_section

Development

Project layout:

  • src/revornix/session.py: core Session client for the Revornix API
  • src/revornix/cli/: Typer CLI entrypoint, command groups, and CLI workflows
  • src/revornix/schema/: Pydantic request and response models
  • src/revornix/endpoints/: API endpoint constants
  • tests/unit/: unit tests that do not hit the real network
  • tests/integration/: opt-in real API integration tests
  • tests/fixtures/: local files used by tests and CLI examples

Run tests:

pytest

Run CLI tests only:

pytest tests/unit/test_cli.py

Run all unit tests:

pytest tests/unit

Integration tests are opt-in and require both credentials and an explicit switch:

export REVORNIX_RUN_INTEGRATION_TESTS=true
pytest tests/integration

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revornix-0.1.2.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revornix-0.1.2-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file revornix-0.1.2.tar.gz.

File metadata

  • Download URL: revornix-0.1.2.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for revornix-0.1.2.tar.gz
Algorithm Hash digest
SHA256 88a12cecf00693d77e9d5742eb6d9f10ec93fc5db3c928ba49cad17f3c7e544d
MD5 707434a6d94781561013b24dfab2932d
BLAKE2b-256 a317a1f6ba241a260988de3eac0ae4d4f8be870b0b8c5f488241e3d979cad766

See more details on using hashes here.

Provenance

The following attestation bundles were made for revornix-0.1.2.tar.gz:

Publisher: pypi-publish.yml on Qingyon-AI/Revornix-Python-Lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file revornix-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: revornix-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for revornix-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53f21ec20b564988f358854b3ddd11dcf81a6c26f4444a84c2918697b3dfce53
MD5 372d0b93a310b1edd6544c3f3e36121b
BLAKE2b-256 567c97ec46046ec0c8d957b0128016175f023665c38b0c5db39ade0fa52252d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for revornix-0.1.2-py3-none-any.whl:

Publisher: pypi-publish.yml on Qingyon-AI/Revornix-Python-Lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page