Skip to content

Instantly share code, notes, and snippets.

@Viveckh
Created February 18, 2020 00:58
Show Gist options
  • Save Viveckh/6f87ae263d260e42701b62643ae48c44 to your computer and use it in GitHub Desktop.
Save Viveckh/6f87ae263d260e42701b62643ae48c44 to your computer and use it in GitHub Desktop.
HiPlot Experiment Fetcher for loading local csv experiments
import hiplot as hip
def fetch_local_csv_experiment(uri):
# Only apply this fetcher if the URI starts with webxp://
PREFIX="localcsvxp://"
if not uri.startswith(PREFIX):
# Let other fetchers handle this one
raise hip.ExperimentFetcherDoesntApply()
# Parse out the local file path from the uri
local_path = uri[len(PREFIX):] # Remove the prefix
# Return the hiplot experiment to render
return hip.Experiment.from_csv(local_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment