A simple CORS proxy utility with requests-like response
Project description
jupyterlite-simple-cors-proxy
Simple CORS proxy for making http requests from JupyterLite
Installation
pip install jupyterlite-simple-cors-proxy
Usage
from jupyterlite_simple_cors_proxy.proxy import cors_proxy_get, robust_get_request, furl, xurl
# Set up
url = "https://api.example.com/data"
# Optional params
params = {"key": "value"}
# Get a cross-origin proxied url
cross_origin_url = xurl(url) # xurl(url, params)
# Get a file like object
# (Make the request, then create a file like object
# from the response)
file_ob = furl(url) # furl(url, params)
# Make a request
response = cors_proxy_get(url, params)
# Use like requests
print(response.text)
data = response.json()
raw = response.content
The robust_get_request() will first try a simple request, then a proxied request: robust_get_request(url, params)
Features
- Simple CORS proxy wrapper
- Requests response object
- Support for URL parameters
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupyterlite_simple_cors_proxy-0.1.7.tar.gz.
File metadata
- Download URL: jupyterlite_simple_cors_proxy-0.1.7.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbb586f2ed3ed965a654b3282f42f1d4cb35ac07df4544abda333e335ba556cc
|
|
| MD5 |
e00754985ae7f776360562943a06daff
|
|
| BLAKE2b-256 |
02aceae186e7c12503e76d119e85eab0f7ed70dd141fcdbcb0d712e5843e6f22
|
File details
Details for the file jupyterlite_simple_cors_proxy-0.1.7-py3-none-any.whl.
File metadata
- Download URL: jupyterlite_simple_cors_proxy-0.1.7-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45630854a715150e273d5135cac138a62a90931d3217a09b0eae29fd02590533
|
|
| MD5 |
ebf47024e3f47a2a687e43190737756a
|
|
| BLAKE2b-256 |
71d1d2779482a9d189485056d972d1d2f507517b414e3be5bece4647807e77fa
|