Skip to main content

A Python wrapper for Zhejiang University WebVPN

Project description

ZJUWebVPNSession

A Python wrapper for accessing Zhejiang University WebVPN automatically.
Login once, access all ZJU internal sites as if you are on campus.

Build and Release

Features

  • Auto login to webvpn.zju.edu.cn
  • Transparent URL conversion (no need to manually rewrite URLs)
  • Fully compatible with requests API
  • Easy to download files, submit forms, crawl internal resources, etc.

Install

pip install ZJUWebVPN

Quick Start

from ZJUWebVPN import ZJUWebVPNSession

# Create a session and login
session = ZJUWebVPNSession('your_zju_username', 'your_zju_password')

# Example: GET request to an internal site
resp = session.get('https://www.cc98.org/')
print(resp.text)

Examples

1. GET a page

resp = session.get('https://www.cc98.org/')
print(resp.text)

2. POST a form

data = {'key1': 'value1', 'key2': 'value2'}
resp = session.post('https://test.zju.edu.cn/submit', data=data)
print(resp.text)

3. Context Manager

with ZJUWebVPNSession(user, pwd) as session:
    r = session.get('https://example.com')

Requirements

  • requests
  • pycryptodome

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

zjuwebvpn-0.2.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

zjuwebvpn-0.2.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file zjuwebvpn-0.2.1.tar.gz.

File metadata

  • Download URL: zjuwebvpn-0.2.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zjuwebvpn-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5d34c11e39f48e8aae4f9a3ffce4c29f525f3ab39afba77150a94ebfa5924f74
MD5 480a024eac3b279a555605b089b6b149
BLAKE2b-256 935c9ec3c8d12d609ee4db589df707a4efd7a557bea40e96ae56242362b78ca3

See more details on using hashes here.

File details

Details for the file zjuwebvpn-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: zjuwebvpn-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zjuwebvpn-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ba20f9cc16e517970878285627abfd02594b4f90901ec09fc78c53051b87ff8
MD5 41f6932ed714c29e597c04387a8c6bfd
BLAKE2b-256 b9487ae7bae2cd25728067c685dececcc81f374cfa42ecc4d91780eb6093bbad

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