Skip to content

Instantly share code, notes, and snippets.

View nickrsan's full-sized avatar

Nick Santos nickrsan

View GitHub Profile
@nickrsan
nickrsan / cawater-links.md
Last active February 16, 2021 03:04 — forked from jdherman/cawater-links.md
links for california water data
@nickrsan
nickrsan / python_toolbox_parameters_as_dict.py
Created February 23, 2017 21:22
A Decorator for ArcGIS Python toolbox tools (their execute function) that makes the "parameters" parameter into a dictionary indexed by parameter name
"""
A Decorator for ArcGIS Python toolbox tools (their execute function) that makes the "parameters" parameter'
into a dictionary indexed by parameter name.
"""
from functools import wraps
def parameters_as_dict(f):
@wraps(f)
def wrapper(*args, **kwargs):
@nickrsan
nickrsan / gcloud_storage_download.py
Created September 2, 2022 20:49
Download Items from Public Google Cloud Storage Bucket
import requests
import re
from pathlib import Path
def get_public_export_urls(bucket_name, prefix=""):
"""
Downloads items from a *public* Google Storage bucket without using a GCloud login. Filters only to files
with the specified prefix
:param bucket_name:
:param prefix: A prefix to use to filter items in the bucket - only URLs where the path matches this prefix will be returned - defaults to all files
@nickrsan
nickrsan / geopandas_in_the_browser.html
Last active June 1, 2023 12:51
A simple bit of code that uses PyScript and Piodide (under the hood) to run geopandas code in the browser. Not super interesting as is, but is a great starting point for further analysis and demos
<html>
<head>
<title>Mapping with PyScript</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
</head>
<body>
<py-config>