1
1
Welcome to apipkg!
2
2
------------------------
3
3
4
- With apipkg you can control the exported namespace of a
5
- python package and greatly reduce the number of imports for your users.
6
- It is a `small pure python module `_ that works on virtually all Python
7
- versions, including CPython2.3 to Python3.1, Jython and PyPy. It co-operates
8
- well with Python's ``help() `` system, custom importers (PEP302) and common
9
- command line completion tools.
4
+ With apipkg you can control the exported namespace of a Python package and
5
+ greatly reduce the number of imports for your users.
6
+ It is a `small pure Python module `_ that works on CPython 2.7 and 3.4+,
7
+ Jython and PyPy. It cooperates well with Python's ``help() `` system,
8
+ custom importers (PEP302) and common command-line completion tools.
10
9
11
10
Usage is very simple: you can require 'apipkg' as a dependency or you
12
- can copy paste the < 200 Lines of code into your project.
11
+ can copy paste the ~ 200 lines of code into your project.
13
12
14
13
15
14
Tutorial example
@@ -32,7 +31,7 @@ The package is initialized with a dictionary as namespace.
32
31
You need to create a ``_mypkg `` package with a ``somemodule.py ``
33
32
and ``othermodule.py `` containing the respective classes.
34
33
The ``_mypkg `` is not special - it's a completely
35
- regular python package.
34
+ regular Python package.
36
35
37
36
Namespace dictionaries contain ``name: value `` mappings
38
37
where the value may be another namespace dictionary or
@@ -53,7 +52,7 @@ loaded when they are accessed. This means:
53
52
* lazy loading - only what is actually needed is ever loaded
54
53
55
54
* only the root "mypkg" ever needs to be imported to get
56
- access to the complete functionality.
55
+ access to the complete functionality
57
56
58
57
* the underlying modules are also accessible, for example::
59
58
@@ -69,7 +68,7 @@ for example ``_mypkg/apipkg.py`` in the above example. You
69
68
then import the ``initpkg `` function from that new place and
70
69
are good to go.
71
70
72
- .. _`small pure python module` :
71
+ .. _`small pure Python module` :
73
72
.. _`apipkg.py` : https://github.com/pytest-dev/apipkg/blob/master/src/apipkg/__init__.py
74
73
75
74
Feedback?
0 commit comments