Download the PHP package streams-sro/gaston without Composer

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

Gaston API Client (PHP)

A small, dependency-free PHP client for the Gaston API: transcription, translation and full-text search of sentences within transcribed recordings.

Requires a Gaston account and an API token (see Configuration).

This is a PHP port of the official Python client and tracks the same API.

Requirements

No third-party runtime dependencies.

Installation

Quick start

The constructor signature is:

Configuration

Generate an API token in the Gaston app under Settings -> API. Full endpoint documentation is available at https://www.gaston.live/en/api.

The token can be supplied directly or via the GASTON_API_TOKEN environment variable:

Argument Environment variable Default
$token GASTON_API_TOKEN (required)

Timeouts

Ordinary requests use a 30s timeout. The file upload in transcribe() and audio exports can take minutes for large files, so they use a separate, more generous $uploadTimeout (default 600s). All timeouts are in seconds; pass 0 to wait indefinitely.

transcribe() accepts either a file path or an open stream resource:

Exporting

exportMedia() returns the file in memory as a MediaExport (->content, ->filename, ->contentType, plus ->save($path)), while exportMediaToFile() streams it straight to disk. Use exportMediaToFile() for audio.

The full signatures are:

$lang defaults to the media's original language. $maxWordsPerBlock and $includeSpeakers only apply to srt. Exporting audio, or any media longer than 30 minutes, requires a paid plan; otherwise an AuthenticationException (HTTP 403) is thrown. Audio exports use the client's $uploadTimeout by default. exportMediaToFile() downloads to a temporary file next to the target first, so a failed export never leaves a partial file behind. The supported formats are listed in Languages::EXPORT_FORMATS.

Directories

Search

$client->search($query, $from = 0, $max = 50, $dirIds = null, $lang = null, $mediaId = null) runs a full-text search over every sentence in your transcribed media.

Query syntax

The query supports a subset of the Lucene query_string syntax:

Feature Example Notes
Boolean AND cats AND dogs both terms must appear
Boolean OR cats OR dogs either term
Boolean NOT cats NOT dogs exclude a term
Grouping (cats OR dogs) AND vet combine operators with parentheses
Exact phrase "climate change" quoted terms match as a phrase
Trailing wildcard transcri* matches transcribe, transcription...

Leading wildcards (*tion), field selectors, fuzzy (~), boosts (^) and ranges are not supported and are stripped server-side. Queries must be at least 3 characters.

Filtering and pagination

Reading results

search() returns a SearchResults object. Iterate it for hits, or read ->total for the overall match count. Each hit is an array with:

Error handling

All failures throw a subclass of GastonException:

Exception Trigger
AuthenticationException HTTP 403, invalid token / disabled user
BadRequestException HTTP 400, invalid parameters
NotFoundException HTTP 404, resource not found
RateLimitException HTTP 429, usage limit exceeded
ExternalServiceException HTTP 502, an external dependency failed upstream
GastonApiException any other API error

Every API exception carries ->getStatusCode(), ->getMessage(), ->getDetails() and the raw ->getPayload(). GastonException is the base class for all of the above (including transport-level failures).

Supported languages

Development

The test suite uses PHPUnit (a dev-only dependency; the library itself has none):

License

MIT - see LICENSE.


All versions of gaston with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-curl Version *
ext-json Version *
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 streams-sro/gaston contains the following files

Loading the files please wait ...