I'm writing a python library to interface to a rest server. I would like to be able to add classes inside the library, which I would like to be hidden once the library is installed via pip and imported into any project.
Example of the library structure:
.
├── my_library
├── __init__.py
├── controller
| ├──OtherClass.py
| └──Client.py
└── models
├── __init__.py
└── MyModel.py
Content of __init__.py in root folder.
from .controller.Client import Client
setup.py:
from setuptools import find_packages, setup
setup(
name='my_library',
packages=find_packages(include=['my_library']),
version='0.1.0',
description='My library',
author='Pasini Matteo',
setup_requires=['pytest-runner'],
license='MIT',
tests_require=['pytest==4.4.1'],
test_suite='tests',
)
what I would like not to be able to do those who use the library:
from my_library.controller.OtherClass import OtherClass
python version >= 3.6