Skip to main content

dorksmith (PyPI)

Deterministic search-dork generator and OSINT/SOCMINT query engine as a pure-Python package with no dependencies (Python ≥ 3.10). Same engine and catalogs as the Dorksmith web app and the npm package, conformance-tested against the same golden fixtures.

pip install dorksmith
from dorksmith import generate, expand_handle, validate_query, search_url

result = generate("example.com", "domain", "public-documents",
                  options={"fileTypes": ["pdf", "docx"], "excludeTerms": ["jobs"], "maxVariants": 3})
for v in result.variants:
    print(f"{v.label:<14} {v.query}")
# Balanced       site:example.com (filetype:pdf OR filetype:docx) -jobs
# Precise        site:example.com filetype:pdf -jobs
# Title-focused  site:example.com (filetype:pdf OR filetype:docx) (intitle:report OR intitle:policy OR intitle:presentation OR intitle:"annual report") -jobs

search_url(result.variants[0].query)
# 'https://www.google.com/search?q=site%3Aexample.com%20%28filetype%3Apdf%20OR%20filetype%3Adocx%29%20-jobs'

handle = expand_handle("@alice42", categories=["developer"], max_platforms=3)
handle.profiles[0].url, handle.profiles[0].status
# ('https://github.com/alice42', 'not-checked')

validate_query("cache:example.com site:example.com or filetype:.pdf").warnings
# ["Lower-case 'or' is treated as an ordinary word; ...", "filetype: values take no leading dot ...", "cache: is deprecated: ..."]

Results are dataclasses; .to_dict() gives the same camelCase shape as the HTTP API (POST /api/v1/dorks/generate), minus requestId and rateLimit.

API

Function Purpose
generate(input, input_type, intent, *, engine="google", options=None, catalogs=None, limits=DEFAULT_LIMITS) Ranked variants with explanation, operators, warnings and rank reason. Raises InputValidationError (.field, .unprocessable).
validate_query(query, engine="google", catalogs=None) Operators used with support state and warnings. Never rewrites the query.
expand_handle(username, *, categories=None, platform_ids=None, max_platforms=None, catalogs=None) Profile URLs (status always not-checked) and site-scoped queries.
infer_input_type(text, known_extensions=None) Deterministic input-type suggestion.
search_url(query, engine="google") Search-engine URL, percent-encoded locally.
validate_catalogs(catalogs) Structural/cross-reference validation, same rules as the API's readiness check.
bundled_catalogs(), load_catalogs(path), catalog_version() Embedded or custom catalogs.
lower-level: normalize_text, try_normalize_domain, quote, safe_term, analyze_query, expand_template, … Building blocks for custom pipelines.

options keys match the HTTP API: fileTypes, excludeTerms, after, before, site, maxVariants, organization, location, role, displayName.

Bring your own catalogs

from dorksmith import load_catalogs, validate_catalogs, generate
catalogs = load_catalogs("path/to/data")      # operators.google.json, intents.json, platforms.json, filetypes.json
assert validate_catalogs(catalogs) == []
generate("x", "keyword", "general-discovery", catalogs=catalogs)

CLI

dorksmith generate example.com --intent exposed-config-files --max 3
dorksmith generate "Alice Smith" --intent person-organization --organization "Example Corp"
dorksmith handle alice42 --categories developer --json
dorksmith validate 'cache:example.com site:example.com'
dorksmith intents

Exit codes: 0 ok, 2 invalid input (or a query with syntax errors for validate), 3 valid request that cannot be generated.

Development

python -m pip install -e ".[test]"
python scripts/sync_catalogs.py      # copies ../../data/*.json into src/dorksmith/data
python -m pytest -q                  # unit tests + the 151 golden fixtures from the monorepo
python -m build                      # sdist + wheel

Publishing is done by the py-package GitHub workflow when a py-v* tag is pushed, using PyPI trusted publishing (see the repository README).

Metadata

Release files for dorksmith 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dorksmith 0.1.0
File Size Uploaded Provenance Actions
dorksmith-0.1.0.tar.gz 48.4 kB With provenance Details for dorksmith-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dorksmith 0.1.0
File Interpreter ABI Platform Actions
dorksmith-0.1.0-py3-none-any.whl Python 3 none any Details for dorksmith-0.1.0-py3-none-any.whl

Total release size: 102.3 kB

Release files / dorksmith-0.1.0.tar.gz

Download URL dorksmith-0.1.0.tar.gz
Size 48.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ea1a8bcefdbe8c90acac5614ffdef48199b3c8af117bae0938b031bac8a13cb0
BLAKE2b-256 checksum
How to use checksums
2130892221ef30a6cf75fc07e76d19e28625c615fa147ee98746e5924342cb05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / dorksmith-0.1.0-py3-none-any.whl

Download URL dorksmith-0.1.0-py3-none-any.whl
Size 53.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
caef49e54c098c18f5bfc13717ccf773e42bb98845575dfb799403aadc6a6af2
BLAKE2b-256 checksum
How to use checksums
fec680514a59039a146e14b96f413d2d0e9b1c51e87dc8cb13093e54900e842b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Security for dorksmith 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dorksmith-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page