semvec/pypi-packages huggingface dataset:
dbtool 0.2.0
A lightweight db tools for sql.
Requires Python: >=3.6,<4.0

#  dbtool
A lightweight db tools for sql.

```
pip install dbtool
```

```
# sqlite3 ....
db = dbtool.connect('sqlite:///:memory:')
db = dbtool.connect('mysql://root:123456@127.0.0.1:3306/test',  mincached=1, maxconnections=20)

# sql
db.execute(sql)
db.execute_fetchone(sql)
db.execute_cursor(sql)
db.execute_batch(sql)
db.execute_script(sql)

# crud
db.insert(user)
db.update(user)
db.delete(User, {'id': 1})
db.find(User, {'status': 1})
db.find_one(User, {'id': 1})
db.find_count(User, {'status': 1})

# transactions
with db.transaction():
    db.execute(sql1)

```

db vs driver

- sqlite - sqlite3
- mysql - pymysql
- postgresql - psycopg2
- sqlserver - pymssql
DagLpDp 1.2
用动态规划求解有向无环图的最长路径问题
Requires Python: >=3.0

# DagLpDp
用动态规划求解有向无环图的最长路径问题

# 安装
pip install DagLpDp

# 功能
1.支持多起点和多终点  
2.可计算到任意节点的最长路径和路径值  
3.可计算到每个终点的最长路径和路径值  
4.可计算所有路径中的最长路径和路径值  
5.采用非递归方式求解，提升运行效率  

# 示例
```
from DagLpDp import DAGLP

def __print(daglp):
    print('起点（无入度）:',daglp.starts) 
    print('终点（无出度）:',daglp.ends) 
    if daglp.done:#在约定时间内计算完成
        print('到任意节点的最长路径:',daglp.nodePV)
        print('到每个终点的最长路径:',[v for k,v in daglp.nodePV.items() if k in daglp.ends])
        print('到达终点的最长路径:%s,到达终点的最长路径值:%f'%(daglp.max_full_path,daglp.max_full_value))
       
def test_single_start_and_end():
    graph = {}
    graph[(1,2)] = 2
    graph[(1,3)] = 10
    graph[(2,4)] = 5
    graph[(2,5)] = 12
    graph[(3,4)] = 2
    graph[(4,6)] = 2
    graph[(5,6)] = 1
    return DAGLP(graph) 
    
def test_multi_start_and_end():
    graph = {}
    graph[(0,2)] = 4
    graph[(1,2)] = 2
    graph[(1,3)] = 10
    graph[(2,4)] = 5
    graph[(2,5)] = 12
    graph[(3,4)] = 2
    graph[(4,6)] = 2
    graph[(4,7)] = 2
    graph[(5,6)] = 1
    #10秒内不能计算完毕，则停止运算，daglp.done则被记为False。默认为60秒
    return DAGLP(graph,10)   

if __name__ == '__main__':
    daglp_single = test_single_start_and_end()
    __print(daglp_single)   
    daglp_multi = test_multi_start_and_end()
    __print(daglp_multi)
```
cactive-ip 1.0.1
Swiftly retrieves data pertaining to an IP address.
Requires Python: >=3.9

# Cactive IP API (Python)

---

### API Information:

This is a free to use API hosted in Melbourne, Australia that provides detailed information of IP addresses.

You can request the API through the HTTP or HTTPS protocol and the `GET` method at [ip.cactive.co/api/lookup/](https://ip.cactive.co/api/lookup/).

You can either provide an IP address with `/api/lookup/[ip]` or leave it blank to get the IP address of the requester.

**Example:** https://ip.cactive.co/api/lookup/8.8.8.8

---

### Installation:

```bash
pip install cactive-ip
```

### Usage:

```python
import cactive_ip as ip

def examples():
    # Get the IP address of the client
    self = ip.self()
    print(self.ip) # eg: 192.168.0.1

    # Get the time zone of a domain, IPv4 or IPv6
    external = ip.retrieve("cactive.cloud")
    print(external.time_zone) # eg: Australia/Melbourne

examples()
```

### Data Schema:

| Field              | Type           | Example             |
|--------------------|----------------|---------------------|
| `ip`               | String         | `8.8.8.8`           |
| `city`             | String or None | `Ashburn`           |
| `state`            | String or None | `Virginia`          |
| `state_code`       | String or None | `VA`                |
| `country`          | String or None | `United States`     |
| `country_code`     | String or None | `US`                |
| `country_currency` | String or None | `USD`               |
| `continent`        | String or None | `North America`     |
| `continent_code`   | String or None | `NA`                |
| `post_code`        | String or None | `20149`             |
| `time_zone`        | String or None | `America/New_York`  |
| `latitude`         | Number or None | `39.03`             |
| `longitude`        | Number or None | `-77.5`             |
| `reverse_dns`      | String or None | `dns.google`        |
| `isp`              | String or None | `Google LLC`        |
| `isp_org`          | String or None | `Google Public DNS` |
| `as_number`        | String or None | `AS15169`           |
| `as_name`          | String or None | `GOOGLE`            |
| `as_org`           | String or None | `Google LLC`        |
| `detection_vpn`    | Boolean        | `false`             |
| `detection_server` | Boolean        | `true`              |
| `detection_mobile` | Boolean        | `false`             |