Skip to content

Instantly share code, notes, and snippets.

View boyank's full-sized avatar

Boyan Kolev boyank

  • Bulgaria, Sofia
View GitHub Profile
# 15 statement in this Fiona script, 12 after I move the prop_type function to Fiona.
# Compare to 31 statements for the ogr.py script at
# http://pcjericks.github.io/py-gdalogr-cookbook/layers.html#create-a-new-shapefile-and-add-data.
# The difference is that Fiona's schema and feature definition are declarative (using dict
# literals and comprehensions, not imperative (CreateField, SetField, etc) and that Fiona
# is designed to allow concise code.
from csv import DictReader
import fiona
from fiona.crs import from_epsg
@gpiancastelli
gpiancastelli / goodreads-oauth-example.py
Created August 19, 2010 13:50
A Python example of how to use OAuth on GoodReads
import oauth2 as oauth
import urlparse
url = 'http://www.goodreads.com'
request_token_url = '%s/oauth/request_token/' % url
authorize_url = '%s/oauth/authorize/' % url
access_token_url = '%s/oauth/access_token/' % url
consumer = oauth.Consumer(key='Your-GoodReads-Key',
secret='Your-GoodReads-Secret')