| Name | market-calendar-tool JSON |
| Version |
0.1.1
JSON |
| download |
| home_page | None |
| Summary | Market Calendar Tool is a Python package that scrapes economic calendar data from multiple financial websites and returns it as pandas DataFrames for easy analysis. |
| upload_time | 2024-10-20 23:08:22 |
| maintainer | None |
| docs_url | None |
| author | Pavel Krusek |
| requires_python | <4.0,>=3.12 |
| license | MIT |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Market Calendar Tool
A Python package for scraping economic calendar data from various financial websites.
## Legal notice
Please note that scraping data from websites must comply with the site's terms of service and legal requirements. The robots.txt files of the supported sites do not explicitly restrict scraping, but users should ensure they comply with local regulations and the website's terms.
## Features
- **Multi-Site Support**: Scrape data from multiple sites:
- [ForexFactory](https://www.forexfactory.com/calendar)
- [MetalsMine](https://www.metalsmine.com/calendar)
- [EnergyExch](https://www.energyexch.com/calendar)
- [CryptoCraft](https://www.cryptocraft.com/calendar)
- **Flexible Date Range**: Specify custom date ranges for scraping.
- **Extended Data Retrieval**: Option to retrieve extended data for each event.
- **Easy-to-Use API**: Simple and intuitive function to get you started quickly.
- **DataFrame Output**: Returns raw data scraped from the website as pandas DataFrame(s) for further processing.
## Installation
Install the package via pip:
```bash
pip install market-calendar-tool
```
## Requirements
- **Python Version**: Python **3.12** or higher is required.
- **Dependencies**:
- The package relies on several libraries such as `loguru`, `requests`, `pandas`, `asyncio`, and `aiohttp`.
- These libraries will be automatically installed when you install the package.
## Usage
Import the package and use the `scrape_calendar` function.
```python
from market_calendar_tool import scrape_calendar, Site, ScrapeResult
# Basic usage: scrape data from today to one week ahead from ForexFactory
df = scrape_calendar()
# Specify a different site
df = scrape_calendar(site=Site.METALSMINE)
# Specify date range
df = scrape_calendar(date_from="2023-01-01", date_to="2023-01-07")
# Retrieve extended data
result = scrape_calendar(extended=True)
print(result.base) # Basic event data
print(result.specs) # Event specifications
print(result.history) # Historical data
print(result.news) # Related news articles
```
## Parameters
- `site` (optional): The website to scrape data from. Default is `Site.FOREXFACTORY`.
- Options:
- `Site.FOREXFACTORY`
- `Site.METALSMINE`
- `Site.ENERGYEXCH`
- `Site.CRYPTOCRAFT`
- `date_from` (optional): Start date in "YYYY-MM-DD" format.
- `date_to` (optional): End date in "YYYY-MM-DD" format.
- `extended` (optional): Boolean flag to retrieve extended data. Default is `False`.
## Return Values
- When `extended=False`: Returns a `pandas.DataFrame` containing basic event data.
- When `extended=True`: Returns a `ScrapeResult` object with the following attributes:
- `base`: DataFrame with basic event data.
- `specs`: DataFrame with event specifications.
- `history`: DataFrame with historical data.
- `news`: DataFrame with related news articles.
## API Reference
### `scrape_calendar`
Function to scrape calendar data.
**Signature:**
```python
def scrape_calendar(
site: Site = Site.FOREXFACTORY,
date_from: Optional[str] = None,
date_to: Optional[str] = None,
extended: bool = False,
) -> Union[pd.DataFrame, ScrapeResult]:
...
```
### `Site` Enum
Enumeration of supported websites.
- `Site.FOREXFACTORY`
- `Site.METALSMINE`
- `Site.ENERGYEXCH`
- `Site.CRYPTOCRAFT`
### `ScrapeResult` Data Class
Contains extended data when `extended=True`.
- `base`: Basic event data (`pd.DataFrame`)
- `specs`: Event specifications (`pd.DataFrame`)
- `history`: Historical data (`pd.DataFrame`)
- `news`: Related news articles (`pd.DataFrame`)
## Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
## License
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to customize this package to better suit your project's needs!
Raw data
{
"_id": null,
"home_page": null,
"name": "market-calendar-tool",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Pavel Krusek",
"author_email": "pavel@krusek.dk",
"download_url": "https://files.pythonhosted.org/packages/d7/e8/45a9b9a8f0e1df33d8447ec7fedec0d48adb39936b1c599c586628109d7f/market_calendar_tool-0.1.1.tar.gz",
"platform": null,
"description": "# Market Calendar Tool\n\nA Python package for scraping economic calendar data from various financial websites.\n\n## Legal notice\n\nPlease note that scraping data from websites must comply with the site's terms of service and legal requirements. The robots.txt files of the supported sites do not explicitly restrict scraping, but users should ensure they comply with local regulations and the website's terms.\n\n## Features\n\n- **Multi-Site Support**: Scrape data from multiple sites:\n - [ForexFactory](https://www.forexfactory.com/calendar)\n - [MetalsMine](https://www.metalsmine.com/calendar)\n - [EnergyExch](https://www.energyexch.com/calendar)\n - [CryptoCraft](https://www.cryptocraft.com/calendar)\n\n- **Flexible Date Range**: Specify custom date ranges for scraping.\n- **Extended Data Retrieval**: Option to retrieve extended data for each event.\n- **Easy-to-Use API**: Simple and intuitive function to get you started quickly.\n- **DataFrame Output**: Returns raw data scraped from the website as pandas DataFrame(s) for further processing.\n\n## Installation\n\nInstall the package via pip:\n\n```bash\npip install market-calendar-tool\n```\n\n## Requirements\n\n- **Python Version**: Python **3.12** or higher is required.\n- **Dependencies**:\n - The package relies on several libraries such as `loguru`, `requests`, `pandas`, `asyncio`, and `aiohttp`.\n - These libraries will be automatically installed when you install the package.\n\n## Usage\n\nImport the package and use the `scrape_calendar` function.\n\n```python\nfrom market_calendar_tool import scrape_calendar, Site, ScrapeResult\n\n# Basic usage: scrape data from today to one week ahead from ForexFactory\ndf = scrape_calendar()\n\n# Specify a different site\ndf = scrape_calendar(site=Site.METALSMINE)\n\n# Specify date range\ndf = scrape_calendar(date_from=\"2023-01-01\", date_to=\"2023-01-07\")\n\n# Retrieve extended data\nresult = scrape_calendar(extended=True)\nprint(result.base) # Basic event data\nprint(result.specs) # Event specifications\nprint(result.history) # Historical data\nprint(result.news) # Related news articles\n```\n\n## Parameters\n\n- `site` (optional): The website to scrape data from. Default is `Site.FOREXFACTORY`.\n - Options:\n - `Site.FOREXFACTORY`\n - `Site.METALSMINE`\n - `Site.ENERGYEXCH`\n - `Site.CRYPTOCRAFT`\n- `date_from` (optional): Start date in \"YYYY-MM-DD\" format.\n- `date_to` (optional): End date in \"YYYY-MM-DD\" format.\n- `extended` (optional): Boolean flag to retrieve extended data. Default is `False`.\n\n## Return Values\n\n- When `extended=False`: Returns a `pandas.DataFrame` containing basic event data.\n- When `extended=True`: Returns a `ScrapeResult` object with the following attributes:\n - `base`: DataFrame with basic event data.\n - `specs`: DataFrame with event specifications.\n - `history`: DataFrame with historical data.\n - `news`: DataFrame with related news articles.\n\n## API Reference\n\n### `scrape_calendar`\n\nFunction to scrape calendar data.\n\n**Signature:**\n\n```python\ndef scrape_calendar(\n site: Site = Site.FOREXFACTORY,\n date_from: Optional[str] = None,\n date_to: Optional[str] = None,\n extended: bool = False,\n) -> Union[pd.DataFrame, ScrapeResult]:\n ...\n```\n\n### `Site` Enum\n\nEnumeration of supported websites.\n\n- `Site.FOREXFACTORY`\n- `Site.METALSMINE`\n- `Site.ENERGYEXCH`\n- `Site.CRYPTOCRAFT`\n\n### `ScrapeResult` Data Class\n\nContains extended data when `extended=True`.\n\n- `base`: Basic event data (`pd.DataFrame`)\n- `specs`: Event specifications (`pd.DataFrame`)\n- `history`: Historical data (`pd.DataFrame`)\n- `news`: Related news articles (`pd.DataFrame`)\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\nFeel free to customize this package to better suit your project's needs!\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Market Calendar Tool is a Python package that scrapes economic calendar data from multiple financial websites and returns it as pandas DataFrames for easy analysis.",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ec09850a56580b23f9183ec75075ae52526e3107af60bfd6fa39f4863165e40f",
"md5": "d9d6e46da217aa2d80c2147ba9118659",
"sha256": "110852cc18dadd45a14a4dff2e9be9ec393e77b1dd7b53ceb29243d6ad12813b"
},
"downloads": -1,
"filename": "market_calendar_tool-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d9d6e46da217aa2d80c2147ba9118659",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 8192,
"upload_time": "2024-10-20T23:08:21",
"upload_time_iso_8601": "2024-10-20T23:08:21.383473Z",
"url": "https://files.pythonhosted.org/packages/ec/09/850a56580b23f9183ec75075ae52526e3107af60bfd6fa39f4863165e40f/market_calendar_tool-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d7e845a9b9a8f0e1df33d8447ec7fedec0d48adb39936b1c599c586628109d7f",
"md5": "be047ba942e5ced7dd60575e5854f120",
"sha256": "89e1faacf7a22b81eb21cae9dcb68b88c2f933ac1a51611936075265b1a5676c"
},
"downloads": -1,
"filename": "market_calendar_tool-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "be047ba942e5ced7dd60575e5854f120",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 5932,
"upload_time": "2024-10-20T23:08:22",
"upload_time_iso_8601": "2024-10-20T23:08:22.270028Z",
"url": "https://files.pythonhosted.org/packages/d7/e8/45a9b9a8f0e1df33d8447ec7fedec0d48adb39936b1c599c586628109d7f/market_calendar_tool-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-20 23:08:22",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "market-calendar-tool"
}