Peter F
Peter F

Reputation: 570

Is there a way to control what can be imported in each package and file in python (fastapi)?

For a large API project we are trying to enforce a folder structure and what package is allowed to be imported from other packages. Is there a package that can check this for you to be used in git pre-commit or CICD?

For example:

In Java i know there is a package called checkstyle that does this with ImportControl. Where it basically checks for a regex in each file.

Is there something similar in some python package ?

Upvotes: 1

Views: 145

Answers (0)

Related Questions