Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

LogVault Python SDK

PyPI version Python versions License: MIT

Official Python client for LogVault — Audit-Log-as-a-Service for B2B SaaS. SOC 2, GDPR, and ISO 27001 compliant. Hosted in the EU.

Installation

pip install logvault

Quick Start

from logvault import Client

client = Client("your-api-key")

# Log an audit event
event = client.log(
    action="user.login",
    user_id="user_123",
    resource="auth",
    metadata={"ip": "192.168.1.1", "method": "password"}
)

print(f"Logged: {event['id']}")

Features

  • Sync & Async — Both Client and AsyncClient available
  • Automatic Retries — Exponential backoff with jitter
  • Input Validation — Action format and payload size checks
  • Error Handling — Typed exceptions for auth, rate limits, validation
  • Replay Protection — Optional nonce support

Usage

Async Client

import asyncio
from logvault import AsyncClient

async def main():
    async with AsyncClient("your-api-key") as client:
        event = await client.log(
            action="document.create",
            user_id="user_456",
            resource="document:789",
            metadata={"title": "Q4 Report"}
        )

asyncio.run(main())

List Events

# Get recent events
response = client.list_events(page=1, page_size=50)

for event in response['events']:
    print(f"{event['timestamp']} - {event['action']}")

# Filter by user or action
user_events = client.list_events(user_id="user_123")
login_events = client.list_events(action="user.login")

Error Handling

from logvault import Client, AuthenticationError, RateLimitError, APIError

client = Client("your-api-key")

try:
    event = client.log(action="user.login", user_id="user_123")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
except APIError as e:
    print(f"API error: {e.status_code}")

Configuration Options

client = Client(
    api_key="your-api-key",
    base_url="https://api.logvault.eu",  # Default
    timeout=30,                           # Request timeout (seconds)
    enable_nonce=True,                    # Replay protection
    max_retries=3                         # Retry attempts
)

Action Format

Actions follow the pattern entity.verb:

Category Examples
Auth user.login, user.logout, user.password_reset
Documents document.create, document.read, document.delete
Permissions permission.grant, permission.revoke, role.assign
Data data.export, data.delete

Requirements

  • Python 3.8+
  • requests (sync client)
  • aiohttp (async client)

License

MIT — see LICENSE for details.

Metadata

Release files for logvault 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for logvault 0.2.5
File Size Uploaded Provenance Actions
logvault-0.2.5.tar.gz 10.8 kB With provenance Details for logvault-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for logvault 0.2.5
File Interpreter ABI Platform Actions
logvault-0.2.5-py3-none-any.whl Python 3 none any Details for logvault-0.2.5-py3-none-any.whl

Total release size: 21.5 kB

Release files / logvault-0.2.5.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL logvault-0.2.5.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0ea02d8359da6650aba9e38d5c3675c6f4fdfa7764d816589173bf0f240a47d5
BLAKE2b-256 checksum
How to use checksums
a1d3d0a05c526c3fd6445965bafd72e65bfa60f45ff7bedc083b0869f331dcd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2025.

Transparency log

Release files / logvault-0.2.5-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL logvault-0.2.5-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adadf967d2529ef9e59b1d8eca964c4f97c0ce01af27e551b20e2a2d1b60db97
BLAKE2b-256 checksum
How to use checksums
cf6e8319c3bd7e603c699eb787004a1f7a3f5677b652e064d1c33b674468035d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2025.

Transparency log

Security for logvault 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Change of provenance

The repository and configuration that created this release differ from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for logvault-0.2.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page