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.5.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.5.tar.gz.

File metadata

File hashes

Hashes for jupyterlite_simple_cors_proxy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 db1a795f8e751af47837ca4816166f24ece5a556e0b257e30c50a13f851c4857
MD5 5597718c3d209dae5f1e9af3f8eaee45
BLAKE2b-256 f22ac7a778ed8961a1a6b118fb6248f496622e328a54683d9da554a9cb907b81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterlite_simple_cors_proxy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2232ecdb5410cfa228f21bd161f5b7fee04432201d50833ef2742e9fa7da8ef7
MD5 14668ede9b8527c8434a78608e419c21
BLAKE2b-256 393980a7810d362ced173709dfe20a23e1ec4bfc69943668ac8b14992bcf7bf1

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