[bug#76125] gnu: Add python-nmap.

Message ID f34f47e6bcc75192056351f1a50c9e2984bc84a5.1738959615.git.peter@polidoro.io
State New
Headers
Series [bug#76125] gnu: Add python-nmap. |

Commit Message

Peter Polidoro Feb. 7, 2025, 8:20 p.m. UTC
  From: Peter Polidoro <peter@polidoro.io>

* gnu/packages/python-xyz.scm (python-nmap): New variable.

Change-Id: Ibc89f501e4d663e8661e3f988aa58e7544bde750
---
 gnu/packages/python-xyz.scm | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)


base-commit: 8455e44cbbe2b23cadb6e15fe1e40f92b8a5e581
  

Comments

Sharlatan Hellseher Feb. 11, 2025, 8:19 p.m. UTC | #1
Hi,

Thank you for the patch.

--8<---------------cut here---------------start------------->8---
+    (propagated-inputs (list python-simplejson nmap which))
--8<---------------cut here---------------end--------------->8---
nmap and which need to be in inputs.

--8<---------------cut here---------------start------------->8---
+    (synopsis
+     "Python interface to the nmap utility for network discovery and security auditing")
--8<---------------cut here---------------end--------------->8---
It may be shorten to: "Python wraper to Nmap"

--8<---------------cut here---------------start------------->8---
+    (description
+     "This library helps use the nmap port scanner in Python, allowing
+automation of scanning tasks and reports.")
--8<---------------cut here---------------end--------------->8---
Maybe describe why this package may be helpful. Skiming the README it's
hard to deduce ... 
e.g: "This package implements a functionality to wrap @code{nmap}
command into Python scripts,  where each command invocation is wrapped
into function providing JSON output."

--8<---------------cut here---------------start------------->8---
 (define-public python-clrprint
   (package
     (name "python-clrprint")
@@ -39237,7 +39259,7 @@ (define-public python-clrprint
                (base32
                 "0xfn8d1by2w7pjiji887qljk1avn4fylbnz1mj28gysm5g0zvy43"))))
     (build-system python-build-system)
-    (arguments '(#:tests? #f))                    ;there are no tests
+    (arguments '(#:tests? #f))          ;there are no tests
--8<---------------cut here---------------end--------------->8---
Please, apply to the right package ;-)

--8<---------------cut here---------------start------------->8---
+  #:use-module (gnu packages admin)
--8<---------------cut here---------------end--------------->8---
You may keep it there to reduce the number of cross references.

License looks correct as seen in LICENSE file:
--8<---------------cut here---------------start------------->8---
GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007
--8<---------------cut here---------------end--------------->8---

No related to the review comments, the value of the project is
questionable as Nmap provides a very powerful scripting in Lua
<https://nmap.org/book/nse-language.html>, why someone needs to reduce
tooling by wrapping it inside hacky Python script I'm doubt to say :-).

And the project admires that fact!
> Nmap is a complicated piece of software used for reconnaissance on
> target networks, over the years new features have been added making it
> more sophisticated.

Waiting for v2 to cover review points.

--
Oleg
  

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 07d31570f1..b99ae55439 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -180,6 +180,7 @@ 
 (define-module (gnu packages python-xyz)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages adns)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages algebra)
@@ -39226,6 +39227,27 @@  (define-public python-nfcpy
 Communication.")
     (license license:eupl1.1)))
 
+(define-public python-nmap
+  (package
+    (name "python-nmap")
+    (version "1.9.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python3-nmap" version))
+       (sha256
+        (base32 "0b16ni4ywylj0k24x1pi6bp83d80wvd0ri2h225gmkgm2fqcyrc4"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-simplejson nmap which))
+    (native-inputs (list python-setuptools python-wheel))
+    (home-page "https://github.com/nmmapper/python3-nmap")
+    (synopsis
+     "Python interface to the nmap utility for network discovery and security auditing")
+    (description
+     "This library helps use the nmap port scanner in Python, allowing
+automation of scanning tasks and reports.")
+    (license license:gpl3)))
+
 (define-public python-clrprint
   (package
     (name "python-clrprint")
@@ -39237,7 +39259,7 @@  (define-public python-clrprint
                (base32
                 "0xfn8d1by2w7pjiji887qljk1avn4fylbnz1mj28gysm5g0zvy43"))))
     (build-system python-build-system)
-    (arguments '(#:tests? #f))                    ;there are no tests
+    (arguments '(#:tests? #f))          ;there are no tests
     (propagated-inputs (list python-colorama python-termcolor))
     (home-page "https://github.com/AbhijithAJ/clrprint")
     (synopsis "Print colorful output in the terminal")