Robust Python client for Zymmr API built on Frappe Framework v14
Project description
Zymmr Client
A robust Python client library for interacting with Zymmr Project Management API, built on Frappe Framework v14.
✨ Features
- 🚀 Simple and Intuitive: Clean API interface inspired by frappe-client but more robust
- 🔐 Frappe Authentication: Session-based authentication with username/password
- 📋 Complete DocType Access: Get any DocType from your Zymmr instance
- 🔄 Robust Error Handling: Custom exceptions for all Frappe API scenarios
- ⚡ Retry Logic: Exponential backoff for network failures
- 💡 Type Safety: Full type hints for excellent developer experience
- 🎯 Production Ready: Built for real-world Frappe applications
📦 Installation
Using uv (Recommended)
uv add zymmr-client
Using pip
pip install zymmr-client
Using poetry
poetry add zymmr-client
🚀 Quick Start
from zymmr_client import ZymmrClient
# Initialize the client with your Zymmr instance
client = ZymmrClient(
base_url="https://zymmr.yourdomain.com",
username="your-username",
password="your-password"
)
# Get list of projects
projects = client.get_list("Project",
fields=["name", "project_name", "status"],
limit_page_length=10)
# Get list of tasks with filters
tasks = client.get_list("Task",
fields=["name", "subject", "status", "priority"],
filters={"status": ["in", ["Open", "Working"]]},
order_by="priority desc")
# Get a specific document
project = client.get_doc("Project", "PROJ-001")
# Test connection
if client.ping():
print("✅ Connected to Zymmr!")
# Get current user info
user_info = client.get_user_info()
print(f"Logged in as: {user_info['username']}")
🔧 Configuration
Basic Configuration
from zymmr_client import ZymmrClient
# Basic initialization
client = ZymmrClient(
base_url="https://zymmr.yourdomain.com",
username="your-username",
password="your-password"
)
# With custom timeout and retry settings
client = ZymmrClient(
base_url="https://zymmr.yourdomain.com",
username="your-username",
password="your-password",
timeout=60, # Request timeout in seconds
max_retries=5, # Max retry attempts
debug=True # Enable debug logging
)
Context Manager (Recommended)
# Automatic session cleanup
with ZymmrClient(base_url, username, password) as client:
projects = client.get_list("Project")
# Session automatically closed when done
📖 API Reference
Core Methods
get_list(doctype, **kwargs)
Get a list of documents from any Frappe DocType:
# Basic usage
projects = client.get_list("Project")
# With specific fields
projects = client.get_list("Project",
fields=["name", "project_name", "status"])
# With filters
open_tasks = client.get_list("Task",
fields=["name", "subject", "priority"],
filters={"status": "Open"},
order_by="priority desc",
limit_page_length=50)
# Complex filters
recent_projects = client.get_list("Project",
filters={
"status": ["in", ["Active", "On Hold"]],
"creation": [">", "2024-01-01"]
})
get_doc(doctype, name, fields=None)
Get a specific document:
# Get full document
project = client.get_doc("Project", "PROJ-001")
# Get specific fields only
task = client.get_doc("Task", "TASK-001",
fields=["name", "subject", "status"])
Utility Methods
# Test connection
is_connected = client.ping()
# Get current user information
user_info = client.get_user_info()
# Check authentication status
if client.is_authenticated:
print("Client is authenticated")
# Clean session cleanup
client.close()
Available DocTypes
Access any DocType from your Zymmr/Frappe instance:
# Standard Frappe DocTypes
users = client.get_list("User")
doctypes = client.get_list("DocType")
# Zymmr-specific DocTypes (depends on your setup)
projects = client.get_list("Project")
tasks = client.get_list("Task")
issues = client.get_list("Issue")
# Custom DocTypes
custom_docs = client.get_list("Your Custom DocType")
🛠️ Development
This project uses uv for dependency management and packaging:
# Clone the repository
git clone https://github.com/kiran-harbak/zymmr-client.git
cd zymmr-client
# Install dependencies
uv sync
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=zymmr_client
# Lint code
uv run ruff check .
# Format code
uv run ruff format .
# Type check
uv run mypy src/
# Build package
uv build
🧪 Running Tests
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=zymmr_client --cov-report=html
# Run specific test file
uv run pytest tests/test_client.py
# Run with verbose output
uv run pytest -v
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 Changelog
See CHANGELOG.md for a list of changes and version history.
🐛 Issues
If you encounter any issues or have feature requests, please create an issue on GitHub.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👤 Author
Kiran Harbak
- Email: kiran.harbak@amruts.com
- GitHub: @kiran-harbak
🙏 Acknowledgments
- Thanks to the Zymmr team for building on Frappe Framework
- Inspired by frappe-client but rebuilt for modern Python
- Built specifically for Frappe Framework v14 REST API
- Powered by uv for fast dependency management
⭐ If you find this package useful, please consider giving it a star on GitHub!
Package available on PyPI: https://pypi.org/project/zymmr-client/
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
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 zymmr_client-0.2.0.tar.gz.
File metadata
- Download URL: zymmr_client-0.2.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f1fba9e0f11838db87a2f4d5cd03c68c61db5137bfabc785c47c3e68601a32
|
|
| MD5 |
278ec1ef45d258b5b71295ef052f4237
|
|
| BLAKE2b-256 |
f8617b81926ff4174b4dbdc7a58a3340b434b6a10ad775acaf71f3da2b84129f
|
File details
Details for the file zymmr_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: zymmr_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d21b61fc23f8dd23f6570a80d26dc40fb3923579c72e0e5f081d18a83646a73
|
|
| MD5 |
e0a4dbe554afd338ec6c4b7a9a3d5848
|
|
| BLAKE2b-256 |
63e0cc36ae18930f2dbaaa8dac691fedf28fee861978b16b33b17db7cfe333dd
|