Download the PHP package algorithmia/algorithmia without Composer

On this page you can find all versions of the php package algorithmia/algorithmia. 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 algorithmia

Algorithmia Common Library (PHP)

PHP client library for accessing the Algorithmia API For API documentation, see the PHPDocs

Installation

Using the package manager Composer, run:

For non-Composer system, use the source

Authentication

First, create an Algorithmia client and authenticate with your API key. You must replace YOUR_API_KEY with your personal key:

Note that you can also set the api key as an environment variable:

Now you're ready to call AI algorithms from your code.

Calling algorithms

The following examples of calling algorithms are organized by type of input/output which vary between algorithms.

Note: a single algorithm may have different input and output types, or accept multiple types of input, so consult the algorithm's description for usage examples specific to that algorithm.

Text input/output

Call an algorithm with text input by simply passing a string into its pipe method. If the algorithm output is text, then the result field of the response will be a string.

You can also call algorithms asynchronously and get back a promise:

JSON input/output

Call an algorithm with JSON input by passing in any object that can be serialized to JSON such as strings or arrays. For algorithms that return JSON, the result field of the response will be the appropriate deserialized type.

Binary input/output

Call an algorithm with binary input by passing the binary file contents wrapped in an Algorithmia\ByteArray into the pipe method. Similarly, if the algorithm response is binary data, then the result field of the response will be binary.

Error handling

API errors and Algorithm exceptions will result in throwing an AlgoException:

Request options

The client exposes options that can configure algorithm requests. This includes support for changing the timeout or indicating that the API should include stdout in the response.

Working with data

The Algorithmia client also provides a way to manage both Algorithmia hosted data and data from Dropbox or S3 accounts that you've connected to you Algorithmia account.

List items in a directory

Work with a directory by instantiating a DataDirectory object.

Create directories

Create directories by instantiating a DataDirectory object and calling create().

Upload files to a directory

Upload files by calling put on a DataFile object, or by calling putFile on a DataDirectory object.

Note: you can also instantiate a DataFile by either $client->file('/path/to/file') or $client->dir('path')->file('filename')

Download contents of file

Download files by calling getString, getBytes, getJson, or getFile on a DataFile object:

Note: the getFile() method uses streams, so if you're getting large files, that's the way you'll want to do it to avoid memory issues.

Delete files and directories

Delete files and directories by calling delete on their respective DataFile or DataDirectory object. DataDirectories take an optional force parameter that indicates whether the directory should be deleted if it contains files or other directories.

Directory permissions

Directory permissions may be set when creating a directory, or may be updated on already existing directories.

Running the tests

Running the tests will connect to the Algorithmia server and execute a variety of connections and exercises to validate the client. You'll need to provide your API KEY to run the tests in a file called "apikey.txt" in the /tests directory. Just create that file and paste in your API KEY with nothing else in the file.

Then you can run the tests by executing: ./vendor/bin/phpunit -v tests

Reading the tests is also a great way to see code examples.

Enjoy!


All versions of algorithmia with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.3
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 algorithmia/algorithmia contains the following files

Loading the files please wait ....