Skip to main content

gatenet

PyPI Docs CI Changelog

Gatenet is a Python toolkit for networking: diagnostics (ping, traceroute, DNS, ports), simple HTTP/TCP/UDP building blocks, service discovery, and Wi‑Fi hotspot management. It now includes a lightweight hooks system for easy extensibility.

Install

pip install gatenet

Python 3.10+ • Linux/macOS/Windows (feature availability varies by platform)

Highlights

  • Diagnostics: ICMP/TCP ping, traceroute, port scan, DNS, IP geolocation
  • HTTP/TCP/UDP: minimal server/client utilities
  • Discovery: pluggable detectors with a registry
  • Hotspot: create/manage Wi‑Fi access points (Linux/macOS)
  • Hooks: shared event bus across modules (HTTP, clients, discovery, diagnostics)

Quick start

HTTP server

from gatenet.http_.server import HTTPServerComponent

server = HTTPServerComponent(host="127.0.0.1", port=8080)

@server.route("/status", method="GET")
def status(_req):
    return {"ok": True}

server.start()

HTTP client

from gatenet.http_.client import HTTPClient

client = HTTPClient("http://127.0.0.1:8080")
res = client.get("/status")
print(res["data"])  # {"ok": True}

TCP / UDP

from gatenet.client.tcp import TCPClient
from gatenet.client.udp import UDPClient

# TCP
tcp = TCPClient("127.0.0.1", 9000)
tcp.connect()
print(tcp.send("ping"))
tcp.close()

# UDP
udp = UDPClient("127.0.0.1", 9001)
print(udp.send("ping"))
udp.close()

Diagnostics

from gatenet.diagnostics import ping
from gatenet.diagnostics.traceroute import traceroute

print(ping("1.1.1.1", count=2))
print(traceroute("example.com"))

Discovery

from gatenet.discovery.ssh import _identify_service

print(_identify_service(22, "SSH-2.0-OpenSSH_8.9p1"))

Hotspot (platform-dependent)

from gatenet.hotspot import Hotspot

hotspot = Hotspot(ssid="GatenetAP", password="SecurePass123!")
if hotspot.start():
    print("running")
    hotspot.stop()

Hooks & events

from gatenet.core import hooks, events

hooks.on(events.HTTP_BEFORE_REQUEST, lambda req: print("HTTP", req.command, req.path))

Learn more

Contributing

Run tests locally:

pytest -q

License: MIT

Metadata

Release files for gatenet 0.12.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 gatenet 0.12.6
File Size Uploaded
gatenet-0.12.6.tar.gz 59.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gatenet 0.12.6
File Interpreter ABI Platform
gatenet-0.12.6-py3-none-any.whl Python 3 none any Details

Total release size: 82.1 kB

Release files / gatenet-0.12.6.tar.gz

Download URL gatenet-0.12.6.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
db2e0a8620617e742b61b8b88df3e244a893258f41be3c638011012618970640
BLAKE2b-256 checksum
How to use checksums
520c086226f8fbd9447d616d4397d4a238f1a4925349ceba31ac98e08d4a9f02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / gatenet-0.12.6-py3-none-any.whl

Download URL gatenet-0.12.6-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
433965ea7c379ca4fb07d0c288f5fc5fe72382b75d0bf7dabc61a8bb7a628eea
BLAKE2b-256 checksum
How to use checksums
3c4cb583201a4cf44f2bb467835a77a7b213cf3d48d423b3f82cd730a4c5f6a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.12.6 This release

2 release files

0.12.5

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.9.9

2 release files

0.9.7

2 release files

0.9.5

2 release files

0.9.0

2 release files

0.8.9

2 release files

0.8.8

2 release files

0.8.6

2 release files

0.8.4

2 release files

0.8.2

2 release files

0.8.0

2 release files

0.7.5

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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