Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterlite_simple_cors_proxy-0.1.7.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyterlite_simple_cors_proxy-0.1.7-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file jupyterlite_simple_cors_proxy-0.1.7.tar.gz.

File metadata

File hashes

Hashes for jupyterlite_simple_cors_proxy-0.1.7.tar.gz
Algorithm Hash digest
SHA256 dbb586f2ed3ed965a654b3282f42f1d4cb35ac07df4544abda333e335ba556cc
MD5 e00754985ae7f776360562943a06daff
BLAKE2b-256 02aceae186e7c12503e76d119e85eab0f7ed70dd141fcdbcb0d712e5843e6f22

See more details on using hashes here.

File details

Details for the file jupyterlite_simple_cors_proxy-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlite_simple_cors_proxy-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 45630854a715150e273d5135cac138a62a90931d3217a09b0eae29fd02590533
MD5 ebf47024e3f47a2a687e43190737756a
BLAKE2b-256 71d1d2779482a9d189485056d972d1d2f507517b414e3be5bece4647807e77fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page