{"id":30284694,"url":"https://github.com/krumyakimov/integration-file-processor-async","last_synced_at":"2026-05-20T14:02:09.981Z","repository":{"id":306402955,"uuid":"1020931684","full_name":"KrumYakimov/Integration-File-Processor-Async","owner":"KrumYakimov","description":"Asynchronous JSON file processor using public APIs and scheduled task execution","archived":false,"fork":false,"pushed_at":"2025-07-25T08:50:47.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T19:30:09.352Z","etag":null,"topics":["api-integration","async","asyncio","automation","data-processing","file-processing","integration","json","public-api","python","scheduler","webservice"],"latest_commit_sha":null,"homepage":"","language":"Python","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/KrumYakimov.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}},"created_at":"2025-07-16T16:00:52.000Z","updated_at":"2025-07-25T08:50:51.000Z","dependencies_parsed_at":"2025-07-25T14:27:13.365Z","dependency_job_id":"091a8ca5-d6c2-41f3-b763-f8783f3a82e3","html_url":"https://github.com/KrumYakimov/Integration-File-Processor-Async","commit_stats":null,"previous_names":["krumyakimov/integration-file-processor-async"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KrumYakimov/Integration-File-Processor-Async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrumYakimov%2FIntegration-File-Processor-Async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrumYakimov%2FIntegration-File-Processor-Async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrumYakimov%2FIntegration-File-Processor-Async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrumYakimov%2FIntegration-File-Processor-Async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KrumYakimov","download_url":"https://codeload.github.com/KrumYakimov/Integration-File-Processor-Async/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrumYakimov%2FIntegration-File-Processor-Async/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33262695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T04:48:54.280Z","status":"ssl_error","status_checked_at":"2026-05-20T04:48:10.851Z","response_time":356,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api-integration","async","asyncio","automation","data-processing","file-processing","integration","json","public-api","python","scheduler","webservice"],"created_at":"2025-08-16T19:14:47.095Z","updated_at":"2026-05-20T14:02:09.975Z","avatar_url":"https://github.com/KrumYakimov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Integration File Processor (Async)\n\n![Python](https://img.shields.io/badge/python-3.11-blue)\n![Async](https://img.shields.io/badge/async-enabled-green)\n![License](https://img.shields.io/github/license/KrumYakimov/Integration-File-Processor-Async)\n![Last Commit](https://img.shields.io/github/last-commit/KrumYakimov/Integration-File-Processor-Async)\n\n📄 [Online Documentation](https://krumyakimov.github.io/Integration-File-Processor-Async/)\n\nThis project demonstrates the design and implementation of an **integration service** that automates JSON file processing and communication with external REST APIs.\n\nIt showcases:\n\n* **System integration** – consuming and posting data via public APIs.\n*  **Automation \u0026 scheduling** – processing tasks at scale (up to hundreds of thousands of files daily).\n*  **Modular architecture (MVC)** – separation of concerns for maintainability and extensibility.\n*  **Resilience** – structured logging for monitoring and troubleshooting.\n*  **Quality assurance** – unit and integration tests included.\n\nThis solution simulates real-world **backend integration scenarios** where data pipelines must reliably process, enrich, and forward information between systems.\n\n## Description\n\nIntegration File Processor is an asynchronous Python-based tool for automating the processing of JSON files placed in nested folders within an `INPUT/` directory. Each JSON file defines a task type and is processed accordingly, making use of public APIs. The output is stored as a new JSON file and the original file is deleted upon success.\n\n\n## Features\n\n- Processes all `.json` files from nested subfolders under `INPUT/`\n- Handles task types:\n  - `age`: Predicts age using the Agify API\n  - `joke`: Fetches a random joke from the Official Joke API\n  - Other: Forwards the original JSON unchanged\n- Sends the resulting data to a Postman Echo endpoint\n- Writes output JSON files with a suffix and removes originals\n- Logs processing info and errors to separate log files\n\n\n## Setup Instructions\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/KrumYakimov/Integration-File-Processor-Async.git\ncd integration_file_processor_async\n````\n\n### 2. Create a virtual environment (optional)\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n### 3. Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### 4. Configure `.env` file\n\n- Create a `.env` file in the project root and define the following variables:\n  ```plaintext\n  # Logging configuration\n  LOG_DIR=\u003cyour_log_directory\u003e             # Directory for log files (e.g. logs)\n  LOG_TO_CONSOLE=\u003cTrue|False\u003e              # Whether to print logs to console\n\n  # Scheduler configuration\n  PROCESS_TIME=\u003cHH:MM\u003e                     # Time of day to trigger processing (e.g. 18:10)\n\n## Usage\n\nUsage\n- Create the INPUT/ directory in the root folder.\n\n- Place one or more subdirectories inside, each containing .json task files. Example input:\n\n```json\n{\n  \"name\": \"Maria\",\n  \"type\": \"\u003ctask_type\u003e\",\n  \"country\": \"BG\"\n}\n```\n\n- Run the processor:\n\n```bash\npython main.py\n```\n\nThis will process all `.json` files immediately and exit after completion.\n\n## Scheduled Execution Options\n\n### Option 1: Run long-running scheduler\n\n```bash\npython run_scheduler.py\n```\n\nThis script runs continuously in the background and triggers processing once per day at the time specified in `.env` (`PROCESS_TIME`).\n\nTo keep it running after closing the terminal:\n\n```bash\nnohup python run_scheduler.py \u0026\n```\n\n### Option 2: Schedule via cron (Linux/macOS)\n\nEdit your crontab:\n\n```bash\ncrontab -e\n```\n\nAdd a line (adjust the time and paths as needed):\n\n```cron\n10 18 * * * /path/to/venv/bin/python /path/to/integration_file_processor_async/main.py \u003e\u003e /path/to/logs/scheduler.log 2\u003e\u00261\n```\n\n### Option 3: Windows Task Scheduler\n\nCreate a daily task with:\n\n* Trigger: Daily at `18:10`\n* Action: `python path\\to\\run_scheduler.py`\n\n## Logs\n\n* `logs/info.log`: records processing time and status for each file\n* `logs/error.log`: records any encountered errors\n\n## Running Tests\n\nRun all tests:\n\n```bash\npytest\n```\n\nRun specific test types (with markers):\n\n```bash\npytest -m \"unit\"\npytest -m \"integration\"\n```\n\n## License\nThis project is licensed under the **MIT License**.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrumyakimov%2Fintegration-file-processor-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrumyakimov%2Fintegration-file-processor-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrumyakimov%2Fintegration-file-processor-async/lists"}