diff options
Diffstat (limited to 'py/_vendored_packages/apipkg-1.4.dist-info')
7 files changed, 214 insertions, 0 deletions
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst b/py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst new file mode 100644 index 0000000..5482220 --- /dev/null +++ b/py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst @@ -0,0 +1,87 @@ +Welcome to apipkg! +------------------------ + +With apipkg you can control the exported namespace of a +python package and greatly reduce the number of imports for your users. +It is a `small pure python module`_ that works on virtually all Python +versions, including CPython2.3 to Python3.1, Jython and PyPy. It co-operates +well with Python's ``help()`` system, custom importers (PEP302) and common +command line completion tools. + +Usage is very simple: you can require 'apipkg' as a dependency or you +can copy paste the <200 Lines of code into your project. + + +Tutorial example +------------------- + +Here is a simple ``mypkg`` package that specifies one namespace +and exports two objects imported from different modules:: + + # mypkg/__init__.py + import apipkg + apipkg.initpkg(__name__, { + 'path': { + 'Class1': "_mypkg.somemodule:Class1", + 'clsattr': "_mypkg.othermodule:Class2.attr", + } + } + +The package is initialized with a dictionary as namespace. + +You need to create a ``_mypkg`` package with a ``somemodule.py`` +and ``othermodule.py`` containing the respective classes. +The ``_mypkg`` is not special - it's a completely +regular python package. + +Namespace dictionaries contain ``name: value`` mappings +where the value may be another namespace dictionary or +a string specifying an import location. On accessing +an namespace attribute an import will be performed:: + + >>> import mypkg + >>> mypkg.path + <ApiModule 'mypkg.path'> + >>> mypkg.path.Class1 # '_mypkg.somemodule' gets imported now + <class _mypkg.somemodule.Class1 at 0xb7d428fc> + >>> mypkg.path.clsattr # '_mypkg.othermodule' gets imported now + 4 # the value of _mypkg.othermodule.Class2.attr + +The ``mypkg.path`` namespace and its two entries are +loaded when they are accessed. This means: + +* lazy loading - only what is actually needed is ever loaded + +* only the root "mypkg" ever needs to be imported to get + access to the complete functionality. + +* the underlying modules are also accessible, for example:: + + from mypkg.sub import Class1 + + +Including apipkg in your package +-------------------------------------- + +If you don't want to add an ``apipkg`` dependency to your package you +can copy the `apipkg.py`_ file somewhere to your own package, +for example ``_mypkg/apipkg.py`` in the above example. You +then import the ``initpkg`` function from that new place and +are good to go. + +.. _`small pure python module`: +.. _`apipkg.py`: http://bitbucket.org/hpk42/apipkg/src/tip/apipkg.py + +Feedback? +----------------------- + +If you have questions you are welcome to + +* join the #pylib channel on irc.freenode.net +* subscribe to the http://codespeak.net/mailman/listinfo/py-dev list. +* create an issue on http://bitbucket.org/hpk42/apipkg/issues + +have fun, +holger krekel + + diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER b/py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER new file mode 100644 index 0000000..a1b589e --- /dev/null +++ b/py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/METADATA b/py/_vendored_packages/apipkg-1.4.dist-info/METADATA new file mode 100644 index 0000000..eb7e60a --- /dev/null +++ b/py/_vendored_packages/apipkg-1.4.dist-info/METADATA @@ -0,0 +1,109 @@ +Metadata-Version: 2.0 +Name: apipkg +Version: 1.4 +Summary: apipkg: namespace control and lazy-import mechanism +Home-page: http://bitbucket.org/hpk42/apipkg +Author: holger krekel +Author-email: holger at merlinux.eu +License: MIT License +Platform: unix +Platform: linux +Platform: osx +Platform: cygwin +Platform: win32 +Classifier: Development Status :: 4 - Beta +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: POSIX +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Topic :: Software Development :: Libraries +Classifier: Programming Language :: Python + +Welcome to apipkg! +------------------------ + +With apipkg you can control the exported namespace of a +python package and greatly reduce the number of imports for your users. +It is a `small pure python module`_ that works on virtually all Python +versions, including CPython2.3 to Python3.1, Jython and PyPy. It co-operates +well with Python's ``help()`` system, custom importers (PEP302) and common +command line completion tools. + +Usage is very simple: you can require 'apipkg' as a dependency or you +can copy paste the <200 Lines of code into your project. + + +Tutorial example +------------------- + +Here is a simple ``mypkg`` package that specifies one namespace +and exports two objects imported from different modules:: + + # mypkg/__init__.py + import apipkg + apipkg.initpkg(__name__, { + 'path': { + 'Class1': "_mypkg.somemodule:Class1", + 'clsattr': "_mypkg.othermodule:Class2.attr", + } + } + +The package is initialized with a dictionary as namespace. + +You need to create a ``_mypkg`` package with a ``somemodule.py`` +and ``othermodule.py`` containing the respective classes. +The ``_mypkg`` is not special - it's a completely +regular python package. + +Namespace dictionaries contain ``name: value`` mappings +where the value may be another namespace dictionary or +a string specifying an import location. On accessing +an namespace attribute an import will be performed:: + + >>> import mypkg + >>> mypkg.path + <ApiModule 'mypkg.path'> + >>> mypkg.path.Class1 # '_mypkg.somemodule' gets imported now + <class _mypkg.somemodule.Class1 at 0xb7d428fc> + >>> mypkg.path.clsattr # '_mypkg.othermodule' gets imported now + 4 # the value of _mypkg.othermodule.Class2.attr + +The ``mypkg.path`` namespace and its two entries are +loaded when they are accessed. This means: + +* lazy loading - only what is actually needed is ever loaded + +* only the root "mypkg" ever needs to be imported to get + access to the complete functionality. + +* the underlying modules are also accessible, for example:: + + from mypkg.sub import Class1 + + +Including apipkg in your package +-------------------------------------- + +If you don't want to add an ``apipkg`` dependency to your package you +can copy the `apipkg.py`_ file somewhere to your own package, +for example ``_mypkg/apipkg.py`` in the above example. You +then import the ``initpkg`` function from that new place and +are good to go. + +.. _`small pure python module`: +.. _`apipkg.py`: http://bitbucket.org/hpk42/apipkg/src/tip/apipkg.py + +Feedback? +----------------------- + +If you have questions you are welcome to + +* join the #pylib channel on irc.freenode.net +* subscribe to the http://codespeak.net/mailman/listinfo/py-dev list. +* create an issue on http://bitbucket.org/hpk42/apipkg/issues + +have fun, +holger krekel + + diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/RECORD b/py/_vendored_packages/apipkg-1.4.dist-info/RECORD new file mode 100644 index 0000000..dc72959 --- /dev/null +++ b/py/_vendored_packages/apipkg-1.4.dist-info/RECORD @@ -0,0 +1,9 @@ +apipkg.py,sha256=BNnv_qvq8zZvku-uudoqgp3XTNFbwsNUmtzOKrVI7X0,6420
+apipkg-1.4.dist-info/top_level.txt,sha256=3TGS6nmN7kjxhUK4LpPCB3QkQI34QYGrT0ZQGWajoZ8,7
+apipkg-1.4.dist-info/METADATA,sha256=Fk_8BrHyXE--kvB3_ZBKgwvPaKusAZUjchH-kpB63Hs,3491
+apipkg-1.4.dist-info/DESCRIPTION.rst,sha256=RkMQqk5ljhGy0DiZkR_nbpjqvwCIhuIEHsyvkn3O96k,2803
+apipkg-1.4.dist-info/metadata.json,sha256=GdshYrA_7gAII3E3EQMH-31BHzU-klTZ6bPQzlDmuy4,779
+apipkg-1.4.dist-info/WHEEL,sha256=AvR0WeTpDaxT645bl5FQxUK6NPsTls2ttpcGJg3j1Xg,110
+apipkg-1.4.dist-info/RECORD,,
+apipkg-1.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
+__pycache__/apipkg.cpython-35.pyc,,
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/WHEEL b/py/_vendored_packages/apipkg-1.4.dist-info/WHEEL new file mode 100644 index 0000000..9dff69d --- /dev/null +++ b/py/_vendored_packages/apipkg-1.4.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.24.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/metadata.json b/py/_vendored_packages/apipkg-1.4.dist-info/metadata.json new file mode 100644 index 0000000..05609b9 --- /dev/null +++ b/py/_vendored_packages/apipkg-1.4.dist-info/metadata.json @@ -0,0 +1 @@ +{"license": "MIT License", "name": "apipkg", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "summary": "apipkg: namespace control and lazy-import mechanism", "platform": "unix", "version": "1.4", "extensions": {"python.details": {"project_urls": {"Home": "http://bitbucket.org/hpk42/apipkg"}, "document_names": {"description": "DESCRIPTION.rst"}, "contacts": [{"role": "author", "email": "holger at merlinux.eu", "name": "holger krekel"}]}}, "classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Topic :: Software Development :: Libraries", "Programming Language :: Python"]}
\ No newline at end of file diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt b/py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt new file mode 100644 index 0000000..e2221c8 --- /dev/null +++ b/py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt @@ -0,0 +1 @@ +apipkg |