Metadata-Version: 2.4
Name: freelybase
Version: 1.0.1
Summary: FreelyBase Python SDK
Author-email: Zhengshaomin <daboluo719@gmail.com>
License: MIT License
        
        Copyright (c) 2026 FreelyBase
        
        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.
        
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28
Provides-Extra: async
Requires-Dist: httpx>=0.24; extra == "async"
Provides-Extra: realtime
Requires-Dist: websocket-client>=1.6; extra == "realtime"
Provides-Extra: crypto
Requires-Dist: cryptography>=41.0; extra == "crypto"
Provides-Extra: all
Requires-Dist: httpx>=0.24; extra == "all"
Requires-Dist: websocket-client>=1.6; extra == "all"
Requires-Dist: cryptography>=41.0; extra == "all"
Dynamic: license-file

# FreelyBase Python SDK

Python SDK for [FreelyBase](http://www.freelybase.com), aligned with the Kotlin SDK.

## Installation

```bash
pip install freelybase
# with optional extras
pip install "freelybase[realtime]"   # FBLiveQuery (WebSocket)
pip install "freelybase[async]"      # AsyncFreelyBase (httpx)
pip install "freelybase[crypto]"     # EncryptedFreelyBase
pip install "freelybase[all]"        # everything
```

## Quick Start

```python
from freelybase import FreelyBase, FBObject, FBQuery, FBUser, FBFile, FBGeoPoint

# Initialize
FreelyBase.initialize(app_key="your_app_id", base_url="https://your-domain.com")

# Define a model
class Post(FBObject):
    table_name = "Post"
    title: str = ""
    view_count: int = 0
    active: bool = True

# Create
post = Post(title="Hello", active=True)
post.save()

# Query
results = FBQuery(Post).equal_to("active", True).order("-created_at").limit(20).find()

# User login
user = FBUser.login("user@example.com", "password123")

# File upload
fb_file = FBFile.upload("photo.jpg")
print(fb_file.url)
```

## Features

| Class | Description |
|---|---|
| `FreelyBase` | Global client & HTTP |
| `FBObject` | Data model base class |
| `FBQuery` | Query builder with geo, time, cache |
| `FBUser` | Auth: register, login, third-party |
| `FBFile` | File upload & URL resolution |
| `FBGeoPoint` | Geo coordinates & distance |
| `FBLiveQuery` | Real-time WebSocket listener |
