Skip to main content

simpleplot-lite

一个简单的 Python 画图工具包,把 matplotlib 最常用的三种图表封装成一行调用。 适合刚学 Python 的同学快速画图。

功能

  • line_chart(x, y, ...):折线图
  • bar_chart(labels, values, ...):柱状图
  • pie_chart(labels, values, ...):饼图

每个函数都支持 title、xlabel、ylabel(饼图没有坐标轴)和 save_path, 返回值是 matplotlib 的 Figure 对象,可以继续自己修改。

安装

pip install simpleplot-lite

快速开始

from simpleplot_lite import line_chart, bar_chart, pie_chart

# 折线图:保存成图片
line_chart([1, 2, 3, 4], [60, 72, 68, 85],
           title="四次小测成绩", xlabel="次数", ylabel="分数",
           save_path="line.png")

# 柱状图
bar_chart(["Python", "C++", "Java"], [90, 80, 70],
          title="编程语言喜好", save_path="bar.png")

# 饼图
pie_chart(["吃饭", "睡觉", "写代码"], [3, 8, 13],
          title="一天的时间分配", save_path="pie.png")

项目结构

simpleplot-lite/
├── LICENSE
├── README.md
├── pyproject.toml
├── demo.py                # 运行后生成三张示例图片
├── simpleplot_lite/
│   ├── __init__.py
│   └── charts.py
└── tests/
    └── test_charts.py

打包发布步骤

# 1. 安装打包工具
pip install build twine

# 2. 运行测试
python -m unittest discover -s tests -v

# 3. 构建,产物在 dist/ 目录
python -m build

# 4. 检查元数据
twine check dist/*

# 5. 先上传到 TestPyPI 测试
twine upload --repository testpypi dist/*

# 6. 再上传到正式 PyPI
twine upload dist/*

上传时用户名填 __token__,密码填 PyPI 网站生成的 API Token(pypi- 开头)。

注意:同一个版本号不能重复上传,重新发布前要把 pyproject.toml 和 simpleplot_lite/__init__.py 里的版本号一起改大,并删除旧的 dist/ 目录。

License

MIT

Metadata

Release files for simpleplot-lite 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simpleplot-lite 0.1.0
File Size Uploaded Provenance Actions
simpleplot_lite-0.1.0.tar.gz 5.2 kB Without provenance Details for simpleplot_lite-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simpleplot-lite 0.1.0
File Interpreter ABI Platform Actions
simpleplot_lite-0.1.0-py3-none-any.whl Python 3 none any Details for simpleplot_lite-0.1.0-py3-none-any.whl

Total release size: 10.1 kB

Release files / simpleplot_lite-0.1.0.tar.gz

Download URL simpleplot_lite-0.1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ed416a2dc6bddb7ee7f9d05daa7446dfd9205b24555ed5b2779eb34d79ac3b8d
BLAKE2b-256 checksum
How to use checksums
6111f7e0f248433c841762afb8e8230cef0d40a922a1d6e2174cb6ad2709f57a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Release files / simpleplot_lite-0.1.0-py3-none-any.whl

Download URL simpleplot_lite-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d39c93008a06e459f3a9f12fe14df77ce7931d500016ec84cc51d74990f1c569
BLAKE2b-256 checksum
How to use checksums
caf04d5323c033c3a3a9d40300887524089d38eaac5a22a388b800225df2008f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Security for simpleplot-lite 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page