zcb-dbutils


Namezcb-dbutils JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/chzcb/dbutils
Summarydb utils with pymysql by chzcb
upload_time2023-07-13 00:59:00
maintainer
docs_urlNone
authorchzcb
requires_python
licenseMIT
keywords python pymysql zcb_dbutils
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dbutils

使用方法

```python
from zcb_dbutils import DBConnection
import logging
import pandas as pd

logging.basicConfig(level=logging.DEBUG,
                    format='%(asctime)s %(filename)s[line:%(lineno)d ] %(levelname)s %(message)s',
                    datefmt='%d %b %Y,%a %H:%M:%S', #日 月 年 ,星期 时 分 秒
                    )

dbconn = DBConnection(host='localhost', port=3306, user='root', password='', database='basic')

ret = dbconn.fetch_one("select * from tb_user1 where id = 1000")
print(ret)

ret = dbconn.showtable('basic', 'tb_user')
print(pd.DataFrame.from_dict(ret))

ret = dbconn.show_table_index('basic', 'tb_user')
print(pd.DataFrame.from_dict(ret))

rows = dbconn.fetch_list('select user_id,id from tb_user')
print(rows)

id = dbconn.insert('insert into tb_role (role_name,role_type,remark_info,created,updated) value (%s,1,%s,0,0)',('xxx', 'xxxx'))
dbconn.commit()
print(id)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/chzcb/dbutils",
    "name": "zcb-dbutils",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,pymysql,zcb_dbutils",
    "author": "chzcb",
    "author_email": "chzcb.04@163.com",
    "download_url": "https://files.pythonhosted.org/packages/25/a6/285fae0a813c3eade8b5783a2cbcd2143ae154d45caba79f5df922c00a36/zcb_dbutils-0.0.7.tar.gz",
    "platform": null,
    "description": "# dbutils\n\n\u4f7f\u7528\u65b9\u6cd5\n\n```python\nfrom zcb_dbutils import DBConnection\nimport logging\nimport pandas as pd\n\nlogging.basicConfig(level=logging.DEBUG,\n                    format='%(asctime)s %(filename)s[line:%(lineno)d ] %(levelname)s %(message)s',\n                    datefmt='%d %b %Y,%a %H:%M:%S', #\u65e5 \u6708 \u5e74 \uff0c\u661f\u671f \u65f6 \u5206 \u79d2\n                    )\n\ndbconn = DBConnection(host='localhost', port=3306, user='root', password='', database='basic')\n\nret = dbconn.fetch_one(\"select * from tb_user1 where id = 1000\")\nprint(ret)\n\nret = dbconn.showtable('basic', 'tb_user')\nprint(pd.DataFrame.from_dict(ret))\n\nret = dbconn.show_table_index('basic', 'tb_user')\nprint(pd.DataFrame.from_dict(ret))\n\nrows = dbconn.fetch_list('select user_id,id from tb_user')\nprint(rows)\n\nid = dbconn.insert('insert into tb_role (role_name,role_type,remark_info,created,updated) value (%s,1,%s,0,0)',('xxx', 'xxxx'))\ndbconn.commit()\nprint(id)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "db utils with pymysql by chzcb",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/chzcb/dbutils"
    },
    "split_keywords": [
        "python",
        "pymysql",
        "zcb_dbutils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25a6285fae0a813c3eade8b5783a2cbcd2143ae154d45caba79f5df922c00a36",
                "md5": "388573adec14ef581bad397b08dfbc15",
                "sha256": "7e6e7ff164e0a5c6b8c3a8732ae0a70d3b956791c7c7e67c9c2d82f527838b46"
            },
            "downloads": -1,
            "filename": "zcb_dbutils-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "388573adec14ef581bad397b08dfbc15",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4505,
            "upload_time": "2023-07-13T00:59:00",
            "upload_time_iso_8601": "2023-07-13T00:59:00.407313Z",
            "url": "https://files.pythonhosted.org/packages/25/a6/285fae0a813c3eade8b5783a2cbcd2143ae154d45caba79f5df922c00a36/zcb_dbutils-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-13 00:59:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "chzcb",
    "github_project": "dbutils",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "zcb-dbutils"
}
        
Elapsed time: 0.08585s