Skip to main content

Python library for accessing the Internet in Peking University.

Project description


A library for accessing the Internet through Peking University's Internet service.


The recommended way is to use pip to install

pip3 install --user libpkuipgw


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("")

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': '', 'location': '22楼', 'login_time': '2018-08-08T22:22:22+08'}, {'ip': '', '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".

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for libpkuipgw, version 0.2.6
Filename, size File type Python version Upload date Hashes
Filename, size libpkuipgw-0.2.6.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View
Filename, size libpkuipgw-0.2.6-py3-none-any.whl (5.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page