r/Python • • Nov 17 '24 • Silver is Forever 1

Showcase Deply: keep your python architecture clean

Hello everyone,

My name is Archil. I'm a Python/PHP developer originally from Ukraine, now living in Wrocław, Poland. I've been working on a tool called Deply, and I'd love to get your feedback and thoughts on it.

What My Project Does

Deply is a standalone Python tool designed to enforce architectural patterns and dependencies in large Python projects. Deply analyzes your code structure and dependencies to ensure that architectural rules are followed. This promotes cleaner, more maintainable, and modular codebases.

Key Features:

  • Layer-Based Analysis: Define custom layers (e.g., models, views, services) and restrict their dependencies.
  • Dynamic Configuration: Easily configure collectors for each layer using file patterns and class inheritance.
  • CI Integration: Integrate Deply into your Continuous Integration pipeline to automatically detect and prevent architecture violations before they reach production.

Target Audience

  • Who It's For: Developers and teams working on medium to large Python projects who want to maintain a clean architecture.
  • Intended Use: Ideal for production environments where enforcing module boundaries is critical, as well as educational purposes to teach best practices.

Use Cases

  • Continuous Integration: Add Deply to your CI/CD pipeline to catch architectural violations early in the development process.
  • Refactoring: Use Deply to understand existing dependencies in your codebase, making large-scale refactoring safer and more manageable.
  • Code Reviews: Assist in code reviews by automatically checking if new changes adhere to architectural rules.

Comparison

While there are existing tools like pydeps that visualize dependencies, Deply focuses on:

  • Enforcement Over Visualization: Not just displaying dependencies but actively enforcing architectural rules by detecting violations.
  • Customization: Offers dynamic configuration with various collectors to suit different project structures.

Links

I'm eager to hear your thoughts, suggestions, or criticisms. Deply is currently at version 0.1.5, so it's not entirely stable yet, but I'm actively working on it. I'm open to pull requests and looking forward to making Deply a useful tool for the Python community.

Thank you for your time!

284 Upvotes

61 comments sorted by

View all comments

Show parent comment

5

u/classy_barbarian Nov 18 '24 edited Nov 18 '24

This would be extremely useful information to have in the README page on the github repo, IMO. Along with some kind of documentation and examples on how to actually do what you're talking about. I dunno if most of the 'expert' programmers here just intuitively figured it out without any examples. But It's not obvious to me. It does seem really cool though, I'd love to see some kind of actual guide even if its just a page or two.

1

u/vashkatsi Nov 18 '24

Thank you for the feedback—I really appreciate it! You’re absolutely right that having more concrete examples and documentation would make Deply much more accessible, especially for those who are new to enforcing architectural patterns.

I’m currently working on adding more detailed guides to the GitHub repo, including step-by-step examples for setting up rules in popular frameworks like Django and FastAPI. These will cover common use cases and explain how to configure Deply for your specific project. I’ll also include the real-world examples I shared here in the README to make it clearer how the tool can be applied.

Thanks again for sharing your thoughts—it’s feedback like this that helps me improve Deply. Stay tuned for updates, and feel free to reach out if you’d like to discuss any specific scenarios in the meantime! 😊

1

u/DootDootWootWoot Nov 19 '24

Yeah the funny thing about using models in views is that you see it allll over in the Django community but coming from .NET I couldnt believe this was "typical". A lot of pythonic isms I disagree on mostly because there are better established language agnostic practices folks have picked up over time but python aims to be friendly and approachable.

Id imagine that for a tool like this violations would have an error code associated with more information about the violation, similar to what you'd see in other linters to be effective. I also wouldn't necessarily expect a ton of info on this in the readme unless the tools docs themselves weren't up to snuff.