How to use the sma.files.save_image function in sma

To help you get started, we’ve selected a few sma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sdockray / sma / sma / sponge.py View on Github external
def image(url, force=False):
	if force or not os.path.exists(files.get_image_path(url)):
		response = requests.get(url, stream=True)
		path = files.save_image(response, url)
		del response
		return path
	else:
		return files.get_image_path(url)