Selective importing and package dependencies

D

David Pratt

Hi. I am in the midst of preparing a package to convert between
various schemas including orms. The issue is I don't want django,
slqalchemy, storm, rdflib etc. as hard dependencies of the package.
Each module is a schema to schema conversion. As an example, I have
imports for sqlalchemy with classes and methods that use them.

from sqlalchemy.util import OrderedDict
from sqlalchemy import types as rdbtype
import sqlalchemy as sa

I have my own ideas about how I might do this but looking for
recommendations from others how they would handle this so the result
would be:

1. no hard dependencies on any of these other packages
2. load the module without failure.
3. import the dependent package if available to perform the conversion

Many thanks
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top