semvec/pypi-packages huggingface dataset:
dbis-sql-exercise-generator 0.0.1
RWTH Aachen Computer Science i5/dbis assets for Lecture Datenbanken und Informationssysteme
Requires Python: >=3.10

# DBIS SQL Exercise Generator

[![pypi](https://img.shields.io/pypi/pyversions/dbis-sql-exercise-generator)](https://pypi.org/project/dbis-sql-exercise-generator/)
[![PyPI Status](https://img.shields.io/pypi/v/dbis-sql-exercise-generator)](https://pypi.org/project/dbis-sql-exercise-generator/)

# Installation
Install via pip:
```bash
# Not yet available on PyPI
pip install dbis-sql-exercise-generator
```
Most notably, following required packages are also installed:
 - [dbis-sql](https://pypi.org/project/dbis-sql)
 - [dbis-exc-manager](https://pypi.org/project/dbis-exc-manager/)

# Usage
```python
from rc_exercise_generator import generate_exercise

# set the solution as SQLite query (string)
solution_sql_query = "SELECT a, c FROM R;"

from excmanager.Task import Exercise, Task, SubTask
exercise1 = Exercise(1)
task1 = Task(exercise1, "1.1")
subtask1 = SubTask(task1, "a", points=2)
# task description
description = "Select the attributes a and c from the relation R."

generated_cells = generate_exercise(
	subtask1,
	description,
	solution_sql_query,
	correct_attributes_score_perc=0.1,
)

# generated_cells is a dictionary of cells, which can be used to generate a Jupyter Notebook
# format:
# filename (str) -> cell content (str)
```


## :warning: Guidelines
In order to directly use the generated cells in an exercise Jupyter notebook, one should follow the following guidelines:
 - [tasks](https://pypi.org/project/dbis-exc-manager/) should be named `task1`, `task2`, ...
 - The SQLite Connection has to be made beforehand. This connection should be stored in the variable `sql_con`.

View the [templates](rc_exercise_generator/resources/templates/README.md) and [this test](tests/test_correct.py) for more information on what cells are generated and how one can incorporate them into an exercise Jupyter notebook.
ipidea-proxy 0.8.0
Python Client for Ipidea Proxy Service API
Requires Python: >=3.6

# ipidea-proxy

Python library for ipidea proxy service API

![Github Checker](https://github.com/pinclr/ipidea-proxy/actions/workflows/pytest.yml/badge.svg?branch=main)
[![Pypi](https://img.shields.io/pypi/v/ipidea-proxy.svg)](https://pypi.org/project/ipidea-proxy/)
[![Documentation Status](https://readthedocs.org/projects/ipidea-proxy/badge/?version=latest)](https://ipidea-proxy.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://pepy.tech/badge/ipidea-proxy)](https://pepy.tech/project/ipidea-proxy)
![GitHub](https://img.shields.io/github/license/pinclr/ipidea-proxy)

## 使用客户端

### 0. 安装

通过pip安装ipidea-proxy的python客户端

```shell
$ pip install --upgrade ipidea-proxy
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting ipidea-proxy
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3a/65/b537feb63f22ce9453600cd49fbf1a230df6914c1ba133ed91efb1fa9a53/ipidea_proxy-0.5.0-py3-none-any.whl (7.8 kB)
Installing collected packages: ipidea-proxy
Successfully installed ipidea-proxy-0.5.0
```

### 1. 获取UID和APPKEY

登录用户Profile

https://www.ipidea.net/ucenter/

然后访问API文档链接，从页面上获取UID和APPKEY

https://www.ipidea.net/ipidea-api.html#001

### 2. 设置环境变量

通过上面获取的UID和APPKEY，设置到以下的环境变量。客户端会自动从该环境变量读取。

```shell
export IPIDEA_UID=xxx
export IPIDEA_APPKEY=xxx
```

### 3. 初始化客户端

```shell
from ipidea_proxy import IpideaProxy

# 通过环境变量设置UID和APPKEY
# 如果UID和APPKEY已经通过环境变量设置，可以这样初始化客户端
ipp = IpideaProxy()

# 通过参数设置UID和APPKEY
ipp = IpideaProxy(uid='xxxx', appkey='xxxxxx')

```

### 4. 使用客户端

#### 4.1 白名单
##### 4.1.1 设置IP到白名单

```shell
# 添加本机公网IP到白名单
ipp.add_whitelist()

# 添加2.3.4.5到白名单
ipp.add_whitelist('2.3.4.5')

# 添加多个IP到白名单（e.g. '2.3.4.6','2.3.4.7')
ipp.add_whitelist('2.3.4.6,2.3.4.7')
```

##### 4.1.2 查看已设置的白名单

```shell
# 查看完整白名单列表
ipp.list_whitelist()
```

##### 4.1.3 从白名单中删除IP

```shell
# 从白名单中删除指定IP
ipp.delete_whitelist('2.3.4.5')

# 从白名单中删除本机对应公网IP
ipp.delete_whitelist()
```

#### 4.2 流量
##### 4.2.1 获取剩余流量

```shell
# 获取当前账号剩余流量
ipp.get_remaining_quota()
```
##### 4.2.2 流量设置预警

```shell
# 设置日预警值 101 并通知到指定手机号 188-8888-8888
ipp.set_alarm_threshold('18888888888','101',0,0)

# 设置流量自停
ipp.set_alarm_threshold('18888888888','101',1,0)

# 开启预警
ipp.set_alarm_threshold('18888888888','101',0,1)
```

##### 4.2.3 查看主账户流量使用

```shell
# 查看主账号流量使用情况 (输入查询的始终时间，格式为'%Y-%m-%d %H:%M:%S')
ipp.get_main_account_usage('2022-06-01 00:00:00', '2022-06-07 23:59:59')
```

##### 4.2.4 查看认证账户流量
```shell
# 查看账户666666的使用流量 (输入查询的始终时间，格式为'%Y-%m-%d %H:%M:%S')
ipp.get_sub_account_usage('666666','2022-06-01 00:00:00', '2022-06-07 23:59:59')
```

## API Reference

https://www.ipidea.net/ipidea-api.html#001