Skip to main content

General information

Pyiface is a package that exposes the network interfaces of the operating system in an easy to use and transparent way. Typical usage looks like this:

#!/usr/bin/env python

import pyiface
from pyiface.ifreqioctls import IFF_UP

# Get all available network interfaces
allIfaces = pyiface.getIfaces()
for iface in allIfaces:
    print(iface)

# Get a specific interface by name
eth0 = pyiface.Interface(name='eth0')

# view eth0 info
print(eth0)

# bring eth0 up
eth0.flags = eth0.flags | IFF_UP

# set ipv4 address of the interface
eth0.addr = (socket.AF_INET, '1.2.3.4')

# set ipv6 address of the interface
eth0.addr = (socket.AF_INET6, '2001:0db8:85a3:0000:0000:8a2e:0370:7334')

Installation

To install the package simply call setup.py with the install option.

Download files

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

Source Distribution

pyiface-0.0.11.tar.gz (17.3 kB view details)

Uploaded Source

File details

Details for the file pyiface-0.0.11.tar.gz.

File metadata

  • Download URL: pyiface-0.0.11.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for pyiface-0.0.11.tar.gz
Algorithm Hash digest
SHA256 e231e5735d329c5b2d4fc8854f069fdaa5436d3ef91ed64ee49e41e3f5e8a3f5
MD5 b066aa984656742738127c9c75436ab4
BLAKE2b-256 acef0ec274c45e0ecf7aac0c997de88fe493a32c7c042153efbb2ca669828d65

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.11 This release

1 file

0.0.10

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.2

1 file

0.0.1

1 file

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