Python client for Clappia API integration
Project description
Clappia Tools
LangChain integration for Clappia API
Overview
Clappia Tools is a Python package that provides a unified client and a set of tools for seamless integration with the Clappia API. It enables developers to automate workflows, manage submissions, and interact with Clappia apps programmatically. The package is designed for use in automation, data integration, and agent-based systems (e.g., LangChain agents).
Features
- Unified API Client: One client for all Clappia API operations.
- Submission Management: Create, edit, update owners, and change status of submissions.
- App Definition Retrieval: Fetch complete app structure and metadata.
- Input Validation: Built-in validation for IDs, emails, and status objects.
- Extensible Tools: Modular functions for each operation, easily integrated into agents or scripts.
- Comprehensive Testing: Includes unit and integration tests.
Installation
pip install clappia-tools
Or, for development:
git clone https://github.com/clappia-dev/clappia-tools.git
cd clappia-tools
pip install -e .[dev]
Configuration
You must provide your Clappia API credentials and workspace information directly when initializing the ClappiaClient:
api_key: Your Clappia API keybase_url: The base URL for the Clappia API (e.g.,https://api.clappia.com)workplace_id: Your Clappia workplace ID
Example:
from clappia_tools import ClappiaClient
client = ClappiaClient(
api_key="your-api-key",
base_url="https://api.clappia.com",
workplace_id="your-workplace-id"
)
Usage
Basic Client Usage
from clappia_tools import ClappiaClient
client = ClappiaClient(
api_key="your-api-key",
base_url="https://api.clappia.com",
workplace_id="your-workplace-id"
)
# Create a submission
result = client.create_submission(
app_id="MFX093412",
data={"employee_name": "John Doe", "department": "Engineering"},
email="user@example.com"
)
print(result)
# Edit a submission
result = client.edit_submission(
app_id="MFX093412",
submission_id="HGO51464561",
data={"department": "Marketing"},
email="user@example.com"
)
print(result)
# Get app definition
result = client.get_app_definition(app_id="MFX093412")
print(result)
Tool Functions
You can also use the modular tool functions directly:
from clappia_tools._tools import (
create_clappia_submission,
edit_clappia_submission,
get_app_definition,
update_clappia_submission_owners,
update_clappia_submission_status,
)
# Create a submission
data = {"employee_name": "Jane Doe", "department": "HR"}
response = create_clappia_submission("MFX093412", data, "user@example.com")
print(response)
# Update submission owners
response = update_clappia_submission_owners(
"MFX093412", "HGO51464561", "admin@example.com", ["user1@company.com", "user2@company.com"]
)
print(response)
# Update submission status
response = update_clappia_submission_status(
"MFX093412", "HGO51464561", "admin@example.com", {"statusName": "Approved", "comments": "Reviewed."}
)
print(response)
Available Tools
create_clappia_submission(app_id, data, email)edit_clappia_submission(app_id, submission_id, data, email)get_app_definition(app_id, language="en", strip_html=True, include_tags=True)update_clappia_submission_owners(app_id, submission_id, requesting_user_email_address, email_ids)update_clappia_submission_status(app_id, submission_id, requesting_user_email_address, status)
See docstrings in each tool for detailed argument and return value descriptions.
Input Validation
- App ID: Must be uppercase letters and numbers (e.g.,
MFX093412). - Submission ID: Must be uppercase letters and numbers (e.g.,
HGO51464561). - Email: Must be a valid email address.
- Status: Must be a dictionary with a non-empty
statusNameornamefield.
Invalid inputs will return descriptive error messages.
Testing
Run all tests (unit and integration):
pytest
Contributing
- Fork the repository and create your branch.
- Write clear, well-documented code and tests.
- Run
pytestand ensure all tests pass. - Submit a pull request with a clear description of your changes.
License
This project is licensed under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clappia_api_tools-0.1.6.tar.gz.
File metadata
- Download URL: clappia_api_tools-0.1.6.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92c9b63c9387985bc515b522944bcbda4b626aeffa56924daec1f178e526c057
|
|
| MD5 |
69965044607da2aed2e30e87efc62c0d
|
|
| BLAKE2b-256 |
9ecb07a9417e1318d460df9f4a7d40b049110bd39f1056189dc6526bf73842a6
|
Provenance
The following attestation bundles were made for clappia_api_tools-0.1.6.tar.gz:
Publisher:
publish.yml on clappia-dev/clappia-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clappia_api_tools-0.1.6.tar.gz -
Subject digest:
92c9b63c9387985bc515b522944bcbda4b626aeffa56924daec1f178e526c057 - Sigstore transparency entry: 267379549
- Sigstore integration time:
-
Permalink:
clappia-dev/clappia-tools@b81e7acb00346dd0a0df75b2919be9529298d239 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/clappia-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b81e7acb00346dd0a0df75b2919be9529298d239 -
Trigger Event:
push
-
Statement type:
File details
Details for the file clappia_api_tools-0.1.6-py3-none-any.whl.
File metadata
- Download URL: clappia_api_tools-0.1.6-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ec619ccbca2f3473000f69a0b8a2f712c2fb88b340d1bdec67a4716e5ec3012
|
|
| MD5 |
6d254f3a96f7409c9c0fca4d17815f41
|
|
| BLAKE2b-256 |
0e8605c1f50bc76174305c4b3ba0149673e96f5f771d794acd3fac376b2cdc9f
|
Provenance
The following attestation bundles were made for clappia_api_tools-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on clappia-dev/clappia-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clappia_api_tools-0.1.6-py3-none-any.whl -
Subject digest:
4ec619ccbca2f3473000f69a0b8a2f712c2fb88b340d1bdec67a4716e5ec3012 - Sigstore transparency entry: 267379567
- Sigstore integration time:
-
Permalink:
clappia-dev/clappia-tools@b81e7acb00346dd0a0df75b2919be9529298d239 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/clappia-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b81e7acb00346dd0a0df75b2919be9529298d239 -
Trigger Event:
push
-
Statement type: