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.0.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.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zjuwebvpn-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 bc525d35cbf75bcda917706eb5c5dceb37b751978b3d002cf1c76e7e6d10bc97
MD5 74b2640ae26f63ce2bcefaf6d1c83091
BLAKE2b-256 749a6930e726d5cd96c08f760ba2cc199694151d12d68ed1ef9b80099c4126c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zjuwebvpn-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 573f44ec668f73f8825b8026897e5678bae9e5ad562f2853705221bcbb1f9a51
MD5 1e2cd12bb15ce7344b2181d30245b3fe
BLAKE2b-256 7152f5ba8bdb65f25cdf9335fc3186931753e2f27c09f4dffb2158eb31486e90

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