{
  "id": "task_libraries:networking/python",
  "path": "/exapedia/python-networking-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python networking libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python networking libraries build, send, capture, and decode network traffic below the level of an HTTP client. A packet library represents each protocol layer as an object that code can construct or parse from raw bytes. These libraries let security tools, network monitors, and automation scripts inspect and control traffic on a network."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python networking libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#dnspython",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#paramiko",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scapy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pymodbus",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#dpkt",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-pcapng",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyroutetwo",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyshark",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#dnspython",
          "label": [
            {
              "t": "text",
              "text": "dnspython"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F131"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Build protocol packets",
            "Read capture files"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#dnspython",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#paramiko",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scapy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pymodbus",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#dpkt",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-pcapng",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyroutetwo",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyshark",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "dnspython",
          "name": [
            {
              "t": "fact",
              "fact": "F130"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/rthalley/dnspython"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/dnspython"
            },
            {
              "label": "Docs",
              "href": "https://dnspython.readthedocs.io/en/stable/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F137"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://dnspython.readthedocs.io/en/stable/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import dns.message\n\nquery = dns.message.make_query('example.com', 'A')\nwire = query.to_wire()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://dnspython.readthedocs.io/en/stable/message-make.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "message.py"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=dnspython%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F135"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "paramiko",
          "name": [
            {
              "t": "fact",
              "fact": "F144"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/paramiko/paramiko"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/paramiko"
            },
            {
              "label": "Docs",
              "href": "https://docs.paramiko.org/en/stable/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F151"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.paramiko.org/en/stable/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F144"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/fabric/fabric",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def get(self, remote, local=None, preserve_mode=True):\n    \"\"\"\n    Copy a file from wrapped connection's host to the local filesystem.\n\n    :param str remote:\n        Remote file to download.\n\n        May be absolute, or relative to the remote working directory.\n\n        .. note::\n            Most SFTP servers set the remote working directory to the\n            connecting user's home directory, and (unlike most shells) do\n            *not* expand tildes (``~``).\n\n            For example, instead of saying ``get(\"~/tmp/archive.tgz\")``,\n            say ``get(\"tmp/archive.tgz\")``.\n\n    :param local:\n        Local path to store downloaded file in, or a file-like object.\n\n        **If None or another 'falsey'/empty value is given** (the default),\n        the remote file is downloaded to the current working directory (as\n        seen by `os.getcwd`) using its remote filename. (This is equivalent\n        to giving ``\"{basename}\"``; see the below subsection on\n        interpolation.)\n\n        **If a string is given**, it should be a path to a local directory\n        or file and is subject to similar behavior as that seen by common\n        Unix utilities or OpenSSH's ``sftp`` or ``scp`` tools.\n\n        For example, if the local path is a directory, the remote path's\n        base filename will be added onto it (so ``get('foo/bar/file.txt',\n        '/tmp/')`` would result in creation or overwriting of\n        ``/tmp/file.txt``).\n\n        This path will be **interpolated** with some useful parameters,\n        using `str.format`:\n\n        - The `.Connection` object's ``host``, ``user`` and ``port``\n          attributes.\n        - The ``basename`` and ``dirname`` of the ``remote`` path, as\n          derived by `os.path` (specifically, its ``posixpath`` flavor, so\n          that the resulting values are useful on remote POSIX-compatible\n          SFTP servers even if the local client is Windows).\n        - Thus, for example, ``\"/some/path/{user}@{host}/{basename}\"`` will\n          yield different local paths depending on the properties of both\n          the connection and the remote path.\n\n        .. note::\n            If nonexistent directories are present in this path (including\n            the final path component, if it ends in `os.sep`) they will be\n            created automatically using `os.makedirs`.\n\n        **If a file-like object is given**, the contents of the remote file\n        are simply written into it.\n\n    :param bool preserve_mode:\n        Whether to `os.chmod` the local file so it matches the remote\n        file's mode (default: ``True``).\n\n    :returns: A `.Result` object.\n\n    .. versionadded:: 2.0\n    .. versionchanged:: 2.6\n        Added ``local`` path interpolation of connection & remote file\n        attributes.\n    .. versionchanged:: 2.6\n        Create missing ``local`` directories automatically.\n    \"\"\"\n    # TODO: how does this API change if we want to implement\n    # remote-to-remote file transfer? (Is that even realistic?)\n    # TODO: callback support\n    # TODO: how best to allow changing the behavior/semantics of\n    # remote/local (e.g. users might want 'safer' behavior that complains\n    # instead of overwriting existing files) - this likely ties into the\n    # \"how to handle recursive/rsync\" and \"how to handle scp\" questions\n\n    # Massage remote path\n    if not remote:\n        raise ValueError(\"Remote path must not be empty!\")\n    orig_remote = remote\n    remote = posixpath.join(\n        self.sftp.getcwd() or self.sftp.normalize(\".\"), remote\n    )\n\n    # Massage local path\n    orig_local = local\n    is_file_like = hasattr(local, \"write\") and callable(local.write)\n    remote_filename = posixpath.basename(remote)\n    if not local:\n        local = remote_filename\n    # Path-driven local downloads need interpolation, abspath'ing &\n    # directory creation\n    if not is_file_like:\n        local = local.format(\n            host=self.connection.host,\n            user=self.connection.user,\n            port=self.connection.port,\n            dirname=posixpath.dirname(remote),\n            basename=remote_filename,\n        )\n        # Must treat dir vs file paths differently, lest we erroneously\n        # mkdir what was intended as a filename, and so that non-empty\n        # dir-like paths still get remote filename tacked on.\n        if local.endswith(os.sep):\n            dir_path = local\n            local = os.path.join(local, remote_filename)\n        else:\n            dir_path, _ = os.path.split(local)\n        local = os.path.abspath(local)\n        Path(dir_path).mkdir(parents=True, exist_ok=True)\n        # TODO: reimplement mkdir (or otherwise write a testing function)\n        # allowing us to track what was created so we can revert if\n        # transfer fails.\n        # TODO: Alternately, transfer to temp location and then move, but\n        # that's basically inverse of v1's sudo-put which gets messy\n\n    # Run Paramiko-level .get() (side-effects only. womp.)\n    # TODO: push some of the path handling into Paramiko; it should be\n    # responsible for dealing with path cleaning etc.\n    # TODO: probably preserve warning message from v1 when overwriting\n    # existing files. Use logging for that obviously.\n    #\n    # If local appears to be a file-like object, use sftp.getfo, not get\n    if is_file_like:\n        self.sftp.getfo(remotepath=remote, fl=local)\n    else:\n        self.sftp.get(remotepath=remote, localpath=local)\n        # Set mode to same as remote end\n        # TODO: Push this down into SFTPClient sometime (requires backwards\n        # incompat release.)\n        if preserve_mode:\n            remote_mode = self.sftp.stat(remote).st_mode\n            mode = stat.S_IMODE(remote_mode)\n            os.chmod(local, mode)\n    # Return something useful\n    return Result(\n        orig_remote=orig_remote,\n        remote=remote,\n        orig_local=orig_local,\n        local=local,\n        connection=self.connection,\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/fabric/fabric/blob/ded51893f02c33d2bc7c157624c44a039a952037/fabric/transfer.py#L43-L185",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=paramiko%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F144"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from paramiko.client import SSHClient\n\nclient = SSHClient()\nclient.load_system_host_keys()\nclient.connect('ssh.example.com')\nstdin, stdout, stderr = client.exec_command('ls -l')\nclient.close()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.paramiko.org/en/stable/api/client.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "client.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F149"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "scapy",
          "name": [
            {
              "t": "fact",
              "fact": "F163"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/secdev/scapy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/scapy"
            },
            {
              "label": "Docs",
              "href": "https://scapy.readthedocs.io/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F13"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://scapy.readthedocs.io/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F21"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from scapy.all import IP, ICMP\n\npacket = IP(dst='127.0.0.1') / ICMP()\npacket.show2()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/secdev/scapy/blob/master/doc/scapy/usage.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "usage.rst"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20scapy%20for%20packet%20and%20capture%20processing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pymodbus",
          "name": [
            {
              "t": "fact",
              "fact": "F176"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pymodbus-dev/pymodbus"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pymodbus"
            },
            {
              "label": "Docs",
              "href": "https://pymodbus.readthedocs.io/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F183"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pymodbus.readthedocs.io/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F176"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/home-assistant/core",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F192"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def low_level_pb_call(\n    self, slave: int | None, address: int, value: int | list[int], use_call: str\n) -> ModbusPDU | None:\n    \"\"\"Call sync. pymodbus.\"\"\"\n    kwargs: dict[str, Any] = (\n        {DEVICE_ID: slave} if slave is not None else {DEVICE_ID: 1}\n    )\n    entry = self._pb_request[use_call]\n\n    if use_call in {\"write_registers\", \"write_coils\"}:\n        if not isinstance(value, list):\n            value = [value]\n\n    kwargs[entry.value_attr_name] = value\n    try:\n        result: ModbusPDU = await entry.func(address, **kwargs)\n    except ModbusException as exception_error:\n        error = f\"Error: device: {slave} address: {address} -> {exception_error!s}\"\n        self._log_error(error)\n        return None\n    if not hasattr(result, entry.attr):\n        error = f\"Error: device: {slave} address: {address} -> {result!s}\"\n        self._log_error(error)\n        return None\n    if result.isError():\n        error = (\n            f\"Error: device: {slave} address: {address}\"\n            \" -> pymodbus returned isError True\"\n        )\n        self._log_error(error)\n        return None\n    return result",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/home-assistant/core/blob/934a88b30bd07cac96f119ef111dc6508e58e1bf/homeassistant/components/modbus/modbus.py#L324-L355",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F191"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pymodbus%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F176"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pymodbus.client import ModbusTcpClient\n\nclient = ModbusTcpClient(\"MyDevice.lan\")\nclient.connect()\nresult = client.read_coils(1, count=1)\nclient.close()",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/pymodbus-dev/pymodbus/blob/21842b1eb2d3d2790d55bfbb8862b1003697488a/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F181"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "dpkt",
          "name": [
            {
              "t": "fact",
              "fact": "F194"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/kbandla/dpkt"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/dpkt"
            },
            {
              "label": "Docs",
              "href": "https://dpkt.readthedocs.io/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F39"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://dpkt.readthedocs.io/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F194"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import dpkt\n\npacket = dpkt.ip.IP()\nwire = bytes(packet)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/kbandla/dpkt/blob/master/dpkt/ip.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "print_packets.py"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20dpkt%20for%20packet%20and%20capture%20processing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F194"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F199"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "python-pcapng",
          "name": [
            {
              "t": "fact",
              "fact": "F206"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/rshk/python-pcapng"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/python-pcapng"
            },
            {
              "label": "Docs",
              "href": "https://python-pcapng.readthedocs.io/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F213"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://python-pcapng.readthedocs.io/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pcapng import FileScanner\n\nwith open('/tmp/mycapture.pcap', 'rb') as fp:\n    scanner = FileScanner(fp)\n    for block in scanner:\n        print(block)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/rshk/python-pcapng/blob/master/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=python-pcapng%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F211"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pyroutetwo",
          "name": [
            {
              "t": "fact",
              "fact": "F221"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/svinota/pyroute2"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyroute2"
            },
            {
              "label": "Docs",
              "href": "https://docs.pyroute2.org/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F228"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.pyroute2.org/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F221"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pyroute2 import IPRoute\n\nwith IPRoute() as ipr:\n    for link in ipr.get_links():\n        print(link)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/svinota/pyroute2/blob/master/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pyroute2%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F221"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F226"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pyshark",
          "name": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/KimiNewt/pyshark"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyshark"
            },
            {
              "label": "Docs",
              "href": "https://pyshark-packet-analysis.readthedocs.io/en/latest/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F62"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pyshark-packet-analysis.readthedocs.io/en/latest/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pyshark\n\ncapture = pyshark.FileCapture('capture.pcapng')\nprint(capture[0])\ncapture.close()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/KimiNewt/pyshark/blob/master/src/pyshark/capture/file_capture.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20pyshark%20for%20packet%20and%20capture%20processing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python networking library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#scapy",
          "label": [
            {
              "t": "text",
              "text": "Scapy"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits building, sending, and decoding packets across many protocols. "
        },
        {
          "t": "link",
          "href": "#pyshark",
          "label": [
            {
              "t": "text",
              "text": "PyShark"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits reading packets that Wireshark's dissectors have already decoded. "
        },
        {
          "t": "link",
          "href": "#dnspython",
          "label": [
            {
              "t": "text",
              "text": "dnspython"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits DNS queries and messages."
        }
      ]
    },
    {
      "q": "What is Paramiko?",
      "a": [
        {
          "t": "link",
          "href": "#paramiko",
          "label": [
            {
              "t": "text",
              "text": "Paramiko"
            }
          ]
        },
        {
          "t": "text",
          "text": " implements the SSH protocol in Python and supports SFTP file transfer over its sessions."
        }
      ]
    },
    {
      "q": "What is Scapy?",
      "a": [
        {
          "t": "link",
          "href": "#scapy",
          "label": [
            {
              "t": "text",
              "text": "Scapy"
            }
          ]
        },
        {
          "t": "text",
          "text": " builds, decodes, captures, and stores layered network packets. Sending and capturing live traffic requires the matching system permissions."
        }
      ]
    },
    {
      "q": "What is PyModbus?",
      "a": [
        {
          "t": "link",
          "href": "#pymodbus",
          "label": [
            {
              "t": "text",
              "text": "PyModbus"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a Modbus protocol stack with client, server, and simulator layers."
        }
      ]
    },
    {
      "q": "What is PyShark?",
      "a": [
        {
          "t": "link",
          "href": "#pyshark",
          "label": [
            {
              "t": "text",
              "text": "PyShark"
            }
          ]
        },
        {
          "t": "text",
          "text": " wraps TShark to expose packets decoded by Wireshark's dissectors in Python. It reads protocol fields rather than constructing new packets."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, scapy",
      "display": "Scapy",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, scapy",
      "display": "4.1M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, scapy",
      "display": "GPL-2.0-only",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, scapy",
      "display": "2.8.0, Oct 2026",
      "asOf": "2026-10-02"
    },
    "F5": {
      "label": "Package release date, scapy",
      "display": "Oct 2026",
      "asOf": "2026-10-02"
    },
    "F6": {
      "label": "Repository stars, scapy",
      "display": "12.7K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Capture-file input, scapy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Live capture, scapy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Packet construction, scapy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Capture-file output, scapy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Output formats, scapy",
      "display": "PCAP",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "Install, scapy",
      "display": "pip install scapy",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "What it does, scapy",
      "display": "Builds, decodes, captures, and stores layered network packets.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, scapy",
      "display": "Combines packet construction and capture",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, scapy",
      "display": "Build protocol packets, capture traffic, and save packet files.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths lead, scapy",
      "display": "Reads PCAP and PCAPNG files",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "strengths, scapy",
      "display": "Use rdpcap to load captured packets into a packet list.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, scapy",
      "display": "Windows capture needs Npcap",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, scapy",
      "display": "Install Npcap for Scapy capture on Windows.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations lead, scapy",
      "display": "rdpcap returns a packet list",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "limitations, scapy",
      "display": "Choose streaming readers when a packet list is too large.",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Quickstart, scapy",
      "display": "#! /usr/bin/env python\nfrom scapy.all import *\n\ndef arp_monitor_callback(pkt):\n    if ARP in pkt and pkt[ARP].op in (1,2): #who-has or is-at\n        return pkt.sprintf(\"%ARP.hwsrc% %ARP.psrc%\")\n\nsniff(prn=arp_monitor_callback, filter=\"arp\", store=0)\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function, scapy",
      "display": "def to_pkt_dump(self):\n    p = self.pkt\n    if p and isinstance(p, Packet):\n        p.show2();\n        hexdump(p);\n        return;\n    p = self.pkt_raw;\n    if p:\n        scapy_pkt = Ether(p);\n        scapy_pkt.show2();\n        hexdump(p);\n",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project function reference, scapy",
      "display": "trex_stl_packet_builder_scapy.py · to_pkt_dump()",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project repository, scapy",
      "display": "cisco-system-traffic-generator/trex-core",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project stars, cisco-system-traffic-generator/trex-core",
      "display": "1.5K",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Project push date, cisco-system-traffic-generator/trex-core",
      "display": "Nov 2025",
      "asOf": "2025-11-05"
    },
    "F28": {
      "label": "Library name, dpkt",
      "display": "dpkt",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Monthly downloads, dpkt",
      "display": "1.5M",
      "asOf": "2026-11-16"
    },
    "F30": {
      "label": "License, dpkt",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Package release, dpkt",
      "display": "1.9.8, Aug 2022",
      "asOf": "2022-08-18"
    },
    "F32": {
      "label": "Package release date, dpkt",
      "display": "Aug 2022",
      "asOf": "2022-08-18"
    },
    "F33": {
      "label": "Repository stars, dpkt",
      "display": "1.2K",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Capture-file input, dpkt",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Packet construction, dpkt",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Capture-file output, dpkt",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Output formats, dpkt",
      "display": "PCAP",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "Install, dpkt",
      "display": "pip install dpkt",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "What it does, dpkt",
      "display": "Parses packet bytes into protocol objects and reads or writes capture files.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, dpkt",
      "display": "Constructs packet objects from fields",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, dpkt",
      "display": "Pass a byte buffer or named header fields to a packet constructor.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths lead, dpkt",
      "display": "Writes standard capture containers",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "strengths, dpkt",
      "display": "Use separate writers for PCAP and PCAPNG output.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, dpkt",
      "display": "PCAPNG needs a different reader",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, dpkt",
      "display": "Use dpkt.pcapng.Reader for PCAPNG captures.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, dpkt",
      "display": "\"\"\"\nUse DPKT to read in a pcap file and print out the contents of the packets.\nThis example is focused on the fields in the Ethernet Frame and IP packet.\n\"\"\"\nimport dpkt\nimport datetime\nfrom dpkt.utils import mac_to_str, inet_to_str\n\n\ndef print_packets(pcap):\n    \"\"\"Print out information about each packet in a pcap\n\n       Args:\n           pcap: dpkt pcap reader object (dpkt.pcap.Reader)\n    \"\"\"\n    # For each packet in the pcap process the contents\n    for timestamp, buf in pcap:\n\n        # Print out the timestamp in UTC\n        print('Timestamp: ', str(datetime.datetime.utcfromtimestamp(timestamp)))\n\n        # Unpack the Ethernet frame (mac src/dst, ethertype)\n        eth = dpkt.ethernet.Ethernet(buf)\n        print('Ethernet Frame: ', mac_to_str(eth.src), mac_to_str(eth.dst), eth.type)\n\n        # Make sure the Ethernet data contains an IP packet\n        if not isinstance(eth.data, dpkt.ip.IP):\n            print('Non IP Packet type not supported %s\\n' % eth.data.__class__.__name__)\n            continue\n\n        # Now access the data within the Ethernet frame (the IP packet)\n        # Pulling out src, dst, length, fragment info, TTL, and Protocol\n        ip = eth.data\n\n        # Print out the info, including the fragment flags and offset\n        print('IP: %s -> %s   (len=%d ttl=%d DF=%d MF=%d offset=%d)\\n' %\n              (inet_to_str(ip.src), inet_to_str(ip.dst), ip.len, ip.ttl, ip.df, ip.mf, ip.offset))\n\n    # Pretty print the last packet\n    print('** Pretty print demo **\\n')\n    eth.pprint()\n\n\ndef test():\n    \"\"\"Open up a test pcap file and print out the packets\"\"\"\n    with open('data/http.pcap', 'rb') as f:\n        pcap = dpkt.pcap.Reader(f)\n        print_packets(pcap)\n\n\nif __name__ == '__main__':\n    test()\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, dpkt",
      "display": "def iplayer_from_raw(raw, linktype=1):\n    \"\"\"Converts a raw packet to a dpkt packet regarding of link type.\n    @param raw: raw packet\n    @param linktype: integer describing link type as expected by dpkt\n    \"\"\"\n    if linktype == 1:  # ethernet\n        pkt = dpkt.ethernet.Ethernet(raw)\n        ip = pkt.data\n    elif linktype == 101:  # raw\n        ip = dpkt.ip.IP(raw)\n    else:\n        raise CuckooProcessingError(\"unknown PCAP linktype\")\n    return ip\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, dpkt",
      "display": "network.py · iplayer_from_raw()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, dpkt",
      "display": "kevoreilly/CAPEv2",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, kevoreilly/CAPEv2",
      "display": "3.7K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, kevoreilly/CAPEv2",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F52": {
      "label": "Library name, pyshark",
      "display": "PyShark",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, pyshark",
      "display": "943.7K",
      "asOf": "2026-11-16"
    },
    "F54": {
      "label": "License, pyshark",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, pyshark",
      "display": "0.6, Apr 2023",
      "asOf": "2023-04-26"
    },
    "F56": {
      "label": "Package release date, pyshark",
      "display": "Apr 2023",
      "asOf": "2023-04-26"
    },
    "F57": {
      "label": "Repository stars, pyshark",
      "display": "2.5K",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Capture-file input, pyshark",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Live capture, pyshark",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Capture-file output, pyshark",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Install, pyshark",
      "display": "pip install pyshark",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "What it does, pyshark",
      "display": "Wraps TShark to expose Wireshark-decoded packets in Python.",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths lead, pyshark",
      "display": "Uses Wireshark protocol dissectors",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths, pyshark",
      "display": "Decode packets with the dissectors installed in TShark.",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths lead, pyshark",
      "display": "Applies capture display filters",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths, pyshark",
      "display": "Pass display_filter when opening a capture file.",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations lead, pyshark",
      "display": "Requires a TShark installation",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations, pyshark",
      "display": "Install TShark separately; the Python package wraps its parser.",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Quickstart, pyshark",
      "display": "import pyshark\ncapture = pyshark.LiveCapture(interface='eth0')\nfor packet in capture.sniff_continuously(packet_count=5):\n    print('Just arrived:', packet)\n",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Project function, pyshark",
      "display": "def _get_packets(self, f: str) -> List:\n    override_prefs = {}\n    if self._keylog_file is not None:\n        override_prefs[\"tls.keylog_file\"] = self._keylog_file\n    cap = pyshark.FileCapture(\n        self._filename,\n        display_filter=f,\n        override_prefs=override_prefs,\n        disable_protocol=\"http3\",  # see https://github.com/quic-interop/quic-interop-runner/pull/179\n        decode_as={\"udp.port==443\": \"quic\"},\n    )\n    packets = []\n    # If the pcap has been cut short in the middle of the packet, pyshark will crash.\n    # See https://github.com/KimiNewt/pyshark/issues/390.\n    try:\n        for p in cap:\n            if \"quic\" not in p:\n                logging.info(\"Captured packet without quic layer: %r\", p)\n                continue\n            packets.append(p)\n    except Exception as e:\n        logging.debug(e)\n    cap.close()\n\n    if self._keylog_file is not None:\n        for p in packets:\n            if hasattr(p[\"quic\"], \"decryption_failed\"):\n                logging.info(\"At least one QUIC packet could not be decrypted\")\n                logging.debug(p)\n                break\n    return packets\n",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project function reference, pyshark",
      "display": "trace.py · _get_packets()",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project repository, pyshark",
      "display": "quic-interop/quic-interop-runner",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project stars, quic-interop/quic-interop-runner",
      "display": "296",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project push date, quic-interop/quic-interop-runner",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F75": {
      "label": "Library name, impacket",
      "display": "Impacket",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Monthly downloads, impacket",
      "display": "533.1K",
      "asOf": "2026-11-16"
    },
    "F77": {
      "label": "License, impacket",
      "display": "Apache modified",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Package release, impacket",
      "display": "0.13.1, May 2026",
      "asOf": "2026-05-19"
    },
    "F79": {
      "label": "Package release date, impacket",
      "display": "May 2026",
      "asOf": "2026-05-19"
    },
    "F80": {
      "label": "Repository stars, impacket",
      "display": "16.3K",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Capture-file input, impacket",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Live capture, impacket",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Packet construction, impacket",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Install, impacket",
      "display": "pip install impacket",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "What it does, impacket",
      "display": "Provides packet structures and higher-level implementations of selected network protocols.",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths lead, impacket",
      "display": "Builds protocol packets directly",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths, impacket",
      "display": "Construct packet structures or parse raw bytes into protocol hierarchies.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths lead, impacket",
      "display": "Provides SMB and RPC stacks",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths, impacket",
      "display": "Use protocol implementations instead of building every message manually.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "limitations lead, impacket",
      "display": "Live capture uses another engine",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "limitations, impacket",
      "display": "The live-capture example requires pcapy alongside the protocol decoder.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Quickstart, impacket",
      "display": "#!/usr/bin/env python\n# Impacket - Collection of Python classes for working with network protocols.\n#\n# Copyright Fortra, LLC and its affiliated companies \n#\n# All rights reserved.\n#\n# This software is provided under a slightly modified version\n# of the Apache Software License. See the accompanying LICENSE file\n# for more information.\n#\n# Description:\n#   Simple ICMP ping.\n#\n#   This implementation of ping uses the ICMP echo and echo-reply packets\n#   to check the status of a host. If the remote host is up, it should reply\n#   to the echo probe with an echo-reply packet.\n#   Note that this isn't a definite test, as in the case the remote host is up\n#   but refuses to reply the probes.\n#   Also note that the user must have special access to be able to open a raw\n#   socket, which this program requires.\n#\n# Authors:\n#   Gerardo Richarte (@gerasdf)\n#   Javier Kohen\n#\n# Reference for:\n#   ImpactPacket: IP, ICMP, DATA\n#   ImpactDecoder\n#\n\nimport select\nimport socket\nimport time\nimport sys\n\nfrom impacket import ImpactDecoder, ImpactPacket\n\nif len(sys.argv) < 3:\n    print(\"Use: %s <src ip> <dst ip>\" % sys.argv[0])\n    sys.exit(1)\n\nsrc = sys.argv[1]\ndst = sys.argv[2]\n\n# Create a new IP packet and set its source and destination addresses.\n\nip = ImpactPacket.IP()\nip.set_ip_src(src)\nip.set_ip_dst(dst)\n\n# Create a new ICMP packet of type ECHO.\n\nicmp = ImpactPacket.ICMP()\nicmp.set_icmp_type(icmp.ICMP_ECHO)\n\n# Include a 156-character long payload inside the ICMP packet.\nicmp.contains(ImpactPacket.Data(b\"A\"*156))\n\n# Have the IP packet contain the ICMP packet (along with its payload).\nip.contains(icmp)\n\n",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Developer need",
      "display": "Constructing and capturing packets",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Why choose scapy",
      "display": "combining packet construction with capture APIs",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Developer need in introduction",
      "display": "constructing and capturing packets",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "When to consider pyshark",
      "display": "Wireshark dissection is the main requirement",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need",
      "display": "Constructing protocol objects",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Why choose dpkt",
      "display": "packet buffers and explicit header fields",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need in introduction",
      "display": "constructing protocol objects",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "When to consider scapy",
      "display": "the workflow combines packet construction and capture",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "Using Wireshark dissectors in Python",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose pyshark",
      "display": "TShark-backed protocol dissection",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "using Wireshark dissectors in Python",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "When to consider dpkt",
      "display": "explicit Python packet objects fit the workflow",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need",
      "display": "Working with SMB or RPC",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Why choose impacket",
      "display": "higher-level SMB and MSRPC implementations",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need in introduction",
      "display": "working with SMB or RPC",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "When to consider scapy",
      "display": "general packet construction and capture fit the task",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Page introduction",
      "display": "Python networking libraries let developers inspect network traffic and packet data.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Which Python networking library fits each packet workflow?",
      "display": "Scapy combines packet construction, decoding, capture, and PCAP storage.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Which Python networking library fits each packet workflow?",
      "display": "dpkt supplies packet constructors that accept buffers or named fields.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Which Python networking library fits each packet workflow?",
      "display": "PyShark uses the installed TShark/Wireshark dissectors.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which Python networking library fits each packet workflow?",
      "display": "Impacket also implements higher-level SMB and MSRPC protocols.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Does PyShark parse the protocols independently of Wireshark?",
      "display": "PyShark delegates decoding to TShark rather than implementing its own packet parsers.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Does Scapy always need libpcap on Linux?",
      "display": "Scapy can run natively on Linux without libpcap.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Does Scapy always need libpcap on Linux?",
      "display": "The installation instructions separately identify libpcap as a BPF-filter compiler.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: What does Scapy need on Windows?",
      "display": "Its installation instructions require Npcap on Windows.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does rdpcap return one packet at a time?",
      "display": "rdpcap returns a packet list from a PCAP or PCAPNG file.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Can dpkt read PCAPNG with the same reader class as PCAP?",
      "display": "dpkt.pcap.Reader is the PCAP reader.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Can dpkt read PCAPNG with the same reader class as PCAP?",
      "display": "PCAPNG has a separate dpkt.pcapng.Reader.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Can dpkt write packet captures?",
      "display": "dpkt.pcap.Writer writes PCAP dumpfiles.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can dpkt write packet captures?",
      "display": "dpkt.pcapng.Writer creates PCAPNG dumpfiles.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Can PyShark filter a file before returning packets?",
      "display": "FileCapture accepts a Wireshark display_filter before reading packets.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Are TShark XML reports the same as raw capture files?",
      "display": "PyShark uses TShark XML output to expose decoded packet fields.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Are TShark XML reports the same as raw capture files?",
      "display": "Saving captured packets is a separate output_file option.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: What does an Impacket live-capture example use for capture?",
      "display": "Its sniff example imports pcapy findalldevs and open_live, then uses Impacket decoders.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does Impacket only expose individual packet headers?",
      "display": "The library includes protocol implementations such as SMB and MSRPC as well as low-level packets.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Does this comparison cover general HTTP client libraries?",
      "display": "The scope here is packet manipulation, capture parsing, and network-protocol access.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: Does this comparison cover general HTTP client libraries?",
      "display": "Impacket describes low-level packet access and selected full protocol implementations.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "Library name, dnspython",
      "display": "dnspython",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Monthly downloads, dnspython",
      "display": "295.8M",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "License, dnspython",
      "display": "ISC",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Package release, dnspython",
      "display": "2.9.2",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Package release date, dnspython",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Install, dnspython",
      "display": "pip install dnspython",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Quickstart, dnspython",
      "display": "import dns.message\n\nquery = dns.message.make_query('example.com', 'A')\nwire = query.to_wire()\n",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Official description, dnspython",
      "display": "Provides a DNS toolkit.",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Quickstart source file, dnspython",
      "display": "dns/message.py",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Repository stars, dnspython",
      "display": "2.7K",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Build protocol packets, dnspython",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Read capture files, dnspython",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Native protocol and data layer, dnspython",
      "display": "DNS-specific toolkit with high-level queries and low-level DNS Name/Message/wire APIs; not general Ethernet/IP capture dissection.",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "First-call setup, dnspython",
      "display": "Creates/serializes a DNS question locally; example.com is literal reserved sample input. No DNS exchange needed for this basic wire-message call. Current stable2.9.2 docs are used; main README says2.10 development and is not used to infer unreleased features.",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Library name, paramiko",
      "display": "Paramiko",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Monthly downloads, paramiko",
      "display": "115.1M",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "License, paramiko",
      "display": "LGPL-2.1",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Package release, paramiko",
      "display": "5.1.0",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Package release date, paramiko",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Install, paramiko",
      "display": "pip install paramiko",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Quickstart, paramiko",
      "display": "from paramiko.client import SSHClient\n\nclient = SSHClient()\nclient.load_system_host_keys()\nclient.connect('ssh.example.com')\nstdin, stdout, stderr = client.exec_command('ls -l')\nclient.close()\n",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Official description, paramiko",
      "display": "Implements the SSH2 protocol.",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Quickstart source file, paramiko",
      "display": "paramiko/client.py",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Repository stars, paramiko",
      "display": "9.9K",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Build protocol packets, paramiko",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Read capture files, paramiko",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Native protocol and data layer, paramiko",
      "display": "SSH2 protocol stack with public Message/Packetizer APIs for custom protocol work; SFTP example demonstrates its higher session layer,not passive capture decoding.",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "First-call setup, paramiko",
      "display": "Existing SSH server,authentication via configured key/agent,and trusted host key in known_hosts. ssh.example.com is a placeholder. This basic session is not passive packet capture; no SSH connection,key file,or command was run.",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Verified whole project contract, paramiko",
      "display": "Whole Fabric Transfer.get function, not a copied Paramiko implementation. Its same-file sftp property delegates to Connection.sftp; that exact-commit companion explicitly returns Paramiko SFTPClient via SSHClient.open_sftp. Current5.1.0 keeps getcwd/normalize/getfo/get/stat and file-attribute st_mode; getfo accepts a writable file-like target, while get accepts a local pathname. The function preserves its original return metadata and local filesystem/chmod logic. No complete Fabric dependency upgrade or live file transfer is claimed; the old consumer pin is not the admission test.",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project function, paramiko",
      "display": "def get(self, remote, local=None, preserve_mode=True):\n    \"\"\"\n    Copy a file from wrapped connection's host to the local filesystem.\n\n    :param str remote:\n        Remote file to download.\n\n        May be absolute, or relative to the remote working directory.\n\n        .. note::\n            Most SFTP servers set the remote working directory to the\n            connecting user's home directory, and (unlike most shells) do\n            *not* expand tildes (``~``).\n\n            For example, instead of saying ``get(\"~/tmp/archive.tgz\")``,\n            say ``get(\"tmp/archive.tgz\")``.\n\n    :param local:\n        Local path to store downloaded file in, or a file-like object.\n\n        **If None or another 'falsey'/empty value is given** (the default),\n        the remote file is downloaded to the current working directory (as\n        seen by `os.getcwd`) using its remote filename. (This is equivalent\n        to giving ``\"{basename}\"``; see the below subsection on\n        interpolation.)\n\n        **If a string is given**, it should be a path to a local directory\n        or file and is subject to similar behavior as that seen by common\n        Unix utilities or OpenSSH's ``sftp`` or ``scp`` tools.\n\n        For example, if the local path is a directory, the remote path's\n        base filename will be added onto it (so ``get('foo/bar/file.txt',\n        '/tmp/')`` would result in creation or overwriting of\n        ``/tmp/file.txt``).\n\n        This path will be **interpolated** with some useful parameters,\n        using `str.format`:\n\n        - The `.Connection` object's ``host``, ``user`` and ``port``\n          attributes.\n        - The ``basename`` and ``dirname`` of the ``remote`` path, as\n          derived by `os.path` (specifically, its ``posixpath`` flavor, so\n          that the resulting values are useful on remote POSIX-compatible\n          SFTP servers even if the local client is Windows).\n        - Thus, for example, ``\"/some/path/{user}@{host}/{basename}\"`` will\n          yield different local paths depending on the properties of both\n          the connection and the remote path.\n\n        .. note::\n            If nonexistent directories are present in this path (including\n            the final path component, if it ends in `os.sep`) they will be\n            created automatically using `os.makedirs`.\n\n        **If a file-like object is given**, the contents of the remote file\n        are simply written into it.\n\n    :param bool preserve_mode:\n        Whether to `os.chmod` the local file so it matches the remote\n        file's mode (default: ``True``).\n\n    :returns: A `.Result` object.\n\n    .. versionadded:: 2.0\n    .. versionchanged:: 2.6\n        Added ``local`` path interpolation of connection & remote file\n        attributes.\n    .. versionchanged:: 2.6\n        Create missing ``local`` directories automatically.\n    \"\"\"\n    # TODO: how does this API change if we want to implement\n    # remote-to-remote file transfer? (Is that even realistic?)\n    # TODO: callback support\n    # TODO: how best to allow changing the behavior/semantics of\n    # remote/local (e.g. users might want 'safer' behavior that complains\n    # instead of overwriting existing files) - this likely ties into the\n    # \"how to handle recursive/rsync\" and \"how to handle scp\" questions\n\n    # Massage remote path\n    if not remote:\n        raise ValueError(\"Remote path must not be empty!\")\n    orig_remote = remote\n    remote = posixpath.join(\n        self.sftp.getcwd() or self.sftp.normalize(\".\"), remote\n    )\n\n    # Massage local path\n    orig_local = local\n    is_file_like = hasattr(local, \"write\") and callable(local.write)\n    remote_filename = posixpath.basename(remote)\n    if not local:\n        local = remote_filename\n    # Path-driven local downloads need interpolation, abspath'ing &\n    # directory creation\n    if not is_file_like:\n        local = local.format(\n            host=self.connection.host,\n            user=self.connection.user,\n            port=self.connection.port,\n            dirname=posixpath.dirname(remote),\n            basename=remote_filename,\n        )\n        # Must treat dir vs file paths differently, lest we erroneously\n        # mkdir what was intended as a filename, and so that non-empty\n        # dir-like paths still get remote filename tacked on.\n        if local.endswith(os.sep):\n            dir_path = local\n            local = os.path.join(local, remote_filename)\n        else:\n            dir_path, _ = os.path.split(local)\n        local = os.path.abspath(local)\n        Path(dir_path).mkdir(parents=True, exist_ok=True)\n        # TODO: reimplement mkdir (or otherwise write a testing function)\n        # allowing us to track what was created so we can revert if\n        # transfer fails.\n        # TODO: Alternately, transfer to temp location and then move, but\n        # that's basically inverse of v1's sudo-put which gets messy\n\n    # Run Paramiko-level .get() (side-effects only. womp.)\n    # TODO: push some of the path handling into Paramiko; it should be\n    # responsible for dealing with path cleaning etc.\n    # TODO: probably preserve warning message from v1 when overwriting\n    # existing files. Use logging for that obviously.\n    #\n    # If local appears to be a file-like object, use sftp.getfo, not get\n    if is_file_like:\n        self.sftp.getfo(remotepath=remote, fl=local)\n    else:\n        self.sftp.get(remotepath=remote, localpath=local)\n        # Set mode to same as remote end\n        # TODO: Push this down into SFTPClient sometime (requires backwards\n        # incompat release.)\n        if preserve_mode:\n            remote_mode = self.sftp.stat(remote).st_mode\n            mode = stat.S_IMODE(remote_mode)\n            os.chmod(local, mode)\n    # Return something useful\n    return Result(\n        orig_remote=orig_remote,\n        remote=remote,\n        orig_local=orig_local,\n        local=local,\n        connection=self.connection,\n    )\n",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project source file, paramiko",
      "display": "fabric/transfer.py",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project full_name, paramiko",
      "display": "fabric/fabric",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project stargazers_count, paramiko",
      "display": "15.5K",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Library name, scapy",
      "display": "Scapy",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Monthly downloads, scapy",
      "display": "4.3M",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "License, scapy",
      "display": "GPL-2.0-only",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Package release, scapy",
      "display": "2.8.0",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Package release date, scapy",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Install, scapy",
      "display": "pip install scapy",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Quickstart, scapy",
      "display": "from scapy.all import IP, ICMP\n\npacket = IP(dst='127.0.0.1') / ICMP()\npacket.show2()\n",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Repository stars, scapy",
      "display": "12.7K",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Build protocol packets, scapy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Read capture files, scapy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Native protocol and data layer, scapy",
      "display": "General packet construction,decoding,live I/O,and PCAP tooling; offline field/byte dump example is separate from capture/send permissions.",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "First-call setup, scapy",
      "display": "Local packet construction/display only. Destination is explicit loopback sample data; this code does not call send,sr1,or sniff. Live I/O has separate OS/driver/permission requirements. No packet generated by executing the SDK.",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Live I/O permissions differ from offline construction, scapy",
      "display": "Offline Packet/Ether display uses no capture driver. Actual live I/O depends on OS,interface,drivers,and privileges; Linux native sockets and Windows capture drivers differ. TRex example is original Python-client usage with its own GPL source grant,not a copied SDK algorithm.",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Library name, pymodbus",
      "display": "PyModbus",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Monthly downloads, pymodbus",
      "display": "2.0M",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "License, pymodbus",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Package release, pymodbus",
      "display": "3.16.2",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Package release date, pymodbus",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Install, pymodbus",
      "display": "pip install pymodbus",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Quickstart, pymodbus",
      "display": "from pymodbus.client import ModbusTcpClient\n\nclient = ModbusTcpClient(\"MyDevice.lan\")\nclient.connect()\nresult = client.read_coils(1, count=1)\nclient.close()",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Official description, pymodbus",
      "display": "Implements the Modbus protocol stack in Python.",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Quickstart source file, pymodbus",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Repository stars, pymodbus",
      "display": "2.8K",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Build protocol packets, pymodbus",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Read capture files, pymodbus",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Native protocol and data layer, pymodbus",
      "display": "Dedicated Modbus PDU/framer stack with client,server,and simulator layers; released offline CLI decodes request/response frames.",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "First-call setup, pymodbus",
      "display": "Offline decode of declared complete ModbusTCP ADU: transaction1,protocol0,length6,device1,function3,address0,count1. Expected IDs0 accept any ID in this native parser. No socket,PLC,or server is contacted. API signatures and wire layout come from exact released3.16.2 tree/blob sources; no legacy positional-count client snippet is copied.",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Project function, pymodbus",
      "display": "async def low_level_pb_call(\n    self, slave: int | None, address: int, value: int | list[int], use_call: str\n) -> ModbusPDU | None:\n    \"\"\"Call sync. pymodbus.\"\"\"\n    kwargs: dict[str, Any] = (\n        {DEVICE_ID: slave} if slave is not None else {DEVICE_ID: 1}\n    )\n    entry = self._pb_request[use_call]\n\n    if use_call in {\"write_registers\", \"write_coils\"}:\n        if not isinstance(value, list):\n            value = [value]\n\n    kwargs[entry.value_attr_name] = value\n    try:\n        result: ModbusPDU = await entry.func(address, **kwargs)\n    except ModbusException as exception_error:\n        error = f\"Error: device: {slave} address: {address} -> {exception_error!s}\"\n        self._log_error(error)\n        return None\n    if not hasattr(result, entry.attr):\n        error = f\"Error: device: {slave} address: {address} -> {result!s}\"\n        self._log_error(error)\n        return None\n    if result.isError():\n        error = (\n            f\"Error: device: {slave} address: {address}\"\n            \" -> pymodbus returned isError True\"\n        )\n        self._log_error(error)\n        return None\n    return result",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Project source file, pymodbus",
      "display": "homeassistant/components/modbus/modbus.py",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Project full_name, pymodbus",
      "display": "home-assistant/core",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Project stargazers_count, pymodbus",
      "display": "92.4K",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Library name, dpkt",
      "display": "dpkt",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Monthly downloads, dpkt",
      "display": "1.6M",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "License, dpkt",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Package release, dpkt",
      "display": "1.9.8",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Package release date, dpkt",
      "display": "Aug 2022",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Install, dpkt",
      "display": "pip install dpkt",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Quickstart, dpkt",
      "display": "import dpkt\n\npacket = dpkt.ip.IP()\nwire = bytes(packet)\n",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Repository stars, dpkt",
      "display": "1.2K",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Build protocol packets, dpkt",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Read capture files, dpkt",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Native protocol and data layer, dpkt",
      "display": "Structured TCP/IP protocol objects and PCAP/PCAPNG readers/writers; caller controls linktype and next-protocol interpretation.",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "First-call setup, dpkt",
      "display": "Local IPv4 header serialization with library defaults,not a transmitted packet. Supply actual addresses/payload for an application. No capture fixture,root,or live interface needed for this basic call.",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Library name, python-pcapng",
      "display": "python-pcapng",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Monthly downloads, python-pcapng",
      "display": "1.1M",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "License, python-pcapng",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Package release, python-pcapng",
      "display": "2.1.1",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Package release date, python-pcapng",
      "display": "Aug 2022",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Install, python-pcapng",
      "display": "pip install python-pcapng",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Quickstart, python-pcapng",
      "display": "from pcapng import FileScanner\n\nwith open('/tmp/mycapture.pcap', 'rb') as fp:\n    scanner = FileScanner(fp)\n    for block in scanner:\n        print(block)\n",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Official description, python-pcapng",
      "display": "Reads and writes the pcap-ng format used by packet sniffers.",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Quickstart source file, python-pcapng",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Repository stars, python-pcapng",
      "display": "129",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Build protocol packets, python-pcapng",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Read capture files, python-pcapng",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Native protocol and data layer, python-pcapng",
      "display": "Pure-Python PCAPNG container blocks/options and file IO,not a protocol-payload decoder or generic classic-PCAP reader.",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "First-call setup, python-pcapng",
      "display": "Provide an actual PCAPNG-formatted file at the placeholder path. The .pcap filename in the official example does not imply support for the older classic-PCAP format. API recipe replaces only the documented block-handling placeholder with print(block); not claimed byte-identical upstream code. No file opened.",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Options and payload preservation, python-pcapng",
      "display": "Options iterator preserves lists of repeated values; known names may be strings and unknown codes numeric. Selected seven-line diagnostic formatter only handles named keys. EnhancedPacket timestamp fields are timestamp_high/timestamp_low,and original length is packet_len; timestamp/original_len constructor kwargs are ignored rather than translated.",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Library name, pyroute2",
      "display": "Pyroute2",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Monthly downloads, pyroute2",
      "display": "1.0M",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "License, pyroute2",
      "display": "GPL-2.0-or-later OR Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Package release, pyroute2",
      "display": "0.9.7",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Package release date, pyroute2",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Install, pyroute2",
      "display": "pip install pyroute2",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Quickstart, pyroute2",
      "display": "from pyroute2 import IPRoute\n\nwith IPRoute() as ipr:\n    for link in ipr.get_links():\n        print(link)\n",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Official description, pyroute2",
      "display": "Exchanges Netlink messages from Python.",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Quickstart source file, pyroute2",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Repository stars, pyroute2",
      "display": "1.1K",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Build protocol packets, pyroute2",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Read capture files, pyroute2",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Native protocol and data layer, pyroute2",
      "display": "Netlink/PF_ROUTE and related network-protocol framework for kernel/network configuration messages,not a Wireshark replacement.",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "First-call setup, pyroute2",
      "display": "Linux RTNL read-only interface dump; constrained environments can restrict Netlink access. Context-manager setup and get_links come from separate literal official blocks,explicitly assembled. Does not create/delete interfaces,change routes,or configure a network. BSD support is a limited emulation subset,not parity.",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "OS and source grant, pyroute2",
      "display": "Linux native; BSD emulates a limited RTNL subset; other platforms unsupported. BlueOS example’s root license explicitly offers AGPL-3.0-only OR a custom license; full AGPL text is the selected source grant,not the custom contact stub. IFA_F_PERMANENT is the application’s heuristic,not complete DHCP state.",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Library name, pyshark",
      "display": "pyshark",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Monthly downloads, pyshark",
      "display": "979.1K",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "License, pyshark",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Package release, pyshark",
      "display": "0.6",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Package release date, pyshark",
      "display": "Apr 2023",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Install, pyshark",
      "display": "pip install pyshark",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Quickstart, pyshark",
      "display": "import pyshark\n\ncapture = pyshark.FileCapture('capture.pcapng')\nprint(capture[0])\ncapture.close()\n",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Repository stars, pyshark",
      "display": "2.5K",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Build protocol packets, pyshark",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Read capture files, pyshark",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Native protocol and data layer, pyshark",
      "display": "Python interface to TShark/Wireshark dissectors,with captured protocol fields rather than native packet construction.",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "First-call setup, pyshark",
      "display": "Install TShark separately and supply an existing nonempty capture file at the placeholder path. First-packet lookup can fail on an empty capture; constructor/close manage parser process state. No TShark process or capture file was read.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python networking packet libraries Scapy dpkt PyShark Impacket code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
