jo
Automatically making flask webservices from python objects
To install: pip install jo
Note: You can find more modern and flexible version of jo in these packages: py2http and qh.
Examples
ObjWrapper
A class to wrap a "controller" class for a web service API. It takes care of LRU caching objects constructed before (so they don't need to be re-constructed for every API call), and converting request.json and request.args arguments to the types that will be recognized by the method calls.
:param obj_constructor: a function that, given some arguments, constructs an object. It is this object
that will be wrapped for the webservice
:param obj_constructor_arg_names:
:param convert_arg: (processing) a dict keyed by variable names (str) and valued by a dict containing a
'type': a function (typically int, float, bool, and list) that will convert the value of the variable
to make it web service compliant
'default': A value to assign to the variable if it's missing.
:param The pattern that determines what attributes are allowed to be accessed. Note that patterns must be
complete patterns (i.e. describing the whole attribute path, not just a subset. For example, if you want
to have access to this.given.thing you, specifying r"this\.given" won't be enough. You need to specify
"this\.given.thing" or "this\.given\..*" (the latter giving access to all children of this.given.).
Allowed formats:
a re.compiled pattern
a string (that will be passed on to re.compile()
a dict with either
an "exclude", pointing to a list of patterns to exclude
an "include", pointing to a list of patterns to include
:param to_jdict: (input processing) Function to convert an output to a jsonizable dict
Metadata
Release files for jo 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jo-0.0.8.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jo-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / jo-0.0.8.tar.gz
| Download URL | jo-0.0.8.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8f4c072a6d6a5edc2aaa1aa006c8431f3ab85787237f76a7fb122701bcac142
|
|
BLAKE2b-256 checksum How to use checksums |
8bb66fe3e7089c7acaa91bd12c4bbce67bfc24b46ceb7f0402f711c9eec6e16d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / jo-0.0.8-py3-none-any.whl
| Download URL | jo-0.0.8-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc7bbea3b69db8a2872de1ce8ca442af8568766e258841c67f19f45a718439c3
|
|
BLAKE2b-256 checksum How to use checksums |
74c3b6a780e915d4141d4c6a013ea5e4fb7133fd1c6af650247f85e7892d759e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|