> ## Documentation Index
> Fetch the complete documentation index at: https://docs.labtrace.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Introduction

> Official SDKs for integrating with Labtrace

# Software Development Kits (SDKs)

LabTrace provides official SDKs that simplify blockchain-powered file management integration into your applications. Our SDKs abstract away complex API interactions, handle authentication automatically, and provide native blockchain verification capabilities.

## Available SDKs

<CardGroup cols={2}>
  <Card title="Python SDK" icon="python" href="/sdk/python">
    Perfect for data science, research workflows, and backend services
  </Card>
</CardGroup>

*Additional SDKs for JavaScript, Go, and other languages are planned for future releases.*

## Why Use LabTrace SDKs?

### 🔐 **Simplified Authentication**

Automatic JWT token management, refresh handling, and secure credential storage without manual token management.

### 🔗 **Native Blockchain Integration**

Built-in Algorand blockchain recording and verification with zero blockchain knowledge required.

### 📁 **Comprehensive File Management**

Upload, download, organize, and verify files with automatic metadata handling and integrity checking.

### 🏗️ **Production Ready**

Error handling, retry logic, and robust networking designed for production workflows and enterprise applications.

## Core Capabilities

### File Operations

* **Public & Private Files**: Support for both public research data and sensitive private documents
* **File Types**: Primary data files and secondary analysis files with linking capabilities
* **Automatic Verification**: Content-based deduplication and integrity checking
* **Certificate Generation**: Blockchain-verified certificates for authenticity proof

### Project Management

* **Multi-user Projects**: Collaborative workspaces with role-based access control
* **User Invitations**: Programmatic team management and permission assignment
* **Activity Tracking**: Complete audit trails of all project operations

### Blockchain Features

* **Real-time Verification**: Instant blockchain transaction status and confirmation
* **Tamper Evidence**: Cryptographic proof of file integrity and timestamp validation
* **Certificate Export**: Generate portable verification documents

## Integration Patterns

### Research & Data Science

Perfect for laboratories, universities, and research institutions requiring verifiable data provenance and collaborative file management.

```python theme={null}
# Simple research workflow
files = client.get_public_project_files("research_project_id")
client.upload_public_file(project_id, data, "primary", "experiment_results.csv")
certificate = client.get_public_file_certificate(project_id, file_id)
```

### Enterprise Document Management

Ideal for organizations requiring audit trails, compliance documentation, and secure file sharing with blockchain verification.

### Automated Workflows

Integrate with CI/CD pipelines, data processing workflows, and automated compliance systems.

## Architecture Overview

```mermaid theme={null}
graph TB
    A[Your Application] --> B[Labtrace SDK]
    B --> C[Authentication Layer]
    B --> D[File Management]
    
    C --> F[LabTrace API Gateway]
    D --> F
    E --> G[Algorand Network]
    
    F --> H[Backend Services]
    H --> E[Blockchain Interface]
    H --> I[Secure Storage]
    H --> J[Database]
    
    style B fill:#e8f5e8
    style F fill:#e1f5fe
    style G fill:#fff3e0
```

## Quick Start Guide

### 1. **Installation**

Install the SDK for your preferred language:

<CodeGroup>
  ```bash Python theme={null}
  # For local development (current)
  cd sdk-py
  pip install -e .
  ```
</CodeGroup>

### 2. **Authentication**

Initialize with your LabTrace credentials:

<CodeGroup>
  ```python Python theme={null}
  from labtrace.client import Client

  client = Client(username="your-email@example.com", password="your-password")
  ```
</CodeGroup>

### 3. **Start Building**

Begin with basic file operations:

<CodeGroup>
  ```python Python theme={null}
  # Upload a file with blockchain verification
  result = client.upload_public_file(
      project_id="your_project_id",
      content=file_content,
      file_type="primary",
      name="document.pdf",
      label="research,data"
  )

  # File is now recorded on blockchain
  print(f"Blockchain transaction: {result['blockchain_tx']}")
  ```
</CodeGroup>

## Security & Compliance

* **End-to-end Encryption**: All file transfers use HTTPS with certificate pinning
* **Blockchain Immutability**: Files recorded on Algorand provide tamper-evident storage
* **Access Control**: Granular permissions with project-based user management
* **Audit Trails**: Complete logging of all operations for compliance requirements

## Error Handling & Reliability

All SDKs provide consistent error handling with:

* **Automatic Retries**: Built-in retry logic for transient network failures
* **Descriptive Errors**: Clear error messages with resolution guidance
* **Status Codes**: Standard HTTP status codes for programmatic handling
* **Graceful Degradation**: Fallback behaviors for service interruptions

## Next Steps

<CardGroup cols={1}>
  <Card title="Python SDK Documentation" icon="python" href="/sdk/python">
    Complete Python SDK reference with detailed examples, API documentation, and advanced usage patterns
  </Card>
</CardGroup>

**Ready to integrate?** The Python SDK documentation includes:

* Complete API reference with all available methods
* Step-by-step examples for common workflows
* Advanced features like bulk operations and custom configurations
* Best practices for production deployments
* Troubleshooting guides and error handling patterns

<CardGroup cols={2}>
  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Direct REST API documentation for custom integrations
  </Card>

  <Card title="How It Works" icon="lightbulb" href="/how-it-works">
    Learn about LabTrace's blockchain architecture
  </Card>
</CardGroup>
