Welcome to NetFuse’s documentation!¶
——–NetFuse——–¶
Main¶
- netfuse.main.center_text(text: str) str ¶
Centers the text with 80 as overall padding size.
- Parameters:
text – Text to be centered.
- Returns:
Text centered using asterisk.
- Return type:
str
- netfuse.main.update_host_file(host_entries: str, output_file: str, dry_run: bool) None ¶
Update the hosts entry file, with all the devices currently connected to the router.
- Parameters:
host_entries – Data that has to be dumped into the hosts file.
output_file – Host file that matches FQDN with server IPs hosting a specific domain.
dry_run – Prints the information instead of writing to hosts file.
- netfuse.main.flush_dns_cache() None ¶
Flushes the DNS cache.
- netfuse.main.dump(dry_run: bool, filepath: str, output: str, module: module, suffix: str) None ¶
Dumps all devices’ hostname and IP addresses into the hosts file.
Config¶
Errors¶
Custom errors for NetFuse module.
>>> Error
- exception netfuse.errors.Error¶
Package’s base exception.
- exception netfuse.errors.ValidationError¶
Custom validation error.
- exception netfuse.errors.MissingRequirement¶
Custom requirement error.
Logger¶
Customized logger function for NetFuse module.
>>> LOGGER
——–Modules——–¶
At&t¶
- netfuse.modules.att.get_network_id() str ¶
Get network id from the current IP address.
- Returns:
Network ID section of the IP address, ignoring the host ID.
- Return type:
str
- netfuse.modules.att.generate_dataframe()¶
Generate a dataframe using the devices information from router web page.
- Returns:
Devices list as a data frame.
- Return type:
pandas.DataFrame
Netgear¶
- netfuse.modules.netgear.attached_devices()¶
Get all attached devices in a Netgear router.
- Returns:
List of device objects.
- Return type:
List[pynetgear.Device]
Squire¶
- class netfuse.modules.squire.Device(dictionary: dict)¶
Convert dictionary into a device object.
>>> Device