超品集团自用的Python包
Project description
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 , 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)
# 更新数据函数,在完成数据库信息配置后,df为pd.dataframe格式的数据
# 更新过程会先经过check_and_sync_columns函数完成表格校验
update_datas(df, table_name, database)
项目结构
CPpackage/
├── CPpackage/ # 主包
│ ├── core/ # 核心功能
│ ├── utils/ # 工具函数
│ └── db/ # 数据库功能与配置(sql_model拆解于此)
├── manage.py # 管理脚本
├── LICENSE # 许可证
├── MANIFEST.in # 打包配置
├── readme.md # 说明文档
└── setup.py # 安装配置
许可证
本项目采用MIT许可证。详情请参阅LICENSE文件。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cppackage-0.2.1.tar.gz
(5.9 kB
view details)
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 cppackage-0.2.1.tar.gz.
File metadata
- Download URL: cppackage-0.2.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2de41b0c5d6964e3a9c6c95b452824fe9bed73a55c90b648e3e61184302cb75b
|
|
| MD5 |
d0630dcd5d9b71ac900368c0322036cd
|
|
| BLAKE2b-256 |
aab983f6acdb5dad03a48f57f2da5fed0c882c866d4c44edd79b3564a60f94e7
|
File details
Details for the file cppackage-0.2.1-py3-none-any.whl.
File metadata
- Download URL: cppackage-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5e0326590909d2b116321f521e325ceafc3331ffbe2164230989385af5018b4
|
|
| MD5 |
09ee117b758177a533ef7f54f550274e
|
|
| BLAKE2b-256 |
e56d9604d6e038a463e8a45e41f4a9b2dc0a001e624e2031e3c23c13111a1673
|