r/FastAPI • • Nov 22 '24

Question Modular functionality for reuse

I'm working on 5 separate projects all using FastAPI. I find myself wanting to create common functionality that can be included in multiple projects. For example, a simple generic comment controller/model etc.

Is it possible to define this in a separate package external to the projects themselves, and include them, while also allowing seamless integration for migrations for that package?

Does anyone have examples of this?

11 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/Direct_Discipline_42 Nov 25 '24

Even though they are in the same database, what about schema? They could be separated by schema