Skip to main content

A Python port of the C# ZwiftPacketMonitor project which monitors Zwift UDP packets

Project description

zwiftpktmon

A Python port of the C# ZwiftPacketMonitor project which monitors Zwift UDP packets.

This project implements a TCP and UDP packet monitor for the Zwift cycling simulator. It listens for packets on a specific port of a local network adapter, and when found, deserializes the payload and dispatches events that can be consumed by the caller. It uses the asyncio standard library to allow the packet parsing activities to not interfere with the event consumer.

NOTE: Because this utilizes a network packet capture to intercept the UDP packets, your system may require this code to run using elevated privileges. This is definitely required on MacOS.

Requirements

  • Requires Python version 3.10 or higher

  • Uses the project pcapy-ng as its interface to the Pcap-API. The Pcap-API exists natively on MacOS and Linux but not on Windows. On Windows, the Npcap packet capture library must be installed. Npcap is available here: https://npcap.com/dist/npcap-1.60.exe

  • The pcapy-ng library is written in Cython at must be compiled for each environment. Currently, two environments have been pre-compiled and supported:

    • Windows 10+ (64bit AMD; Intel might work but untested)
    • MacOS 10.13+ (High Sierra)

Setup

pip install zwiftpktmon

There are some example scripts in the .\tests folder:

  • test_harness.py: A simple script allowing network selection and event logging.
  • test_harness_ui.py: A simple UI based upon PySimpleGui. To use this you must pip install PySimpleGui first.

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

zwiftpktmon-0.1.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

zwiftpktmon-0.1.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file zwiftpktmon-0.1.0.tar.gz.

File metadata

  • Download URL: zwiftpktmon-0.1.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for zwiftpktmon-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3c5ad0b7c467618443c07a77a1097379c36a4b9d8870f4f8d2cf7f89d5c4d6d
MD5 dcec6807323f49b08c0bc396a33f34e5
BLAKE2b-256 b93e1314034f686d0da45c03c309198304d94af85b2fb72a393ebaa5dd0b23dc

See more details on using hashes here.

File details

Details for the file zwiftpktmon-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zwiftpktmon-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for zwiftpktmon-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2752e4620f72052816ab4bf0fb5be5b335e031d004ab9825328f738a7c80aa9
MD5 4c6c45e27cda293bd31555c4fa9ca563
BLAKE2b-256 1662d94ad12b646c660bcd458168186b928dd020238184bbcba2d5632fbef987

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