Metadata-Version: 2.4
Name: minerai
Version: 1.0.2
Summary: MinerAI Python Library for DigitalOcean Spaces Integration
Home-page: https://github.com/minerai/minerai
Author: MinerAI Team
Author-email: MinerAI Team <support@minerai.com>
License: MIT
Project-URL: Homepage, https://github.com/minerai/minerai
Project-URL: Documentation, https://docs.minerai.com
Project-URL: Repository, https://github.com/minerai/minerai.git
Project-URL: Issues, https://github.com/minerai/minerai/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Requires-Dist: Pillow>=9.0.0
Requires-Dist: python-dotenv>=0.19.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: flake8>=5.0.0; extra == "dev"
Requires-Dist: mypy>=0.990; extra == "dev"
Requires-Dist: build>=0.10.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# MinerAI Client Library

[![PyPI version](https://badge.fury.io/py/minerai.svg)](https://badge.fury.io/py/minerai)
[![Python Version](https://img.shields.io/pypi/pyversions/minerai.svg)](https://pypi.org/project/minerai/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/minerai)](https://pepy.tech/project/minerai)

Python client library for MinerAI platform - Seamless integration with DigitalOcean Spaces for mine detection AI workflows.

## Features

- 🔐 **Secure Authentication** - API key-based authentication with HMAC signatures
- 📦 **DigitalOcean Spaces Integration** - Upload/download images directly to/from Spaces
- 🎯 **User Isolation** - Each user gets their own folder structure
- 🚀 **Pre-signed URLs** - Temporary, scoped access to Spaces
- 🔄 **Backward Compatible** - Works with existing minerai import patterns
- 🧪 **Type Hints** - Full type annotations for better IDE support

## Installation

```bash
pip install minerai


git clone https://github.com/minerai/minerai.git
cd minerai
pip install -e ".[dev]"


#Quick Start

from minerai import get_client

# Initialize with your API credentials
client = get_client(
    api_key="your_api_key",
    api_secret="your_api_secret",
    base_url="https://api.minerai.com"  # optional
)

# Get user info
user_info = client.get_user_info()
print(f"Connected as: {user_info['email']}")

# Set up folders
input_folder = client.find_or_create_user_folder(user_info['user_id'], "input")
output_folder = client.find_or_create_user_folder(user_info['user_id'], "output")

# Download images
import tempfile
with tempfile.TemporaryDirectory() as temp_dir:
    images = client.download_user_images(input_folder, temp_dir)
    print(f"Downloaded {len(images)} images")

# Upload a mask
from PIL import Image
import numpy as np

# Create a sample mask
mask = Image.fromarray(np.zeros((512, 512), dtype=np.uint8))
client.upload_mask(mask, "sample_mask.png", output_folder)

# List all job folders
jobs = client.get_job_folders()
print(f"Job folders: {jobs}")


#.env

MINERAI_API_KEY=your_api_key_here
MINERAI_API_SECRET=your_api_secret_here
MINERAI_API_URL=https://api.minerai.com  # optional




## 3. License File

### `LICENSE`
```text
MIT License

Copyright (c) 2024 MinerAI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
