nowfound

Dev tools · February 21, 2024

MA

Modguard – a lightweight Python tool for enforcing modular design

Hi HN! We are excited to show you modguard - a Python tool we built to enforce a modular, decoupled package architecture. We built modguard to solve a recurring problem that we've experienced on software teams - code sprawl. Over time, cross-module imports would tightly couple together what used to be independent domains, and eventually create "balls of mud". This made it harder to test, and harder to make changes. Mis-use of modules which were intended to be private would then degrade performance and even cause security incidents. This would happen for a variety of reasons: - Junior…

In plain words

Modguard is a lightweight Python tool that enforces modular, decoupled package architecture to prevent code sprawl and tightly coupled imports. It helps development teams maintain independent domains and avoid "balls of mud" that become difficult to test and modify. The tool addresses issues like unintended private module access that can degrade performance and create security problems, making codebases easier to manage as they grow.

written from the facts on this page · September 2026

From the sources

In the maker’s words, at launch

Hi HN! We are excited to show you modguard - a Python tool we built to enforce a modular, decoupled package architecture. We built modguard to solve a recurring problem that we've experienced on software teams - code sprawl. Over time, cross-module imports would tightly couple together what used to be independent domains, and eventually create "balls of mud". This made it harder to test, and harder to make changes. Mis-use of modules which were intended to be private would then degrade performance and even cause security incidents. This would happen for a variety of reasons: - Junior developers had a limited understanding of the existing architecture and/or frameworks being used - It's significantly easier to add to an existing service than to create a new one - Python doesn't stop you from importing any code living anywhere - When changes are in a 'gray area', social desire to not block others would let changes through code review - External deadlines and management pressure would result in "doing it properly" getting punted and/or never done Attempts to fix this problem always came up short. Inevitably, standards guides would be written, and stricter attempts would be made to enforce those guides. Teams would lead developer education efforts, and restrict code review. These approaches each had their own flaws, and didn't scale. The solution is to explicitly define a module's boundary and public interface in code, and enforce those domain boundaries through CI. This means that introducing a new cross-module dependency required explicitly changing the public interface or the boundary itself. This is a significantly smaller and well-scoped set of changes that can be maintained and managed by those who understood the intended design of the system. modguard is: - fully open source - able to be adopted incrementally - implemented with no runtime footprint - a standalone library with no external dependencies - interoperable with your existing system (cli, generated config) We hope you try it out! We’d love your feedback. Github - https://github.com/Never-Over/modguard Docs - https://never-over.github.io/modguard/ [email protected]

More dev tools this month

the category →
  • Dograh592

    The open source VAPI alternative

    Dev tools · 25d ago · dograh.com

  • Meridian530

    Don't let your work go unnoticed. Get promoted!

    Dev tools · 20d ago · meridiona.com

  • x1516

    Lovable for iPhone apps go from idea to App Store

    Dev tools · 11d ago · x1.new

  • Open-source GTM skills for technical founders

    Dev tools · 29d ago · gtmcofounder.com

  • OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.

    Dev tools · 1d ago · opentrailpaper.com

  • Nuphos380

    The AI-Native DevOps Workspace.

    Dev tools · 24d ago · nuphos.ai

Launched alongside, February 2024

the whole month →
  • Flipner AI1,629

    Capture your ideas & craft texts with AI's touch

    AI · 2024 · flipner.webflow.io

  • Typeframes1,307

    Video creation for makers

    Work · 2024 · revid.ai

  • Superlist1,254

    Home to all your lists

    Work · 2024 · superlist.com

  • Never run out of marketing ideas ever again

    Growth · 2024 · marketingideas.com

  • Layers1,201

    A home for designers

    Work · 2024 · layers.to

  • Heyday1,178

    AI copilot for your own research, notes & conversations

    AI · 2024 · heyday.xyz