Linking the Requests and WebTest libraries together, pyriform allows you to use the requests library to interact your WSGI app without needing to have it running on the network; it bonds these two web components together.
It’s useful for testing purposes, handles all standard HTTP methods (as well as custom ones), supports request timeouts. and is both Python 2 and 3 compatible.
Example Usage
Here’s an example with a small WSGI app (in this case, using CherryPy), and how we can use Pyriform to connect to it:
>>> # Create the WSGI app.
>>>
>>> import cherrypy
>>>
>>> class SayHello(object):
...
... @cherrypy.expose
... def default(self, word):
... return "Hello %s from %s!" % (word, cherrypy.request.headers['X-Location'])
...
>>> cherrypy.config.update({'environment': 'embedded'}) # Suppress logging output.
>>> app = cherrypy.tree.mount(SayHello(), '/')
>>>
>>> # Now use Pyriform to map requests from a particular URL to this app.
>>>
>>> import pyriform
>>> import requests
>>> adapter = pyriform.WSGIAdapter(app)
>>> session = requests.Session()
>>> session.mount('http://helloapp/', adapter)
>>> resp = session.get('http://helloapp/World', headers={'X-Location': 'London'})
>>> print (resp.text)
Hello World from London!
You can browse the source code and file bug reports at the project repository. Full documentation can be found here.
Metadata
Release files for pyriform 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyriform-0.5.tar.gz | 6.2 kB | Without provenance | Details for pyriform-0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyriform-0.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for pyriform-0.5-py2.py3-none-any.whl |
Total release size: 14.4 kB
Release files / pyriform-0.5.tar.gz
| Download URL | pyriform-0.5.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df9f40cbd9a4d20bb16ff64480e561f0375d663d931cbddbe2fefea5d6fdd116
|
|
BLAKE2b-256 checksum How to use checksums |
f50b6c0140d16cb2fd8f9a8c217c82a2ffa7c2e4e1c597f0d19ba16bb733d8e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyriform-0.5-py2.py3-none-any.whl
| Download URL | pyriform-0.5-py2.py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
1474d41f8a7da1a8c86c12a72795b880e0f74198c68e05276256a37878e61028
|
|
BLAKE2b-256 checksum How to use checksums |
88a5bc248993237a564976b28a494f8a2ad36621f32b427d95a7985b413447ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyriform 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.