REST API CALL
This python library is a REST API Call which generates REST URLs using attributes.",
As an example:
http://example.org/product/kart/customer?id=3&name=foo'
The URI path:
product/kart/customer?id=3&name=foo
with this python library is the sequence:
product.kart.customer(id='3', name='foo')
get()
You can perform the request (Cf. http://docs.python-requests.org/) with get():
>>> import restapicall
>>> conn = restapicall.ApiCall(endpoint='http://example.org')
>>> r = conn.product.kart.customer(id='3', name='foo').get()
>>> r.url
http://example.org/product/kart/customer?id=3&name=foo
>>> r.status_code
404
>>> r.headers['content-type']
'text/html; charset=UTF-8'
get_url()
the url can be get by get_url():
>>> import restapicall
>>> conn = restapicall.ApiCall(endpoint='http://example.org')
>>> r = conn.product(id='3').kart.customer(name='foo').get_url()
>>> print(r)
http://example.org/product/kart/customer?id=3&name=foo'
You can concatenate the attributes. That's exactly the same:
>>> conn = ApiCall(endpoint='http://example.org')
>>> r = conn.product.kart.customer(id='3', name='foo').get_url()
>>> print(r)
http://example.org/product/kart/customer?id=3&name=foo'
License
ISC
Author information
This code was created in 2019 by Olivier Locard.
Metadata
Release files for RestApiCall 1.0.0
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 |
|---|---|---|---|---|
| RestApiCall-1.0.0.tar.gz | 3.3 kB | Without provenance | Details for RestApiCall-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| RestApiCall-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for RestApiCall-1.0.0-py3-none-any.whl |
Total release size: 8.2 kB
Release files / RestApiCall-1.0.0.tar.gz
| Download URL | RestApiCall-1.0.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbbbc22c3080ed140bc54a5fbf3ec3e9e776b403d2b60a0958753cefc85ecf6a
|
|
BLAKE2b-256 checksum How to use checksums |
2babd379ebe53d5d8820f1e752dc7795bbbe50acff076b1e81c79a426e4ac949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / RestApiCall-1.0.0-py3-none-any.whl
| Download URL | RestApiCall-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1305ecc504c5b22a5dee460357d72f23b0552c9fbd964dfb60bc2d261a2baec
|
|
BLAKE2b-256 checksum How to use checksums |
75cf393b6ce3cac48085bca09650004e7c91a11e6578e499b0b996d370cbfbad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for RestApiCall 1.0.0
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.