Skip to content

Commit 4c9a806

Browse files
Refactor project structure, rename package to Clappia API Tools, and release v1.0.1 (#7)
* Refactor project structure and rename package to Clappia API Tools - Updated package name from `clappia-tools` to `clappia-api-tools` in `pyproject.toml`, `README.md`, and `uv.lock`. - Adjusted test paths in `pyproject.toml` to reflect the new package structure. - Removed unused modules and files related to the previous package structure. - Enhanced documentation in `README.md` to clarify the purpose and features of the Clappia API Tools. - Updated version to 1.0.0 to reflect the changes made in the package structure and naming. Signed-off-by: Rishabh Verma <rishabh.v@clappia.com> * Update package references and remove AppManagementClient - Changed package references from `clappia-tools` to `clappia-api-tools` in `pyproject.toml` and `README.md`. - Removed the `AppManagementClient` class and its references throughout the codebase, consolidating functionality into `AppDefinitionClient`. - Updated documentation to reflect the removal of `AppManagementClient` and added new methods for app creation and field management in `AppDefinitionClient`. - Adjusted tests to ensure compatibility with the updated client structure. Signed-off-by: Rishabh Verma <rishabh.v@clappia.com> * Update version to 1.0.1 in pyproject.toml and __init__.py Signed-off-by: Rishabh Verma <rishabh.v@clappia.com> --------- Signed-off-by: Rishabh Verma <rishabh.v@clappia.com>
1 parent 4d50fca commit 4c9a806

28 files changed

+850
-332
lines changed

README.md

Lines changed: 56 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,92 @@
1-
# Clappia Tools
1+
# Clappia API Tools
22

3-
**LangChain integration for Clappia API**
3+
**Clappia APIs SDK**
44

5-
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/clappia-tools)](https://pypi.org/project/clappia-tools/)
5+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/clappia-api-tools)](https://pypi.org/project/clappia-api-tools/)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
77

88
---
99

1010
## Overview
1111

12-
Clappia Tools is a Python package that provides a unified client and a set of tools for seamless integration with the [Clappia API](https://www.clappia.com/). 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).
12+
Clappia API Tools is a Python package that provides a set of clients for seamless integration with the [Clappia API](https://developer.clappia.com/). 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, MCP).
1313

1414
---
1515

1616
## Features
1717

18-
- **Unified API Client**: One client for all Clappia API operations.
18+
- **Multiple API Clients**: Dedicated clients for each Clappia API operation.
1919
- **Submission Management**: Create, edit, update owners, and change status of submissions.
20-
- **App Definition Retrieval**: Fetch complete app structure and metadata.
20+
- **App Definition Retrieval**: Fetch complete app structure and metadata and manage the app structure via fields and sections updates.
2121
- **Input Validation**: Built-in validation for IDs, emails, and status objects.
22-
- **Extensible Tools**: Modular functions for each operation, easily integrated into agents or scripts.
2322
- **Comprehensive Testing**: Includes unit and integration tests.
2423

2524
---
2625

26+
## Available Clients
27+
28+
- `SubmissionClient`: Manage submissions (create, edit, update owners, change status)
29+
- `AppDefinitionClient`: Retrieve app definitions and metadata and Manage app structure (fields, sections, creation)
30+
31+
---
32+
33+
## Documentation
34+
35+
- [Submission Client Reference](docs/submission_client.md)
36+
- [App Definition Client Reference](docs/app_definition_client.md)
37+
38+
---
39+
2740
## Installation
2841

2942
```bash
30-
pip install clappia-tools
43+
pip install clappia-api-tools
3144
```
3245

3346
Or, for development:
3447

3548
```bash
36-
git clone https://github.com/clappia-dev/clappia-tools.git
37-
cd clappia-tools
38-
pip install -e .[dev]
49+
git clone https://github.com/clappia-dev/clappia-api-tools.git
50+
cd clappia-api-tools
51+
pip install -e ."[dev]"
3952
```
4053

4154
---
4255

56+
## First-Time Setup
57+
58+
Before using or testing Clappia API Tools, set up your environment variables. Create a `.env` file in the project root with the following content:
59+
60+
```env
61+
CLAPPIA_API_KEY=your-api-key
62+
CLAPPIA_BASE_URL=https://api.clappia.com
63+
CLAPPIA_WORKPLACE_ID=your-workplace-id
64+
```
65+
66+
- Replace `your-api-key` and `your-workplace-id` with your actual Clappia credentials.
67+
- The `.env` file is included in `.gitignore` and will not be committed.
68+
- The package uses [python-dotenv](https://pypi.org/project/python-dotenv/) to load these variables automatically if present.
69+
70+
---
71+
4372
## Configuration
4473

45-
You must provide your Clappia API credentials and workspace information directly when initializing the `ClappiaClient`:
74+
You must provide your Clappia API credentials and workspace information directly when initializing any client:
4675

4776
- `api_key`: Your Clappia API key
4877
- `base_url`: The base URL for the Clappia API (e.g., `https://api.clappia.com`)
4978
- `workplace_id`: Your Clappia workplace ID
5079

51-
**Example:**
52-
53-
```python
54-
from clappia_tools import ClappiaClient
55-
56-
client = ClappiaClient(
57-
api_key="your-api-key",
58-
base_url="https://api.clappia.com",
59-
workplace_id="your-workplace-id"
60-
)
61-
```
6280
---
6381

6482
## Usage
6583

66-
### Basic Client Usage
84+
### SubmissionClient Example
6785

6886
```python
69-
from clappia_tools import ClappiaClient
87+
from clappia_api_tools.client.submission_client import SubmissionClient
7088

71-
client = ClappiaClient(
89+
client = SubmissionClient(
7290
api_key="your-api-key",
7391
base_url="https://api.clappia.com",
7492
workplace_id="your-workplace-id"
@@ -78,69 +96,29 @@ client = ClappiaClient(
7896
result = client.create_submission(
7997
app_id="MFX093412",
8098
data={"employee_name": "John Doe", "department": "Engineering"},
81-
email="user@example.com"
99+
requesting_user_email_address="user@example.com"
82100
)
83101
print(result)
84-
85-
# Edit a submission
86-
result = client.edit_submission(
87-
app_id="MFX093412",
88-
submission_id="HGO51464561",
89-
data={"department": "Marketing"},
90-
email="user@example.com"
91-
)
92-
print(result)
93-
94-
# Get app definition
95-
result = client.get_app_definition(app_id="MFX093412")
96-
print(result)
97102
```
98103

99-
### Tool Functions
100-
101-
You can also use the modular tool functions directly:
104+
### AppDefinitionClient Example
102105

103106
```python
104-
from clappia_tools._tools import (
105-
create_clappia_submission,
106-
edit_clappia_submission,
107-
get_app_definition,
108-
update_clappia_submission_owners,
109-
update_clappia_submission_status,
110-
)
107+
from clappia_api_tools.client.app_definition_client import AppDefinitionClient
111108

112-
# Create a submission
113-
data = {"employee_name": "Jane Doe", "department": "HR"}
114-
response = create_clappia_submission("MFX093412", data, "user@example.com")
115-
print(response)
116-
117-
# Update submission owners
118-
response = update_clappia_submission_owners(
119-
"MFX093412", "HGO51464561", "admin@example.com", ["user1@company.com", "user2@company.com"]
109+
client = AppDefinitionClient(
110+
api_key="your-api-key",
111+
base_url="https://api.clappia.com",
112+
workplace_id="your-workplace-id"
120113
)
121-
print(response)
122114

123-
# Update submission status
124-
response = update_clappia_submission_status(
125-
"MFX093412", "HGO51464561", "admin@example.com", {"statusName": "Approved", "comments": "Reviewed."}
126-
)
127-
print(response)
115+
# Get app definition
116+
result = client.get_definition(app_id="MFX093412")
117+
print(result)
128118
```
129119

130120
---
131121

132-
## Available Tools
133-
134-
- `create_clappia_submission(app_id, data, email)`
135-
- `edit_clappia_submission(app_id, submission_id, data, email)`
136-
- `get_app_definition(app_id, language="en", strip_html=True, include_tags=True)`
137-
- `update_clappia_submission_owners(app_id, submission_id, requesting_user_email_address, email_ids)`
138-
- `update_clappia_submission_status(app_id, submission_id, requesting_user_email_address, status)`
139-
140-
See docstrings in each tool for detailed argument and return value descriptions.
141-
142-
---
143-
144122
## Input Validation
145123

146124
- **App ID**: Must be uppercase letters and numbers (e.g., `MFX093412`).
@@ -154,6 +132,8 @@ Invalid inputs will return descriptive error messages.
154132

155133
## Testing
156134

135+
Before running tests, ensure your `.env` file is present in the project root with valid credentials. The test suite will load environment variables automatically.
136+
157137
Run all tests (unit and integration):
158138

159139
```bash
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
from .client.clappia_client import ClappiaClient
88
from .client.app_definition_client import AppDefinitionClient
9-
from .client.app_management_client import AppManagementClient
109
from .client.submission_client import SubmissionClient
1110

12-
__version__ = "0.1.5"
13-
__all__ = ["ClappiaClient", "AppDefinitionClient", "AppManagementClient", "SubmissionClient"]
11+
__version__ = "1.0.1"
12+
__all__ = ["ClappiaClient", "AppDefinitionClient", "SubmissionClient"]
1413

1514

1615
def __dir__():
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import requests
44
from typing import Optional, Dict, Any, Tuple
5-
from clappia_tools._utils.logging_utils import get_logger
5+
from clappia_api_tools._utils.logging_utils import get_logger
66

77
logger = get_logger(__name__)
88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22
from typing import Tuple, List
3-
from clappia_tools._models.model import Section
3+
from clappia_api_tools._models.model import Section
44

55
class ClappiaInputValidator:
66
"""Validates user inputs like app IDs, emails, etc."""

0 commit comments

Comments
 (0)