https://github.com/residentmario/pysocrata
Python module for interfacing with the Socrata open data catalog API.
https://github.com/residentmario/pysocrata
Last synced: about 1 year ago
JSON representation
Python module for interfacing with the Socrata open data catalog API.
- Host: GitHub
- URL: https://github.com/residentmario/pysocrata
- Owner: ResidentMario
- License: mit
- Created: 2017-01-05T19:16:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-12T19:30:16.000Z (almost 9 years ago)
- Last Synced: 2025-03-03T00:04:42.803Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## pysocrata [](https://pypi.python.org/pypi/pysocrata/) 
### About
`pysocrata` is a small Python module which provides an interface to the [Socrata](https://socrata.com/) open data
portal [catalog API](http://docs.socratadiscovery.apiary.io/).
It is *not* a binding for the [Socrata SODA API](https://dev.socrata.com/consumers/getting-started.html), which
implements direct access to data within individual dataset. For that, see [`sodapy`](https://github.com/xmunoz/sodapy)
or [`rsocrata`](https://github.com/Chicago/RSocrata). `pysocrata` instead provides a way of getting a list of *all*
datasets on a portal, for example, or of querying them for various dataset-level characteristics.
### Quickstart
In the following brief overview I take **domain** to mean the open data portal of interest (for example, the New York
City Open Data Portal, or the New York State Open Data Portal). An **endpoint** is a URL-accessible "thing" on a
Socrata open data portal. A **resource** (or data endpoint) is an endpoint which contains actual novel data; this
definition purposefully excludes endpoints which publish data filtered or remixed from another source. For instance,
in the case of a map-type endpoint that displays a sub-selection of data from a different geospatial type resource,
the originator is a *resource*, while the map endpoint is merely a *non-data endpoint*.
The methodology implemented in this module solves the surprisingly non-trivial problem of distinguishing between data
and non-data endpoints on a Socrata open data portal, which are not immediately differenciable in the Socrata catalog
API.
Keeping these definitions in mind, this module has two user-facing top-level methods:
* `pysocrata.get_resources(domain, token)` returns the metadata for every resource on a domain of interest.
* `pysocrata.count_resources(domain, token)` returns a counter of resources by type.
You may also peruse `pysocrata.get_endpoints_using_raw_json_emission` and `pysocrata.get_endpoints_using_catalog_api`
to fetch the raw catalog API streams.
### Further Reading
* [`socrata-portal-metadata`](https://github.com/ResidentMario/socrata-portal-metadata)
* [The anatomy of an open data portal](http://www.residentmar.io/2016/08/11/nyc-open-data-portal.html)