Is it possible to make sure a structure only generates a specific template once or never?

For example i have this village datapack which adds a bunch of villages, how do i make sure, for an example a librarian's house only generates once or never in that village?
Continue to help post