eoko / text-kernel
Installs: 4 778
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 3
Open Issues: 2
Requires
- guzzlehttp/guzzle: ^6.2
This package is not auto-updated.
Last update: 2024-11-01 03:12:18 UTC
README
This is a small implementation of the sourcebox extract API
Contributions are welcome.
Usage with Symfony
Configuration
In your service.yml
textkernel.factory: class: Eoko\TextKernel\Factory\TextKernelFactory textkernel.api.servicebox: class: Eoko\TextKernel\Api\SourceboxApi factory: [ '@textkernel.factory', createSourceboxApi ] arguments: - '%textkernel_account%' - '%textkernel_username%' - '%textkernel_password%'
In your parameters.yml
parameters: textkernel_account: change_me textkernel_username: change_me textkernel_password: ######
Usage
In a container aware class
$api = $this->get('textkernel.api.servicebox'); try { /** @param \Eoko\TextKernel\Model\CvModel $cv */ $cv = $api->extractFromFile($filepath); // or $cv = $api->extract($cvBuffer); } catch(\Exception $e) { //handle errors }
Raw usage
use Eoko\TextKernel\Factory\TextKernelFactory; $account = 'change_me'; $username = 'change_me'; $password = '########'; $factory = new TextKernelFactory(); $api = $factory->createSourceboxApi($account, $username, $password); try { /** @param \Eoko\TextKernel\Model\CvModel $cv */ $cv = $api->extractFromFile($filepath); // or $cv = $api->extract($cvBuffer); } catch(\Exception $e) { //handle errors }