Skip to content

Commit fcfe484

Browse files
committed
first commit
1 parent 0c00992 commit fcfe484

16 files changed

+854
-0
lines changed

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
uMIT License
2+
3+
Copyright (c) 2024 SharpAPI
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 in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11+

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SharpAPI Python Client SDK
2+
3+
🚀 Automate workflows with AI-powered API
4+
5+
## Leverage AI API to streamline workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and more.
6+
7+
[![Version](https://img.shields.io/pypi/v/sharpapi-python-client.svg)](https://pypi.org/project/sharpapi-python-client/)
8+
[![License](https://img.shields.io/pypi/l/sharpapi-python-client.svg)](https://github.com/yourusername/sharpapi-python-client/blob/main/LICENSE)
9+
10+
#### Save time on repetitive content analysis and generation tasks that your app users perform daily.
11+
12+
See more at [SharpAPI.com Website »](https://sharpapi.com/)
13+
14+
## Requirements
15+
16+
- Python >= 3.6
17+
18+
19+
## Installation
20+
21+
```bash
22+
pip install sharpapi-python-client
23+
24+
25+
## What can it do for you?
26+
27+
- **E-commerce**
28+
- Generate engaging product introductions.
29+
- Create personalized thank-you emails.
30+
- Streamline product categorization.
31+
- Perform sentiment analysis on product reviews.
32+
33+
- **Content & Marketing Automation**
34+
- Translate text for a global audience.
35+
- Paraphrase and proofread any text.
36+
- Detect spam content.
37+
- Extract contact information.
38+
- Summarize content and generate keywords/tags.
39+
- Generate SEO meta tags.
40+
41+
- **HR Tech**
42+
- Generate job descriptions.
43+
- Identify related job positions and skills.
44+
- Parse and extract information from resumes.
45+
46+
- **Travel, Tourism & Hospitality**
47+
- Analyze sentiment in travel reviews.
48+
- Categorize tours, activities, and hospitality products.
49+
50+
## Usage
51+
52+
### Simple Example
53+
54+
```python
55+
from sharpapi.sharp_api_service import SharpApiService
56+
57+
sharp_api = SharpApiService('YOUR_SHARP_API_KEY')
58+
59+
try:
60+
status_url = sharp_api.product_categories(
61+
'Lenovo Chromebook Laptop (2023), 14" FHD Touchscreen Slim 3, 8-Core MediaTek Kompanio 520 CPU, 4GB RAM, 128GB Storage',
62+
language='German', # optional
63+
max_quantity=400, # optional
64+
voice_tone='Neutral', # optional
65+
context='Optional current e-store categories' # optional
66+
)
67+
68+
result_sharp_api_job = sharp_api.fetch_results(status_url)
69+
print(result_sharp_api_job.get_result_json())
70+
except Exception as e:
71+
print(e)
72+
```
73+
74+
## Documentation
75+
For detailed usage and API methods, please refer to the [SharpAPI Documentation](https://sharpapi.com/documentation).
76+
77+
## Changelog
78+
Please see CHANGELOG for more information on what has changed recently.
79+
80+
## License
81+
The MIT License (MIT). Please see License File for more information.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests>=2.25.1

setup.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='sharpapi-python-client',
5+
version='1.2.0',
6+
description='SharpAPI.com Python SDK Client - AI-Powered Workflow Automation API.',
7+
author='Dawid Makowski',
8+
author_email='[email protected]',
9+
url='https://github.com/sharpapi/sharpapi-python-client',
10+
packages=find_packages(),
11+
install_requires=[
12+
'requests>=2.25.1',
13+
],
14+
classifiers=[
15+
'Programming Language :: Python :: 3',
16+
'License :: OSI Approved :: MIT License',
17+
],
18+
)
19+

sharpapi/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# sharpapi/__init__.py
2+
3+
"""
4+
SharpAPI Python SDK Package Initialization
5+
"""
6+
7+
# Import the main service class for easy access
8+
from .sharp_api_service import SharpApiService
9+
10+
# Import subpackages
11+
from . import dto
12+
from . import enums
13+

sharpapi/dto/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# sharpapi/dto/__init__.py
2+
3+
"""
4+
Data Transfer Objects (DTO) Package Initialization
5+
"""
6+
7+
# Import DTO classes for easy access
8+
from .job_description_parameters import JobDescriptionParameters
9+
from .sharp_api_job import SharpApiJob
10+
from .sharp_api_subscription_info import SharpApiSubscriptionInfo
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
class JobDescriptionParameters:
2+
def __init__(
3+
self,
4+
name,
5+
company_name=None,
6+
minimum_work_experience=None,
7+
minimum_education=None,
8+
employment_type=None,
9+
required_skills=None,
10+
optional_skills=None,
11+
country=None,
12+
remote=None,
13+
visa_sponsored=None,
14+
voice_tone=None,
15+
context=None,
16+
language=None,
17+
):
18+
self.name = name
19+
self.company_name = company_name
20+
self.minimum_work_experience = minimum_work_experience
21+
self.minimum_education = minimum_education
22+
self.employment_type = employment_type
23+
self.required_skills = required_skills
24+
self.optional_skills = optional_skills
25+
self.country = country
26+
self.remote = remote
27+
self.visa_sponsored = visa_sponsored
28+
self.voice_tone = voice_tone
29+
self.context = context
30+
self.language = language
31+
32+
def to_dict(self):
33+
return {
34+
'name': self.name,
35+
'company_name': self.company_name,
36+
'minimum_work_experience': self.minimum_work_experience,
37+
'minimum_education': self.minimum_education,
38+
'employment_type': self.employment_type,
39+
'required_skills': self.required_skills,
40+
'optional_skills': self.optional_skills,
41+
'country': self.country,
42+
'remote': self.remote,
43+
'visa_sponsored': self.visa_sponsored,
44+
'voice_tone': self.voice_tone,
45+
'context': self.context,
46+
'language': self.language,
47+
}
48+

sharpapi/dto/sharp_api_job.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from ..enums.sharp_api_job_status_enum import SharpApiJobStatusEnum
2+
from ..enums.sharp_api_job_type_enum import SharpApiJobTypeEnum
3+
import json
4+
5+
6+
class SharpApiJob:
7+
def __init__(self, id, type, status, result):
8+
self.id = id
9+
self.type = type
10+
self.status = status
11+
self.result = result
12+
13+
def get_id(self):
14+
return self.id
15+
16+
def get_type(self):
17+
return self.type
18+
19+
def get_status(self):
20+
return self.status
21+
22+
def get_result_json(self):
23+
return json.dumps(self.result, indent=2) if self.result else None
24+
25+
def get_result_object(self):
26+
return self.result
27+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from datetime import datetime
2+
3+
4+
class SharpApiSubscriptionInfo:
5+
def __init__(self, data):
6+
self.timestamp = datetime.fromisoformat(data['timestamp'])
7+
self.on_trial = data['on_trial']
8+
self.trial_ends = datetime.fromisoformat(data['trial_ends'])
9+
self.subscribed = data['subscribed']
10+
self.current_subscription_start = datetime.fromisoformat(data['current_subscription_start'])
11+
self.current_subscription_end = datetime.fromisoformat(data['current_subscription_end'])
12+
self.subscription_words_quota = data['subscription_words_quota']
13+
self.subscription_words_used = data['subscription_words_used']
14+
self.subscription_words_used_percentage = data['subscription_words_used_percentage']
15+

sharpapi/enums/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# sharpapi/enums/__init__.py
2+
3+
"""
4+
Enumerations Package Initialization
5+
"""
6+
from .sharp_api_job_status_enum import SharpApiJobStatusEnum
7+
from .sharp_api_job_type_enum import SharpApiJobTypeEnum
8+
from .sharp_api_languages import SharpApiLanguages
9+
from .sharp_api_voice_tone import SharpApiVoiceTone
10+

0 commit comments

Comments
 (0)