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.6.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for jupyterlite_simple_cors_proxy-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f55994a8251324d091e9c603cf887b00f05116fdfcb9715a80fea07fe570b69d
MD5 0edd903a4b095f54b1c38f0f949cc1ed
BLAKE2b-256 05a4b9902921469a8e1ad52a9e619e3e52467c17dae829deafd068c4d80f9f15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterlite_simple_cors_proxy-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1abd1f91147e1ab1f5c0a82b6be74fba3b68e1b6d9269e98da8da1f08023eb41
MD5 73f4bdf432e926ce75f4018105e59073
BLAKE2b-256 1245f080b4e1368d305b76824cd838d826d6ef46d02a1985b491768a1f2109d9

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