Skip to main content

Official Python SDK for the Arxivis document store

Project description

arxivis-python

Official Python SDK for the Arxivis document store.

Requirements

  • Python ≥ 3.9
  • httpx (installed automatically)

Installation

pip install arxivis

Or from source:

pip install ./sdk/python

Quick start

Synchronous

from arxivis import ArxivisClient, UploadOptions

with ArxivisClient("http://localhost:8080", "axv_xxxx_yyyy") as client:
    # Upload a file
    record = client.upload(
        open("invoice.pdf", "rb").read(),
        "invoice.pdf",
        UploadOptions(path="/invoices/2024/", tags=["cliente", "enero"]),
    )
    print(f"Stored: {record.id}  ({record.size} bytes)")

    # List files
    result = client.list("/invoices/2024/", limit=20)
    for f in result.files:
        print(f.original_name)

    # Full-text search
    hits = client.search("factura enero")
    for f in hits.files:
        print(f.original_name)

    # Download
    data = client.download(record.id)
    open("copy.pdf", "wb").write(data)

    # Delete
    client.delete(record.id)

Asynchronous

import asyncio
from arxivis import AsyncArxivisClient, UploadOptions

async def main():
    async with AsyncArxivisClient("http://localhost:8080", "axv_xxxx_yyyy") as client:
        stats = await client.get_stats()
        print(f"Total files: {stats.total_files}")

        record = await client.upload(
            open("doc.pdf", "rb").read(),
            "doc.pdf",
            UploadOptions(path="/docs/"),
        )
        print(record.id)

asyncio.run(main())

Upload from disk

record = client.upload_file("/path/to/file.pdf", UploadOptions(path="/docs/"))

API reference

ArxivisClient / AsyncArxivisClient

Both classes expose identical methods; async versions are prefixed with await.

Method Description
get_stats() Aggregate storage statistics
upload(data, filename, opts) Upload raw bytes
upload_file(path, opts) Upload from disk
list(path, limit, offset) Paginated file listing
get(id) Fetch file metadata
download(id) Download raw bytes
delete(id) Soft-delete a file
download_zip(ids) Export multiple files as ZIP
create_folder(path) Create a virtual folder
search(query, limit, offset) Full-text search (FTS5)
semantic_search(query, limit) Vector similarity search
hybrid_search(query, limit) FTS5 + semantic fusion
create_key(name) Create an API key
list_keys() List all API keys
revoke_key(id) Revoke an API key
download_url(id) Direct download URL
preview_url(id) Inline preview URL
path_url(file_path) Virtual-path URL

UploadOptions

from arxivis import UploadOptions

opts = UploadOptions(
    path="/invoices/2024/",   # virtual folder (default "/")
    tags=["cliente", "ene"],  # list of tags (default [])
    compress=True,            # override server default (default None)
    encrypt=True,             # override server default (default None)
)

ArxivisError

from arxivis import ArxivisError

try:
    client.get("nonexistent-id")
except ArxivisError as e:
    print(e.status)           # HTTP status code
    print(e.is_not_found)     # True if 404
    print(e.is_unauthorized)  # True if 401
    print(e.is_rate_limited)  # True if 429

License

MIT

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

arxivis-1.0.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

arxivis-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file arxivis-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for arxivis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 61d79e3c3479336ed40361ccc1e24ad728642e924cd38a31a65cc651afcdb355
MD5 e5971bc77012a8be131efabd91359bc3
BLAKE2b-256 7af1d34f4b10c68aa5a8ca4f278484e4eeab35ee296a585e95b6630c92b80252

See more details on using hashes here.

Provenance

The following attestation bundles were made for arxivis-1.0.0.tar.gz:

Publisher: publish-sdk-python.yml on v019-Labs/Arxivis

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

File details

Details for the file arxivis-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for arxivis-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbc3233a7e60c72ade3e692db0438b1bad16995456b23116dcd57664e2d4e281
MD5 d781c11617d132d4fd3fbdff009f3c80
BLAKE2b-256 9b4706ff26640f7845cd12d91738cc7070de15e007795178822f97b407aa8189

See more details on using hashes here.

Provenance

The following attestation bundles were made for arxivis-1.0.0-py3-none-any.whl:

Publisher: publish-sdk-python.yml on v019-Labs/Arxivis

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