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.1.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.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xiaoming_datahelper-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 daad7ffcdd47a42eb34c10062aa8e29660768a03d6cdd9d65c3a0b2c083ff0f9
MD5 ece58d75f0396c693e3acf1164b31ca4
BLAKE2b-256 8d15b21f4f605688e92d92bb0316e1118ad382634899b32fc4b888f5b8753066

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xiaoming_datahelper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0d90882ad72fc0f99aa0d31dc71a047bf75c9a6a50c5eb2f9eb56d7ce60286
MD5 55a59dfeed8c68e034f1856787fa454a
BLAKE2b-256 4466fcadd87512a1dcec538d6581fb69f4e4794ad595a892a87900e0d58e019a

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