{"id":31802621,"url":"https://github.com/ilteoood/polipo","last_synced_at":"2025-10-11T00:52:01.517Z","repository":{"id":317817211,"uuid":"1068948107","full_name":"ilteoood/polipo","owner":"ilteoood","description":"Improve your Octopus' energy offer, with polipo! 🐙","archived":false,"fork":false,"pushed_at":"2025-10-03T07:56:38.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T09:09:14.439Z","etag":null,"topics":["energy","hacktoberfest","octopus","octopus-energy","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilteoood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-03T06:55:19.000Z","updated_at":"2025-10-03T07:56:42.000Z","dependencies_parsed_at":"2025-10-03T09:09:27.665Z","dependency_job_id":"f81831a9-caf9-47a0-b270-3199823e24f9","html_url":"https://github.com/ilteoood/polipo","commit_stats":null,"previous_names":["ilteoood/polipo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ilteoood/polipo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilteoood%2Fpolipo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilteoood%2Fpolipo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilteoood%2Fpolipo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilteoood%2Fpolipo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilteoood","download_url":"https://codeload.github.com/ilteoood/polipo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilteoood%2Fpolipo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005655,"owners_count":26083942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["energy","hacktoberfest","octopus","octopus-energy","rust"],"created_at":"2025-10-11T00:51:58.380Z","updated_at":"2025-10-11T00:52:01.509Z","avatar_url":"https://github.com/ilteoood.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polipo 🐙 - Octopus Energy Tariff Monitor\n\nPolipo is a Rust application that automatically monitors Octopus Energy tariffs and notifies you when better deals become available. It compares your current electricity and gas tariffs with the latest 12-month fixed offers and sends email notifications when advantageous tariff changes are found.\n\n\u003e [!NOTE]\n\u003e This project has been developed and tested only for the italian market 🇮🇹.\n\n## Features\n\n- **Automatic Tariff Monitoring**: Fetches the latest Octopus Energy tariffs from their website\n- **Account Integration**: Logs into your Octopus account to check your current tariffs\n- **Smart Comparison**: Compares raw material prices and marketing costs to find better deals\n- **Email Notifications**: Sends formatted emails to Octopus Energy requesting tariff adjustments\n- **Configurable Scheduling**: Runs on a configurable cron schedule\n- **Resource Efficient**: Built in Rust for minimal resource consumption\n\n## Business Logic\n\nThe application follows this process:\n\n1. **Fetch Latest Offers**: Retrieves the current 12-month fixed offers for electricity and gas from Octopus Energy's website\n2. **Account Login**: Authenticates with your Octopus account using your credentials\n3. **Current Tariff Check**: Fetches your current electricity and gas tariff details\n4. **Comparison Logic**: For each supply point, checks if new offers have:\n   - Lower or equal marketing price (annual standing charge)\n   - Lower raw material price (consumption charge)\n5. **Email Notification**: If better tariffs are found, sends a formatted email to Octopus Energy requesting the tariff change\n\n## Installation\n\n### Prerequisites\n\n- Rust (latest stable version)\n- Access to an SMTP server for sending emails\n- Octopus Energy account credentials\n\n### Build\n\n```bash\ngit clone \u003crepository-url\u003e\ncd polipo\ncargo build --release\n```\n\n## Project Structure\n\nThe project is organized into modular components for better maintainability:\n\n```\nsrc/\n├── main.rs             # Application entry point\n├── lib.rs              # Library root and main application logic\n├── config.rs           # Configuration management\n├── octopus             # Code related to Octopus\n   ├── models.rs        # Data structures for API responses\n   ├── client.rs        # Octopus Energy API client\n├── email.rs            # Email notification service\n└── scheduler.rs        # Cron scheduling utilities\n```\n\n### Module Overview\n\n- **`config`**: Handles environment variable configuration\n- **`octpus`**: Contains the code related the communication with Octopus APIs\n  - **`models`**: Defines all data structures for API responses and serialization\n  - **`client`**: Contains the Octopus Energy API client with methods for login, tariff fetching, and user data retrieval\n- **`email`**: Email service for sending SMTP notifications\n- **`scheduler`**: Cron expression parsing and scheduling utilities\n- **`lib`**: Main application logic and orchestration\n\n## Configuration\n\nPolipo uses environment variables for configuration. Create a `.env` file or set these variables in your environment:\n\n### Required Environment Variables\n\n```bash\n# Octopus Energy account credentials\nOCTOPUS_EMAIL=your-octopus-email@example.com\nOCTOPUS_PASSWORD=your-octopus-password\n\n# SMTP server configuration for sending emails\nSMTP_SERVER=smtp.your-provider.com\nSMTP_PORT=587\nSMTP_USERNAME=your-smtp-username\nSMTP_PASSWORD=your-smtp-password\n\n# Optional: Cron schedule (defaults to \"0 9 * * *\" - daily at 9 AM)\nCRON_SCHEDULE=\"0 9 * * *\"\n\n# Optional: Cache file location (defaults to \"/tmp/polipo_cache.json\")\nCACHE_FILE_PATH=./cache.json\n```\n\n### Cron Schedule Format\n\nThe `CRON_SCHEDULE` uses standard cron format:\n```\n* * * * *\n│ │ │ │ │\n│ │ │ │ └─── Day of week (0-7, Sunday = 0 or 7)\n│ │ │ └───── Month (1-12)\n│ │ └─────── Day of month (1-31)\n│ └───────── Hour (0-23)\n└─────────── Minute (0-59)\n```\n\nExamples:\n- `\"0 9 * * *\"` - Daily at 9:00 AM\n- `\"0 9 * * 1\"` - Every Monday at 9:00 AM\n- `\"0 */6 * * *\"` - Every 6 hours\n\n## Usage\n\n### Running the Application\n\n```bash\n# Using cargo\ncargo run --release\n\n# Or run the compiled binary\n./target/release/polipo\n```\n\n### Docker (Optional)\n\nDownload and run the image `ilteoood/polipo` from DockerHub:\n\n```bash\ndocker run -e OCTOPUS_EMAIL=your-email@example.com -e OCTOPUS_PASSWORD=your-password -e SMTP_SERVER=smtp.example.com -e SMTP_PORT=587 -e SMTP_USERNAME=smtp-user -e SMTP_PASSWORD=smtp-pass ilteoood/polipo\n```\n\n## Email Format\n\nWhen a better tariff is found, Polipo sends an email with the following format:\n\n**Subject**: `Richiesta adeguamento tariffa {TYPE} - account {ACCOUNT_NUMBER}`\n\n**Body**:\n```\nBuongiorno,\ncon la presente richiedo l'adeguamento della mia tariffa {TYPE} con quella attualmente in commercio, per l'account {ACCOUNT_NUMBER}.\nIn dettaglio, vorrei passare dalla mia tariffa da {CURRENT_PRICE} a quella da {NEW_PRICE}.\n\nCordiali saluti,\n{FULL_NAME}\n```\n\nWhere:\n- `{TYPE}` is \"luce\" (electricity) or \"gas\"\n- `{ACCOUNT_NUMBER}` is your Octopus account number\n- `{CURRENT_PRICE}` is your current consumption charge\n- `{NEW_PRICE}` is the new, better consumption charge\n- `{FULL_NAME}` is your full name from your Octopus account\n\n## Logging\n\nPolipo uses the `log` crate for logging. Set the `RUST_LOG` environment variable to control log levels:\n\n```bash\nexport RUST_LOG=info  # Default level\nexport RUST_LOG=debug # More verbose\nexport RUST_LOG=error # Errors only\n```\n\n## Security Considerations\n\n- Store sensitive environment variables (passwords, API keys) securely\n- Consider using a secrets management system in production\n- Ensure your SMTP credentials have limited permissions\n- The application stores no persistent data and processes credentials in memory only\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Login Failure**: Check your Octopus Energy credentials\n2. **Email Sending Failure**: Verify SMTP server settings and credentials\n3. **Tariff Fetching Issues**: Ensure internet connectivity and check if Octopus Energy website structure has changed\n4. **Cron Schedule**: Verify the cron expression format is correct\n\n### Debug Mode\n\nRun with debug logging to see detailed execution:\n\n```bash\nRUST_LOG=debug cargo run\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Disclaimer\n\nThis application is not affiliated with Octopus Energy. Use at your own risk and ensure compliance with Octopus Energy's terms of service. The authors are not responsible for any issues arising from the use of this software.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filteoood%2Fpolipo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filteoood%2Fpolipo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filteoood%2Fpolipo/lists"}