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"

Ask document AI and manage reading state:

revornix documents ask --document-id 123 --question "Summarize the key decisions"
revornix documents read --document-id 123 --status true
revornix documents star --document-id 123 --status true

Work with notes, task generation, and graphs:

revornix documents create-note --document-id 123 --content "Follow up next week"
revornix documents generate-graph --document-id 123
revornix documents generate-podcast --document-id 123
revornix graphs document --document-id 123
revornix graphs section --section-id 12

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
  • ask_document
  • create_document_ai_summary
  • create_document_embedding
  • transcribe_audio_document
  • generate_document_graph
  • generate_document_podcast
  • get_document_month_summary
  • create_document_note
  • search_document_notes
  • delete_document_notes
  • update_document
  • transform_document_markdown
  • delete_document
  • search_mine_documents
  • search_unread_documents
  • search_recent_documents
  • search_star_documents
  • search_document_vector
  • set_document_read_status
  • set_document_star_status
  • create_section_label
  • get_mine_all_section_labels
  • delete_section_label
  • create_section
  • update_section
  • delete_section
  • get_section_detail
  • get_section_documents
  • ask_section
  • get_mine_all_sections
  • search_mine_sections
  • search_subscribed_sections
  • search_public_sections
  • search_user_sections
  • generate_section_podcast
  • generate_section_ppt
  • trigger_section_process
  • retry_section_document
  • publish_section
  • get_section_publish
  • republish_section
  • search_graph
  • search_document_graph
  • search_section_graph

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.2.0.tar.gz (20.9 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.2.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for revornix-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f83ba57f91fd09bffcea361761f438ab0f957957371be84225fdbd7c4e369efc
MD5 207cd4787948323f356ff5d99e3993ea
BLAKE2b-256 5160f5001971238d8129ec45a214743b9ed2d98bb2d6689da3b4179006318ab2

See more details on using hashes here.

Provenance

The following attestation bundles were made for revornix-0.2.0.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.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for revornix-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ecb65d3300532297a01d75f782b89a97d54b384a7b6020703977cca7fd0b51af
MD5 b7491f3c1f88d96de736458da59ecc69
BLAKE2b-256 25bac119f3add51977ce161b1a4689efef2bbb21857441723d483207ef975e8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for revornix-0.2.0-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