Skip to main content

Simple, powerful, and scalable cloud storage for Python applications

Project description

WoosCloud Storage - Python Client

Simple, powerful, and scalable cloud storage for Python applications.

🚀 Features

  • Simple API - Store and retrieve data with just a few lines of code
  • Type Safe - Full type hints support
  • Fast - Optimized for performance
  • Secure - API key authentication
  • Free Tier - 500MB storage + 10,000 API calls/month

📦 Installation

pip install wooscloud

🔑 Get Your API Key

  1. Sign up at woos-ai.com
  2. Create an API key from your dashboard
  3. Copy your API key (starts with wai_)

🎯 Quick Start

from wooscloud import WoosStorage

# Initialize with your API key
storage = WoosStorage(api_key="wai_your_api_key_here")

# Save data
data_id = storage.save("users", {
    "name": "John Doe",
    "email": "john@example.com",
    "age": 30
})
print(f"Saved with ID: {data_id}")

# Find data
users = storage.find("users")
for user in users:
    print(user.data)

# Find by ID
user = storage.find_one(data_id)
print(user.data)

# Update data
storage.update(data_id, {
    "name": "John Doe",
    "email": "john@example.com",
    "age": 31  # Updated age
})

# Delete data
storage.delete(data_id)

# Get statistics
stats = storage.stats()
print(f"Storage used: {stats.storage_used_mb} MB")
print(f"API calls: {stats.api_calls_count}")

📚 Examples

E-commerce Product Management

from wooscloud import WoosStorage

storage = WoosStorage(api_key="wai_your_api_key")

# Add products
laptop_id = storage.save("products", {
    "name": "MacBook Pro M3",
    "price": 2500000,
    "category": "laptop",
    "stock": 15
})

phone_id = storage.save("products", {
    "name": "iPhone 15 Pro",
    "price": 1550000,
    "category": "smartphone",
    "stock": 30
})

# Get all products
products = storage.find("products")
print(f"Total products: {len(products)}")

# Get product count
count = storage.count("products")
print(f"Product count: {count}")

User Profile Management

from wooscloud import WoosStorage

storage = WoosStorage(api_key="wai_your_api_key")

# Create user profile
user_id = storage.save("users", {
    "username": "john_doe",
    "email": "john@example.com",
    "profile": {
        "age": 30,
        "city": "Seoul",
        "interests": ["technology", "reading", "travel"]
    }
})

# Update profile
storage.update(user_id, {
    "username": "john_doe",
    "email": "john@example.com",
    "profile": {
        "age": 31,  # Birthday!
        "city": "Seoul",
        "interests": ["technology", "reading", "travel", "photography"]
    }
})

Blog System

from wooscloud import WoosStorage
from datetime import datetime

storage = WoosStorage(api_key="wai_your_api_key")

# Create blog post
post_id = storage.save("posts", {
    "title": "Getting Started with WoosCloud",
    "content": "WoosCloud is a simple cloud storage...",
    "author": "John Doe",
    "tags": ["cloud", "storage", "tutorial"],
    "published_at": datetime.now().isoformat()
})

# Get all posts
posts = storage.find("posts", limit=10)
for post in posts:
    print(f"Title: {post.data['title']}")
    print(f"Author: {post.data['author']}")

🔧 API Reference

WoosStorage

Main class for interacting with WoosCloud Storage.

__init__(api_key: str, base_url: str = "https://wooscloud.up.railway.app")

Initialize WoosStorage client.

Parameters:

  • api_key (str): Your WoosCloud API key
  • base_url (str, optional): API base URL

save(collection: str, data: Dict[str, Any]) -> str

Save data to a collection.

Parameters:

  • collection (str): Collection name
  • data (dict): Data to save

Returns:

  • str: Data ID

find(collection: str, limit: int = 100, skip: int = 0) -> List[StorageData]

Find data in a collection.

Parameters:

  • collection (str): Collection name
  • limit (int): Maximum results (1-1000)
  • skip (int): Number to skip (pagination)

Returns:

  • List[StorageData]: List of data objects

find_one(data_id: str) -> StorageData

Find data by ID.

Parameters:

  • data_id (str): Data ID

Returns:

  • StorageData: Data object

update(data_id: str, data: Dict[str, Any]) -> bool

Update data by ID.

Parameters:

  • data_id (str): Data ID
  • data (dict): New data

Returns:

  • bool: True if successful

delete(data_id: str) -> bool

Delete data by ID.

Parameters:

  • data_id (str): Data ID

Returns:

  • bool: True if successful

stats() -> StorageStats

Get storage usage statistics.

Returns:

  • StorageStats: Statistics object

collections() -> List[Collection]

List all collections.

Returns:

  • List[Collection]: List of collections

count(collection: str) -> int

Count items in a collection.

Parameters:

  • collection (str): Collection name

Returns:

  • int: Number of items

🛡️ Error Handling

from wooscloud import WoosStorage
from wooscloud import (
    AuthenticationError,
    QuotaExceededError,
    NotFoundError,
    ValidationError
)

storage = WoosStorage(api_key="wai_your_api_key")

try:
    data = storage.find_one("invalid_id")
except NotFoundError:
    print("Data not found")
except AuthenticationError:
    print("Invalid API key")
except QuotaExceededError:
    print("Storage quota exceeded")
except ValidationError as e:
    print(f"Validation error: {e.message}")

📊 Pricing

FREE Plan

  • Storage: 500 MB
  • API Calls: 10,000/month
  • Price: $0

STARTER Plan

  • Storage: 5 GB
  • API Calls: Unlimited
  • Price: $9/month

PRO Plan

  • Storage: 50 GB
  • API Calls: Unlimited
  • Price: $29/month

🔗 Links

📝 License

MIT License - see LICENSE file for details

🤝 Support

🌟 Contributing

Contributions are welcome! Please read our contributing guidelines.


Made with ❤️ by WoosCloud Team

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

wooscloud-1.2.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

wooscloud-1.2.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file wooscloud-1.2.0.tar.gz.

File metadata

  • Download URL: wooscloud-1.2.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for wooscloud-1.2.0.tar.gz
Algorithm Hash digest
SHA256 ecc0a7a391987c60cbaec3729a2e60a3ec5d1bac2143e1b5e3f03f00b3215478
MD5 8eac9f836dc6bb143db86b7562b90e1c
BLAKE2b-256 c082e1bf77a3ffa5ba96bef1ac14df07c8965a3ebda366f275d8d46323a3a9f5

See more details on using hashes here.

File details

Details for the file wooscloud-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: wooscloud-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for wooscloud-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a50c1087ad7592ddcbde082ec45f374ef58b8181441f9bc38699ceb11661af56
MD5 dbe1b6d727bc7809ed69cfece706f579
BLAKE2b-256 3b87228b8c2a60c5090d1872876e2749148b58e9bc8c2d53c50ddfff5e263216

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