🚀 Automate Workflows with AI-Powered API
Leverage AI API to Streamline Workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and More.
SharpAPI Python Client SDK enables developers to integrate advanced artificial intelligence capabilities into their Python applications. This SDK simplifies interaction with the SharpAPI services, providing a seamless way to leverage AI for various use cases.
Visit the SharpAPI.com Website » for more information.
You can install the SharpAPI Python Client SDK via PyPI using pip:
pip install sharpapi-python-clientAlternatively, if you prefer using Poetry for dependency management, you can add it to your project:
poetry add sharpapi-python-clientSign up at SharpAPI.com to obtain your API key.
Create a .env file in your project's root directory to securely store your API key:
SHARP_API_KEY=your_sharpapi_api_key_hereEnsure that .env is included in your .gitignore to prevent accidental exposure of your API key.
The SDK uses python-dotenv to load environment variables. Ensure that your application initializes the environment variables before using the SDK:
fromdotenvimportload_dotenvload_dotenv() # Loads environment variables from .env fileThe SharpAPI Python Client SDK offers a comprehensive suite of AI-powered tools to enhance various aspects of your applications:
- Generate Engaging Product Introductions
- Create Personalized Thank-You Emails
- Streamline Product Categorization
- Perform Sentiment Analysis on Product Reviews
- Translate Text for a Global Audience
- Paraphrase and Proofread Any Text
- Detect Spam Content
- Extract Contact Information
- Summarize Content and Generate Keywords/Tags
- Generate SEO Meta Tags
- Generate Job Descriptions
- Identify Related Job Positions and Skills
- Parse and Extract Information from Resumes
- Analyze Sentiment in Travel Reviews
- Categorize Tours, Activities, and Hospitality Products
fromsharpapiimportSharpApiService# Initialize the SharpApiService with your API keysharp_api=SharpApiService(api_key='YOUR_SHARP_API_KEY')
try:
# Example: Generate Product Categoriesstatus_url=sharp_api.product_categories(
product_name='Lenovo Chromebook Laptop (2023), 14" FHD Touchscreen Slim 3, 8-Core MediaTek Kompanio 520 CPU, 4GB RAM, 128GB Storage',
language='German', # Optionalmax_quantity=400, # Optionalvoice_tone='Neutral', # Optionalcontext='Optional current e-store categories'# Optional
)
# Fetch and print the resultsresult_sharp_api_job=sharp_api.fetch_results(status_url)
print(result_sharp_api_job.get_result_json())
exceptExceptionase:
print(f"An error occurred: {e}")fromsharpapiimportSharpApiService# Initialize the SharpApiService with your API keysharp_api=SharpApiService(api_key='YOUR_SHARP_API_KEY')
try:
# Parse Resumestatus_url=sharp_api.parse_resume(
file_path='path/to/sample_resume.pdf',
language='English'# Optional
)
# Fetch and print the parsed resume dataparsed_resume=sharp_api.fetch_results(status_url)
print(parsed_resume.get_result_json())
exceptExceptionase:
print(f"An error occurred: {e}")This project uses Python's built-in unittest framework for testing.
Ensure that you are in the project's root directory and that all dependencies are installed via Poetry or pip.
Activate Poetry Shell:
poetry shell
Run Tests:
python -m unittest discover tests
Activate Your Virtual Environment:
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
Run Tests:
python -m unittest discover tests
src/sharpapi/: Contains the main SDK code.dto/: Data Transfer Objects for handling request and response data.enums/: Enumerations for standardized values across the SDK.sharp_api_service.py: Core service class to interact with SharpAPI endpoints.
tests/: Contains unit tests for the SDK using Python'sunittestframework.pyproject.toml: Configuration file managed by Poetry for dependencies and packaging.LICENSE: Licensing information.README.md: Project documentation.venv/: Virtual environment directory (should be excluded from version control).
Contributions are welcome! Whether you're reporting a bug, suggesting an enhancement, or submitting a pull request, your input is valuable to us.
Fork the Repository
Click the Fork button at the top-right corner of the repository page.
Clone Your Fork
git clone https://github.com/yourusername/sharpapi-python-client.git cd sharpapi-python-clientCreate a New Branch
git checkout -b feature/YourFeatureName
Make Your Changes
Implement your feature or fix. Ensure that your code adheres to the project's coding standards.
Run Tests
Ensure all tests pass before committing your changes.
poetry shell python -m unittest discover tests
Commit Your Changes
git commit -m "Add feature XYZ"Push to Your Fork
git push origin feature/YourFeatureName
Create a Pull Request
Navigate to the original repository and click on "Compare & pull request." Provide a clear description of your changes.
- Follow PEP 8 style guidelines.
- Write clear and concise docstrings for all modules, classes, and methods.
- Ensure that all new features are accompanied by corresponding unit tests.
This project is licensed under the MIT License.
For any questions, support, or inquiries, feel free to reach out:
- Email: contact@sharpapi.com
- Website: https://sharpapi.com
- GitHub: https://github.com/sharpapi/sharpapi-python-client
Please see CHANGELOG.md for more information on what has changed recently.
For detailed usage and API methods, please refer to the SharpAPI Documentation.
- Poetry Documentation: https://python-poetry.org/docs/
- Python
unittestDocumentation: https://docs.python.org/3/library/unittest.html - SharpAPI Documentation: https://sharpapi.com/documentation
🚀 For the latest news, tutorials, and case studies, don't forget to follow us on:
Happy Coding! 🚀
