![CI/CD](https://github.com/AnyNodes/shdw-node-stats/actions/workflows/cicd.yml/badge.svg)
# shdw-node-stats
This Python package, `shdw-node-stats`, is designed to fetch and record information about blockchain nodes. It has two features:
1. Retrieve data such as the node's rank, total rewards, and status from a specified API endpoint, then records this information in a CSV file for chart purpose if you need.
2. Send notification to your Telegram when the node status is `not_eligible`.
## Installation
To install `shdw-node-stats` as a package, simply use pip:
```
pip install shdw-node-stats
```
This command installs `shdw-node-stats` along with all required dependencies. Ensure you have Python installed on your system (version 3.8 or later is recommended).
## Usage
### As a Standalone Script
If you prefer to use `NodeStats.py` as a standalone script:
1. Ensure you have Python installed on your system (version 3.8 or later is recommended) and clone the repository or download the script.
2. Install the required dependencies:
```
pip install -r requirements.txt
```
3. Prepare a file named `nodes.txt` or `nodes.json` with the node addresses.
4. Run the script from the terminal or command prompt:
```
python3 NodeStats.py
```
### As a Python Package
To install `shdw-node-stats` as a package, simply use pip:
```
pip install shdw-node-stats
```
This command installs `shdw-node-stats` along with all required dependencies. Ensure you have Python installed on your system (version 3.8 or later is recommended). After installing `shdw-node-stats` via pip, you can use it in your Python scripts as follows:
1. Prepare a file named `nodes.txt` or `nodes.json` containing the addresses of the nodes you wish to query.
2. Use the package in your script:
```python
from shdw_node_stats import NodeStats
# Assuming you have a 'nodes.txt' or 'nodes.json' file in your current directory
node_stats = NodeStats('nodes.txt') # or NodeStats('nodes.json')
node_stats.run()
```
This will fetch the node information and output it to a CSV file named `node_rankings.csv`.
## File Formats Supported
- **JSON (.json):** Should contain an array of node addresses.
- **Text (.txt):** Should contain node addresses, one per line.
## Output
Both usage methods generate a CSV file named `node_rankings.csv`, which includes the following columns: Timestamp, Node Address, Rank, Rewards, and Status. The console output will display the node information and the total rewards accumulated by the nodes listed in the input file.
## Community Contribution
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## License
Distributed under the MIT License. See [LICENSE](./LICENSE) for more information.
## Note
This package/script is intended for educational and demonstration purposes. It showcases how to interact with web APIs, process data in Python, and write output to a CSV file. Ensure you have the necessary permissions to use the API and data.
Raw data
{
"_id": null,
"home_page": null,
"name": "shdw-node-stats",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "API, ShadowDrive, statistics, CSV, shdw, solana, storage",
"author": null,
"author_email": "AnyNodes <anynodes@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/69/3d/e8cded2d19175aaab53ee4a753c7d124aaa10689d7ffceafa522ca335e66/shdw-node-stats-0.4.1.tar.gz",
"platform": null,
"description": "![CI/CD](https://github.com/AnyNodes/shdw-node-stats/actions/workflows/cicd.yml/badge.svg)\n\n# shdw-node-stats\n\nThis Python package, `shdw-node-stats`, is designed to fetch and record information about blockchain nodes. It has two features:\n\n1. Retrieve data such as the node's rank, total rewards, and status from a specified API endpoint, then records this information in a CSV file for chart purpose if you need.\n\n2. Send notification to your Telegram when the node status is `not_eligible`.\n\n## Installation\n\nTo install `shdw-node-stats` as a package, simply use pip:\n\n```\npip install shdw-node-stats\n```\n\nThis command installs `shdw-node-stats` along with all required dependencies. Ensure you have Python installed on your system (version 3.8 or later is recommended).\n\n## Usage\n\n### As a Standalone Script\n\nIf you prefer to use `NodeStats.py` as a standalone script:\n\n1. Ensure you have Python installed on your system (version 3.8 or later is recommended) and clone the repository or download the script.\n\n2. Install the required dependencies:\n\n```\npip install -r requirements.txt\n```\n\n3. Prepare a file named `nodes.txt` or `nodes.json` with the node addresses.\n\n4. Run the script from the terminal or command prompt:\n\n```\npython3 NodeStats.py\n```\n\n### As a Python Package\n\nTo install `shdw-node-stats` as a package, simply use pip:\n\n```\npip install shdw-node-stats\n```\n\nThis command installs `shdw-node-stats` along with all required dependencies. Ensure you have Python installed on your system (version 3.8 or later is recommended). After installing `shdw-node-stats` via pip, you can use it in your Python scripts as follows:\n\n1. Prepare a file named `nodes.txt` or `nodes.json` containing the addresses of the nodes you wish to query.\n\n2. Use the package in your script:\n\n```python\nfrom shdw_node_stats import NodeStats\n\n# Assuming you have a 'nodes.txt' or 'nodes.json' file in your current directory\nnode_stats = NodeStats('nodes.txt') # or NodeStats('nodes.json')\nnode_stats.run()\n```\n\nThis will fetch the node information and output it to a CSV file named `node_rankings.csv`.\n\n## File Formats Supported\n\n- **JSON (.json):** Should contain an array of node addresses.\n- **Text (.txt):** Should contain node addresses, one per line.\n\n## Output\n\nBoth usage methods generate a CSV file named `node_rankings.csv`, which includes the following columns: Timestamp, Node Address, Rank, Rewards, and Status. The console output will display the node information and the total rewards accumulated by the nodes listed in the input file.\n\n## Community Contribution\n\nContributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\n\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nDistributed under the MIT License. See [LICENSE](./LICENSE) for more information.\n\n## Note\n\nThis package/script is intended for educational and demonstration purposes. It showcases how to interact with web APIs, process data in Python, and write output to a CSV file. Ensure you have the necessary permissions to use the API and data.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool to fetch and record ShadowDrive node statistics from an API and save them to a CSV file.",
"version": "0.4.1",
"project_urls": {
"homepage": "https://github.com/AnyNodes/shdw-node-stats#readme",
"issues": "https://github.com/AnyNodes/shdw-node-stats/issues",
"repository": "https://github.com/AnyNodes/shdw-node-stats.git",
"source": "https://github.com/AnyNodes/shdw-node-stats.git"
},
"split_keywords": [
"api",
" shadowdrive",
" statistics",
" csv",
" shdw",
" solana",
" storage"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bb13005f164601a80636f713d4fcb822cfe32445eed04aeab72d3c054ba21687",
"md5": "31e62a824fbce4e66f01f2dbaed7cae6",
"sha256": "c7e95a8ccd0bfa4404c743cc082e3950579574077df5cfa8a1c05fb04ea8a2b6"
},
"downloads": -1,
"filename": "shdw_node_stats-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "31e62a824fbce4e66f01f2dbaed7cae6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5538,
"upload_time": "2024-03-25T00:55:19",
"upload_time_iso_8601": "2024-03-25T00:55:19.946542Z",
"url": "https://files.pythonhosted.org/packages/bb/13/005f164601a80636f713d4fcb822cfe32445eed04aeab72d3c054ba21687/shdw_node_stats-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "693de8cded2d19175aaab53ee4a753c7d124aaa10689d7ffceafa522ca335e66",
"md5": "6c7745ab783e3ca4e89f1c1a30211f52",
"sha256": "b02e64b5ad91f2d7bb3177d4cde8cf0c4310a7dfdaf00f0d73bc433c98a32c36"
},
"downloads": -1,
"filename": "shdw-node-stats-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "6c7745ab783e3ca4e89f1c1a30211f52",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5376,
"upload_time": "2024-03-25T00:55:21",
"upload_time_iso_8601": "2024-03-25T00:55:21.653312Z",
"url": "https://files.pythonhosted.org/packages/69/3d/e8cded2d19175aaab53ee4a753c7d124aaa10689d7ffceafa522ca335e66/shdw-node-stats-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-25 00:55:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AnyNodes",
"github_project": "shdw-node-stats#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "requests",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "tensorflow",
"specs": []
},
{
"name": "numpy",
"specs": []
}
],
"lcname": "shdw-node-stats"
}