function sqlalchemy.inspect(subject, raiseerr=True)
Produce an inspection object for the given target.
The returned value in some cases may be the same object as the one given, such as if a Mapper object is passed. In other cases, it will be an instance of the registered inspection type for the given object, such as if an Engine is passed, an Inspector object is returned.
Parameters
subject – the subject to be inspected.
raiseerr¶ – When True, if the given subject does not correspond to a known SQLAlchemy inspected type, sqlalchemy.exc.NoInspectionAvailable is raised. If False, None is returned.