Skip to main content

Port from .NET to Python of the Neuroglia Framework

Project description

Neuroglia Python Framework

The framework is a very thin software layer built on top of FastAPI that provides developers with a set of coding features and tools that may be useful for any microservice (regardless of its role and domain/bounded context), such as:

  • Implements all guidelines from https://12factor.net
  • MVC Web App builder with fundamental abstractions
  • Simple Dependency Injection mechanism, including automatic class discovery and instantiation
  • Class-based API controller with automatic module discovery
  • Modular Command/Query responsibility segregation
  • Optional Event-sourcing for event-driven Domain modeling
  • Clean layered Code https://levelup.gitconnected.com/clean-architecture-86c4f03e4771
    • Pure Domain models, independent of persistence
    • Application handlers (Command, Queries, Events, Tasks)
    • Repository pattern
    • Independent API controllers, endpoints and models (DTO's) vs Domain models and logic
  • Native async Events ingestion, handling, emission (JSON CloudEvent) using ReactiveX programming with RxPy
  • Data models mapping between Domain and Integration
  • Easy extension for background task scheduling with apscheduler
  • etc...

The code typically includes comments that help understand it.

The src/main.py file is the entry point that defines all dependencies, including the sub-folders where to dynamically load the API, Application, Persistence and Domain layers.

In turn, when booting, the web app dynamically discovers, identifies and instantiate dependencies then loads:

  • API controllers and define the mapping between each endpoint and its corresponding Application handler
  • Application handlers (incl. Commands, Queries, Events, Tasks) and services (any business logic)
  • Integration dependencies (any API client service, persistence-layer clients, ) and models (API' DTO for requests and responses)

Documentation

Temporarily hosted at https://bvandewe.github.io/pyneuro/

Disclaimer

This project was the opportunity for me (cdavernas) to learn Python while porting some of the concepts and services of the .NET version of the Neuroglia Framework

Packaging

# Set `package-mode = true` in pyproject.toml
# Set the version tag in pyproject.toml
# Commit changes
# Create API Token in pypi.org...
# Configure credentials for pypi registry:
poetry config pypi-token.pypi  {pypi-....mytoken}
# Build package locally
poetry build
# Publish package to pypi.org:
poetry publish

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

neuroglia_python-0.1.4.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

neuroglia_python-0.1.4-py3-none-any.whl (57.0 kB view details)

Uploaded Python 3

File details

Details for the file neuroglia_python-0.1.4.tar.gz.

File metadata

  • Download URL: neuroglia_python-0.1.4.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.9 Darwin/24.3.0

File hashes

Hashes for neuroglia_python-0.1.4.tar.gz
Algorithm Hash digest
SHA256 578dbd350ca1492c1c9789cc4aea738121b01a15bfb00c690527860d1453c8ce
MD5 a650c7e873892d30ef8643f942c4851b
BLAKE2b-256 fe5401221e9864b9acab3238d38b3112473b988a743b6d9c134132cd397519d9

See more details on using hashes here.

File details

Details for the file neuroglia_python-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: neuroglia_python-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 57.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.9 Darwin/24.3.0

File hashes

Hashes for neuroglia_python-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c1464bdacb4d854b184dfa382dd17d3dc9089e686b95352398ac526660b6c6a6
MD5 8a03f9523d5acce6df93bac6949cdd89
BLAKE2b-256 4d52ac0ce7cff5b3880363cee85d2465701ce4807b94cb59ef5148b65403ba97

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