Client to talk with Pootle API v1 nicely
See. https://pootle.readthedocs.io/en/stable-2.5.1/api/index.html for more information about the API resources/data_structures this Client returns.
Eg. https://pootle.readthedocs.io/en/stable-2.5.1/api/api_project.html#get-a-project maps to Pootle::Resource::Project locally.
Perl 5.20 or newer with support for subroutine signatures
See Pootle::Cache, for how the simple caching system works to spare the Pootle-Server from abuse
See Pootle::Logger, for how to change Pootle::Client chattiness
my $papi = Pootle::Client->new({ baseUrl => 'http://translate.example.com', credentials => 'username:password' || 'credentials.txt'} ); my $languages = $papi->languages(); my $trnsProjs = $papi->searchTranslationProjects( $languages, Pootle::Filters->new({fullname => qr/^Project name/}) );
Instantiates a new Pootle::Client
$params HASHRef of parameters { baseUrl => 'http://translate.pootle.url', credentials => 'usename:password' || 'credentials.file.containing.credentials.txt', cacheFile => 'pootle-client.cache', } @returns Pootle::Client
This Client transparently handles authentication based on the credentials supplied. Use the following methods to make API requests.
@PARAM1 String, API endpoint to get the resource, eg. /api/v1/languages/124/ @RETURNS L<Pootle::Resource::Language>
@RETURNS ARRAYRef of L<Pootle::Resource::Language>, all languages in the Pootle database @CACHED Transiently
Uses the API to find all languages starting with the given country code
@PARAM1 L<Pootle::Filters> @RETURNS ARRAYRef of L<Pootle::Resource::Language>, all languages starting with the given code. @CACHED Persistently
@PARAM1 String, API endpoint to get the resource, eg. /api/v1/translation-projects/124/ @RETURNS L<Pootle::Resource::TranslationProject>
@UNIMPLEMENTED
This endpoint is unimplemented in the Pootle-Client. Maybe some day it becomes enabled. If it does, this should work out-of-box.
It might be better to use searchTranslationProjects() instead, since this API call can be really invasive to the Pootle-server. Really depends on how many translation projects you are after.
@RETURNS ARRAYRef of L<Pootle::Resource::TranslationProject>, all translation projects in the Pootle database @CACHED Transiently @THROWS L<Pootle::Exception::HTTP::MethodNotAllowed>
Uses the API to find all translation projects matching the given search expressions
@PARAM1 L<Pootle::Filters>, Used to select the desired objects @RETURNS ARRAYRef of L<Pootle::Resource::TranslationProject>. All matched translation projects. @CACHED Persistently @THROWS L<Pootle::Exception::HTTP::MethodNotAllowed>
@PARAM1 L<Pootle::Filters>, Filters to pick desired languages or ARRAYRef of L<Pootle::Resource::Language> @PARAM2 L<Pootle::Filters>, Filters to pick desired projects or ARRAYRef of L<Pootle::Resource::Project> @RETURNS ARRAYRef of L<Pootle::Resource::TranslationProject>, matching the given languages and projects @CACHED Persistently
@PARAM1 String, API endpoint to get the resource, eg. /api/v1/stores/77/ @RETURNS L<Pootle::Resource::Store>
@PARAM1 L<Pootle::Filters>, Filters to pick desired languages or ARRAYRef of L<Pootle::Resource::Language> @PARAM2 L<Pootle::Filters>, Filters to pick desired projects or ARRAYRef of L<Pootle::Resource::Project> @RETURNS ARRAYRef of L<Pootle::Resource::Store>, matching the given languages and projects
@PARAM1 String, API endpoint to get the project, eg. /api/v1/projects/124/ @RETURNS L<Pootle::Resource::Project>
@RETURNS ARRAYRef of L<Pootle::Resource::Project>, all projects in the Pootle database @CACHED Transiently
Uses the API to find all projects matching the given search expressions
@PARAM1 L<Pootle::Filters>, matching criteria for needed objects @RETURNS ARRAYRef of L<Pootle::Resource::Project>. All matched projects. @CACHED Persistently
@PARAM1 String, API endpoint to get the resource, eg. /api/v1/units/77/ @RETURNS L<Pootle::Resource::Unit>
Flushes all caches
@RETURNS L<Pootle::Agent>
@RETURNS L<Pootle::Cache>
5 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
=over without closing =back
To install Pootle::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pootle::Client
CPAN shell
perl -MCPAN -e shell install Pootle::Client
For more information on module installation, please visit the detailed CPAN module installation guide.