Skip to main content

This is a simple Python library for dealing with the /etc/network/interfaces file in most Debian based distributions. This is forked from https://github.com/dggreenbaum/debinterface to refactor it and maybe extends it with wpa_supplicant handling

Example usage

import debinterface

# Get a collection of objects representing the network adapters.
adapters = debinterface.Interfaces().adapters

# You get a list you can iterare over.
# Each adapter has an 'export()' method that returns a dictionary of its options.
# You can print the name of each adapter as follows:
for adapter in adapters:
    item = adapter.export()
    print(item['name'])

# Write your new interfaces file as follows:
# Any changes made with setter methods will be reflected with the new write.
interfaces = debinterface.Interfaces()
interfaces.writeInterfaces()

# A backup of your old interfaces file will be generated when writing over the previous interfaces file
# By defaults these paths are used :
# INTERFACES_PATH='/etc/network/interfaces'
# BACKUP_PATH='/etc/network/interfaces.old'
# Paths can be customized when instanciating the Interfaces class:
interfaces = debinterface.Interfaces(interfaces_path='/home/interfaces', backup_path='/another/custom/path')

# By defaults, interfaces file is read when instanciating the Interfaces class, to do it lazyly:
interfaces = debinterface.Interfaces(update_adapters=False)
interfaces.updateAdapters()

Download files

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

Source Distribution

debinterface-2.3.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

debinterface-2.3.0-py2-none-any.whl (15.9 kB view details)

Uploaded Python 2

File details

Details for the file debinterface-2.3.0.tar.gz.

File metadata

  • Download URL: debinterface-2.3.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for debinterface-2.3.0.tar.gz
Algorithm Hash digest
SHA256 ec2a669f25593320d7046ef31403d187b79f2b535c214d8cc39ffa0f74f73f49
MD5 22ce27028fde543d60e6562da03b63b5
BLAKE2b-256 ab57a82c72e92d60427dfd5b587f072e752873c166912627be223444cf345063

See more details on using hashes here.

File details

Details for the file debinterface-2.3.0-py2-none-any.whl.

File metadata

File hashes

Hashes for debinterface-2.3.0-py2-none-any.whl
Algorithm Hash digest
SHA256 e6989c51b849bc7f093f68c66a3d818ab081acf20c2692ffc3fb3f52e867222e
MD5 0f57050ca7c7a62d6685dfca45d30c8a
BLAKE2b-256 ffae8b8f50ec11a3d8208aa2ff46923ea1d9042bd4df63583d3a596ebb3e6b7c

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