How can I \'embed\' a Python library in my own Python package?
Take the Requests library, for instance. How could I integrate it into my own package, the objective b
While not a direct answer to your question. You may want to look at setuptools. By leveraging this package distribution mechanism you can describe your dependencies and when your package is "installed" all the dependent packages will be installed too. You would create a setup.py file at the top of your package structure similar to:
from setuptools import setup, find_packages
setup(
name = 'MyPackage',
version = '1.0',
packages = find_packages(),
...
install_requires = ['requests'],
...
)
this would be installed by the user
python setup.py install
Requests would be automatically installed too.