aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanketsu <hanketsu@egregore.fun>2025-03-04 16:12:07 +0100
committerHanketsu <hanketsu@egregore.fun>2025-06-13 00:04:49 +0200
commita7d03f90953c6d87118d3a48e8c0be5ee06288d6 (patch)
tree05a332b106fef361aeab7053b5ab264c88ac52c3
parent8b62ade668af9955405df3dc58794946e146fe5a (diff)
battering: Add python-maigret.
* battering/packages/osint.scm (python-maigret): New variable.
-rw-r--r--battering/packages/osint.scm86
1 files changed, 85 insertions, 1 deletions
diff --git a/battering/packages/osint.scm b/battering/packages/osint.scm
index ab8bb78..511c287 100644
--- a/battering/packages/osint.scm
+++ b/battering/packages/osint.scm
@@ -2,8 +2,10 @@
#:use-module (guix build-system python)
#:use-module (guix build-system pyproject)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix gexp)
+ #:use-module (gnu packages pdf)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages python-web)
@@ -12,7 +14,8 @@
#:use-module (gnu packages check)
#:use-module (gnu packages xml)
#:use-module ((guix licenses)
- #:prefix license:))
+ #:prefix license:)
+ #:use-module (battering packages python-xyz))
(define-public python-linkedin-api
(package
@@ -116,3 +119,84 @@
(description
"This package provides a Python wrapper for the Discord user API.")
(license license:expat)))
+
+(define-public python-maigret
+ (let ((commit "4195a3ca21ce22d30ccc800a48489377bce21865")
+ (revision "1"))
+ (package
+ (name "python-maigret")
+ (version (git-version "0.5.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/soxoj/maigret")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0vsg8ampbp7vdppz117555khwfd1bz3jw9fjyidfjdhzcw659x05"))
+ (modules '((guix build utils)))
+ (snippet
+ '(let ((maigret-dir-python "(os.getenv('XDG_DATA_HOME') or (os.getenv('HOME') + '/.local/share/')) + '/maigret'"))
+ (substitute* "maigret/maigret.py"
+ ;; Default report directory is in /gnu/store
+ (("(report_dir = .*)os.getcwd\\(\\)" _ prefix)
+ (string-append prefix maigret-dir-python))
+ (("(db_file = .*)path.dirname\\(path.realpath\\(__file__\\)\\)" _ prefix)
+ (string-append prefix maigret-dir-python))
+ (("(db = MaigretDatabase\\(\\).load_from_path)\\(db_file\\)" all prefix)
+ (format #f "try:~% ~a~% except:~% ~a(path.join(path.dirname(path.realpath(__file__)), \"resources/data.json\"))" all prefix)))
+ (substitute* "maigret/sites.py"
+ (("import sys" all)
+ (string-append all "\n" "import os"))
+ (("with open\\(filename, \"w\"\\) as f:" all)
+ (string-append "os.makedirs(os.path.dirname(filename), exist_ok=True)\n " all)))))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-aiodns
+ python-aiohttp
+ python-aiohttp-socks
+ python-arabic-reshaper
+ python-async-timeout
+ python-attrs
+ python-certifi
+ python-chardet
+ python-colorama
+ python-future
+ ;; python-future-annotations
+ python-html5lib
+ python-idna
+ python-jinja2
+ python-lxml
+ python-markupsafe
+ python-mock
+ python-multidict
+ python-pycountry
+ python-pypdf2
+ python-pysocks
+ python-bidi
+ python-requests
+ python-requests-futures
+ python-six
+ python-socid-extractor
+ python-soupsieve
+ python-stem
+ python-torrequest
+ python-typing-extensions
+ python-alive-progress
+ python-webencodings
+ python-xhtml2pdf
+ python-xmind
+ python-yarl
+ python-networkx
+ python-pyvis
+ python-reportlab
+ python-cloudscraper))
+ (native-inputs (list python-poetry-core
+ python-pytest))
+ (arguments (list #:tests? #f))
+ (home-page "https://github.com/soxoj/maigret")
+ (synopsis
+ "Collect a dossier on a person by username from a huge number of sites")
+ (description
+ "Collect a dossier on a person by username from a huge number of sites.")
+ (license license:expat))))