All Projects → pcah → Python Clean Architecture

pcah / Python Clean Architecture

Licence: mit
A Python toolkit for applications driven by The Clean Architecture

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Clean Architecture

Designpatternslibrary
A comprehensive design patterns library implemented in C#, which covers various design patterns from the most commonly used ones to the lesser-known ones. Get familiar with and learn design patterns through moderately realistic examples.
Stars: ✭ 485 (+205.03%)
Mutual labels:  architecture, design-patterns
Design Patterns For Humans
An ultra-simplified explanation to design patterns
Stars: ✭ 32,376 (+20262.26%)
Mutual labels:  architecture, design-patterns
Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+3805.66%)
Mutual labels:  architecture, design-patterns
Domain Driven Hexagon
Guide on Domain-Driven Design, software architecture, design patterns, best practices etc.
Stars: ✭ 4,417 (+2677.99%)
Mutual labels:  architecture, design-patterns
1975
1975 - Modelando Domínios Ricos
Stars: ✭ 94 (-40.88%)
Mutual labels:  architecture, design-patterns
Flawless Ios
Awesome iOS guides from the community, shared on Flawless iOS Medium blog 👉
Stars: ✭ 260 (+63.52%)
Mutual labels:  architecture, design-patterns
Awesome Scalability
The Patterns of Scalable, Reliable, and Performant Large-Scale Systems
Stars: ✭ 36,688 (+22974.21%)
Mutual labels:  architecture, design-patterns
Coordinator
Implementation of Coordinators app design pattern.
Stars: ✭ 616 (+287.42%)
Mutual labels:  architecture, design-patterns
Swift Design Patterns
🚀 The ultimate collection of various Software Design Patterns implemented in Swift [Swift 5.0, 28 Patterns].
Stars: ✭ 85 (-46.54%)
Mutual labels:  architecture, design-patterns
Super Simple Architecture
🧩 Super Simple Architecture in Swift
Stars: ✭ 44 (-72.33%)
Mutual labels:  architecture, design-patterns
Urf.core
Unit of Work & Repositories Framework - .NET Core, NET Standard, Entity Framework Core. 100% extensible & lightweight. Live demo: https://goo.gl/QpJVgd
Stars: ✭ 226 (+42.14%)
Mutual labels:  architecture, design-patterns
Android Readthefuckingsourcecode
😜 记录日常的开发技巧,开发中遇到的技术重点、难点,各个知识点的总结,优质面试题等等。持续更新...
Stars: ✭ 1,665 (+947.17%)
Mutual labels:  architecture, design-patterns
Archit Ios
Intelygenz iOS Architecture
Stars: ✭ 203 (+27.67%)
Mutual labels:  architecture, design-patterns
Game Programming Patterns
Source repo for the book
Stars: ✭ 3,096 (+1847.17%)
Mutual labels:  architecture, design-patterns
Awesome Design Patterns
A curated list of software and architecture related design patterns.
Stars: ✭ 15,579 (+9698.11%)
Mutual labels:  architecture, design-patterns
System Design And Architecture
Learn how to design large-scale systems. Prep for the system design interview.
Stars: ✭ 1,005 (+532.08%)
Mutual labels:  architecture, design-patterns
Paper Code
对一些好的技术文章结合自己的实践经验进行翻译、举例说明等或自己的经验分享。主要包括架构设计、模式设计、模型设计、重构等。
Stars: ✭ 94 (-40.88%)
Mutual labels:  architecture, design-patterns
Ios Design Patterns
Learning ground for iOS Design Pattern included with sample projects for MVC, MVP, MVVM, and VIPER
Stars: ✭ 120 (-24.53%)
Mutual labels:  architecture, design-patterns
Design Patterns In Ruby
GoF design patterns in Ruby
Stars: ✭ 1,969 (+1138.36%)
Mutual labels:  design-patterns
Drawers
Group related classes together. No more silos. A solution to rails dystopia.
Stars: ✭ 150 (-5.66%)
Mutual labels:  architecture

python-clean-architecture

GitHub tag development status supports build status codecov Join the chat at https://gitter.im/pcah/python-clean-architecture

python-clean-architecture is a Python library aiming to bring your code closer to The Clean Architecture. The first goal is to equip you with a set of patterns and good practices. The second one is to provide you a toolbox of adapters for integration with popular frameworks. Using them can make your code more focused on the knowledge you are trying to embody with your application and separation from technical details. A nice side-effects of this approach is an ease of plugging your application to a different variants of your infrastructure and lightweight testing the key fragments of your codebase.

Development Status (Stage 2 - Pre-Alpha Status)

THE LIBRARY IS NOT PRODUCTION- OR DEVELOPMENT-READY. If you want to make it useful, come and help. See CONTRIBUTING for details.

The concept for this library is ambitious and its core team has not as much spare time as it would like to dedicate, so don't expect rapid development here. If you are interested in making its progress more apparent, you are more than welcomed to propose your help. The core team reserves the right to choose focus points and scopes for the library, however.

The library is still in a planning phase, so expect much refactorization and many changes to its API.

Motivation & inspirations

There is a saying that every developer should write his own framework once in a lifetime. Being happily married with our professional jobs, we do this library in our spare time. Why? To show ourselves and fellow developers there is an achievable way to come closer to The Clean Architecture using a finite amount of effort. We try to show that Python community can build well designed applications as well. We treat following lectures as food for thoughts as we strive to implement ideas found there:

The Principles of the Library

Here you can find a short version of The Principles the library is meant to follow. If you want to read more about them, take a look at our docs.

  1. Domain First Design. Building an application should begin with its business intent and without any decision about a framework or other technical details.
  2. Keep it simple and straightforward. There's a great value of having simple business objects, like dataclasses. Decompose your every component to make them correspond a specific single responsibility, but only as far as to be straightforward in your intents. Keep your state-transformation functions pure and classes self-contained.
  3. Layered architecture. Keep domain & application logic pure. Separate them in layers, the same goes for technical details for a framework & the whole system/hardware environment. Dependencies between layers should point only inwards, with domain in the core. You can have more layers if you feel a need, but keep in mind that every layer is a cost to maintain.
  4. Coupling management. Quite often components don't need to be tightly connected and have knowledge of construction methods of the other one. Use Dependency Injection technique then, along with interfaces that define other component's contract. Dependency Injection may also help to control lifecycle of components.
  5. Be open to reimplementation. If a component may be implemented in several different manners, keep its design open to be reimplemented in different ways. Use interfaces that define contracts with other components. Use coupling management using these interfaces to interact with other components.
  6. Batteries included. The library should provide integrations with the key Python projects.

Tiers of the architecture

  • Data-level logic: data description objects, factories, serialization, predicates, formulae. (it's not a specific layer)
  • Domain layer: bounded contexts, entities, value objects, aggregates, repositories, policies, factories, domain services.
  • Application-specific logic: use-cases, application services, gateways, CQRS stacks, sagas. Task-, event- and data-driven applications, commands.

Micro-frameworks

To accomplish the goals in a most convenient and readable manner, the library introduces some helper micro-frameworks:

  • pca/utils/dependency_injection to provide loose coupling between components in the pythonic way: interface-based with type annotations, declarative dependencies, introspection, no necessity for global-state container.
  • utils/errors.py as a declarative way to provide l10n-independent errors with params & hints for developers, together with thematic catalogues of errors.

Integrations

One of the goals of this library is to provide integration with popular Python frameworks and libraries. Here are the most notable ones:

  • TinyDb as a DAO
  • YAML, JSON or INI file loaded into the memory as a DAO
  • more to come soon...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].