2017 © Pedro Peláez
 

library soda-php

A simple library to make it easier to access SODA services from PHP

image

socrata/soda-php

A simple library to make it easier to access SODA services from PHP

  • Wednesday, October 11, 2017
  • by chrismetcalf
  • Repository
  • 65 Watchers
  • 52 Stars
  • 655 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 27 Forks
  • 6 Open issues
  • 5 Versions
  • 22 % Grown

The README.md

Build Status, (*1)

Socrata - Basic PHP Library

This library provides a simple wrapper for accessing some of the features of the Socrata Open Data API from PHP. Currently it supports HTTP GET, POST, and PUT operations., (*2)

The library is very simple. To access the Socrata API, you first instantiate a "Socrata" object, passing in the domain of the data site you wish to access. The library will also accept the full root path including the protocol (ex: http://data.medicare.gov). Then you can use its included methods to make simple API calls:, (*3)

Supported PHP versions

In order to access the SODA API via HTTPS, clients must now support the Server Name Indication (SNI) extension to the TLS protocol. What does this mean? It means that if you're using soda-php, you must use PHP 5.6 or above, as that is when PHP introduced support for SNI., (*4)

Install

Via composer, (*5)

``` bash composer require socrata/soda-php, (*6)


## Usage ```php $socrata = new Socrata("data.medicare.gov"); $response = $socrata->get("abcd-2345");

In your API calls, specify ether the full endpoint relative path (eg: /resource/abcd-2345.json), or the dataset ID (eg: abcd-2345)., (*7)

Querying

Simple filters and SoQL Queries can be passed as a parameter to the get function:, (*8)

$socrata = new Socrata("data.austintexas.gov", $app_token);

$params = array("\$where" => "within_circle(location, $latitude, $longitude, $range)");

$response = $socrata->get($view_uid, $params);

Publishing

To use the library to publish data you can use the PUT (replace) or POST (upsert) methods:, (*9)

$socrata = new Socrata("data.medicare.gov", $app_token, $user_name, $password);

// Publish data via 'upsert'
$response = $socrata->post("abcd-2345", $data_as_json);

// Publish data via 'replace'
$response = $socrata->put("abcd-2345", $data_as_json);

The library also includes a simple example application, which retrieves rows from a dataset and dumps them in a simple table., (*10)

License

Apache License, Version 2.0. Please see License File for more information., (*11)

The Versions

11/10 2017

dev-develop

dev-develop http://dev.socrata.com

A simple library to make it easier to access SODA services from PHP

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *
  • ext-json *
  • php >=5.3

 

The Development Requires

sdk open data soda socrata

01/06 2017

dev-master

9999999-dev http://dev.socrata.com

A simple library to make it easier to access SODA services from PHP

  Sources   Download

The Requires

  • php ~5.3
  • ext-curl *

 

soda socrata

21/09 2016

v1.1.0

1.1.0.0 http://dev.socrata.com

A simple library to make it easier to access SODA services from PHP

  Sources   Download

The Requires

  • php ~5.3
  • ext-curl *

 

soda socrata

21/09 2016

dev-chrismetcalf/travis

dev-chrismetcalf/travis http://dev.socrata.com

A simple library to make it easier to access SODA services from PHP

  Sources   Download

The Requires

  • php ~5.3
  • ext-curl *

 

soda socrata

21/10 2014

v1.0.5

1.0.5.0 http://dev.socrata.com

A simple library to make it easier to access SODA services from PHP

  Sources   Download

The Requires

  • php ~5.3
  • ext-curl *

 

soda socrata