一个简单的数据处理工具包
Project description
Xiaoming DataHelper
一个简单的数据处理工具包,帮助你轻松处理 CSV 文件数据。
功能特点
- 支持相对路径和绝对路径的 CSV 文件读取
- 提供基本的数据统计功能
- 简单易用的 API 设计
- 完整的类型提示支持
安装
pip install xiaoming-datahelper
快速开始
from datahelper import CSVReader, DataProcessor
# 读取 CSV 文件
reader = CSVReader("data.csv")
data = reader.read()
# 处理数据
processor = DataProcessor(data)
stats = processor.calculate_stats("age")
print(stats)
使用示例
使用相对路径
from datahelper import CSVReader
# 使用相对路径(基于当前工作目录)
reader = CSVReader("data/sales.csv")
data = reader.read()
使用绝对路径
from datahelper import CSVReader
# 使用绝对路径
reader = CSVReader("/absolute/path/to/data.csv")
data = reader.read()
指定基准目录
from datahelper import CSVReader
# 指定基准目录
reader = CSVReader("data/sales.csv", base_dir="/path/to/project")
data = reader.read()
数据统计
from datahelper import CSVReader, DataProcessor
# 读取数据
reader = CSVReader("data.csv")
data = reader.read()
# 计算统计信息
processor = DataProcessor(data)
age_stats = processor.calculate_stats("age")
salary_stats = processor.calculate_stats("salary")
print("年龄统计:", age_stats)
print("薪资统计:", salary_stats)
开发指南
环境设置
- 克隆仓库:
git clone https://github.com/yourusername/xiaoming-datahelper.git
cd xiaoming-datahelper
- 创建虚拟环境:
python -m venv venv
source venv/bin/activate # Windows 使用: venv\Scripts\activate
- 安装开发依赖:
pip install -e ".[dev]"
开发工具
项目提供了多个便捷的脚本:
- 清理项目:
./scripts/clean.sh
- 构建包:
./scripts/build.sh
- 上传到 PyPI:
./scripts/upload.sh
运行测试
pytest tests/
项目结构
datahelper/
├── src/
│ └── datahelper/
│ ├── __init__.py
│ ├── core/
│ │ ├── __init__.py
│ │ ├── reader.py
│ │ └── processor.py
│ └── utils/
│ ├── __init__.py
│ └── helpers.py
├── tests/
│ ├── __init__.py
│ ├── test_reader.py
│ └── test_processor.py
├── examples/
│ └── basic_usage.py
└── scripts/
├── clean.py
├── build.py
└── upload.py
贡献指南
- Fork 项目
- 创建特性分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 创建 Pull Request
许可证
本项目采用 MIT 许可证 - 详见 LICENSE 文件
作者
- 小明 - @xiaoming
致谢
- 感谢所有贡献者的付出
- 特别感谢 pandas 和 numpy 团队
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 xiaoming_datahelper-0.1.3.tar.gz.
File metadata
- Download URL: xiaoming_datahelper-0.1.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61cc39fecefe5fb1a89335d38e8fd8125f775ec20de0fe22f1cd616be30725b5
|
|
| MD5 |
e0c0c20b1b47162b6323c8754cb93c0d
|
|
| BLAKE2b-256 |
32f45ce474754e8679981efa497c84745ec6c149023e782a0266d3cc388e8e1a
|
File details
Details for the file xiaoming_datahelper-0.1.3-py3-none-any.whl.
File metadata
- Download URL: xiaoming_datahelper-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a17781c9bd1c39c9c8cf8ab5e5f19d7a497aeb6d52f54101fa7eb21ac2582b7
|
|
| MD5 |
ad9e015e2f7de52803eaf13f4642cd98
|
|
| BLAKE2b-256 |
bcd13b410f839063eff6878b0c764ca37e03d4bab64ab8a4883eeba335b85d62
|