# Melonly API Python Client
A comprehensive Python client library for the Melonly API, providing easy access to server management, applications, logs, shifts, and more.
## Features
- **Full API Coverage**: Complete support for all Melonly API endpoints
- **Type Hints**: Full type annotations for better IDE support and code safety
- **Async Support**: Both synchronous and asynchronous client implementations
- **Error Handling**: Comprehensive error handling with custom exceptions
- **Pagination**: Built-in pagination support for list endpoints
- **Rate Limiting**: Automatic rate limiting and retry logic
- **Documentation**: Extensive documentation and examples
## Installation
```bash
pip install melonly-api
```
## Quick Start
```python
from melonly import MelonlyClient
# Initialize the client
client = MelonlyClient(token="your-api-token")
# Get server information
server = client.get_server_info()
print(f"Server: {server.name}")
# Get applications
applications = client.get_applications()
for app in applications.data:
print(f"Application: {app.title}")
# Get logs with pagination
logs = client.get_logs(page=1, limit=50)
for log in logs.data:
print(f"Log: {log.text}")
```
## Async Usage
```python
import asyncio
from melonly import AsyncMelonlyClient
async def main():
client = AsyncMelonlyClient(token="your-api-token")
# Get server information
server = await client.get_server_info()
print(f"Server: {server.name}")
# Don't forget to close the client
await client.close()
# Run the async function
asyncio.run(main())
```
## API Reference
### Applications
```python
# Get all applications
applications = client.get_applications()
# Get specific application
app = client.get_application("app_id")
# Get application responses
responses = client.get_application_responses("app_id")
# Get user application responses
user_responses = client.get_user_application_responses("user_id")
```
### Members
```python
# Get all members
members = client.get_members()
# Get specific member
member = client.get_member("member_id")
# Get member by Discord ID
member = client.get_member_by_discord_id("discord_id")
```
### Logs
```python
# Get all logs
logs = client.get_logs()
# Get specific log
log = client.get_log("log_id")
# Get logs by user
user_logs = client.get_user_logs("username")
# Get logs by staff
staff_logs = client.get_staff_logs("staff_id")
```
### Shifts
```python
# Get all shifts
shifts = client.get_shifts()
# Get specific shift
shift = client.get_shift("shift_id")
```
### Other Resources
```python
# Get roles
roles = client.get_roles()
role = client.get_role("role_id")
# Get LOAs (Leave of Absence)
loas = client.get_loas()
loa = client.get_loa("loa_id")
user_loas = client.get_user_loas("member_id")
# Get join requests
join_requests = client.get_join_requests()
join_request = client.get_join_request("user_id")
# Get audit logs
audit_logs = client.get_audit_logs()
```
## Error Handling
```python
from melonly import MelonlyClient, MelonlyAPIError, MelonlyNotFoundError
client = MelonlyClient(token="your-token")
try:
member = client.get_member("invalid_id")
except MelonlyNotFoundError:
print("Member not found")
except MelonlyAPIError as e:
print(f"API Error: {e.message}")
```
## Configuration
The client can be configured with various options:
```python
client = MelonlyClient(
token="your-token",
base_url="https://api.melonly.xyz/api/v1", # Custom base URL
timeout=30, # Request timeout in seconds
max_retries=3, # Maximum number of retries
retry_delay=1.0, # Delay between retries
)
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Support
- Documentation: [https://melonly-api.readthedocs.io/](https://melonly-api.readthedocs.io/)
- Issues: [https://github.com/yourusername/melonly-api/issues](https://github.com/yourusername/melonly-api/issues)
- Melonly API Documentation: [https://api.melonly.xyz/docs](https://api.melonly.xyz/docs)
Raw data
{
"_id": null,
"home_page": "https://github.com/Melonly-Moderation/py-melonly-client",
"name": "melonly-api",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "melonly, api, client, discord, server, management",
"author": "Melonly API Client",
"author_email": "Melonly API Client <contact@example.com>",
"download_url": "https://files.pythonhosted.org/packages/ec/0e/c467a39bfe0a793f9cc35e68e9e1cf1f4192fd86853cf6ddbeb144a25b10/melonly_api-1.0.0.tar.gz",
"platform": null,
"description": "# Melonly API Python Client\n\nA comprehensive Python client library for the Melonly API, providing easy access to server management, applications, logs, shifts, and more.\n\n## Features\n\n- **Full API Coverage**: Complete support for all Melonly API endpoints\n- **Type Hints**: Full type annotations for better IDE support and code safety\n- **Async Support**: Both synchronous and asynchronous client implementations\n- **Error Handling**: Comprehensive error handling with custom exceptions\n- **Pagination**: Built-in pagination support for list endpoints\n- **Rate Limiting**: Automatic rate limiting and retry logic\n- **Documentation**: Extensive documentation and examples\n\n## Installation\n\n```bash\npip install melonly-api\n```\n\n## Quick Start\n\n```python\nfrom melonly import MelonlyClient\n\n# Initialize the client\nclient = MelonlyClient(token=\"your-api-token\")\n\n# Get server information\nserver = client.get_server_info()\nprint(f\"Server: {server.name}\")\n\n# Get applications\napplications = client.get_applications()\nfor app in applications.data:\n print(f\"Application: {app.title}\")\n\n# Get logs with pagination\nlogs = client.get_logs(page=1, limit=50)\nfor log in logs.data:\n print(f\"Log: {log.text}\")\n```\n\n## Async Usage\n\n```python\nimport asyncio\nfrom melonly import AsyncMelonlyClient\n\nasync def main():\n client = AsyncMelonlyClient(token=\"your-api-token\")\n \n # Get server information\n server = await client.get_server_info()\n print(f\"Server: {server.name}\")\n \n # Don't forget to close the client\n await client.close()\n\n# Run the async function\nasyncio.run(main())\n```\n\n## API Reference\n\n### Applications\n\n```python\n# Get all applications\napplications = client.get_applications()\n\n# Get specific application\napp = client.get_application(\"app_id\")\n\n# Get application responses\nresponses = client.get_application_responses(\"app_id\")\n\n# Get user application responses\nuser_responses = client.get_user_application_responses(\"user_id\")\n```\n\n### Members\n\n```python\n# Get all members\nmembers = client.get_members()\n\n# Get specific member\nmember = client.get_member(\"member_id\")\n\n# Get member by Discord ID\nmember = client.get_member_by_discord_id(\"discord_id\")\n```\n\n### Logs\n\n```python\n# Get all logs\nlogs = client.get_logs()\n\n# Get specific log\nlog = client.get_log(\"log_id\")\n\n# Get logs by user\nuser_logs = client.get_user_logs(\"username\")\n\n# Get logs by staff\nstaff_logs = client.get_staff_logs(\"staff_id\")\n```\n\n### Shifts\n\n```python\n# Get all shifts\nshifts = client.get_shifts()\n\n# Get specific shift\nshift = client.get_shift(\"shift_id\")\n```\n\n### Other Resources\n\n```python\n# Get roles\nroles = client.get_roles()\nrole = client.get_role(\"role_id\")\n\n# Get LOAs (Leave of Absence)\nloas = client.get_loas()\nloa = client.get_loa(\"loa_id\")\nuser_loas = client.get_user_loas(\"member_id\")\n\n# Get join requests\njoin_requests = client.get_join_requests()\njoin_request = client.get_join_request(\"user_id\")\n\n# Get audit logs\naudit_logs = client.get_audit_logs()\n```\n\n## Error Handling\n\n```python\nfrom melonly import MelonlyClient, MelonlyAPIError, MelonlyNotFoundError\n\nclient = MelonlyClient(token=\"your-token\")\n\ntry:\n member = client.get_member(\"invalid_id\")\nexcept MelonlyNotFoundError:\n print(\"Member not found\")\nexcept MelonlyAPIError as e:\n print(f\"API Error: {e.message}\")\n```\n\n## Configuration\n\nThe client can be configured with various options:\n\n```python\nclient = MelonlyClient(\n token=\"your-token\",\n base_url=\"https://api.melonly.xyz/api/v1\", # Custom base URL\n timeout=30, # Request timeout in seconds\n max_retries=3, # Maximum number of retries\n retry_delay=1.0, # Delay between retries\n)\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to 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## Support\n\n- Documentation: [https://melonly-api.readthedocs.io/](https://melonly-api.readthedocs.io/)\n- Issues: [https://github.com/yourusername/melonly-api/issues](https://github.com/yourusername/melonly-api/issues)\n- Melonly API Documentation: [https://api.melonly.xyz/docs](https://api.melonly.xyz/docs)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python client library for the Melonly API",
"version": "1.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/yourusername/melonly-api/issues",
"Documentation": "https://melonly-api.readthedocs.io/",
"Homepage": "https://github.com/yourusername/melonly-api",
"Repository": "https://github.com/yourusername/melonly-api.git"
},
"split_keywords": [
"melonly",
" api",
" client",
" discord",
" server",
" management"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0a02e793e5a3c9f92f8bc8ab03c45fbabd0d962575a214cec7e993dfaaad15a4",
"md5": "9a5f51ebf47182663cb43e8754d6ea1d",
"sha256": "894389e803e47bc98b4886f142f11823d94e9cf0cf4fd3870ff7663e80f7c2d2"
},
"downloads": -1,
"filename": "melonly_api-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9a5f51ebf47182663cb43e8754d6ea1d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 13351,
"upload_time": "2025-07-28T23:37:26",
"upload_time_iso_8601": "2025-07-28T23:37:26.111879Z",
"url": "https://files.pythonhosted.org/packages/0a/02/e793e5a3c9f92f8bc8ab03c45fbabd0d962575a214cec7e993dfaaad15a4/melonly_api-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ec0ec467a39bfe0a793f9cc35e68e9e1cf1f4192fd86853cf6ddbeb144a25b10",
"md5": "467fb4cb46b691f702e8c86dd3df888e",
"sha256": "f6d69cc817c9e32d5c4f5f6613681bad28a5520aa783e6db35a3218cd84f5595"
},
"downloads": -1,
"filename": "melonly_api-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "467fb4cb46b691f702e8c86dd3df888e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 15028,
"upload_time": "2025-07-28T23:37:27",
"upload_time_iso_8601": "2025-07-28T23:37:27.193543Z",
"url": "https://files.pythonhosted.org/packages/ec/0e/c467a39bfe0a793f9cc35e68e9e1cf1f4192fd86853cf6ddbeb144a25b10/melonly_api-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-28 23:37:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Melonly-Moderation",
"github_project": "py-melonly-client",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
">=",
"2.25.0"
]
]
},
{
"name": "aiohttp",
"specs": []
},
{
"name": "urllib3",
"specs": []
},
{
"name": "typing-extensions",
"specs": [
[
">=",
"4.0.0"
]
]
},
{
"name": "setuptools",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "aioresponses",
"specs": []
},
{
"name": "responses",
"specs": []
}
],
"lcname": "melonly-api"
}