semvec/pypi-packages huggingface dataset:
zapi-mysql 1.0.0
基于异步的快速操作MySQL的组件
License: MIT
Requires Python: >=3.8,<4.0
Keywords: zapi,mysql,async,zhangdapeng

# zapi_mysql
基于异步的快速操作MySQL的组件

使用pip安装
```shell
pip install zapi_mysql
```

## 一、增删改数据

### 1.1 创建表
```python
import asyncio
from zapi_mysql import Mysql
db = Mysql(host='127.0.0.1',
           port=3306,
           user='root',
           password='root',
           db='test')


async def test_example_execute(loop):
    # 删除表
    await db.connect()
    sql = "DROP TABLE IF EXISTS user;"
    
    # 创建表
    await db.execute(sql)
    sql = """CREATE TABLE user
                                  (id INT,
                                  name VARCHAR(255),
                                  PRIMARY KEY (id));"""
    await db.execute(sql)
    
    # 插入SQL语句
    sql = "INSERT INTO user VALUES(1,'张三')"
    await db.execute(sql)


loop = asyncio.get_event_loop()
loop.run_until_complete(test_example_execute(loop))
```

### 1.2 插入数据
```python
import asyncio
from zapi_mysql import Mysql
db = Mysql(host='127.0.0.1',
           port=3306,
           user='root',
           password='root',
           db='test')


async def test_example_execute(loop):
    # 插入SQL语句
    sql = "INSERT INTO user VALUES(2,'李四')"
    await db.execute(sql)


loop = asyncio.get_event_loop()
loop.run_until_complete(test_example_execute(loop))
```

### 1.3 批量插入数据
```python
import asyncio
from zapi_mysql import Mysql
db = Mysql(host='127.0.0.1',
           port=3306,
           user='root',
           password='root',
           db='test')


async def test_example_execute(loop):
    # 插入SQL语句
    data = [(4, 'gothic metal'), (5, 'doom metal'), (6, 'post metal')]
    sql = "INSERT INTO user VALUES(%s,%s)"
    await db.execute(sql, data=data)


loop = asyncio.get_event_loop()
loop.run_until_complete(test_example_execute(loop))
```

## 二、查询数据

### 2.1 查询所有数据
```python
import asyncio
from zapi_mysql import Mysql
db = Mysql(host='127.0.0.1',
           port=3306,
           user='root',
           password='root',
           db='test')


async def test_example_execute(loop):
    # 插入SQL语句
    sql = "SELECT id, name FROM user ORDER BY id"
    result = await db.execute(sql)
    print("查询结果：\n", result)


loop = asyncio.get_event_loop()
loop.run_until_complete(test_example_execute(loop))
```

### 2.2 查询单条数据
```python
import asyncio
from zapi_mysql import Mysql
db = Mysql(host='127.0.0.1',
           port=3306,
           user='root',
           password='root',
           db='test')


async def test_example_execute(loop):
    # 查询单条数据
    sql = "SELECT id, name FROM user ORDER BY id"
    result = await db.execute(sql, return_all=False)
    print("查询结果：\n", result)


loop = asyncio.get_event_loop()
loop.run_until_complete(test_example_execute(loop))
```
pyurlcheck 0.1.2
Search docs and validate URLs found are working properly.
License: MIT
Requires Python: >=3.6,<4.0

# PYURLCHECK

Project is currently a **WIP**.

`pyurlcheck` can be used to scan through all of a projects documents and validate any `public` facing URLs are still reachable.

### Why??
It's apparent when navigating code documentation online that keeping up with URLs in documentation isn't always done properly.  Running into constant `404 Not Found` errors is frustrating for users that are trying to learn how to use a product or tool.

### Examples
Running the tool against a single file.
```python
▶ python cli.py examples/example1.md                          
examples/example1.md:8  URL Issue: https://www.ansible.com/jeff
```

Running the tool against a directory.  All files in the directory will be executed.
```python
▶ python cli.py examples/           
examples/example2.md:6  URL Issue: https://www.ansible.com/jeff
examples/example1.md:8  URL Issue: https://www.ansible.com/fake
```

Alternatively,

you can replace `python cli.py` with `pyurlcheck` on the command line.

```
▶ pyurlcheck pyurlcheck/examples/
pyurlcheck/examples/example3.txt:4      URL Issue: https://www.ansible.com/jeff
pyurlcheck/examples/example2.md:7       URL Issue: https://www.ansible.com/jeff
pyurlcheck/examples/example3.md:3       URL Issue: https://www.ansible.com/jeff
pyurlcheck/examples/example4.rst:22     URL Issue: http://google.com/france
pyurlcheck/examples/example4.rst:23     URL Issue: http://google.com/japan
pyurlcheck/examples/example1.md:9       URL Issue: https://www.ansible.com/jeff
```

File extensions are currently not checked; therefore all files in a directory that is passed in will be validated.

## Installation

```
pip install pyurlcheck
```