{"id":25602839,"url":"https://github.com/abbasi0abolfazl/forexfactory-scraper","last_synced_at":"2026-04-26T07:30:17.093Z","repository":{"id":277227225,"uuid":"931746000","full_name":"abbasi0abolfazl/forexfactory_calender","owner":"abbasi0abolfazl","description":"Python script to fetch and process Forex events from ForexFactory","archived":false,"fork":false,"pushed_at":"2025-02-20T09:31:39.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T10:31:27.999Z","etag":null,"topics":["algo-trading","forex","forex-trading","python","python-3","python3","trading"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abbasi0abolfazl.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}},"created_at":"2025-02-12T19:36:59.000Z","updated_at":"2025-02-20T09:31:42.000Z","dependencies_parsed_at":"2025-02-12T20:44:15.248Z","dependency_job_id":null,"html_url":"https://github.com/abbasi0abolfazl/forexfactory_calender","commit_stats":null,"previous_names":["abbasi0abolfazl/forexfactory_calender"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbasi0abolfazl%2Fforexfactory_calender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbasi0abolfazl%2Fforexfactory_calender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbasi0abolfazl%2Fforexfactory_calender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbasi0abolfazl%2Fforexfactory_calender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbasi0abolfazl","download_url":"https://codeload.github.com/abbasi0abolfazl/forexfactory_calender/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240056096,"owners_count":19741074,"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","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":["algo-trading","forex","forex-trading","python","python-3","python3","trading"],"created_at":"2025-02-21T17:24:13.078Z","updated_at":"2026-04-26T07:30:17.033Z","avatar_url":"https://github.com/abbasi0abolfazl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Forex Events Scheduler\n\n![Python](https://img.shields.io/badge/Python-3.x-blue)\n![License](https://img.shields.io/badge/License-Apache%202.0-blue)\n\nThis repository contains a Python script that fetches and processes Forex events from [ForexFactory's](https://www.forexfactory.com/) weekly calendar. The script is designed to run periodically, saving Forex events to structured files for easy analysis and tracking. It supports filtering events by country, title, and impact, and allows users to save the output in either JSON or TXT format.\n\n## Features\n\n- **Automated Fetching**: Fetches Forex events from ForexFactory's weekly calendar (XML format) every hour.\n- **Event Parsing**: Extracts key details for each event, including title, country, date, time, impact, forecast, previous value, and URL.\n- **Custom Filters**: Filter events by:\n  - **Country** (e.g., USD, EUR)\n  - **Title** (case-insensitive search)\n  - **Impact** (e.g., High, Medium, Low)\n- **Flexible Output Formats**: Save events in:\n  - **JSON**: Structured and machine-readable format.\n  - **TXT**: Human-readable, formatted text files.\n- **Custom File Names**: Specify a custom base name for output files.\n- **Scheduling**: Automatically runs the script every hour using the `schedule` library.\n\n## Prerequisites\n\n- Python 3.x\n\n## Installation\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/abbasi0abolfazl/forexfactory_calender.git\n    cd forexfactory_calender\n    ```\n\n2. Create a virtual environment and activate it:\n    ```sh\n    python -m venv env\n    source env/bin/activate  # On Windows, use `env\\Scripts\\activate`\n    ```\n\n3. Install the required packages:\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n## Usage\n\nRun the script with the following command:\n\n```sh\npython forex_events_scheduler.py\n```\n\n### Command-Line Options\n\n| Option           | Description                                                                 |\n|------------------|-----------------------------------------------------------------------------|\n| `--schedule`     | Schedule the script to run every hour.                                      |\n| `--country`      | Filter events by country (e.g., `USD`, `EUR`).                              |\n| `--title`        | Filter events by title (case-insensitive).                                  |\n| `--impact`       | Filter events by impact (e.g., `High`, `Medium`, `Low`).                    |\n| `--save-format`  | Save format: `json` or `txt` (default: `json`).                             |\n| `--output-file`  | Base name for the output file (without extension, default: `filtered_events`). |\n\n### Examples\n\n1. **Run Once with Default Settings**:\n   ```sh\n   python forex_events_scheduler.py\n   ```\n   Output files: `filtered_events.json` or `filtered_events.txt`.\n\n2. **Filter by Country and Save as TXT**:\n   ```sh\n   python forex_events_scheduler.py --country USD --save-format txt --output-file usd_events\n   ```\n   Output file: `usd_events.txt`.\n\n3. **Schedule the Script to Run Every Hour**:\n   ```sh\n   python forex_events_scheduler.py --schedule\n   ```\n\n4. **Custom File Name and Filters**:\n   ```sh\n   python forex_events_scheduler.py --country USD --impact High --output-file high_impact_usd_events\n   ```\n   Output file: `high_impact_usd_events.json`.\n\n## Running as a Background Process\n\nTo run the script as a background process, you can use `nohup` or a process manager like `systemd`:\n\n```sh\nnohup python forex_events_scheduler.py --schedule \u0026\n```\n\n## Output Files\n\nThe script generates output files based on the provided options:\n- **JSON Format**:\n  ```json\n  [\n      {\n          \"title\": \"Nonfarm Payrolls\",\n          \"country\": \"USD\",\n          \"date\": \"10-27-2023\",\n          \"time\": \"08:30am\",\n          \"impact\": \"High\",\n          \"forecast\": \"200K\",\n          \"previous\": \"187K\",\n          \"url\": \"https://www.forexfactory.com/event/12345\"\n      }\n  ]\n  ```\n\n- **TXT Format**:\n  ```\n  Title: Nonfarm Payrolls\n  Country: USD\n  Date: 10-27-2023\n  Time: 08:30am\n  Impact: High\n  Forecast: 200K\n  Previous: 187K\n  URL: https://www.forexfactory.com/event/12345\n  ----------------------------------------\n  ```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbasi0abolfazl%2Fforexfactory-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbasi0abolfazl%2Fforexfactory-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbasi0abolfazl%2Fforexfactory-scraper/lists"}