Prefix

The prefix argument is the string that should be appended to all the names of the python modules.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import zunzuncito

root = 'my_api'

versions = ['v0', 'v1']

hosts = {'*': 'default'}

routes = {'default':[
    ('/(md5|sha1|sha256|sha512)(/.*)?', 'hasher', 'GET, POST')
]}

app = zunzuncito.ZunZun(root, versions, hosts, routes, prefix='zzz_')

Note

The default prefix is zun_

Directory structure

The directory containing the sources for the application would look like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/home/
  `--zunzun/
     |--app.py
     `--my_api
        |--__init__.py
        `--default
           |--__init__.py
           |--v0
           |  |--__init__.py
           |  |--zzz_default
           |  |  |--__init__.py
           |  |  `--zzz_default.py
           |  `--zzz_hasher
           |     |--__init__.py
           |     `--zzz_hasher.py
           `--v1
              |--__init__.py
              |--zzz_default
              |  |--__init__.py
              |  `--zzz_default.py
              `--zzz_hasher
                 |--__init__.py
                 `--zzz_hasher.py
  • In this case the my_api directory, is the root and all modules (API Resources) start with zzz_

Note

The idea of the prefix is to avoid conflics with current python modules

Many thanks Paw - The ultimate REST client for Mac. for supporting Open Source projects.

paw

A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.

Donating helps ensure continued support, development and availability.

dalmp


comments powered by Disqus