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-3.0.1.tar.gz
(17.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file debinterface-3.0.1.tar.gz.
File metadata
- Download URL: debinterface-3.0.1.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baea60084c2b33846375fbcd67e7c29840097bd5e021b1f2c288eb4553027a61
|
|
| MD5 |
f47dad2cb690a0834f25eec637adeeff
|
|
| BLAKE2b-256 |
c812facfc462d97cb89fc9d687de394a9a26a4a34047df1a47ba5a2cc77bb29f
|
File details
Details for the file debinterface-3.0.1-py2-none-any.whl.
File metadata
- Download URL: debinterface-3.0.1-py2-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d519c46c643d149c44f8ec39259517d9a79bec86933e0654ec0762673dc31b58
|
|
| MD5 |
999bca20095c87fb916b6e39d99ca5dd
|
|
| BLAKE2b-256 |
490bf041980bdabc2ae029a48decde8114f5d83ff467162d702a77deac4b1ae7
|