Download the PHP package chrismou/echonest without Composer

On this page you can find all versions of the php package chrismou/echonest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package echonest

PHP Echonest API Wrapper

Build Status Test Coverage Code Climate Buy me a beer

A dead simple wrapper class for the echonest API.

Includes support for Guzzle 6, options for max number of attempts before giving up, and a auto rate limiter which spaces out requests based on the number of API requests remaining for that minute.

Install

For composer based projects:

Usage

First you need an Echonest API key. You can obtain one by signing up here: https://developer.echonest.com/account/register

To set up the echonest API client:

(you can also pass a PSR-3 compliant logger as a third argument - see below for more details)

GET requests

In most cases, this is the only method you'll need to use.

Virtually all requests to Echonest are GET requests, so the simplest way to use this client is to use the get helper function. The format for this is:

So, if you wanted to get all images for Cher, you could run:

Or if you wanted Artist by a specific genre, you could run:

You can also specify 'buckets' as a way of returning multiple sets of data within the same API query. To request them in the request, you can do the following:

POST requests

A couple of the Echonest endpoints require a POST requests:

Building a custom request

In some cases, you may want to take advantage of the extra options. The format for these requests is as follows:

Refer to the Echonest API documentation for a full list of available endpoints, parameters, buckets and example responses. This wrapper is designed to support virtually all endpoints out of the box, so you should be safe to use whichever ones you need.

Rate limiting

Echonest implements rate limiting, so if you make too many requests within a minute it'll stop you connecting until the minute is up and your limit is reset (the number of requests you get depends on your Echonest account type - if you're in need of more than the default, drop them an email).

This wrapper supports auto rate limiting at the client end, thanks to Echonest returning the number of requests left in the response headers. It does this by checking the number left after each request and the amount of time you have to make these requests, and calculates a suitable wait time between each request. In essence, it tries to space the available requests out over the minute, rather than pounding the API over 20 seconds and then sitting dormant for 40 seconds waiting for the reset.

In some cases, you may want to override this (say, if you know you're only making a total of 20 requests and would rather just run them ASAP rather than space them over 1 minute), which you can do by specifying as the 4 parameter in the method call.

For example:

Logging

Optionally, you can pass a PSR-3 compliant logger as the third constructor argument to the client, as long as it implements the \Psr\Log interface (ie, Monolog). By passing this in, some basic logging will automatically be enabled, such a the reason for connection failures, etc.

The echonest client assumes the logger has already been properly configured, so you'll need to do this before passing it in. For more information on configuring Monolog for use with this class, see the usage documentation.

Tests

To run the unit test suite:

If you use docker, you can also run the test suite against all supported PHP versions:

License

Released under the MIT License. See LICENSE.


All versions of echonest with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
guzzlehttp/guzzle Version ~6.0
psr/log Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chrismou/echonest contains the following files

Loading the files please wait ....