Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python NMAP library enabling you to start async nmap tasks, parse and compare/diff scan results

Project Description

Code status

Use cases

libnmap is a python library enabling python developers to manipulate nmap process and data.

libnmap is what you were looking for if you need to implement the following:

  • automate or schedule nmap scans on a regular basis
  • manipulate nmap scans results to do reporting
  • compare and diff nmap scans to generate graphs
  • batch process scan reports

The above uses cases will be easy to implement with the help of the libnmap modules.

libnmap modules

The lib currently offers the following modules:

  • process: enables you to launch nmap scans
  • parse: enables you to parse nmap reports or scan results (only XML so far) from a file, a string,…
  • report: enables you to manipulate a parsed scan result and de/serialize scan results in a json format
  • diff: enables you to see what changed between two scans
  • common: contains basic nmap objects like NmapHost and NmapService. It is to note that each object can be “diff()ed” with another similar object.
  • plugins: enables you to support datastores for your scan results directly in the “NmapReport” object. from report module:
  • mongodb: insert/get/getAll/delete
  • sqlalchemy: insert/get/getAll/delete
  • aws s3: insert/get/getAll/delete (not supported for python3 since boto is not supporting py3)
  • csv: todo (easy to implement)
  • elastic search: todo


All the documentation is available on read the docs. This documentation contains small code samples that you directly reuse.


libnmap has by default no dependencies.

The only additional python modules you’ll have to install depends if you wish to use libnmap to store reports on an exotic data store via libnmap’s independents plugins.

Below the list of optional dependencies:

Python Support

The libnmap code is tested against the following python interpreters:

  • Python 2.6
  • Python 2.7
  • Python 3.3
  • Python 3.4


You can install libnmap via pip:

pip install python-libnmap

or via git:

$ git clone
$ cd python-libnmap
$ python install


Some codes samples are available in the examples directory or in the documentation.

Among other example, you notice an sample code pushing nmap scan reports in an ElasticSearch instance and allowing you to create fancy dashboards in Kibana like the screenshot below:


Mike @bmx0r Boutillier for S3 and SQL-Alechemy plugins and for the constructive critics. Thanks!

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(35.9 kB) Copy SHA256 Hash SHA256
Source Feb 28, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting