{"id":25668271,"url":"https://github.com/ff137/ohlc-toolkit","last_synced_at":"2026-06-14T12:32:34.926Z","repository":{"id":278803187,"uuid":"933716267","full_name":"ff137/ohlc-toolkit","owner":"ff137","description":"A flexible Python toolkit for working with OHLC data","archived":false,"fork":false,"pushed_at":"2025-09-13T12:05:51.000Z","size":360,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T12:35:06.696Z","etag":null,"topics":["financial-analysis","ohlc-analysis","ohlcv","price-data","technical-analysis"],"latest_commit_sha":null,"homepage":"https://ff137.github.io/ohlc-toolkit/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ff137.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-02-16T14:34:55.000Z","updated_at":"2025-06-08T19:07:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9be5d32-6971-4233-9226-65d6830464f5","html_url":"https://github.com/ff137/ohlc-toolkit","commit_stats":null,"previous_names":["ff137/ohlc-toolkit"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ff137/ohlc-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff137%2Fohlc-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff137%2Fohlc-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff137%2Fohlc-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff137%2Fohlc-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ff137","download_url":"https://codeload.github.com/ff137/ohlc-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff137%2Fohlc-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34322073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","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":["financial-analysis","ohlc-analysis","ohlcv","price-data","technical-analysis"],"created_at":"2025-02-24T10:29:14.188Z","updated_at":"2026-06-14T12:32:34.919Z","avatar_url":"https://github.com/ff137.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OHLC Toolkit\n\n[![PyPI](https://img.shields.io/pypi/v/ohlc-toolkit)](https://pypi.org/project/ohlc-toolkit/)\n[![Python](https://img.shields.io/pypi/pyversions/ohlc-toolkit.svg)](https://pypi.org/project/ohlc-toolkit/)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0db6f73fe9bb4e8a8591055a6ea284f2)](https://app.codacy.com/gh/ff137/ohlc-toolkit/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/0db6f73fe9bb4e8a8591055a6ea284f2)](https://app.codacy.com/gh/ff137/ohlc-toolkit/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_coverage)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA flexible Python toolkit for working with OHLC (Open, High, Low, Close) market data.\n\n## Installation\n\nThe project is available on [PyPI](https://pypi.org/project/ohlc-toolkit/):\n\n```bash\npip install ohlc-toolkit\n```\n\n## Features\n\n- Read OHLC data from CSV files into pandas DataFrames, with built-in data quality checks:\n\n  ```py\n    df = read_ohlc_csv(csv_file_path, timeframe=\"1d\")\n  ```\n\n- Download BTCUSD 1-minute candle data in one line (using data from [ff137/bitstamp-btcusd-minute-data](https://github.com/ff137/bitstamp-btcusd-minute-data)):\n\n  ```py\n    df_1min = DatasetDownloader().download_bitstamp_btcusd_minute_data(bulk=True)\n  ```\n\n- Transform your candle data into any desired timeframe and resolution:\n\n  ```py\n    # Convert 1-minute candle data into 5-minute candles (with candle updated every minute)\n    df_5m = transform_ohlc(df_1min, timeframe=5, step_size_minutes=1)\n\n    # Convert 1-minute candle data into 1-day candles (with candle updated every day)\n    df_1d = transform_ohlc(df_1min, timeframe=\"1d\", step_size_minutes=1440)  \n  \n    # Support for arbitrary timeframes is available!\n    df_arb = transform_ohlc(df_1min, timeframe=\"1d3h7m\", step_size_minutes=33)\n  ```\n\n- Convert timeframe strings to the number of minutes, and vice versa:\n\n  ```py\n    # From string to minutes\n    parse_timeframe(\"1h15m\") == 75\n\n    # From minutes to string\n    format_timeframe(minutes=75) == \"1h15m\"\n  ```\n\n- Calculate future price changes:\n\n  ```py\n    # For every minute, compute the 1-hour percentage price change\n    df_future_returns = calculate_percentage_return(\n        df_1min[\"close\"],  # Use the close price column\n        timestep_size=1,  # Compute returns at 1-minute resolution (same as input)\n        future_return_length=60,  # Compute price changes over 60 minutes\n    )\n  ```\n\n🚧 Coming soon™️:\n\n- Calculate technical indicators\n\nAll of the above features will enable you to generate extensive training data for machine learning models, whether for research or trading, to predict future price changes based on technical indicators.\n\n## Examples\n\nSee the [examples](examples/README.md) directory for examples of how to use the toolkit.\n\nRun the example script to see how the toolkit works:\n\n```bash\n# Clone the repository\ngit clone https://github.com/ff137/ohlc-toolkit.git\ncd ohlc-toolkit\n\n# Create and activate a virtual environment\npython -m venv .venv\nsource .venv/bin/activate\n\n# Install dependencies\npip install poetry\npoetry install\n\n# Run the example script\npython examples/basic_usage.py\n```\n\n## Support\n\nIf you need any help or have any questions, please feel free to open an issue or contact me directly.\n\nWe hope this repo makes your life easier! If it does, please give us a star! ⭐\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff137%2Fohlc-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fff137%2Fohlc-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff137%2Fohlc-toolkit/lists"}