Skip to main content
https://travis-ci.org/nMustaki/debinterface.svg?branch=master

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

Documentation : http://debinterface.readthedocs.io/en/latest/index.html

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()

Run the tests

pip install -r requirements_dev.txt
tox

Download files

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

Source Distribution

debinterface-3.2.0.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

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

debinterface-3.2.0-py2-none-any.whl (20.8 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for debinterface-3.2.0.tar.gz
Algorithm Hash digest
SHA256 9fd212b7671d807a7e5a531a76daef4f229cfac38218f8c54f2b61c937a70225
MD5 13de4d4c3ba969c0b8d32798874107a4
BLAKE2b-256 2bfb71590c70c978136422c4259ff15119bf7ced9048c4d107bceb0124cf3663

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for debinterface-3.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 5f5500beb264b93b8255f62d2c86d4d53395188696d051c4c0335b7735a84033
MD5 9b97635b1ce5b3f91e1a3228fd658157
BLAKE2b-256 23b7ebe8257b2775be093e86661d86ae1b5a7de8bdd1f9a2b63c51483bb98c1e

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