skillfed

python3-nmap

Python3-nmap converts Nmap commands into python3 methods making it very easy to use nmap in any of your python pentesting projects

python3-nmap v1.9.1 232.6K downloads/30d#9,063 on PyPI313
License unclear AGING released

What it is and what it does

python3-nmap is a Python wrapper around the nmap command-line port scanner that exposes nmap functionality as Python methods and classes. Instead of constructing shell commands, you instantiate Nmap objects and call methods to run scans and receive results as JSON. The library organizes nmap's capabilities into three main classes: Nmap (general scanning), NmapScanTechniques (various scan types), and NmapHostDiscovery (discovery modes).

The package depends on simplejson for result serialization and requires nmap itself to be installed on the system. It supports Python 3.6 and later. Several operations require root privileges. The library is useful for automating network reconnaissance tasks within Python scripts, though it remains a thin wrapper around nmap rather than a reimplementation.

Use it for:

  • Automate port scanning and service discovery in Python security testing scripts without shell command construction.
  • Batch scan multiple hosts and parse structured JSON results for reporting or downstream analysis.
  • Integrate OS detection and version identification into Python-based network inventory or assessment tools.
  • Run DNS brute-force subdomain enumeration via nmap scripts through Python method calls.
  • Combine multiple scan techniques in a single Python workflow for comprehensive host reconnaissance.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Wraps nmap port scanner commands as Python methods, converting command-line nmap operations into callable functions that return JSON-structured results.

Yes, with conditions. Install if you need to automate nmap scans from Python and can tolerate the aging maintenance status (698 days since last release). Verify the unclear license before use in proprietary contexts. Requires nmap to be pre-installed on the system and root access for certain operations. No known security vulnerabilities.

Install

python3-nmap on PyPI

pip

pip install python3-nmap

uv

uv add python3-nmap

poetry

poetry add python3-nmap

Installing python3-nmap

Before you install

Low install friction with a single runtime dependency (simplejson). Maintenance status is aging—last release was 698 days ago, though the repository remains active with 313 stars and a recent commit on 2025-09-10.

License in practice

License treatment is unclear; no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before use in proprietary or restricted contexts.

Quickstart

pip install python3-nmap

import python3_nmap
results = python3_nmap.Nmap().scan_top_ports("your-host.com")

Requires nmap to be installed on the system. Some operations require root/superuser privileges.

Verify before relying

  • Whether the package is actively maintained or in maintenance-only mode given the 698-day gap since last release.
  • Actual license terms, since license_treatment is unclear and no SPDX identifier is present.
  • Cross-platform support claim (Windows and Linux) and any platform-specific limitations.
  • Which specific operations require root privileges beyond those documented in the description excerpt.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 1 — simplejson
Maintenance aging — 698 days since the last release
Last repo commit
First released
Downloads 232,576/month — #9,063 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python3_nmap-1.9.1-py3-none-any.whl

Operating System :: OS IndependentProgramming Language :: Python :: 3

Tags

nmap python wrapperport scanning library pythonnetwork reconnaissance automationnmap command interfacehost discovery pythonservice version detectionnetwork scanning api
network-securitypentesting

More Networking packages