Skip to main content

TrustLoop Python client for interacting with TrustLoop servers

Project description

file: /trustloop-python/README.md

TrustLoop Python Client

A Python client library for interacting with TrustLoop servers. This package provides easy access to TrustLoop APIs for data loading, domain management, and more.

Prerequisites

Important: This package requires a running TrustLoop server. It's a client library that connects to your TrustLoop server instance (default: http://localhost:4000).

Installation

pip install trustloop

Quick Start

import trustloop as tl

# Ensure your TrustLoop server is running on localhost:4000
# or configure a custom server URL:
# from trustloop import TrustLoop
# tl = TrustLoop(base_url="http://your-server:port")

# List available data sources
tl.data.list()

# Load data from TrustLoop server
data = tl.data.load("domain-directory")

# List domains
domains = tl.domains.list()

# Make direct API calls
result = tl.api.get("/api/testing/ping")

# Get help
tl.help()

Usage

Data Module

# Load data from different sources
data = tl.data.load("domain-directory")
testing_data = tl.data.load("testing")
status = tl.data.load("global-status")

# List available data sources
tl.data.list()

# Check cached data
tl.data.cached()

# Reload data (bypass cache)
fresh_data = tl.data.reload("domain-directory")

Domains Module

# List all domains
domains = tl.domains.list()

# Get specific domain
domain = tl.domains.get("example", "namespace", "database")

# Check if domain exists
exists = tl.domains.check_exists("example", "namespace", "database")

API Module

# Make direct GET requests
result = tl.api.get("/api/testing/ping")

# Make direct POST requests
result = tl.api.post("/api/endpoint", {"key": "value"})

EventBus Module

# Emit events (placeholder implementation)
tl.eventbus.emit("test-event", {"key": "value"})

Configuration

By default, the client connects to http://localhost:4000. You can customize this:

from trustloop import TrustLoop

# Connect to different server
tl = TrustLoop(base_url="http://your-server:port")

Development

Local Development

# Clone and install in development mode
git clone https://github.com/trustloop/trustloop-python
cd trustloop-python
pip install -e .

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black trustloop/
isort trustloop/

Building and Publishing

# Build the package
python -m build

# Upload to PyPI
twine upload dist/*

Requirements

  • Python 3.8+
  • Access to a TrustLoop server

License

MIT License

Support

For support and questions, please visit our GitHub repository or contact us at hello@trustloop.com.

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

trustloop-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

trustloop-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file trustloop-0.1.0.tar.gz.

File metadata

  • Download URL: trustloop-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for trustloop-0.1.0.tar.gz
Algorithm Hash digest
SHA256 51b87f0a52c8e997b14ab26d8531560e15468ea7aa5357132b87033b38ebd80e
MD5 6a49e106839c583b631092282c718208
BLAKE2b-256 936394a63c7dbfa1def6f0b9eb8aae9d5878793d881156ed6250f320895a7398

See more details on using hashes here.

File details

Details for the file trustloop-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trustloop-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for trustloop-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d2aeabd7dddc5b1a0e0bed521f23f29091bb2396029205853455e59986072d5
MD5 671eade93cf8c645b8d81e1d1e566b28
BLAKE2b-256 bcd3db32212e92eb8e03d5f4393a4d442c451d44b0ed5ecedf9e74086abb7359

See more details on using hashes here.

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