libpkuipgw
A library for accessing the Internet through Peking University's Internet service.
Installing
The recommended way is to use pip to install
pip3 install --user libpkuipgw
Usage
First, initialize an IPGWClientobject:
import libpkuipgw
cli = libpkuipgw.IPGWClient(username, password)
To connect to the Internet, call cli.connect()
To check connectivity to the Internet, call cli.check_connectivity()
To disconnect this device, call cli.disconnect()
To disconnect device with specific IP, make the call like cli.disconnect("10.2.111.111")
To disconnect all devices, call cli.disconnect_all()
To get all the connections available: cli.get_connections()
All operations returns IPGWStatus objects. For example, for get_connections:
$ res = cli.get_connections()
$ res
libpkuipgw.IPGWStatus(operation="list", status="success", description="", data=[{'ip': '10.2.111.111', 'location': '22楼', 'login_time': '2018-08-08T22:22:22+08'}, {'ip': '10.2.222.222', 'location': '33楼', 'login_time': '2018-08-08T11:11:11+08'}])
The time format is ISO8601 compliant.
If something goes wrong, returns a status of "error".
Release files for libpkuipgw 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libpkuipgw-0.2.6.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libpkuipgw-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:11.0 kB
Release files / libpkuipgw-0.2.6.tar.gz
| Download URL | libpkuipgw-0.2.6.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50cb3bf0609eefbe43e8344dfc46a6f2642cad68166b6b0d17ce510b23c9f30d
|
|
BLAKE2b-256 checksum How to use checksums |
91d9a1f13289144f659823f16bfa64d9e70126d7151de965b97c019b702b4abe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5rc1
|
Release files / libpkuipgw-0.2.6-py3-none-any.whl
| Download URL | libpkuipgw-0.2.6-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8152016c2ee1d00d352d93308b87d2ae5a95d71d86b68190103a08964411dd74
|
|
BLAKE2b-256 checksum How to use checksums |
65a0b5f6183b0f9b43f7aab23ca7a1e21a460d48b9f2bc714672a48c75657cc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5rc1
|