# ehdtd-daemon
Daemon script for the [ehdtd](https://github.com/rmalvarezkai/ehdtd) package
## Introduction
The ehdtd-daemon is a Python script designed to collect historic and current data from exchanges and store it into a database (PostgreSQL or MySQL). It works in conjunction with the ehdtd package.
## Installation
```bash
pip install --upgrade pip setuptools # This line is only necesary in some setups
pip install ehdtd_daemon
```
## Usage
```
python ehdtd_daemon.py [options] command
```
## Example
```
python ehdtd_daemon.py start
sleep 900
python ehdtd_daemon.py stop
```
## Options
* `-h, --help`: Display this help message and exit.
* `-c, --config=CONFIG_FILE`: Specify an alternative config file, Default is '/etc/ehdtd-daemon/ehdtd-daemon.yaml'
## Commands
* `start`: Start the daemon
* `stop`: Stop the daemon
## Configuration File Format
The ehdtd-daemon.yaml configuration file follows a YAML (YAML Ain't Markup Language) format. It consists of several sections and parameters, allowing customization of the daemon's behavior.
### Global Configuration
The global configuration section defines settings that apply to the entire daemon operation.
#### Parameters
log_dir: The directory path for log files. Default is /var/log/ehdtd-daemon.
run_dir: The directory path for runtime files. Default is /run/ehdtd-daemon.
debug: A boolean flag indicating whether to enable debug mode. Default is false.
### Database Configuration
The database configuration section defines parameters for connecting to the database.
#### Parameters
db_type: The type of database used by the daemon. Supported options are postgresql, pgsql and mysql.
db_name: The name of the database.
db_user: The username used to connect to the database.
db_pass: The password used to authenticate the database user.
db_host: The hostname or IP address of the database server.
db_port: The port number on which the database server is listening.
### Exchange Configuration
The exchange configuration section defines parameters specific to each supported exchange.
#### Parameters
trading_type: The type of trading supported by the exchange. Currently, only SPOT trading is supported.
fetch_data: A list of dictionaries, each specifying the symbol and interval for fetching data from the exchange.
##### Fetch Data Parameters
symbol: The trading pair symbol.
interval: The time interval for fetching data, such as 1m for 1 minute or 5m for 5 minutes.
### Example Configuration
```yaml
global:
log_dir: /var/log/ehdtd-daemon
run_dir: /run/ehdtd-daemon
debug: false
db_data:
db_type: postgresql
db_name: 'DB_NAME'
db_user: 'DB_USER'
db_pass: 'DB_PASS'
db_host: 'DB_HOST'
db_port: 'DB_PORT'
exchanges:
binance:
trading_type: SPOT
fetch_data:
- symbol: BTC/USDT
interval: '1m'
- symbol: BNB/USDT
interval: '1m'
- symbol: ETH/USDT
interval: '1m'
- symbol: LTC/USDT
interval: '1m'
- symbol: BTC/USDT
interval: '5m'
- symbol: BNB/USDT
interval: '5m'
- symbol: ETH/USDT
interval: '5m'
- symbol: LTC/USDT
interval: '5m'
```
Raw data
{
"_id": null,
"home_page": "https://github.com/rmalvarezkai/ehdtd_daemon",
"name": "ehdtd-daemon",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Ricardo Marcelo Alvarez",
"author_email": "rmalvarezkai@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a6/e4/7f2e2402e5aa3cc30525b3448a62380ae4cd985bc185d4b5c60d3022a032/ehdtd_daemon-0.2.0.tar.gz",
"platform": null,
"description": "# ehdtd-daemon\nDaemon script for the [ehdtd](https://github.com/rmalvarezkai/ehdtd) package\n\n## Introduction\nThe ehdtd-daemon is a Python script designed to collect historic and current data from exchanges and store it into a database (PostgreSQL or MySQL). It works in conjunction with the ehdtd package.\n\n## Installation\n```bash\npip install --upgrade pip setuptools # This line is only necesary in some setups\npip install ehdtd_daemon\n```\n\n## Usage\n```\npython ehdtd_daemon.py [options] command\n```\n\n## Example\n```\npython ehdtd_daemon.py start\nsleep 900\npython ehdtd_daemon.py stop\n```\n\n## Options\n* `-h, --help`: Display this help message and exit.\n* `-c, --config=CONFIG_FILE`: Specify an alternative config file, Default is '/etc/ehdtd-daemon/ehdtd-daemon.yaml'\n\n## Commands\n* `start`: Start the daemon\n* `stop`: Stop the daemon\n\n## Configuration File Format\n\nThe ehdtd-daemon.yaml configuration file follows a YAML (YAML Ain't Markup Language) format. It consists of several sections and parameters, allowing customization of the daemon's behavior.\n\n### Global Configuration\n\nThe global configuration section defines settings that apply to the entire daemon operation.\n\n#### Parameters\n\n log_dir: The directory path for log files. Default is /var/log/ehdtd-daemon.\n run_dir: The directory path for runtime files. Default is /run/ehdtd-daemon.\n debug: A boolean flag indicating whether to enable debug mode. Default is false.\n\n### Database Configuration\n\nThe database configuration section defines parameters for connecting to the database.\n\n#### Parameters\n\n db_type: The type of database used by the daemon. Supported options are postgresql, pgsql and mysql.\n db_name: The name of the database.\n db_user: The username used to connect to the database.\n db_pass: The password used to authenticate the database user.\n db_host: The hostname or IP address of the database server.\n db_port: The port number on which the database server is listening.\n\n### Exchange Configuration\n\nThe exchange configuration section defines parameters specific to each supported exchange.\n\n#### Parameters\n\n trading_type: The type of trading supported by the exchange. Currently, only SPOT trading is supported.\n fetch_data: A list of dictionaries, each specifying the symbol and interval for fetching data from the exchange.\n\n##### Fetch Data Parameters\n\n symbol: The trading pair symbol.\n interval: The time interval for fetching data, such as 1m for 1 minute or 5m for 5 minutes.\n\n### Example Configuration\n\n```yaml\n\nglobal:\n log_dir: /var/log/ehdtd-daemon\n run_dir: /run/ehdtd-daemon\n debug: false\n\ndb_data:\n db_type: postgresql\n db_name: 'DB_NAME'\n db_user: 'DB_USER'\n db_pass: 'DB_PASS'\n db_host: 'DB_HOST'\n db_port: 'DB_PORT'\n\nexchanges:\n binance:\n trading_type: SPOT\n\n fetch_data:\n - symbol: BTC/USDT\n interval: '1m'\n - symbol: BNB/USDT\n interval: '1m'\n - symbol: ETH/USDT\n interval: '1m'\n - symbol: LTC/USDT\n interval: '1m'\n - symbol: BTC/USDT\n interval: '5m'\n - symbol: BNB/USDT\n interval: '5m'\n - symbol: ETH/USDT\n interval: '5m'\n - symbol: LTC/USDT\n interval: '5m'\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Daemon script for ehdtd package",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/rmalvarezkai/ehdtd_daemon"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "67c1b793e4e2faf8980bbc9e72a67f9991fff39205b54d984d744c20661f9c3e",
"md5": "8144b312e59a8910a70ea5927e214ddd",
"sha256": "abc711d60ec7798a4f80eb670bbccf41c3394874559676b4a191e89c49c10656"
},
"downloads": -1,
"filename": "ehdtd_daemon-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8144b312e59a8910a70ea5927e214ddd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 10286,
"upload_time": "2024-04-12T13:41:24",
"upload_time_iso_8601": "2024-04-12T13:41:24.848796Z",
"url": "https://files.pythonhosted.org/packages/67/c1/b793e4e2faf8980bbc9e72a67f9991fff39205b54d984d744c20661f9c3e/ehdtd_daemon-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a6e47f2e2402e5aa3cc30525b3448a62380ae4cd985bc185d4b5c60d3022a032",
"md5": "9fe4d7f5f9f6208818dc074c50d3442c",
"sha256": "98245674ccb9ab98ff5100aaa305e630c21e4c7a84b23f7df27c0b88cd4b22f3"
},
"downloads": -1,
"filename": "ehdtd_daemon-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "9fe4d7f5f9f6208818dc074c50d3442c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 9049,
"upload_time": "2024-04-12T13:41:26",
"upload_time_iso_8601": "2024-04-12T13:41:26.407279Z",
"url": "https://files.pythonhosted.org/packages/a6/e4/7f2e2402e5aa3cc30525b3448a62380ae4cd985bc185d4b5c60d3022a032/ehdtd_daemon-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-12 13:41:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rmalvarezkai",
"github_project": "ehdtd_daemon",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ehdtd-daemon"
}