Skip to main content

A modular, interface-driven web framework inspired by Symfony, built on top of FastAPI.

Project description

Apeex Framework

A modular, interface-driven Python web framework inspired by Symfony, built on top of FastAPI.


🧩 Project Structure

apeex/         # Core framework (Kernel, Container, HTTP, ORM, CLI, Events)
adapters/      # Integrations and adapters for external libraries
bundles/       # Feature modules (bundles)
scripts/       # CLI and dev utilities
config/        # Configuration files and service definitions
tests/         # Unit and integration tests

🧰 Development

Install dependencies (assuming poetry is used):

poetry install

Run code quality checks:

poetry run black .
poetry run isort .
poetry run flake8 .
poetry run mypy .
poetry run pytest -v

All comments in code should be in English.


⚙️ DI Container

The framework provides a Dependency Injection container for managing services.

Register services:

from apeex.container.container import Container

container = Container()
container.set('Logger', Logger())
container.set_factory('UserService', lambda c: UserService(c.get('Logger')))

Autowire classes:

user_service = container.autowire(UserService)  # dependencies resolved automatically

Singleton scope:

a1 = container.autowire(UserService)
a2 = container.autowire(UserService)
assert a1 is a2

Build bundles:

from bundles.sample_bundle.bundle import SampleBundle
bundle = SampleBundle()
container.build_bundle(bundle)

🏗️ Kernel & Bundles (Planned)

  • Kernel will manage application lifecycle, bundles, container, and routing.
  • Bundle is an abstract class that allows registration of services and lifecycle hooks (build, boot, shutdown).
  • Bundles can define controllers and services with full container integration.
  • Example bundles: DemoBundle, SampleBundle.

📄 Contributing

See CONTRIBUTING.md for guidelines on:

  • Branching strategy
  • Commit messages (use Conventional Commits)
  • Code formatting and linting
  • Testing

🚦 CI/CD

The project includes a GitHub Actions pipeline to automatically:

  • Install dependencies
  • Run black, isort, flake8, mypy checks
  • Run pytest
name: CI

on:
  push:
    branches: [ main, develop ]
  pull_request:
    branches: [ main, develop ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - run: |
          pip install poetry
          poetry install
      - run: |
          poetry run black --check .
          poetry run isort --check-only .
          poetry run flake8 .
          poetry run mypy .
      - run: poetry run pytest -v

📖 Examples

Defining a simple service and controller:

class HelloService:
    def greet(self, name: str) -> str:
        return f'Hello, {name}!'

class HelloController:
    def __init__(self, service: HelloService):
        self.service = service

    def hello(self, name: str) -> str:
        return self.service.greet(name)

container.set_factory('HelloService', lambda c: HelloService())
container.set_factory('HelloController', lambda c: HelloController(c.get('HelloService')))

controller = container.get('HelloController')
print(controller.hello('World'))

Autowiring example:

controller2 = container.autowire(HelloController)
assert controller2 is container.get('HelloController')  # singleton behavior

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

apeex-0.1.0a1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

apeex-0.1.0a1-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file apeex-0.1.0a1.tar.gz.

File metadata

  • Download URL: apeex-0.1.0a1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.7 Linux/6.11.0-21-generic

File hashes

Hashes for apeex-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 c85647009c07077b30f53a7e7c5dc100c6e277cebbd76b4edf316ada25a04321
MD5 726eb7aef4ac77ce661a581c755c62f7
BLAKE2b-256 8beb12c6b1f3e06eed29644bc31a9e32578587c5f38425ade2e59388bb339397

See more details on using hashes here.

File details

Details for the file apeex-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: apeex-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.7 Linux/6.11.0-21-generic

File hashes

Hashes for apeex-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 7bfe89e062fb11795c110c730ac6bc94a8a6f0e001bdf0b1dad1028b48e81770
MD5 5b82526312da6ee057ae78c711270d7a
BLAKE2b-256 53a3176fd0b7020b3ec72f3bc2a2045c33fd79ac3f96a4df4487dc9f1e87d421

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