Skip to main content

一个简单的数据处理工具包

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)

开发指南

环境设置

  1. 克隆仓库:
git clone https://github.com/yourusername/xiaoming-datahelper.git
cd xiaoming-datahelper
  1. 创建虚拟环境:
python -m venv venv
source venv/bin/activate  # Windows 使用: venv\Scripts\activate
  1. 安装开发依赖:
pip install -e ".[dev]"

开发工具

项目提供了多个便捷的脚本:

  1. 清理项目:
./scripts/clean.sh
  1. 构建包:
./scripts/build.sh
  1. 上传到 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

贡献指南

  1. Fork 项目
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 创建 Pull Request

许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件

作者

致谢

  • 感谢所有贡献者的付出
  • 特别感谢 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

xiaoming_datahelper-0.1.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xiaoming_datahelper-0.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file xiaoming_datahelper-0.1.2.tar.gz.

File metadata

  • Download URL: xiaoming_datahelper-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xiaoming_datahelper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3d8782a5cc6896e16dab84910ebc9e5f8780a8d7492e604315d097078a9be379
MD5 8dcdbe545f87d872dad2e759e207e102
BLAKE2b-256 166c591e01ee8dd6e969780329771e5a1e3af3cbce6a37a7ffe20ef5cf124e71

See more details on using hashes here.

File details

Details for the file xiaoming_datahelper-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for xiaoming_datahelper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a3cfb80e27e9de623acb91385e17718da43738777971c6f3dbc854f6fdfa5cf
MD5 4b55739d0011686e8d5fdd051c27a635
BLAKE2b-256 4795a10ade3adc7b353e70af570e6b22532c56313315c11e6d71a86491c2daba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page