Download the PHP package mbagnall/gov-info without Composer
On this page you can find all versions of the php package mbagnall/gov-info. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mbagnall/gov-info
More information about mbagnall/gov-info
Files in mbagnall/gov-info
Package gov-info
Short Description A fork for a library for using api.govinfo.gov. Compatible with Drupal 9 until it can use console 5
License MIT
Homepage https://github.com/ElusiveMind/gov-info
Informations about the package gov-info
GOVINFO: PHP library for accessing api.govinfo.gov
This alpha stage package provides a very simple way to access api.govinfo.gov
See console demo
Install
You can install this package via composer.
Usage
Retrieve an index of all collections available
After running this code $result
will contain a non-truncated version of collections:
Retrieve all packages in a collection
After running this code $result
will contain a non-truncated version of packages:
Retrieve a specific package in a collection.
After running this code $result
will contain the requested package
Retrieve a summary of a package.
After running this code $result
will contain a non-truncated version of the package summary
Retrieve a package as a specified content-type
After running this code $result
will be an instance of GuzzleHttp\Psr7\Response
For additional usage examples, please look at src/Console
and tests
.
Console
There is a minimalist console application that can be used, but its not designed for production use.
I built this so I could easily regression test the library against the production API. Each command
will prompt you for an API key. To avoid this prompt you can create a local apiKey.txt
file with your
API key in there.
Testing
License
The MIT License (MIT). Please see License File for more information.