chisel 1.2.5__tar.gz → 1.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chisel-1.2.7/PKG-INFO +113 -0
- chisel-1.2.7/README.md +88 -0
- {chisel-1.2.5 → chisel-1.2.7}/setup.cfg +3 -3
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel/doc.py +2 -0
- chisel-1.2.7/src/chisel.egg-info/PKG-INFO +113 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel.egg-info/SOURCES.txt +1 -1
- chisel-1.2.5/PKG-INFO +0 -126
- chisel-1.2.5/README.rst +0 -101
- chisel-1.2.5/src/chisel.egg-info/PKG-INFO +0 -126
- {chisel-1.2.5 → chisel-1.2.7}/LICENSE +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/pyproject.toml +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel/__init__.py +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel/action.py +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel/app.py +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel/request.py +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel.egg-info/dependency_links.txt +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel.egg-info/requires.txt +0 -0
- {chisel-1.2.5 → chisel-1.2.7}/src/chisel.egg-info/top_level.txt +0 -0
chisel-1.2.7/PKG-INFO
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: chisel
|
|
3
|
+
Version: 1.2.7
|
|
4
|
+
Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
|
|
5
|
+
Home-page: https://github.com/craigahobbs/chisel
|
|
6
|
+
Author: Craig A. Hobbs
|
|
7
|
+
Author-email: craigahobbs@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: api,json,framework,schema,wsgi
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
|
|
20
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: schema-markdown>=1.2.0
|
|
25
|
+
|
|
26
|
+
# chisel
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/chisel/)
|
|
29
|
+
[](https://pypi.org/project/chisel/)
|
|
30
|
+
[](https://github.com/craigahobbs/chisel/blob/main/LICENSE)
|
|
31
|
+
[](https://pypi.org/project/chisel/)
|
|
32
|
+
|
|
33
|
+
Chisel is a light-weight Python WSGI application framework built for creating well-documented,
|
|
34
|
+
schema-validated JSON web APIs.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Links
|
|
38
|
+
|
|
39
|
+
- [API Documentation](https://craigahobbs.github.io/chisel/)
|
|
40
|
+
- [Source code](https://github.com/craigahobbs/chisel)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## JSON APIs
|
|
44
|
+
|
|
45
|
+
Chisel provides the [action](https://craigahobbs.github.io/chisel/action.html#chisel.action)
|
|
46
|
+
decorator for easily implementing schema-validated JSON APIs.
|
|
47
|
+
|
|
48
|
+
~~~ python
|
|
49
|
+
@chisel.action(spec='''
|
|
50
|
+
# Sum a list of numbers
|
|
51
|
+
action sum_numbers
|
|
52
|
+
urls
|
|
53
|
+
GET
|
|
54
|
+
|
|
55
|
+
query
|
|
56
|
+
# The list of numbers
|
|
57
|
+
float[len > 0] numbers
|
|
58
|
+
|
|
59
|
+
output
|
|
60
|
+
# The sum of the numbers
|
|
61
|
+
float sum
|
|
62
|
+
''')
|
|
63
|
+
def sum_numbers(ctx, req):
|
|
64
|
+
return {'sum': sum(req['numbers'])}
|
|
65
|
+
|
|
66
|
+
application = chisel.Application()
|
|
67
|
+
application.add_request(sum_numbers)
|
|
68
|
+
application.request('GET', '/sum_numbers', query_string='numbers.0=1&numbers.1=2&numbers.2=4')
|
|
69
|
+
|
|
70
|
+
('200 OK', [('Content-Type', 'application/json')], b'{"sum":7.0}')
|
|
71
|
+
~~~
|
|
72
|
+
|
|
73
|
+
Each action defines an ``action`` definition using
|
|
74
|
+
[Schema Markdown](https://craigahobbs.github.io/schema-markdown-js/language/).
|
|
75
|
+
The action callback is passed two arguments, a request
|
|
76
|
+
[Context](https://craigahobbs.github.io/chisel/app.html#chisel.Context)
|
|
77
|
+
and the schema-validated request input dictionary. The input request dictionary is created by
|
|
78
|
+
combining the request's URL path parameters, query string parameters, and input JSON content
|
|
79
|
+
parameters.
|
|
80
|
+
|
|
81
|
+
If there is a schema validation error the appropriate error code is automatically returned.
|
|
82
|
+
|
|
83
|
+
~~~ python
|
|
84
|
+
status, _, content_bytes = application.request('GET', '/sum_numbers')
|
|
85
|
+
|
|
86
|
+
'400 Bad Request'
|
|
87
|
+
b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
|
|
88
|
+
~~~
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## API Documentation
|
|
92
|
+
|
|
93
|
+
You can add API documentation to your application by adding the Chisel documentation application
|
|
94
|
+
requests from
|
|
95
|
+
[create_doc_requests](https://craigahobbs.github.io/chisel/request.html#chisel.create_doc_requests).
|
|
96
|
+
|
|
97
|
+
~~~ python
|
|
98
|
+
application = chisel.Application()
|
|
99
|
+
application.add_requests(chisel.create_doc_requests())
|
|
100
|
+
~~~
|
|
101
|
+
|
|
102
|
+
By default the documentation application is hosted at "/doc/". An example of of Chisel's documentation output is
|
|
103
|
+
available [here](https://craigahobbs.github.io/chisel/example/#var.vName='chisel_doc_request').
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
This package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).
|
|
109
|
+
It was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:
|
|
110
|
+
|
|
111
|
+
~~~ sh
|
|
112
|
+
template-specialize python-template/template/ chisel/ -k package chisel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k nomain 1
|
|
113
|
+
~~~
|
chisel-1.2.7/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# chisel
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/chisel/)
|
|
4
|
+
[](https://pypi.org/project/chisel/)
|
|
5
|
+
[](https://github.com/craigahobbs/chisel/blob/main/LICENSE)
|
|
6
|
+
[](https://pypi.org/project/chisel/)
|
|
7
|
+
|
|
8
|
+
Chisel is a light-weight Python WSGI application framework built for creating well-documented,
|
|
9
|
+
schema-validated JSON web APIs.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Links
|
|
13
|
+
|
|
14
|
+
- [API Documentation](https://craigahobbs.github.io/chisel/)
|
|
15
|
+
- [Source code](https://github.com/craigahobbs/chisel)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## JSON APIs
|
|
19
|
+
|
|
20
|
+
Chisel provides the [action](https://craigahobbs.github.io/chisel/action.html#chisel.action)
|
|
21
|
+
decorator for easily implementing schema-validated JSON APIs.
|
|
22
|
+
|
|
23
|
+
~~~ python
|
|
24
|
+
@chisel.action(spec='''
|
|
25
|
+
# Sum a list of numbers
|
|
26
|
+
action sum_numbers
|
|
27
|
+
urls
|
|
28
|
+
GET
|
|
29
|
+
|
|
30
|
+
query
|
|
31
|
+
# The list of numbers
|
|
32
|
+
float[len > 0] numbers
|
|
33
|
+
|
|
34
|
+
output
|
|
35
|
+
# The sum of the numbers
|
|
36
|
+
float sum
|
|
37
|
+
''')
|
|
38
|
+
def sum_numbers(ctx, req):
|
|
39
|
+
return {'sum': sum(req['numbers'])}
|
|
40
|
+
|
|
41
|
+
application = chisel.Application()
|
|
42
|
+
application.add_request(sum_numbers)
|
|
43
|
+
application.request('GET', '/sum_numbers', query_string='numbers.0=1&numbers.1=2&numbers.2=4')
|
|
44
|
+
|
|
45
|
+
('200 OK', [('Content-Type', 'application/json')], b'{"sum":7.0}')
|
|
46
|
+
~~~
|
|
47
|
+
|
|
48
|
+
Each action defines an ``action`` definition using
|
|
49
|
+
[Schema Markdown](https://craigahobbs.github.io/schema-markdown-js/language/).
|
|
50
|
+
The action callback is passed two arguments, a request
|
|
51
|
+
[Context](https://craigahobbs.github.io/chisel/app.html#chisel.Context)
|
|
52
|
+
and the schema-validated request input dictionary. The input request dictionary is created by
|
|
53
|
+
combining the request's URL path parameters, query string parameters, and input JSON content
|
|
54
|
+
parameters.
|
|
55
|
+
|
|
56
|
+
If there is a schema validation error the appropriate error code is automatically returned.
|
|
57
|
+
|
|
58
|
+
~~~ python
|
|
59
|
+
status, _, content_bytes = application.request('GET', '/sum_numbers')
|
|
60
|
+
|
|
61
|
+
'400 Bad Request'
|
|
62
|
+
b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
|
|
63
|
+
~~~
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## API Documentation
|
|
67
|
+
|
|
68
|
+
You can add API documentation to your application by adding the Chisel documentation application
|
|
69
|
+
requests from
|
|
70
|
+
[create_doc_requests](https://craigahobbs.github.io/chisel/request.html#chisel.create_doc_requests).
|
|
71
|
+
|
|
72
|
+
~~~ python
|
|
73
|
+
application = chisel.Application()
|
|
74
|
+
application.add_requests(chisel.create_doc_requests())
|
|
75
|
+
~~~
|
|
76
|
+
|
|
77
|
+
By default the documentation application is hosted at "/doc/". An example of of Chisel's documentation output is
|
|
78
|
+
available [here](https://craigahobbs.github.io/chisel/example/#var.vName='chisel_doc_request').
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Development
|
|
82
|
+
|
|
83
|
+
This package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).
|
|
84
|
+
It was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:
|
|
85
|
+
|
|
86
|
+
~~~ sh
|
|
87
|
+
template-specialize python-template/template/ chisel/ -k package chisel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k nomain 1
|
|
88
|
+
~~~
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = chisel
|
|
3
|
-
version = 1.2.
|
|
3
|
+
version = 1.2.7
|
|
4
4
|
url = https://github.com/craigahobbs/chisel
|
|
5
5
|
author = Craig A. Hobbs
|
|
6
6
|
author_email = craigahobbs@gmail.com
|
|
7
7
|
license = MIT
|
|
8
8
|
description = Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
|
|
9
|
-
long_description = file:README.
|
|
10
|
-
long_description_content_type = text/
|
|
9
|
+
long_description = file:README.md
|
|
10
|
+
long_description_content_type = text/markdown
|
|
11
11
|
keywords = api, json, framework, schema, wsgi
|
|
12
12
|
classifiers =
|
|
13
13
|
Development Status :: 5 - Production/Stable
|
|
@@ -27,9 +27,11 @@ CHISEL_DOC_HTML = b'''\
|
|
|
27
27
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/data.js" as="script">
|
|
28
28
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/library.js" as="script">
|
|
29
29
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/model.js" as="script">
|
|
30
|
+
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/options.js" as="script">
|
|
30
31
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/parser.js" as="script">
|
|
31
32
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/runtime.js" as="script">
|
|
32
33
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/runtimeAsync.js" as="script">
|
|
34
|
+
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/bare-script/lib/value.js" as="script">
|
|
33
35
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/element-model/lib/elementModel.js" as="script">
|
|
34
36
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/app.js" as="script">
|
|
35
37
|
<link rel="modulepreload" href="https://craigahobbs.github.io/markdown-up/lib/dataTable.js" as="script">
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: chisel
|
|
3
|
+
Version: 1.2.7
|
|
4
|
+
Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
|
|
5
|
+
Home-page: https://github.com/craigahobbs/chisel
|
|
6
|
+
Author: Craig A. Hobbs
|
|
7
|
+
Author-email: craigahobbs@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: api,json,framework,schema,wsgi
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
|
|
20
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: schema-markdown>=1.2.0
|
|
25
|
+
|
|
26
|
+
# chisel
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/chisel/)
|
|
29
|
+
[](https://pypi.org/project/chisel/)
|
|
30
|
+
[](https://github.com/craigahobbs/chisel/blob/main/LICENSE)
|
|
31
|
+
[](https://pypi.org/project/chisel/)
|
|
32
|
+
|
|
33
|
+
Chisel is a light-weight Python WSGI application framework built for creating well-documented,
|
|
34
|
+
schema-validated JSON web APIs.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Links
|
|
38
|
+
|
|
39
|
+
- [API Documentation](https://craigahobbs.github.io/chisel/)
|
|
40
|
+
- [Source code](https://github.com/craigahobbs/chisel)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## JSON APIs
|
|
44
|
+
|
|
45
|
+
Chisel provides the [action](https://craigahobbs.github.io/chisel/action.html#chisel.action)
|
|
46
|
+
decorator for easily implementing schema-validated JSON APIs.
|
|
47
|
+
|
|
48
|
+
~~~ python
|
|
49
|
+
@chisel.action(spec='''
|
|
50
|
+
# Sum a list of numbers
|
|
51
|
+
action sum_numbers
|
|
52
|
+
urls
|
|
53
|
+
GET
|
|
54
|
+
|
|
55
|
+
query
|
|
56
|
+
# The list of numbers
|
|
57
|
+
float[len > 0] numbers
|
|
58
|
+
|
|
59
|
+
output
|
|
60
|
+
# The sum of the numbers
|
|
61
|
+
float sum
|
|
62
|
+
''')
|
|
63
|
+
def sum_numbers(ctx, req):
|
|
64
|
+
return {'sum': sum(req['numbers'])}
|
|
65
|
+
|
|
66
|
+
application = chisel.Application()
|
|
67
|
+
application.add_request(sum_numbers)
|
|
68
|
+
application.request('GET', '/sum_numbers', query_string='numbers.0=1&numbers.1=2&numbers.2=4')
|
|
69
|
+
|
|
70
|
+
('200 OK', [('Content-Type', 'application/json')], b'{"sum":7.0}')
|
|
71
|
+
~~~
|
|
72
|
+
|
|
73
|
+
Each action defines an ``action`` definition using
|
|
74
|
+
[Schema Markdown](https://craigahobbs.github.io/schema-markdown-js/language/).
|
|
75
|
+
The action callback is passed two arguments, a request
|
|
76
|
+
[Context](https://craigahobbs.github.io/chisel/app.html#chisel.Context)
|
|
77
|
+
and the schema-validated request input dictionary. The input request dictionary is created by
|
|
78
|
+
combining the request's URL path parameters, query string parameters, and input JSON content
|
|
79
|
+
parameters.
|
|
80
|
+
|
|
81
|
+
If there is a schema validation error the appropriate error code is automatically returned.
|
|
82
|
+
|
|
83
|
+
~~~ python
|
|
84
|
+
status, _, content_bytes = application.request('GET', '/sum_numbers')
|
|
85
|
+
|
|
86
|
+
'400 Bad Request'
|
|
87
|
+
b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
|
|
88
|
+
~~~
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## API Documentation
|
|
92
|
+
|
|
93
|
+
You can add API documentation to your application by adding the Chisel documentation application
|
|
94
|
+
requests from
|
|
95
|
+
[create_doc_requests](https://craigahobbs.github.io/chisel/request.html#chisel.create_doc_requests).
|
|
96
|
+
|
|
97
|
+
~~~ python
|
|
98
|
+
application = chisel.Application()
|
|
99
|
+
application.add_requests(chisel.create_doc_requests())
|
|
100
|
+
~~~
|
|
101
|
+
|
|
102
|
+
By default the documentation application is hosted at "/doc/". An example of of Chisel's documentation output is
|
|
103
|
+
available [here](https://craigahobbs.github.io/chisel/example/#var.vName='chisel_doc_request').
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
This package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).
|
|
109
|
+
It was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:
|
|
110
|
+
|
|
111
|
+
~~~ sh
|
|
112
|
+
template-specialize python-template/template/ chisel/ -k package chisel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k nomain 1
|
|
113
|
+
~~~
|
chisel-1.2.5/PKG-INFO
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: chisel
|
|
3
|
-
Version: 1.2.5
|
|
4
|
-
Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
|
|
5
|
-
Home-page: https://github.com/craigahobbs/chisel
|
|
6
|
-
Author: Craig A. Hobbs
|
|
7
|
-
Author-email: craigahobbs@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Keywords: api,json,framework,schema,wsgi
|
|
10
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
|
|
20
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
21
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
|
-
Description-Content-Type: text/x-rst
|
|
23
|
-
License-File: LICENSE
|
|
24
|
-
Requires-Dist: schema-markdown>=1.2.0
|
|
25
|
-
|
|
26
|
-
chisel
|
|
27
|
-
======
|
|
28
|
-
|
|
29
|
-
.. |badge-status| image:: https://img.shields.io/pypi/status/chisel
|
|
30
|
-
:alt: PyPI - Status
|
|
31
|
-
:target: https://pypi.python.org/pypi/chisel/
|
|
32
|
-
|
|
33
|
-
.. |badge-version| image:: https://img.shields.io/pypi/v/chisel
|
|
34
|
-
:alt: PyPI
|
|
35
|
-
:target: https://pypi.python.org/pypi/chisel/
|
|
36
|
-
|
|
37
|
-
.. |badge-license| image:: https://img.shields.io/github/license/craigahobbs/chisel
|
|
38
|
-
:alt: GitHub
|
|
39
|
-
:target: https://github.com/craigahobbs/chisel/blob/main/LICENSE
|
|
40
|
-
|
|
41
|
-
.. |badge-python| image:: https://img.shields.io/pypi/pyversions/chisel
|
|
42
|
-
:alt: PyPI - Python Version
|
|
43
|
-
:target: https://www.python.org/downloads/
|
|
44
|
-
|
|
45
|
-
|badge-status| |badge-version| |badge-license| |badge-python|
|
|
46
|
-
|
|
47
|
-
Chisel is a light-weight Python WSGI application framework built for creating well-documented,
|
|
48
|
-
schema-validated JSON web APIs.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Links
|
|
52
|
-
-----
|
|
53
|
-
|
|
54
|
-
- `API Documentation <https://craigahobbs.github.io/chisel/>`__
|
|
55
|
-
- `Source code <https://github.com/craigahobbs/chisel>`__
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
JSON APIs
|
|
59
|
-
---------
|
|
60
|
-
|
|
61
|
-
Chisel provides the `action <https://craigahobbs.github.io/chisel/action.html#chisel.action>`__
|
|
62
|
-
decorator for easily implementing schema-validated JSON APIs.
|
|
63
|
-
|
|
64
|
-
>>> @chisel.action(spec='''
|
|
65
|
-
... # Sum a list of numbers
|
|
66
|
-
... action sum_numbers
|
|
67
|
-
... urls
|
|
68
|
-
... GET
|
|
69
|
-
...
|
|
70
|
-
... query
|
|
71
|
-
... # The list of numbers
|
|
72
|
-
... float[len > 0] numbers
|
|
73
|
-
...
|
|
74
|
-
... output
|
|
75
|
-
... # The sum of the numbers
|
|
76
|
-
... float sum
|
|
77
|
-
... ''')
|
|
78
|
-
... def sum_numbers(ctx, req):
|
|
79
|
-
... return {'sum': sum(req['numbers'])}
|
|
80
|
-
...
|
|
81
|
-
>>> application = chisel.Application()
|
|
82
|
-
>>> application.add_request(sum_numbers)
|
|
83
|
-
>>> application.request('GET', '/sum_numbers', query_string='numbers.0=1&numbers.1=2&numbers.2=4')
|
|
84
|
-
('200 OK', [('Content-Type', 'application/json')], b'{"sum":7.0}')
|
|
85
|
-
|
|
86
|
-
Each action defines an ``action`` definition using
|
|
87
|
-
`Schema Markdown <https://craigahobbs.github.io/schema-markdown-js/language/>`__.
|
|
88
|
-
The action callback is passed two arguments, a request
|
|
89
|
-
`Context <https://craigahobbs.github.io/chisel/app.html#chisel.Context>`__
|
|
90
|
-
and the schema-validated request input dictionary. The input request dictionary is created by
|
|
91
|
-
combining the request's URL path parameters, query string parameters, and input JSON content
|
|
92
|
-
parameters.
|
|
93
|
-
|
|
94
|
-
If there is a schema validation error the appropriate error code is automatically returned.
|
|
95
|
-
|
|
96
|
-
>>> status, _, content_bytes = application.request('GET', '/sum_numbers')
|
|
97
|
-
>>> status
|
|
98
|
-
'400 Bad Request'
|
|
99
|
-
|
|
100
|
-
>>> content_bytes
|
|
101
|
-
b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
API Documentation
|
|
105
|
-
-----------------
|
|
106
|
-
|
|
107
|
-
You can add API documentation to your application by adding the Chisel documentation application
|
|
108
|
-
requests from
|
|
109
|
-
`create_doc_requests <https://craigahobbs.github.io/chisel/request.html#chisel.create_doc_requests>`__.
|
|
110
|
-
|
|
111
|
-
>>> application = chisel.Application()
|
|
112
|
-
>>> application.add_requests(chisel.create_doc_requests())
|
|
113
|
-
|
|
114
|
-
By default the documentation application is hosted at "/doc/". An example of of Chisel's documentation output is
|
|
115
|
-
available `here <https://craigahobbs.github.io/chisel/example/#var.vName='chisel_doc_request'>`__.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
Development
|
|
119
|
-
-----------
|
|
120
|
-
|
|
121
|
-
This package is developed using `python-build <https://github.com/craigahobbs/python-build#readme>`__.
|
|
122
|
-
It was started using `python-template <https://github.com/craigahobbs/python-template#readme>`__ as follows:
|
|
123
|
-
|
|
124
|
-
.. code-block:: sh
|
|
125
|
-
|
|
126
|
-
template-specialize python-template/template/ chisel/ -k package chisel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k nomain 1
|
chisel-1.2.5/README.rst
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
chisel
|
|
2
|
-
======
|
|
3
|
-
|
|
4
|
-
.. |badge-status| image:: https://img.shields.io/pypi/status/chisel
|
|
5
|
-
:alt: PyPI - Status
|
|
6
|
-
:target: https://pypi.python.org/pypi/chisel/
|
|
7
|
-
|
|
8
|
-
.. |badge-version| image:: https://img.shields.io/pypi/v/chisel
|
|
9
|
-
:alt: PyPI
|
|
10
|
-
:target: https://pypi.python.org/pypi/chisel/
|
|
11
|
-
|
|
12
|
-
.. |badge-license| image:: https://img.shields.io/github/license/craigahobbs/chisel
|
|
13
|
-
:alt: GitHub
|
|
14
|
-
:target: https://github.com/craigahobbs/chisel/blob/main/LICENSE
|
|
15
|
-
|
|
16
|
-
.. |badge-python| image:: https://img.shields.io/pypi/pyversions/chisel
|
|
17
|
-
:alt: PyPI - Python Version
|
|
18
|
-
:target: https://www.python.org/downloads/
|
|
19
|
-
|
|
20
|
-
|badge-status| |badge-version| |badge-license| |badge-python|
|
|
21
|
-
|
|
22
|
-
Chisel is a light-weight Python WSGI application framework built for creating well-documented,
|
|
23
|
-
schema-validated JSON web APIs.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Links
|
|
27
|
-
-----
|
|
28
|
-
|
|
29
|
-
- `API Documentation <https://craigahobbs.github.io/chisel/>`__
|
|
30
|
-
- `Source code <https://github.com/craigahobbs/chisel>`__
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
JSON APIs
|
|
34
|
-
---------
|
|
35
|
-
|
|
36
|
-
Chisel provides the `action <https://craigahobbs.github.io/chisel/action.html#chisel.action>`__
|
|
37
|
-
decorator for easily implementing schema-validated JSON APIs.
|
|
38
|
-
|
|
39
|
-
>>> @chisel.action(spec='''
|
|
40
|
-
... # Sum a list of numbers
|
|
41
|
-
... action sum_numbers
|
|
42
|
-
... urls
|
|
43
|
-
... GET
|
|
44
|
-
...
|
|
45
|
-
... query
|
|
46
|
-
... # The list of numbers
|
|
47
|
-
... float[len > 0] numbers
|
|
48
|
-
...
|
|
49
|
-
... output
|
|
50
|
-
... # The sum of the numbers
|
|
51
|
-
... float sum
|
|
52
|
-
... ''')
|
|
53
|
-
... def sum_numbers(ctx, req):
|
|
54
|
-
... return {'sum': sum(req['numbers'])}
|
|
55
|
-
...
|
|
56
|
-
>>> application = chisel.Application()
|
|
57
|
-
>>> application.add_request(sum_numbers)
|
|
58
|
-
>>> application.request('GET', '/sum_numbers', query_string='numbers.0=1&numbers.1=2&numbers.2=4')
|
|
59
|
-
('200 OK', [('Content-Type', 'application/json')], b'{"sum":7.0}')
|
|
60
|
-
|
|
61
|
-
Each action defines an ``action`` definition using
|
|
62
|
-
`Schema Markdown <https://craigahobbs.github.io/schema-markdown-js/language/>`__.
|
|
63
|
-
The action callback is passed two arguments, a request
|
|
64
|
-
`Context <https://craigahobbs.github.io/chisel/app.html#chisel.Context>`__
|
|
65
|
-
and the schema-validated request input dictionary. The input request dictionary is created by
|
|
66
|
-
combining the request's URL path parameters, query string parameters, and input JSON content
|
|
67
|
-
parameters.
|
|
68
|
-
|
|
69
|
-
If there is a schema validation error the appropriate error code is automatically returned.
|
|
70
|
-
|
|
71
|
-
>>> status, _, content_bytes = application.request('GET', '/sum_numbers')
|
|
72
|
-
>>> status
|
|
73
|
-
'400 Bad Request'
|
|
74
|
-
|
|
75
|
-
>>> content_bytes
|
|
76
|
-
b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
API Documentation
|
|
80
|
-
-----------------
|
|
81
|
-
|
|
82
|
-
You can add API documentation to your application by adding the Chisel documentation application
|
|
83
|
-
requests from
|
|
84
|
-
`create_doc_requests <https://craigahobbs.github.io/chisel/request.html#chisel.create_doc_requests>`__.
|
|
85
|
-
|
|
86
|
-
>>> application = chisel.Application()
|
|
87
|
-
>>> application.add_requests(chisel.create_doc_requests())
|
|
88
|
-
|
|
89
|
-
By default the documentation application is hosted at "/doc/". An example of of Chisel's documentation output is
|
|
90
|
-
available `here <https://craigahobbs.github.io/chisel/example/#var.vName='chisel_doc_request'>`__.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Development
|
|
94
|
-
-----------
|
|
95
|
-
|
|
96
|
-
This package is developed using `python-build <https://github.com/craigahobbs/python-build#readme>`__.
|
|
97
|
-
It was started using `python-template <https://github.com/craigahobbs/python-template#readme>`__ as follows:
|
|
98
|
-
|
|
99
|
-
.. code-block:: sh
|
|
100
|
-
|
|
101
|
-
template-specialize python-template/template/ chisel/ -k package chisel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k nomain 1
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: chisel
|
|
3
|
-
Version: 1.2.5
|
|
4
|
-
Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
|
|
5
|
-
Home-page: https://github.com/craigahobbs/chisel
|
|
6
|
-
Author: Craig A. Hobbs
|
|
7
|
-
Author-email: craigahobbs@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Keywords: api,json,framework,schema,wsgi
|
|
10
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
|
|
20
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
21
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
|
-
Description-Content-Type: text/x-rst
|
|
23
|
-
License-File: LICENSE
|
|
24
|
-
Requires-Dist: schema-markdown>=1.2.0
|
|
25
|
-
|
|
26
|
-
chisel
|
|
27
|
-
======
|
|
28
|
-
|
|
29
|
-
.. |badge-status| image:: https://img.shields.io/pypi/status/chisel
|
|
30
|
-
:alt: PyPI - Status
|
|
31
|
-
:target: https://pypi.python.org/pypi/chisel/
|
|
32
|
-
|
|
33
|
-
.. |badge-version| image:: https://img.shields.io/pypi/v/chisel
|
|
34
|
-
:alt: PyPI
|
|
35
|
-
:target: https://pypi.python.org/pypi/chisel/
|
|
36
|
-
|
|
37
|
-
.. |badge-license| image:: https://img.shields.io/github/license/craigahobbs/chisel
|
|
38
|
-
:alt: GitHub
|
|
39
|
-
:target: https://github.com/craigahobbs/chisel/blob/main/LICENSE
|
|
40
|
-
|
|
41
|
-
.. |badge-python| image:: https://img.shields.io/pypi/pyversions/chisel
|
|
42
|
-
:alt: PyPI - Python Version
|
|
43
|
-
:target: https://www.python.org/downloads/
|
|
44
|
-
|
|
45
|
-
|badge-status| |badge-version| |badge-license| |badge-python|
|
|
46
|
-
|
|
47
|
-
Chisel is a light-weight Python WSGI application framework built for creating well-documented,
|
|
48
|
-
schema-validated JSON web APIs.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Links
|
|
52
|
-
-----
|
|
53
|
-
|
|
54
|
-
- `API Documentation <https://craigahobbs.github.io/chisel/>`__
|
|
55
|
-
- `Source code <https://github.com/craigahobbs/chisel>`__
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
JSON APIs
|
|
59
|
-
---------
|
|
60
|
-
|
|
61
|
-
Chisel provides the `action <https://craigahobbs.github.io/chisel/action.html#chisel.action>`__
|
|
62
|
-
decorator for easily implementing schema-validated JSON APIs.
|
|
63
|
-
|
|
64
|
-
>>> @chisel.action(spec='''
|
|
65
|
-
... # Sum a list of numbers
|
|
66
|
-
... action sum_numbers
|
|
67
|
-
... urls
|
|
68
|
-
... GET
|
|
69
|
-
...
|
|
70
|
-
... query
|
|
71
|
-
... # The list of numbers
|
|
72
|
-
... float[len > 0] numbers
|
|
73
|
-
...
|
|
74
|
-
... output
|
|
75
|
-
... # The sum of the numbers
|
|
76
|
-
... float sum
|
|
77
|
-
... ''')
|
|
78
|
-
... def sum_numbers(ctx, req):
|
|
79
|
-
... return {'sum': sum(req['numbers'])}
|
|
80
|
-
...
|
|
81
|
-
>>> application = chisel.Application()
|
|
82
|
-
>>> application.add_request(sum_numbers)
|
|
83
|
-
>>> application.request('GET', '/sum_numbers', query_string='numbers.0=1&numbers.1=2&numbers.2=4')
|
|
84
|
-
('200 OK', [('Content-Type', 'application/json')], b'{"sum":7.0}')
|
|
85
|
-
|
|
86
|
-
Each action defines an ``action`` definition using
|
|
87
|
-
`Schema Markdown <https://craigahobbs.github.io/schema-markdown-js/language/>`__.
|
|
88
|
-
The action callback is passed two arguments, a request
|
|
89
|
-
`Context <https://craigahobbs.github.io/chisel/app.html#chisel.Context>`__
|
|
90
|
-
and the schema-validated request input dictionary. The input request dictionary is created by
|
|
91
|
-
combining the request's URL path parameters, query string parameters, and input JSON content
|
|
92
|
-
parameters.
|
|
93
|
-
|
|
94
|
-
If there is a schema validation error the appropriate error code is automatically returned.
|
|
95
|
-
|
|
96
|
-
>>> status, _, content_bytes = application.request('GET', '/sum_numbers')
|
|
97
|
-
>>> status
|
|
98
|
-
'400 Bad Request'
|
|
99
|
-
|
|
100
|
-
>>> content_bytes
|
|
101
|
-
b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
API Documentation
|
|
105
|
-
-----------------
|
|
106
|
-
|
|
107
|
-
You can add API documentation to your application by adding the Chisel documentation application
|
|
108
|
-
requests from
|
|
109
|
-
`create_doc_requests <https://craigahobbs.github.io/chisel/request.html#chisel.create_doc_requests>`__.
|
|
110
|
-
|
|
111
|
-
>>> application = chisel.Application()
|
|
112
|
-
>>> application.add_requests(chisel.create_doc_requests())
|
|
113
|
-
|
|
114
|
-
By default the documentation application is hosted at "/doc/". An example of of Chisel's documentation output is
|
|
115
|
-
available `here <https://craigahobbs.github.io/chisel/example/#var.vName='chisel_doc_request'>`__.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
Development
|
|
119
|
-
-----------
|
|
120
|
-
|
|
121
|
-
This package is developed using `python-build <https://github.com/craigahobbs/python-build#readme>`__.
|
|
122
|
-
It was started using `python-template <https://github.com/craigahobbs/python-template#readme>`__ as follows:
|
|
123
|
-
|
|
124
|
-
.. code-block:: sh
|
|
125
|
-
|
|
126
|
-
template-specialize python-template/template/ chisel/ -k package chisel -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k nomain 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|