{"id":18464867,"url":"https://github.com/acceis/pyfconfig","last_synced_at":"2025-09-10T08:12:23.482Z","repository":{"id":110848769,"uuid":"204497462","full_name":"Acceis/pyfconfig","owner":"Acceis","description":"Pyfconfig is a simple package to manipulate your network interfaces under Linux.","archived":false,"fork":false,"pushed_at":"2019-08-27T08:57:27.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T19:50:27.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Acceis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-26T14:47:01.000Z","updated_at":"2019-08-31T04:31:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf39b3e8-c4f9-43ce-8982-6d5e8fab1444","html_url":"https://github.com/Acceis/pyfconfig","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Acceis/pyfconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acceis%2Fpyfconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acceis%2Fpyfconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acceis%2Fpyfconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acceis%2Fpyfconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Acceis","download_url":"https://codeload.github.com/Acceis/pyfconfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acceis%2Fpyfconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274429720,"owners_count":25283441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T09:11:21.673Z","updated_at":"2025-09-10T08:12:23.434Z","avatar_url":"https://github.com/Acceis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pyfconfig\n\nPyfconfig is a simple package to manipulate your network interfaces under Linux.\nIt uses the */sys* filesystem to interact with your interfaces and the *pyroute2* package to implement the IP part (retrieving addresses and routes).\n\nThe entire package manages both IPv4 and IPv6 indinstinctly.\n\nEvery IP/network address uses the standard library [ipaddress](https://docs.python.org/3/library/ipaddress.html).\n\nThis module works for python 3.5+ and requires the following dependency : `pyroute2`.\n\n## What can I do with it ?\n\n### Retrieve your current interfaces :\n```python\nfrom pyfconfig import *\n\n# Retrieve everything\ninterfaces = getInterfaces()\nprint(interfaces)\n# [pyfconfig.Interface(eth0), pyfconfig.Interface(wlan0)]\n\n# Retrieve a single interface\neth0 = IpInterface(\"eth0\")\neth0\n# pyfconfig.IpInterface(eth0)\n```\n\n### Access basic data\n```python\nfrom pyfconfig import *\neth0 = IpInterface(\"eth0\")\n\n# Retrieve the MAC address\nprint(eth0.address)\n# 12:34:ab:cd:ff:43\n\n# Get flags\nprint(eth0.flags)\n# {'MULTICAST', 'BROADCAST', 'UP'}\n\n# Or a single flag\nprint(eth0.UP)\n# True\n\n# Get the interface type\nprint(eth0.wired)\n# True\nprint(eth0.wireless)\n# False\n\n# Get routing information for a single interface\nprint(eth0.routes)\n# [{\"gateway\": IPv4Address('10.10.10.254'), 'outInterface': pyfconfig.IpInterface(eth0), 'dest': IPv4Network('0.0.0.0/0')}]\n\n# or for the entire system\nprint(getRoutes())\n\"\"\" [\n        {\n            \"gateway\": IPv4Address('10.10.10.254'),\n            'outInterface': pyfconfig.IpInterface(eth0),\n            'dest': IPv4Network('0.0.0.0/0')},\n        {\n            'table': 255,\n            'dest': IPv4Network('0.0.0.0/0'),\n            'prefSrc': '127.0.0.1', \n            'outInterface': pyfconfig.IpInterface(lo)\n        }\n    ]\n\"\"\"\n\n# Get IP addresses\nprint(eth0.ipAddresses)\n# [IPv4Interface('10.10.10.42/24')]\n```\n\n### Configure your interfaces\n```python\nfrom pyfconfig import *\neth0 = IpInterface(\"eth0\")\n\n# Set the interface up and down\neth0.up()\neth0.down()\n\n# Toggle some random flag\neth0.togglePromisc()\n\n# Add and remove IP addresses\neth0.addIpAddress(\"10.10.10.42/24\")\neth0.delIpAddress(\"10.10.10.42.24\")\n```\n\n## Install\n\nDownload the latest release and install it with pip :\n```bash\npip install --user ./pyfconfig-0.1.1.tar.gz\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facceis%2Fpyfconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facceis%2Fpyfconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facceis%2Fpyfconfig/lists"}