Skip to main content

SharpAPI.com Python SDK Client - AI-Powered Workflow Automation API.

Project description

SharpAPI GitHub cover

SharpAPI Python Client SDK

🚀 Automate Workflows with AI-Powered API

Leverage AI API to Streamline Workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and More.

PyPI Version License PyPI Downloads Python Version

Save time on repetitive content analysis and generation tasks that your app users perform daily.

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.


📚 Table of Contents


📦 Installation

You can install the SharpAPI Python Client SDK via PyPI using pip:

pip install sharpapi-python-client

Alternatively, if you prefer using Poetry for dependency management, you can add it to your project:

poetry add sharpapi-python-client

🔧 Configuration

1. Obtain Your SharpAPI API Key

Sign up at SharpAPI.com to obtain your API key.

2. Set Up Environment Variables

Create a .env file in your project's root directory to securely store your API key:

SHARP_API_KEY=your_sharpapi_api_key_here

Ensure that .env is included in your .gitignore to prevent accidental exposure of your API key.

3. Loading Environment Variables

The SDK uses python-dotenv to load environment variables. Ensure that your application initializes the environment variables before using the SDK:

from dotenv import load_dotenv

load_dotenv()  # Loads environment variables from .env file

💡 Features

The SharpAPI Python Client SDK offers a comprehensive suite of AI-powered tools to enhance various aspects of your applications:

E-Commerce

  • Generate Engaging Product Introductions
  • Create Personalized Thank-You Emails
  • Streamline Product Categorization
  • Perform Sentiment Analysis on Product Reviews

Content & Marketing Automation

  • 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

HR Tech

  • Generate Job Descriptions
  • Identify Related Job Positions and Skills
  • Parse and Extract Information from Resumes

Travel, Tourism & Hospitality

  • Analyze Sentiment in Travel Reviews
  • Categorize Tours, Activities, and Hospitality Products

💻 Usage

🛠 Basic Example

from sharpapi import SharpApiService

# Initialize the SharpApiService with your API key
sharp_api = SharpApiService(api_key='YOUR_SHARP_API_KEY')

try:
    # Example: Generate Product Categories
    status_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',  # Optional
        max_quantity=400,   # Optional
        voice_tone='Neutral',  # Optional
        context='Optional current e-store categories'  # Optional
    )

    # Fetch and print the results
    result_sharp_api_job = sharp_api.fetch_results(status_url)
    print(result_sharp_api_job.get_result_json())
except Exception as e:
    print(f"An error occurred: {e}")

🛠 Advanced Example: Parsing a Resume

from sharpapi import SharpApiService

# Initialize the SharpApiService with your API key
sharp_api = SharpApiService(api_key='YOUR_SHARP_API_KEY')

try:
    # Parse Resume
    status_url = sharp_api.parse_resume(
        file_path='path/to/sample_resume.pdf',
        language='English'  # Optional
    )

    # Fetch and print the parsed resume data
    parsed_resume = sharp_api.fetch_results(status_url)
    print(parsed_resume.get_result_json())
except Exception as e:
    print(f"An error occurred: {e}")

🧪 Testing

This project uses Python's built-in unittest framework for testing.

Running Tests

Ensure that you are in the project's root directory and that all dependencies are installed via Poetry or pip.

Using Poetry:

  1. Activate Poetry Shell:

    poetry shell
    
  2. Run Tests:

    python -m unittest discover tests
    

Using pip and Virtual Environment:

  1. Activate Your Virtual Environment:

    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
    
  2. Run Tests:

    python -m unittest discover tests
    

Key Components:

  • 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's unittest framework.
  • 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).

🤝 Contributing

Contributions are welcome! Whether you're reporting a bug, suggesting an enhancement, or submitting a pull request, your input is valuable to us.

How to Contribute:

  1. Fork the Repository

    Click the Fork button at the top-right corner of the repository page.

  2. Clone Your Fork

    git clone https://github.com/yourusername/sharpapi-python-client.git
    cd sharpapi-python-client
    
  3. Create a New Branch

    git checkout -b feature/YourFeatureName
    
  4. Make Your Changes

    Implement your feature or fix. Ensure that your code adheres to the project's coding standards.

  5. Run Tests

    Ensure all tests pass before committing your changes.

    poetry shell
    python -m unittest discover tests
    
  6. Commit Your Changes

    git commit -m "Add feature XYZ"
    
  7. Push to Your Fork

    git push origin feature/YourFeatureName
    
  8. Create a Pull Request

    Navigate to the original repository and click on "Compare & pull request." Provide a clear description of your changes.

Coding Standards:

  • 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.

📄 License

This project is licensed under the MIT License.


📞 Contact

For any questions, support, or inquiries, feel free to reach out:


📝 Changelog

Please see CHANGELOG.md for more information on what has changed recently.


📚 Documentation

For detailed usage and API methods, please refer to the SharpAPI Documentation.


🧰 Additional Resources


Social Media

🚀 For the latest news, tutorials, and case studies, don't forget to follow us on:


Happy Coding! 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sharpapi_python_client-1.0.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

sharpapi_python_client-1.0.2-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file sharpapi_python_client-1.0.2.tar.gz.

File metadata

  • Download URL: sharpapi_python_client-1.0.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.0.0

File hashes

Hashes for sharpapi_python_client-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3bce8619ae2de52acacc1d4a7fc23131c99aa136fdce28764e28684fed11426c
MD5 34d08023016c7036fedbe86a2e273d6d
BLAKE2b-256 c045cd802cbe8811cdf006dfd18ad1b23dfddee1e45a40534cfbb736ecd8fe4f

See more details on using hashes here.

File details

Details for the file sharpapi_python_client-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sharpapi_python_client-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 860c6d200afe6bb20c756ebd238812774ef1ae433415f4ace4e093cbda655d60
MD5 3bf6d71d90211dd8d703c9780e327cef
BLAKE2b-256 4afd0fde6e6d6b6fda51c5c0f35731a80a3ed6f070b34ec3b2cbcef11832db0c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page