whistic


Namewhistic JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/massyn/whistic
SummaryPython SDK to interface with the Whistic API
upload_time2025-08-22 02:40:57
maintainerNone
docs_urlNone
authorPhil Massyn
requires_python>=3.7
licenseMIT License Copyright (c) 2025 Phil Massyn Permission is hereby granted, free of charge, to any person obtaining a copy 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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.
keywords whistic api sdk vendor management third-party risk
VCS
bugtrack_url
requirements requests python-dotenv colorama
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Whistic SDK

A Python SDK to interface with the Whistic API for vendor management and third-party risk management operations.

## Installation

### From PyPI (Recommended)

```bash
pip install whistic
```

### From Source

```bash
git clone https://github.com/massyn/whistic.git
cd whistic
pip install -e .
```

## Requirements

* Python 3.7 or higher
* Create an [API Key](https://whistichelp.zendesk.com/hc/en-us/articles/14823790530071-API-Key-Creation) on the Whistic platform

## Quick Start

### Environment Setup

Create a `.env` file in your project root or set the environment variable:

```bash
export WHISTIC_TOKEN=your_api_token_here
```

Or create a `.env` file:
```
WHISTIC_TOKEN=your_api_token_here
```

### Basic Usage

```python
from whistic_sdk import Whistic
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Initialize the client
client = Whistic()

# List all vendors
vendors = client.vendors.list()
print(f"Found {len(vendors)} vendors")

# Get detailed information for all vendors (parallel processing)
detailed_vendors = client.vendors.describe()

# Get a specific vendor
vendor_id = vendors[0]['identifier']
vendor_details = client.vendors.get(vendor_id)

# Update a vendor
client.vendors.update(vendor_id, {
    "name": "Updated Vendor Name",
    "description": "Updated description"
})

# Create a new vendor
new_vendor_data = {
    "name": "New Vendor",
    "description": "A new vendor",
    # ... other vendor fields
}
client.vendors.new(new_vendor_data)
```

## Advanced Usage

### Custom Configuration

```python
from whistic_sdk import Whistic

# Configure with custom settings
client = Whistic(max_workers=10)  # Increase parallel processing workers
```

### Batch Operations

```python
# Process all vendors in parallel
all_vendors = client.vendors.describe()

# Filter and update multiple vendors
for vendor in all_vendors:
    if vendor.get('status') == 'pending':
        client.vendors.update(vendor['identifier'], {
            'status': 'active'
        })
```

### Error Handling

```python
import logging

# Enable debug logging to see API calls
logging.basicConfig(level=logging.DEBUG)

try:
    vendor = client.vendors.get('non-existent-id')
except Exception as e:
    print(f"Error fetching vendor: {e}")
```

## API Reference

### Whistic Class

The main client class for interacting with the Whistic API.

#### Constructor
- `Whistic(max_workers=5)`: Initialize client with optional max workers for parallel processing

#### Properties
- `vendors`: Access to vendor management operations

### Vendors Class

Handles all vendor-related operations.

#### Methods

- **`list()`**: Get paginated list of all vendor identifiers
  - Returns: List of vendor objects with basic information

- **`describe()`**: Get detailed information for all vendors using parallel processing
  - Returns: List of complete vendor objects with all details

- **`get(vendor_id)`**: Fetch detailed information for a specific vendor
  - Parameters: `vendor_id` (str) - The vendor identifier
  - Returns: Complete vendor object or None if not found

- **`update(vendor_id, data)`**: Update vendor information
  - Parameters: 
    - `vendor_id` (str) - The vendor identifier
    - `data` (dict) - Dictionary with fields to update
  - Note: Uses deep merge to preserve existing data

- **`new(data)`**: Create a new vendor
  - Parameters: `data` (dict) - Complete vendor data structure

## Features

- **Automatic Pagination**: Handles API pagination automatically
- **Parallel Processing**: Concurrent API calls for better performance
- **Rate Limiting**: Built-in retry logic with exponential backoff
- **Deep Merge Updates**: Safely update vendor data without losing existing fields
- **Colored Logging**: Enhanced console output for debugging
- **Environment Variable Support**: Secure token management

## Error Handling

The SDK includes comprehensive error handling:

- **Rate Limiting**: Automatic retry with exponential backoff for 429 responses
- **Request Timeouts**: 30-second timeout on all API calls
- **Connection Errors**: Graceful handling of network issues
- **API Errors**: Detailed error logging with response codes and messages

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Reference

* [Whistic API Documentation](https://public.whistic.com/swagger-ui/index.html)
* [API Key Creation Guide](https://whistichelp.zendesk.com/hc/en-us/articles/14823790530071-API-Key-Creation)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/massyn/whistic",
    "name": "whistic",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Phil Massyn <phil.massyn@icloud.com>",
    "keywords": "whistic, api, sdk, vendor, management, third-party, risk",
    "author": "Phil Massyn",
    "author_email": "Phil Massyn <phil.massyn@icloud.com>",
    "download_url": "https://files.pythonhosted.org/packages/b5/1a/c21888637f62de0b0322da9005e6c2e087aab7d6dc4b803062218ff433f5/whistic-0.0.1.tar.gz",
    "platform": null,
    "description": "# Whistic SDK\n\nA Python SDK to interface with the Whistic API for vendor management and third-party risk management operations.\n\n## Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install whistic\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/massyn/whistic.git\ncd whistic\npip install -e .\n```\n\n## Requirements\n\n* Python 3.7 or higher\n* Create an [API Key](https://whistichelp.zendesk.com/hc/en-us/articles/14823790530071-API-Key-Creation) on the Whistic platform\n\n## Quick Start\n\n### Environment Setup\n\nCreate a `.env` file in your project root or set the environment variable:\n\n```bash\nexport WHISTIC_TOKEN=your_api_token_here\n```\n\nOr create a `.env` file:\n```\nWHISTIC_TOKEN=your_api_token_here\n```\n\n### Basic Usage\n\n```python\nfrom whistic_sdk import Whistic\nfrom dotenv import load_dotenv\n\n# Load environment variables\nload_dotenv()\n\n# Initialize the client\nclient = Whistic()\n\n# List all vendors\nvendors = client.vendors.list()\nprint(f\"Found {len(vendors)} vendors\")\n\n# Get detailed information for all vendors (parallel processing)\ndetailed_vendors = client.vendors.describe()\n\n# Get a specific vendor\nvendor_id = vendors[0]['identifier']\nvendor_details = client.vendors.get(vendor_id)\n\n# Update a vendor\nclient.vendors.update(vendor_id, {\n    \"name\": \"Updated Vendor Name\",\n    \"description\": \"Updated description\"\n})\n\n# Create a new vendor\nnew_vendor_data = {\n    \"name\": \"New Vendor\",\n    \"description\": \"A new vendor\",\n    # ... other vendor fields\n}\nclient.vendors.new(new_vendor_data)\n```\n\n## Advanced Usage\n\n### Custom Configuration\n\n```python\nfrom whistic_sdk import Whistic\n\n# Configure with custom settings\nclient = Whistic(max_workers=10)  # Increase parallel processing workers\n```\n\n### Batch Operations\n\n```python\n# Process all vendors in parallel\nall_vendors = client.vendors.describe()\n\n# Filter and update multiple vendors\nfor vendor in all_vendors:\n    if vendor.get('status') == 'pending':\n        client.vendors.update(vendor['identifier'], {\n            'status': 'active'\n        })\n```\n\n### Error Handling\n\n```python\nimport logging\n\n# Enable debug logging to see API calls\nlogging.basicConfig(level=logging.DEBUG)\n\ntry:\n    vendor = client.vendors.get('non-existent-id')\nexcept Exception as e:\n    print(f\"Error fetching vendor: {e}\")\n```\n\n## API Reference\n\n### Whistic Class\n\nThe main client class for interacting with the Whistic API.\n\n#### Constructor\n- `Whistic(max_workers=5)`: Initialize client with optional max workers for parallel processing\n\n#### Properties\n- `vendors`: Access to vendor management operations\n\n### Vendors Class\n\nHandles all vendor-related operations.\n\n#### Methods\n\n- **`list()`**: Get paginated list of all vendor identifiers\n  - Returns: List of vendor objects with basic information\n\n- **`describe()`**: Get detailed information for all vendors using parallel processing\n  - Returns: List of complete vendor objects with all details\n\n- **`get(vendor_id)`**: Fetch detailed information for a specific vendor\n  - Parameters: `vendor_id` (str) - The vendor identifier\n  - Returns: Complete vendor object or None if not found\n\n- **`update(vendor_id, data)`**: Update vendor information\n  - Parameters: \n    - `vendor_id` (str) - The vendor identifier\n    - `data` (dict) - Dictionary with fields to update\n  - Note: Uses deep merge to preserve existing data\n\n- **`new(data)`**: Create a new vendor\n  - Parameters: `data` (dict) - Complete vendor data structure\n\n## Features\n\n- **Automatic Pagination**: Handles API pagination automatically\n- **Parallel Processing**: Concurrent API calls for better performance\n- **Rate Limiting**: Built-in retry logic with exponential backoff\n- **Deep Merge Updates**: Safely update vendor data without losing existing fields\n- **Colored Logging**: Enhanced console output for debugging\n- **Environment Variable Support**: Secure token management\n\n## Error Handling\n\nThe SDK includes comprehensive error handling:\n\n- **Rate Limiting**: Automatic retry with exponential backoff for 429 responses\n- **Request Timeouts**: 30-second timeout on all API calls\n- **Connection Errors**: Graceful handling of network issues\n- **API Errors**: Detailed error logging with response codes and messages\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Reference\n\n* [Whistic API Documentation](https://public.whistic.com/swagger-ui/index.html)\n* [API Key Creation Guide](https://whistichelp.zendesk.com/hc/en-us/articles/14823790530071-API-Key-Creation)\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Phil Massyn\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Python SDK to interface with the Whistic API",
    "version": "0.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/massyn/whistic/issues",
        "Documentation": "https://github.com/massyn/whistic#readme",
        "Homepage": "https://github.com/massyn/whistic",
        "Source Code": "https://github.com/massyn/whistic"
    },
    "split_keywords": [
        "whistic",
        " api",
        " sdk",
        " vendor",
        " management",
        " third-party",
        " risk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f6487d76dbdf5a62f4443d921753ae43bd7d650f11aecec7856c3930e3a779f1",
                "md5": "9cd5108780a56ee9c0b776dccf55cb1b",
                "sha256": "a163a45f1d0319d587d093fb71650cf532e5efd3c9bab93a8a7f50a52e530b09"
            },
            "downloads": -1,
            "filename": "whistic-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9cd5108780a56ee9c0b776dccf55cb1b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8099,
            "upload_time": "2025-08-22T02:40:56",
            "upload_time_iso_8601": "2025-08-22T02:40:56.329455Z",
            "url": "https://files.pythonhosted.org/packages/f6/48/7d76dbdf5a62f4443d921753ae43bd7d650f11aecec7856c3930e3a779f1/whistic-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b51ac21888637f62de0b0322da9005e6c2e087aab7d6dc4b803062218ff433f5",
                "md5": "216fac1e053ceecae66eaaf58c40b0a7",
                "sha256": "089cf014f28d3413e4feceb99b969f6b1577e61a55269ca9335679fcd0d86d6d"
            },
            "downloads": -1,
            "filename": "whistic-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "216fac1e053ceecae66eaaf58c40b0a7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7503,
            "upload_time": "2025-08-22T02:40:57",
            "upload_time_iso_8601": "2025-08-22T02:40:57.308627Z",
            "url": "https://files.pythonhosted.org/packages/b5/1a/c21888637f62de0b0322da9005e6c2e087aab7d6dc4b803062218ff433f5/whistic-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-22 02:40:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "massyn",
    "github_project": "whistic",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.25.0"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    ">=",
                    "0.19.0"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    ">=",
                    "0.4.4"
                ]
            ]
        }
    ],
    "lcname": "whistic"
}
        
Elapsed time: 0.76362s