Skip to content

Commit c28729a

Browse files
committed
initial commit
0 parents  commit c28729a

8 files changed

+552
-0
lines changed

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/vendor/
2+
node_modules/
3+
npm-debug.log
4+
yarn-error.log
5+
6+
storage/*.key
7+
.env
8+
Homestead.yaml
9+
Homestead.json
10+
/.vagrant
11+
.phpunit.result.cache
12+
.idea
13+
14+
build
15+
composer.lock
16+
.phpunit.result.cache
17+
.php-cs-fixer.cache
18+
coverage
19+
phpstan.neon
20+

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
## November 13, 2024 - v1.0.0
4+
- removing the requirement to publish config file

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) SharpAPI <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+301
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
![SharpAPI GitHub cover](https://sharpapi.com/sharpapi-github-laravel-bg.jpg "SharpAPI Laravel Client")
2+
3+
# Resume Parser/CV Parser for Laravel with AI-powered SharpAPI
4+
5+
## 🚀 Leverage AI API to streamline resume parsing and data extraction in your HR Tech applications.
6+
7+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/sharpapi/laravel-resume-parser.svg?style=flat-square)](https://packagist.org/packages/sharpapi/laravel-resume-parser)
8+
[![Total Downloads](https://img.shields.io/packagist/dt/sharpapi/laravel-resume-parser.svg?style=flat-square)](https://packagist.org/packages/sharpapi/laravel-resume-parser)
9+
10+
Check the details at SharpAPI's [Resume Rarsing API](https://sharpapi.com/en/catalog/ai/hr-tech/resume-cv-parsing) page.
11+
12+
---
13+
14+
## Requirements
15+
16+
- PHP >= 8.1
17+
- Laravel >= 9.0
18+
19+
---
20+
21+
## Installation
22+
23+
Follow these steps to install and set up the SharpAPI Laravel Resume Parser package.
24+
25+
1. Install the package via `composer`:
26+
27+
```bash
28+
composer require sharpapi/laravel-resume-parser
29+
```
30+
31+
2. Register at [SharpAPI.com](https://sharpapi.com/) to obtain your API key.
32+
33+
3. Set the API key in your `.env` file:
34+
35+
```bash
36+
SHARP_API_KEY=your_api_key_here
37+
```
38+
39+
4. **[OPTIONAL]** Publish the configuration file:
40+
41+
```bash
42+
php artisan vendor:publish --tag=sharpapi-resume-parser
43+
```
44+
45+
---
46+
## Key Features
47+
48+
- **Automated Resume Parsing with AI**: Efficiently parse and extract structured information from resumes in various formats, including PDF, DOC, DOCX, TXT, and RTF.
49+
- **Multi-language Support**: Supports 80+ languages for parsing results.
50+
- **Consistent Data Format**: Ensures predictable JSON structure for parsed data.
51+
- **Robust Polling for Results**: Polling-based API response handling with customizable intervals.
52+
- **API Availability and Quota Check**: Check API availability and current usage quotas with `ping` and `quota` endpoints.
53+
54+
---
55+
56+
## Usage
57+
58+
You can inject the `ResumeParserService` class to access parsing functionalities. For best results, especially with batch processing, use Laravel’s queuing system to optimize job dispatch and result polling.
59+
60+
### Basic Workflow
61+
62+
1. **Dispatch Job**: Send a resume file to the API using `parseResume`, which returns a status URL.
63+
2. **Poll for Results**: Use `fetchResults($statusUrl)` to poll until the job completes or fails.
64+
3. **Process Result**: After completion, retrieve the results from the `SharpApiJob` object returned.
65+
66+
> **Note**: Each job typically takes a few seconds to complete. Once completed successfully, the status will update to `success`, and you can process the results as JSON, array, or object format.
67+
68+
---
69+
70+
### Controller Example
71+
72+
Here is an example of how to use `ResumeParserService` within a Laravel controller:
73+
74+
```php
75+
<?php
76+
77+
namespace App\Http\Controllers;
78+
79+
use GuzzleHttp\Exception\GuzzleException;
80+
use SharpAPI\ResumeParser\ResumeParserService;
81+
82+
class ResumeController extends Controller
83+
{
84+
protected ResumeParserService $resumeParserService;
85+
86+
public function __construct(ResumeParserService $resumeParserService)
87+
{
88+
$this->resumeParserService = $resumeParserService;
89+
}
90+
91+
/**
92+
* @throws GuzzleException
93+
*/
94+
public function parseResume()
95+
{
96+
$statusUrl = $this->resumeParserService->parseResume(
97+
'/path/to/resume.pdf',
98+
'English' // OPTIONAL output language, English is the default anyway
99+
);
100+
$result = $this->resumeParserService->fetchResults($statusUrl);
101+
102+
return response()->json($result->getResultJson());
103+
}
104+
}
105+
```
106+
107+
### Handling Guzzle Exceptions
108+
109+
All requests are managed by Guzzle, so it's helpful to be familiar with [Guzzle Exceptions](https://docs.guzzlephp.org/en/stable/quickstart.html#exceptions).
110+
111+
Example:
112+
113+
```php
114+
use GuzzleHttp\Exception\ClientException;
115+
116+
try {
117+
$statusUrl = $this->resumeParserService->parseResume('/path/to/resume.pdf', 'English');
118+
} catch (ClientException $e) {
119+
echo $e->getMessage();
120+
}
121+
```
122+
123+
---
124+
125+
## Optonal Configuration
126+
127+
You can customize the configuration by setting the following environment variables in your `.env` file:
128+
129+
```bash
130+
SHARP_API_KEY=your_api_key_here
131+
SHARP_API_JOB_STATUS_POLLING_WAIT=180
132+
SHARP_API_JOB_STATUS_USE_POLLING_INTERVAL=true
133+
SHARP_API_JOB_STATUS_POLLING_INTERVAL=10
134+
SHARP_API_BASE_URL=https://sharpapi.com/api/v1
135+
```
136+
137+
---
138+
139+
### Available Endpoints
140+
141+
#### Resume Parsing
142+
143+
Parses a resume in multiple formats and returns structured data points.
144+
145+
```php
146+
$statusUrl = $resumeParserService->parseResume('/path/to/resume.pdf', 'English');
147+
```
148+
149+
#### Quota Check
150+
151+
Returns information about the subscription, including usage and remaining quota.
152+
153+
```php
154+
$quotaInfo = $resumeParserService->quota();
155+
```
156+
157+
#### API Lightweight Availability Check (Ping)
158+
159+
Checks the API availability and server timestamp.
160+
161+
```php
162+
$pingResponse = $resumeParserService->ping();
163+
```
164+
165+
---
166+
167+
## AI Resume Parsing Data Format Example
168+
169+
```json
170+
{
171+
"data": {
172+
"type": "api_job_result",
173+
"id": "5a113c4d-38e9-43e5-80f4-ec3fdea3420e",
174+
"attributes": {
175+
"status": "success",
176+
"type": "hr_parse_resume",
177+
"result": {
178+
"positions": [
179+
{
180+
"skills": [
181+
"Acceptance testing",
182+
"Technical investigation",
183+
"Exploratory testing",
184+
"Agile",
185+
"Test environments",
186+
"Test management tools",
187+
"UAT knowledge",
188+
"Writing test reports",
189+
"Organising, conducting and supporting test activities",
190+
"Performance testing",
191+
"Integration testing",
192+
"Rapid response to equipment failures",
193+
"Implementing immediate repairs",
194+
"Participating in audits and reviews",
195+
"Monitoring and reporting repair trends",
196+
"Drawings and documentation updates",
197+
"Executing test cases",
198+
"Documenting results and defects",
199+
"Testing and fault finding finished systems",
200+
"Reporting issues to Test Manager",
201+
"Assisting in software installation",
202+
"Experience of testing Web, PC and mobile based software",
203+
"Understanding iterative software development lifecycle",
204+
"Manual testing methods and processes",
205+
"Technical knowledge of Test Systems hardware and software",
206+
"Planning and task management skills",
207+
"Microsoft operating systems",
208+
"Testing GUI based software"
209+
],
210+
"country": "United Kingdom",
211+
"end_date": null,
212+
"start_date": "2008-06-01",
213+
"job_details": "Responsible for the whole test process from planning, through test plan development, execution & result reporting. Also involved in the development and improvement of the test functions, putting forward suggestions and implementing plans accordingly. Duties included organising, conducting and supporting test activities, performance testing, integration testing, rapid response to equipment failures, implementing immediate repairs, participating in audits and reviews, monitoring and reporting repair trends, updating drawings and documentation, executing test cases, documenting results and defects, testing and fault finding finished systems, reporting issues to Test Manager, and assisting in software installation.",
214+
"company_name": "IT & Telecoms Company",
215+
"position_name": "Test Engineer"
216+
}
217+
],
218+
"candidate_name": "Linda Harris",
219+
"candidate_email": "[email protected]",
220+
"candidate_phone": "02476 000 0000, 0887 222 9999",
221+
"candidate_address": "34 Made Up Road, Coventry, CV66 7RF",
222+
"candidate_language": "English",
223+
"education_qualifications": [
224+
{
225+
"country": "United Kingdom",
226+
"end_date": "2008-06-01",
227+
"start_date": "2005-09-01",
228+
"degree_type": "Bachelor’s Degree or equivalent",
229+
"school_name": "Nuneaton University",
230+
"school_type": "University or equivalent",
231+
"learning_mode": "In-person learning",
232+
"education_details": "",
233+
"faculty_department": "",
234+
"specialization_subjects": "Software Engineering"
235+
},
236+
{
237+
"country": "United Kingdom",
238+
"end_date": "2005-06-01",
239+
"start_date": "2000-09-01",
240+
"degree_type": "High School/Secondary School Diploma or equivalent",
241+
"school_name": "Coventry North School",
242+
"school_type": "High School/Secondary School or equivalent",
243+
"learning_mode": "In-person learning",
244+
"education_details": "A levels: Maths (A), English (B), Technology (B), Science (C)",
245+
"faculty_department": "",
246+
"specialization_subjects": ""
247+
}
248+
],
249+
"candidate_spoken_languages": [
250+
"German"
251+
],
252+
"candidate_honors_and_awards": [],
253+
"candidate_courses_and_certifications": [
254+
"ISEB certification"
255+
]
256+
}
257+
}
258+
}
259+
}
260+
```
261+
262+
---
263+
264+
## Support & Feedback
265+
266+
For issues or suggestions, please:
267+
268+
- [Open an issue on GitHub](https://github.com/sharpapi/laravel-resume-parser/issues)
269+
- Join our [Telegram community](https://t.me/sharpapi_community)
270+
271+
---
272+
273+
## Changelog
274+
275+
Please see [CHANGELOG](CHANGELOG.md) for a detailed list of changes.
276+
277+
---
278+
279+
## Credits
280+
281+
- [A2Z WEB LTD](https://github.com/a2zwebltd)
282+
- [Dawid Makowski](https://github.com/makowskid)
283+
- Enhance your [Laravel AI](https://sharpapi.com/) capabilities!
284+
285+
---
286+
287+
## License
288+
289+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
290+
291+
---
292+
293+
## Follow Us
294+
295+
Stay updated with news, tutorials, and case studies:
296+
297+
- [SharpAPI on X (Twitter)](https://x.com/SharpAPI)
298+
- [SharpAPI on YouTube](https://www.youtube.com/@SharpAPI)
299+
- [SharpAPI on Vimeo](https://vimeo.com/SharpAPI)
300+
- [SharpAPI on LinkedIn](https://www.linkedin.com/products/a2z-web-ltd-sharpapicom-automate-with-aipowered-api/)
301+
- [SharpAPI on Facebook](https://www.facebook.com/profile.php?id=61554115896974)

0 commit comments

Comments
 (0)