Skip to content

50gramx/eapp-python-domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EAPP Python Domain 🐍

System Contracts Build Latest Release License Package Index

Python client library for EAPP (Ethos Apps Platform) - Auto-generated protobuf client code for seamless integration with EAPP services.

πŸ“¦ Package Index & Downloads

πŸš€ Quick Access

πŸ“¦ Available Packages

πŸ“‹ View all available packages and versions in our Package Index (HTML Preview)

πŸ”§ Installation

# Install from our package index
pip install --index-url https://raw.githubusercontent.com/50gramx/eapp-python-domain/master/packages/index.html eapp-python-domain

# Or install specific version
pip install --index-url https://raw.githubusercontent.com/50gramx/eapp-python-domain/master/packages/index.html eapp-python-domain==0.1.0.1752936352

πŸ“‹ Table of Contents

🌟 Overview

EAPP Python Domain provides auto-generated Python client code for all EAPP system contracts. This package is automatically generated from Protocol Buffer definitions and provides type-safe, efficient access to EAPP services.

🎯 Key Features

  • πŸ”„ Auto-Generated - Built from protobuf definitions in eapp-system-contracts
  • πŸ“¦ Type-Safe - Full type hints and IDE support
  • ⚑ High Performance - Optimized protobuf serialization
  • πŸ”’ Production Ready - Used in production EAPP services
  • πŸ“š Comprehensive - Covers all EAPP service contracts

πŸ—οΈ Service Coverage

Service Category Description Available
πŸ” Identity User authentication & authorization βœ…
πŸ’¬ Communication Messaging & notifications βœ…
🧠 Cognitive AI & knowledge management βœ…
πŸ›οΈ Commerce Transactions & payments βœ…
🌌 Multiverse Space & universe management βœ…

πŸš€ Quick Start

1. Installation

# Install from our private package index
pip install --index-url https://raw.githubusercontent.com/50gramx/eapp-python-domain/master/packages/index.html eapp-python-domain

# Or install from PyPI (if published)
pip install eapp-python-domain

2. Basic Usage

from eapp_python_domain.ethos import user_pb2, account_pb2

# Create a user
user = user_pb2.User()
user.id = "user123"
user.name = "John Doe"
user.email = "john@example.com"

# Create an account
account = account_pb2.Account()
account.id = "acc123"
account.user_id = user.id
account.status = account_pb2.AccountStatus.ACTIVE

print(f"User: {user.name} ({user.email})")
print(f"Account: {account.id} - Status: {account.status}")

3. Service Integration

import grpc
from eapp_python_domain.ethos import account_service_pb2, account_service_pb2_grpc

# Connect to EAPP service
channel = grpc.insecure_channel('localhost:50051')
stub = account_service_pb2_grpc.AccountServiceStub(channel)

# Create account request
request = account_service_pb2.CreateAccountRequest()
request.user_id = "user123"
request.account_type = account_service_pb2.AccountType.PERSONAL

# Call service
response = stub.CreateAccount(request)
print(f"Created account: {response.account.id}")

πŸ“¦ Installation

Requirements

  • Python: 3.7+
  • Dependencies:
    • protobuf>=3.21.0
    • grpcio>=1.50.0

Installation Methods

1. Private Package Index (Recommended)

pip install --index-url https://raw.githubusercontent.com/50gramx/eapp-python-domain/master/packages/index.html eapp-python-domain

2. From Source

git clone https://github.com/50gramx/eapp-python-domain.git
cd eapp-python-domain
pip install -e .

3. Development Installation

git clone https://github.com/50gramx/eapp-python-domain.git
cd eapp-python-domain
pip install -e ".[dev]"

πŸ”§ Usage

Importing Modules

# Core entities
from eapp_python_domain.ethos import user_pb2
from eapp_python_domain.ethos import account_pb2
from eapp_python_domain.ethos import space_pb2

# Service stubs
from eapp_python_domain.ethos import account_service_pb2_grpc
from eapp_python_domain.ethos import user_service_pb2_grpc
from eapp_python_domain.ethos import space_service_pb2_grpc

Working with Messages

from eapp_python_domain.ethos import user_pb2

# Create messages
user = user_pb2.User(
    id="user123",
    name="John Doe",
    email="john@example.com",
    status=user_pb2.UserStatus.ACTIVE
)

# Serialize to bytes
user_bytes = user.SerializeToString()

# Deserialize from bytes
user_from_bytes = user_pb2.User()
user_from_bytes.ParseFromString(user_bytes)

# Convert to/from JSON
user_json = user.to_json()
user_from_json = user_pb2.User.from_json(user_json)

gRPC Service Calls

import grpc
from eapp_python_domain.ethos import account_service_pb2, account_service_pb2_grpc

async def get_user_accounts(user_id: str):
    async with grpc.aio.insecure_channel('localhost:50051') as channel:
        stub = account_service_pb2_grpc.AccountServiceStub(channel)
        
        request = account_service_pb2.GetUserAccountsRequest(user_id=user_id)
        response = await stub.GetUserAccounts(request)
        
        return response.accounts

πŸ“š API Reference

Core Entities

User

from eapp_python_domain.ethos import user_pb2

user = user_pb2.User(
    id="string",           # Unique user identifier
    name="string",         # Display name
    email="string",        # Email address
    status=user_pb2.UserStatus.ACTIVE,  # User status
    created_at="timestamp", # Creation timestamp
    updated_at="timestamp"  # Last update timestamp
)

Account

from eapp_python_domain.ethos import account_pb2

account = account_pb2.Account(
    id="string",           # Unique account identifier
    user_id="string",      # Associated user ID
    type=account_pb2.AccountType.PERSONAL,  # Account type
    status=account_pb2.AccountStatus.ACTIVE, # Account status
    created_at="timestamp" # Creation timestamp
)

Space

from eapp_python_domain.ethos import space_pb2

space = space_pb2.Space(
    id="string",           # Unique space identifier
    name="string",         # Space name
    description="string",  # Space description
    owner_id="string",     # Owner user ID
    type=space_pb2.SpaceType.PUBLIC,  # Space type
    created_at="timestamp" # Creation timestamp
)

Service Stubs

AccountService

from eapp_python_domain.ethos import account_service_pb2_grpc

# Available methods:
# - CreateAccount(request)
# - GetAccount(request)
# - UpdateAccount(request)
# - DeleteAccount(request)
# - GetUserAccounts(request)

UserService

from eapp_python_domain.ethos import user_service_pb2_grpc

# Available methods:
# - CreateUser(request)
# - GetUser(request)
# - UpdateUser(request)
# - DeleteUser(request)
# - ListUsers(request)

πŸ”„ Auto-Generation

This package is automatically generated from protobuf definitions in the eapp-system-contracts repository.

Generation Process

  1. Protobuf Changes - Updates to .proto files in system-contracts
  2. CI/CD Trigger - GitHub Actions workflow automatically triggers
  3. Code Generation - protoc generates Python code from .proto files
  4. Package Building - Creates Python wheel and source distribution
  5. Release Creation - Creates GitHub release with new version
  6. Index Update - Updates package index with new release

Versioning

  • Auto-generated versions - Based on timestamp: 0.1.0.{timestamp}
  • Release frequency - On every protobuf change
  • Backward compatibility - Maintained within major versions

🀝 Contributing

For Python-Specific Changes

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

For Protobuf Changes

  1. Update protobuf definitions in eapp-system-contracts
  2. Push to trigger auto-generation
  3. Review generated Python code
  4. Test with your changes

Development Setup

# Clone repository
git clone https://github.com/50gramx/eapp-python-domain.git
cd eapp-python-domain

# Install in development mode
pip install -e ".[dev]"

# Run tests
python -m pytest tests/

# Run linting
flake8 src/
black src/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ”— Quick Links


Auto-generated Python client for EAPP System Contracts

Built with ❀️ by the EAPP Team

About

🐍 Auto-generated Python client library for EAPP system contracts. Type-safe protobuf client with gRPC support for seamless Python integration.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages