CPpackage
简介
CPpackage是超品集团内部使用的Python包,核心功能集中在MySQL数据库增删改查功能以及部分数据清洗的能力。
安装
pip install cppackage
使用方法
# 导入包
from CPpackage.db.config import set_db_config
from CPpackage.db.sql_model import sel_data, del_data , incremental_update, get_table_columns,add_columns,check_and_sync_columns,update_datas
#
# 配置数据库连接(也可通过环境变量CPPACKAGE_DB_*配置)
set_db_config(host='your_host', user='your_user', password='your_password', database='your_database', port=3306)
# 更新过程会先经过check_and_sync_columns函数完成表格校验
check_and_sync_columns(df, table_name, database, max_new=5)
# 更新数据函数,在完成数据库信息配置后,df为pd.dataframe格式的数据
update_datas(df, table_name, database)
项目结构
CPpackage/
├── CPpackage/ # 主包
│ ├── core/ # 核心功能
│ ├── utils/ # 工具函数
│ └── db/ # 数据库功能与配置(sql_model拆解于此)
├── manage.py # 管理脚本
├── LICENSE # 许可证
├── MANIFEST.in # 打包配置
├── readme.md # 说明文档
└── setup.py # 安装配置
许可证
本项目采用MIT许可证。详情请参阅LICENSE文件。
Metadata
Release files for cppackage 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cppackage-0.3.2.tar.gz | 8.8 kB | Without provenance | Details for cppackage-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cppackage-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for cppackage-0.3.2-py3-none-any.whl |
Total release size: 18.8 kB
Release files / cppackage-0.3.2.tar.gz
| Download URL | cppackage-0.3.2.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acd75c2d1df46c7a2bc431bc95ae888a0c1057d6a9e20219f35e62b9f84fcba0
|
|
BLAKE2b-256 checksum How to use checksums |
52f43ec89dd3c66931ed7d859c467fd672e1e7b90de6b67754280d076ef12aee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.6
|
Release files / cppackage-0.3.2-py3-none-any.whl
| Download URL | cppackage-0.3.2-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b398e1d107282596e44056a759b5b1b5b55dbbd082670fec499064454dd3f62
|
|
BLAKE2b-256 checksum How to use checksums |
6bb70932a8373f57400389c83669fcbb66c5346d9ee1dfcbb4f08bcde0f1926e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.6
|
Security for cppackage 0.3.2
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.