How corfucinas/crypto-candlesticks works
Project Overview and Main Purpose
• This project is a command-line tool built with Python that facilitates downloading and processing cryptocurrency candlestick data from exchanges – currently, Bitfinex is supported.
• The tool gathers data (candlestick values like open, high, low, close, volume, timestamp) and converts/stores it in multiple file formats (CSV, SQLite, pickle) for analysis.
• The CLI is implemented using Click and there is clear separation between data collection, processing, and storage.
Analyzing the File Structure
• Top-Level Directories:
• “src” contains the core application code.
• “docs” holds the documentation (including reStructuredText files that detail various modules and usage).
• “tests” include test modules indicating the project is well-tested.
• “examples” showcase sample data files for demonstration.
• “.github” holds CI/CD and GitHub workflow configurations.
• main.py: Likely the entry point that initializes the CLI.
• get_data.py: Contains logic to fetch candlestick data.
• database.py: Contains routines to convert and store data in different file formats.
• exchanges (with bitfinex.py): Implements the integration with Bitfinex.
• symbols (with quote_currencies.py and time_intervals.py): Handles symbol-related processing.
• text_console.py: Likely manages console output for user interactions.
• There are even some playful directories and files (e.g., src/🎁) that might be related to additional features or packaging.
Key Architectural Components and Their Roles
a. User Interface Layer:
• CLI Interface: Based on Click, handling user prompts and command-line argument parsing (activated mainly by the main.py and text_console.py).
b. Data Retrieval/Processing Layer:
• Data Collector Module: The get_data.py module orchestrates data fetching.
• Exchanges Module: Under src/crypto_candlesticks/exchanges (specifically bitfinex.py) implementing the API calls.
• Symbols Module: Contains logic for validating and converting cryptocurrency symbols, base currencies, and time intervals.
c. Data Persistence/Conversion Layer:
• Database Module: Reads the retrieved data and provides functions to persist it as CSV, SQLite, or pickle files.
d. External Dependencies and Services:
• Bitfinex Exchange API: The external resource from which the candlestick data is fetched.
• Documentation, tests, CI/CD configurations (indicating adherence to quality standards).
• Data Retrieval Flow:
• Symbols and Parameter Processing:
• A module labeled “Symbols Module (quote_currencies, time_intervals)” linked to “Data Collector” to indicate preprocessing or validation of the currency and interval inputs.
• Data Storage and Conversion:
• Console Output:
• “Text Console (text_console.py)” connected back to the CLI layer for displaying user feedback or results.
• Testing and CI/CD: