Skip to main content

Python library for accessing the Internet in Peking University.

Project description

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".

Project details


Download files

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

Source Distribution

libpkuipgw-0.2.6.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libpkuipgw-0.2.6-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file libpkuipgw-0.2.6.tar.gz.

File metadata

  • Download URL: libpkuipgw-0.2.6.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for libpkuipgw-0.2.6.tar.gz
Algorithm Hash digest
SHA256 50cb3bf0609eefbe43e8344dfc46a6f2642cad68166b6b0d17ce510b23c9f30d
MD5 26f4bbcfa7c281bc75e51ae53cd5b97f
BLAKE2b-256 91d9a1f13289144f659823f16bfa64d9e70126d7151de965b97c019b702b4abe

See more details on using hashes here.

File details

Details for the file libpkuipgw-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: libpkuipgw-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for libpkuipgw-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8152016c2ee1d00d352d93308b87d2ae5a95d71d86b68190103a08964411dd74
MD5 f659c3b22bd38f6bd21bed4902d04e2a
BLAKE2b-256 65a0b5f6183b0f9b43f7aab23ca7a1e21a460d48b9f2bc714672a48c75657cc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page