資源簡介
python-win-votesmart
代碼片段和文件信息
“““?Python?library?for?interacting?with?Project?Vote?Smart?API.
????Project?Vote?Smart‘s?API?(http://www.votesmart.org/services_api.php)
????provides?rich?biographical?data?including?data?on?votes?committee
????assignments?and?much?more.
“““
__author__?=?“James?Turk?“
__version__?=?“0.3.4“
__copyright__?=?“Copyright?(c)?2016?Project?Vote?Smart“
__license__?=?“BSD“
import?urllib?urllib.errorurllib.request
try:
????import?json
except?ImportError:
????import?simplejson?as?json
class?VotesmartApiError(Exception):
????“““?Exception?for?Sunlight?API?errors?“““
class?VotesmartApiobject(object):
????def?__init__(self?d):
????????self.__dict__?=?d
????def?__repr__(self):
????????return?‘%s(%r)‘?%?(self.__class__.__name__?self.__dict__)
class?Address(objec
評論
共有 條評論