This is a design decision by the developers of that package. What does or does not appear in the root package namespace comes down to what they put in the package’s __init__.py
file.
Currently, there are lots of things imported into the global shapely
namespace, but not wkt
:
from .lib import GEOSException # NOQA
from .lib import Geometry # NOQA
from .lib import geos_version, geos_version_string # NOQA
from .lib import geos_capi_version, geos_capi_version_string # NOQA
from .errors import setup_signal_checks # NOQA
from ._geometry import * # NOQA
from .creation import * # NOQA
from .constructive import * # NOQA
from .predicates import * # NOQA
from .measurement import * # NOQA
from .set_operations import * # NOQA
from .linear import * # NOQA
from .coordinates import * # NOQA
from .strtree import * # NOQA
from .io import * # NOQA
# Submodule always needs to be imported to ensure Geometry subclasses are registered
from shapely.geometry import ( # NOQA
Point,
LineString,
Polygon,
MultiPoint,
MultiLineString,
MultiPolygon,
GeometryCollection,
LinearRing,
)
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
setup_signal_checks()
This type of pattern is common across many packages. You can access pandas.DataFrame
directly even though DataFrame is actually defined in pandas.core
, but for testing methods you still need to import pandas.testing
. Scipy forces you to import most submodules directly, as each submodule is large and importing all by default would drag down performance.
If you want to know why shapely made these specific choices, you’ll have to ask the developers
:)