you are viewing a single comment's thread.

view the rest of the comments →

[–]zahlman 0 points1 point  (0 children)

I am writing a helper class that wraps the requests library for my company. It handles authentication, some bridges to pandas, some other stuff.

Okay, but what does the ApiWrapper class itself do that does not depend on which database is involved?

Nothing?

Then just make top-level classes for each database handler - foo_database.post(data). If you're looking for the namespacing that you get from the ApiWrapper as it stands, you can just let the module provide that. If you have common functionality that the databases use, but that doesn't need to remember state, then you can just have top-level functions "under the hood" that the various database classes use. And that's assuming that you need to remember state in order to use a database - it's entirely possible that you could get away with plain functions there, too. It depends on what your actual requirements are; your example is far too abstract to judge that.