# Gmail Automation Bot
A lightweight Python library for creating automated email response systems using Gmail. This bot monitors your Gmail inbox for new messages and responds to them automatically using a custom response function.
## Features
- 🔄 Continuous email monitoring
- ✨ Automatic responses to new emails
- 🚫 Built-in filtering for system emails
- 🔒 Secure authentication using Gmail App Passwords
- 📝 Customizable response function
- 🎯 Smart email threading with proper subject prefixing
- 💫 Beautiful terminal spinner animation during execution
## Installation
```bash
pip install imaplib email smtplib
```
## Quick Start
```python
from gmaillite import GmailAutomation
def response_func(subject, body):
# Define your custom response logic here
response = f"This is an automated response to your email: {body}"
return response
# Initialize the bot with your credentials
gmail = GmailAutomation(response_func)
# Start the bot
gmail.start()
```
## Configuration Options
```python
GmailAutomation(
response_func, # Your custom response function
email_address='your.email@gmail.com', # Gmail address
app_password='your-app-password' # Gmail App Password
)
```
### Starting the Bot
```python
# Start with default 2-second check interval
gmail.start()
# Or specify custom check interval (in seconds)
gmail.start(sleep_time=5)
```
## Custom Response Function
The response function receives two parameters:
- `subject`: The email subject
- `body`: The email body
Example:
```python
def response_func(subject, body):
if "urgent" in subject.lower():
return "I'll process your urgent request soon!"
return f"Thank you for your email about: {subject}"
```
## Features in Detail
### Email Filtering
The bot automatically filters out system emails from:
- noreply addresses
- Google Community Team
- Google Play notifications
- Other automated system notifications
### Logging
Built-in logging system with:
- Info level logging for successful operations
- Error level logging for issues
- Debug level logging for system email filtering
### Error Handling
Robust error handling for:
- Email connection issues
- Authentication problems
- Message processing errors
## Security Notes
- Never commit your email credentials to version control
- Always use App Passwords instead of your main Gmail password
- Consider storing credentials in environment variables
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.
## Support
For issues and feature requests, please open an issue on the GitHub repository.
Raw data
{
"_id": null,
"home_page": "https://github.com/santhosh/",
"name": "gmaillite",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Kammari Santhosh",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/5f/a0/9278528a26c4fa0752240436496a7e6d4b7176cd129c9eec3923d8cadd32/gmaillite-0.2.12.tar.gz",
"platform": null,
"description": "# Gmail Automation Bot\n\nA lightweight Python library for creating automated email response systems using Gmail. This bot monitors your Gmail inbox for new messages and responds to them automatically using a custom response function.\n\n## Features\n\n- \ud83d\udd04 Continuous email monitoring\n- \u2728 Automatic responses to new emails\n- \ud83d\udeab Built-in filtering for system emails\n- \ud83d\udd12 Secure authentication using Gmail App Passwords\n- \ud83d\udcdd Customizable response function\n- \ud83c\udfaf Smart email threading with proper subject prefixing\n- \ud83d\udcab Beautiful terminal spinner animation during execution\n\n## Installation\n\n```bash\npip install imaplib email smtplib\n```\n\n\n## Quick Start\n\n```python\nfrom gmaillite import GmailAutomation\n\ndef response_func(subject, body):\n # Define your custom response logic here\n response = f\"This is an automated response to your email: {body}\"\n return response\n\n# Initialize the bot with your credentials\ngmail = GmailAutomation(response_func)\n\n# Start the bot\ngmail.start()\n```\n\n## Configuration Options\n\n```python\nGmailAutomation(\n response_func, # Your custom response function\n email_address='your.email@gmail.com', # Gmail address\n app_password='your-app-password' # Gmail App Password\n)\n```\n\n### Starting the Bot\n\n```python\n# Start with default 2-second check interval\ngmail.start()\n\n# Or specify custom check interval (in seconds)\ngmail.start(sleep_time=5)\n```\n\n## Custom Response Function\n\nThe response function receives two parameters:\n- `subject`: The email subject\n- `body`: The email body\n\nExample:\n\n```python\ndef response_func(subject, body):\n if \"urgent\" in subject.lower():\n return \"I'll process your urgent request soon!\"\n return f\"Thank you for your email about: {subject}\"\n```\n\n## Features in Detail\n\n### Email Filtering\nThe bot automatically filters out system emails from:\n- noreply addresses\n- Google Community Team\n- Google Play notifications\n- Other automated system notifications\n\n### Logging\nBuilt-in logging system with:\n- Info level logging for successful operations\n- Error level logging for issues\n- Debug level logging for system email filtering\n\n### Error Handling\nRobust error handling for:\n- Email connection issues\n- Authentication problems\n- Message processing errors\n\n## Security Notes\n\n- Never commit your email credentials to version control\n- Always use App Passwords instead of your main Gmail password\n- Consider storing credentials in environment variables\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 file for details.\n\n## Support\n\nFor issues and feature requests, please open an issue on the GitHub repository.",
"bugtrack_url": null,
"license": "MIT",
"summary": "automated email",
"version": "0.2.12",
"project_urls": {
"Homepage": "https://github.com/santhosh/",
"Repository": "https://github.com/santhosh/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4d3098252b9cb55a90683cad320c2fcd2bf34a726e9a358fa0e00b8d4e7b5845",
"md5": "462ea6621f0c81f4c8e6f9b878df108a",
"sha256": "47481c1cf5101154845905415f2972cecfd576dbe1bfe348c7fa9f3b6c7eeaf2"
},
"downloads": -1,
"filename": "gmaillite-0.2.12-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "462ea6621f0c81f4c8e6f9b878df108a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 5057,
"upload_time": "2024-12-25T17:55:05",
"upload_time_iso_8601": "2024-12-25T17:55:05.861732Z",
"url": "https://files.pythonhosted.org/packages/4d/30/98252b9cb55a90683cad320c2fcd2bf34a726e9a358fa0e00b8d4e7b5845/gmaillite-0.2.12-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5fa09278528a26c4fa0752240436496a7e6d4b7176cd129c9eec3923d8cadd32",
"md5": "fc0bee246178f9e39d951e4fbdb23971",
"sha256": "cce4877b06d6df8130b1fec623e6879559a037acbc6e94b451b21023d752d6a1"
},
"downloads": -1,
"filename": "gmaillite-0.2.12.tar.gz",
"has_sig": false,
"md5_digest": "fc0bee246178f9e39d951e4fbdb23971",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4387,
"upload_time": "2024-12-25T17:55:08",
"upload_time_iso_8601": "2024-12-25T17:55:08.251313Z",
"url": "https://files.pythonhosted.org/packages/5f/a0/9278528a26c4fa0752240436496a7e6d4b7176cd129c9eec3923d8cadd32/gmaillite-0.2.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-25 17:55:08",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "gmaillite"
}