Skip to main content

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)

Source distribution for libpkuipgw 0.2.6
File Size Uploaded
libpkuipgw-0.2.6.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libpkuipgw 0.2.6
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

1 release file

0.2.0

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page