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 the npm package and the web app use.
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 of the catalogs. |
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 npm package: 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 153 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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dorksmith-0.2.0.tar.gz | 49.1 kB | With provenance | Details for dorksmith-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dorksmith-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for dorksmith-0.2.0-py3-none-any.whl |
Total release size: 103.2 kB
Release files / dorksmith-0.2.0.tar.gz
| Download URL | dorksmith-0.2.0.tar.gz |
|---|---|
| Size | 49.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
028cf56261804945c0a48f82cc8d5ea199cb01cdd76f54eb6eea486151952ac8
|
|
BLAKE2b-256 checksum How to use checksums |
2de3ef29b627335225ff1afe18babcec4d6665023df7a410425f0b9b0fd9da6b
|
| 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 29, 2026.
Transparency logRelease files / dorksmith-0.2.0-py3-none-any.whl
| Download URL | dorksmith-0.2.0-py3-none-any.whl |
|---|---|
| Size | 54.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c12aa812489fdfe6b3a839d504ae908e4e748cb66495149e6f831e4831d4cab4
|
|
BLAKE2b-256 checksum How to use checksums |
58df8241473f832245faf9e67a6a1393f8553a91b64d24d77553e595eb4c15c6
|
| 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 29, 2026.
Transparency logSecurity for dorksmith 0.2.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.
Attestation for dorksmith-0.2.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 29, 2026.
Transparency logA 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.