semvec/pypi-packages huggingface dataset:
AirThings-API 0.1.5
Python Wrappers for AirThings API
License: MIT
Requires Python: >=3.7

# airthings-api
## Description

Python Wrappers for AirThings API

## Installation

* Package published at https://pypi.org/project/airthings-api/
* Install package: `pip install -i airthings-api`

## Usage (Jupyter)

> NB: You can now use async/await at the top level in the IPython terminal and in the notebook, it should — in most of the cases — “just work”. Update IPython to version 7+, IPykernel to version 5+.

```python
# import the library
ata = __import__('airthings-api')
import aiohttp

session = aiohttp.ClientSession()

# Create an API manager; use your dashboard's credentials
manager = ata.api.web.AirThingsManager(
    username='jdoe@gmail.com', 
    password='xxxxxxxx',
    session=session) 

# Get the 'me' instance
me = await manager.get_me_instance()

print(me.email)
# Should be 'jdoe@gmail.com' I guess

# Get the 'locations' instances
locations_instance = await manager.get_locations_instance()

# Print devices and sensor values
for location in locations_instance.locations:
    for device in location.devices:
        print('device: {0}'.format(device.room_name))
        
        for current_sensor_value in device.current_sensor_values:
            print('  {0}: {1} {2}'.format(
                current_sensor_value.type_,
                current_sensor_value.value,
                current_sensor_value.provided_unit))

await session.close()

# device: Wave Mini
#   temp: 21.6 c
#   humidity: 41.0 pct
#   voc: 253.0 ppb
#   mold: 0.0 riskIndex
# device: Wave
#   radonShortTermAvg: 103.0 bq
#   temp: 20.5 c
#   humidity: 47.0 pct
# device: Hub AirThings
```

## Usage (Python file)

> NB: If you run in a Python file, wrapping the call within `asyncio.run(...)` will do the trick.

```python
ata = __import__('airthings-api')
import aiohttp
import asyncio


async def test():

    session = aiohttp.ClientSession()

    # Create an API manager; use your dashboard's credentials
    manager = ata.api.web.AirThingsManager(
        username='jdoe@gmail.com', 
        password='xxxxxxxx',
        session=session) 

    # Get the 'me' instance
    me = await manager.get_me_instance()

    print(me.email)
    # Should be 'jdoe@gmail.com' I guess

    # Get the 'locations' instances
    locations_instance = await manager.get_locations_instance()

    # Print devices and sensor values
    for location in locations_instance.locations:
        for device in location.devices:
            print('device: {0}'.format(device.room_name))
            
            for current_sensor_value in device.current_sensor_values:
                print('  {0}: {1} {2}'.format(
                    current_sensor_value.type_,
                    current_sensor_value.value,
                    current_sensor_value.provided_unit))

    await session.close()

    # device: Wave Mini
    #   temp: 21.6 c
    #   humidity: 41.0 pct
    #   voc: 253.0 ppb
    #   mold: 0.0 riskIndex
    # device: Wave
    #   radonShortTermAvg: 103.0 bq
    #   temp: 20.5 c
    #   humidity: 47.0 pct
    # device: Hub AirThings


if __name__ == '__main__':

    asyncio.run(test())
```
pyluog 0.13.9
A python module for using Luogu Api.
License: MIT


A python module for using Luogu Api.
一个用于洛谷API的的Python模块。

Github: https://github.com/hlwdy/pyluog

**如何使用**

首先，你需要使用`pip install pyluog`来安装本模块，然后再进行引用：

```python
import pyluog
```

User类型属性：


- name 当前账号的用户名

- password 当前账号的密码，如果通过非账号密码登录方式登录，则该属性值为'*'

- sess 当前账号的session会话对象 (requests的Session类)

- uid 当前账号的uid


你可以定义一个User类型的账号变量，需要两个字符串参数，分别是账号密码：

```python
a=pyluog.User('name','password')
```

注意，以上操作并没有进行登录，登录操作需要执行：

```python
a.login()
```

中途会要求输入验证码，请根据显示的图片验证码正确输入。

如果过程顺利，最后会输出 登录成功!。

除此之外，你还可以使用cookie进行登录 (两个参数，__client_id和你的uid)：

```python
a=pyluog.loginWithCookie('aaabbcc1233dd344ee','12345')
```

这将返回一个登录过的User对象给变量a (cookie需要校验)。

登录操作完成后，你可以用：


- a.getUserData() 获取当前用户的信息

- a.getRecordList('name','1') 获取指定用户的评测提交记录 (两个参数分别是用户名和页数)

- a.getNotification(1,1) 获取当前用户的通知，(两个参数分别是类型和页数)
	- 类型1: @我的
	- 类型2: 回复
	- 类型3: 系统通知


- a.QianDao() 执行签到

- a.getLatestMessages() 获取私信最新消息列表

- a.getMessagesRecord('uid') 获取与指定用户的聊天记录 (注意参数是uid而不是用户名)

- a.sendMessage('uid','content') 向指定用户发送一条私信

- a.getLastCode('P1001') 获取你指定题目最后一次提交的代码

- a.getMyPastes() 获取你发布的所有云剪贴板信息

以上操作均会返回一个json对象。

无需登录账号即可执行的操作：

- pyluog.getUid('name') 根据用户名获取该用户的uid，如果不存在则返回'-1'

- pyluog.searchProblem('keyword',1,-1) 搜索题库内容 (三个参数分别是关键词，页数和题目难度，默认难度-1)
	- -1为全部难度
	- 0为暂无评定
	- 1为入门
	- 2为普及-
	- 3为普及/提高-
	- 4为普及+/提高
	- 5为提高+/省选-
	- 6为省选/NOI-
	- 7为NOI/NOI+/CTSC


- pyluog.getContestList('1') 获取比赛列表，参数为页数

- pyluog.getProblemInfo('P1001') 获取指定题目的详细内容 (包括题面，提交数，通过数，难度等)