A cryptocurrency trading info package
Project description
Crypto Service
一个基于 Python 的加密货币数据处理工具包,专注于数据获取、处理和分析。
功能特点
- 支持币安的现货和永续合约数据获取
- 高效的数据缓存和存储机制
- 完整的类型提示和错误处理
- 支持自定义数据格式和存储方式
- 持续集成和自动发布
文档
详细的使用说明和 API 文档请访问我们的文档站点:Crypto Service 文档
安装
pip install cryptoservice
快速开始
- 设置环境变量:
# 在 .env 文件中设置
BINANCE_API_KEY=your_api_key
BINANCE_API_SECRET=your_api_secret
- 基本使用:
from dotenv import load_dotenv
import os
from cryptoservice import MarketDataService
# 加载环境变量
load_dotenv()
api_key = os.getenv("BINANCE_API_KEY")
api_secret = os.getenv("BINANCE_API_SECRET")
# 创建服务实例
market_service = MarketDataService(api_key, api_secret)
# 获取 BTCUSDT 的实时行情
btc_ticker = market_service.get_symbol_ticker("BTCUSDT")
print(f"BTCUSDT 实时行情: {btc_ticker}")
更多使用示例请参考文档站点。
开发环境设置
- 克隆仓库:
git clone https://github.com/Mrzai/cryptoservice.git
cd cryptoservice
- 安装 uv(推荐):
# macOS/Linux
./scripts/setup_uv.sh
# Windows
.\scripts\setup_uv.ps1
或者手动安装依赖:
pip install -e ".[dev-all]" # 安装所有开发依赖
通过uv安装
uv pip install -e ".[dev-all]"
- 安装 pre-commit hooks:
pre-commit install
贡献指南
- Fork 项目
- 创建功能分支:
git checkout -b feature/new-feature - 提交更改:
git commit -m 'feat: add new feature' - 推送分支:
git push origin feature/new-feature - 提交 Pull Request
提交信息必须遵循 Conventional Commits 规范:
feat: 新功能fix: 修复问题docs: 文档更新style: 代码格式调整refactor: 代码重构perf: 性能优化test: 测试相关chore: 构建过程或辅助工具的变动
许可证
MIT License
联系方式
- GitHub Issues: https://github.com/ppmina/xdata/issues
- Email: minzzzai.s@gmail.com
提交规范
提交信息必须遵循以下格式:
<type>(<scope>): <subject>
<body>
<footer>
例如:
# 新功能
feat(market): add historical data support
Added support for fetching historical market data
with customizable time ranges and intervals.
# 修复bug
fix(cache): resolve memory leak issue
Fixed memory leak in cache manager when handling
large datasets.
# 文档更新
docs(readme): update installation guide
Updated installation instructions to include
new development dependencies.
提交类型必须是以下之一:
- feat: 新功能
- fix: 修复问题
- docs: 文档更新
- style: 代码格式调整
- refactor: 代码重构
- perf: 性能优化
- test: 测试相关
- chore: 构建过程或辅助工具
- revert: 回退
- ci: CI/CD相关
- build: 构建系统
little bugs: merge before commit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cryptoservice-1.1.0.tar.gz
(175.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cryptoservice-1.1.0.tar.gz.
File metadata
- Download URL: cryptoservice-1.1.0.tar.gz
- Upload date:
- Size: 175.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ade3bd867d1f7ca1ec83d8c4891d5fece8ebdff628db7bfda89b59e4ed4e632
|
|
| MD5 |
f74bca9e58be05acb0f168295ae5db8f
|
|
| BLAKE2b-256 |
0773cde3804ff59c3c9b5a766c91365b88258b134aa9965c7edbf7af4c8bf377
|
File details
Details for the file cryptoservice-1.1.0-py3-none-any.whl.
File metadata
- Download URL: cryptoservice-1.1.0-py3-none-any.whl
- Upload date:
- Size: 45.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1792c6e93a65ccd45c1babd2044acdd505251b24a73d512db5fbfcc772cc0f3c
|
|
| MD5 |
fd876063ee8c3f3121b142ef6d2ae367
|
|
| BLAKE2b-256 |
8b773052b9541ba363ad7a58bc313b5effd716f952f7c1d541e8e6cd6b2b9268
|