Skip to main content

Abstract Frame Hub Client

AbstractFrameHubClient is a Python client for interacting with AbstractFrameHub, a secure, schema-aware, and cloud-ready data layer inspired by MongoDB. It supports document validation, user and permission management, and future AI-enhanced data features.


📦 Installation

Install via PyPI:

pip install abstract-framehub-client

Or install from source:

git clone https://gitlab.com/stackngo-client/abstractframehub-client-python.git
cd abstractframehub-client-python
pip install .

Abstract Frame Hub Server :

git clone https://gitlab.com/stackngo-client/abstractframehub-helm.git
cd docker-compose
docker-compose up -d

🚀 Quick Start

from abstract-framehub-client import AbstractFrameHubClient

# Connect and authenticate
client = AbstractFrameHubClient()
client.login("root", "afh-password")

# Select a database and collection
db = client.database("mydb")
try:
    db.create()
except AlreadyExistsException as e:
    pass
collection = db.collection("mycollection")

# Insert a document
collection.insert_one({"title": "Hello, FrameHub!", "likes": 0})

# Query documents
results = collection.find({"likes": {"$gte": 0}})
print(results)

🔐 Authentication

client.login("root", "afh-password")

Stores a session token used automatically in future requests.


🗃️ Database & Collection API

db = client.database("blog")
db.create()
db.drop()

collection = db.collection("posts")
collection.insert_one({...})
collection.find_one({"key": "value"})
collection.delete_many({})

📐 Schema Support

Define and enforce JSON schemas per collection:

collection.schema({
    "bsonType": "object",
    "required": ["title", "content"],
    "properties": {
        "title": {"bsonType": "string"},
        "content": {"bsonType": "string"}
    },
    "additionalProperties": False
})

👤 User Management

client.add_user({
    "username": "admin",
    "password": "securepass",
    "permissions": {"blog": "*"}
})
client.drop_user("admin")

❗ Error Handling

All errors raise custom exceptions:

  • NotAuthenticatedException
  • ValidationException
  • AlreadyExistsException
  • AfhException (generic)

🧪 Testing Example

def test_insert_and_find():
    client = AbstractFrameHubClient()
    client.login("admin", "123456")
    db = client.database("testdb")
    coll = db.collection("items")
    doc_id = coll.insert_one({"name": "test item"})
    result = coll.find_one({"_id": doc_id})
    assert result["name"] == "test item"

📁 Project Structure

├── abstract_framehub_client
│   ├── __init__.py
│   ├── client.py
│   ├── exceptions.py
│   └── wrappers
│       ├── __init__.py
│       ├── collection.py
│       └── database.py

📝 License

This project is licensed under the MIT License.

Metadata

Release files for abstract-framehub-client 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abstract-framehub-client 0.1.6
File Size Uploaded Provenance
abstract_framehub_client-0.1.6.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for abstract-framehub-client 0.1.6
File Interpreter ABI Platform
abstract_framehub_client-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 20.8 kB

Release files / abstract_framehub_client-0.1.6.tar.gz

Download URL abstract_framehub_client-0.1.6.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5f002575acb6cd62049ed16798fa7e2cdaf40d56650eeef70f7e6cdf84b6788f
BLAKE2b-256 checksum
How to use checksums
b8bfb22eca4c1dafeeedf2e81392af65ce7a371c56b5cb58e82268c03ecc8756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / abstract_framehub_client-0.1.6-py3-none-any.whl

Download URL abstract_framehub_client-0.1.6-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8ffdcbe67be7e102619e3aa8cc2d585d910a9b516d09629a9afbe56216272c0
BLAKE2b-256 checksum
How to use checksums
de80e2a7887be6ea4b0bfd607615ae2b59bef60a352a5c31b81701f6e7d6d364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for abstract-framehub-client 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page