Registry / auth-security / trufflehogregexes

trufflehogregexes

JSON →
library0.0.7pypypiunverified

trufflehogregexes is a Python package that provides the core regular expressions used by the TruffleHog secrets scanner. It offers a structured list of dictionaries, each containing a regex pattern, ID, name, and tags for various sensitive information. Currently at version 0.0.7, it has a low release cadence, primarily serving as a data dependency for the main TruffleHog application.

pip install trufflehogregexes
INSTALL
IMPORT
SIG · TRUFFLEHOGREGEXES
T
trufflehogregexes
auth-securitypythonv0.0.7
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

regexes
from truffleHogRegexes import regexes
from trufflehogregexes import regexes

This example demonstrates how to import and inspect the `regexes` list. It also shows a basic way to iterate and apply one of the regexes using Python's `re` module, as the package only provides the patterns, not the matching logic.

from trufflehogregexes import regexes # The 'regexes' variable is a list of dictionaries print(f"Total regexes available: {len(regexes)}") if regexes: first_regex = regexes[0] print(f"\nExample regex entry:") print(f" ID: {first_regex.get('id')}") print(f" Name: {first_regex.get('name')}") print(f" Regex: {first_regex.get('regex')}") print(f" Tags: {first_regex.get('tags')}") # To actually use a regex, you'd compile and run it: import re test_string = "My private key is: AKIAIOSFODNN7EXAMPLE" for r_entry in regexes: pattern = r_entry.get('regex') if pattern: # Note: some regexes might require 're.DOTALL' or other flags match = re.search(pattern, test_string) if match: print(f"\nMatch found for '{r_entry.get('name')}': {match.group(0)}") break # Found one match for demonstration
Debug
Known issues
gotchaThe `regexes` list is a module-level variable, not a function. Do not attempt to call it or use a `get_regexes()` style accessor.
fix
Access the `regexes` list directly after importing: `from trufflehogregexes import regexes` then `regexes[0]` or `len(regexes)`.
affects: 0.0.1 - current
gotchaThis package provides only the regular expression patterns as data; it does not include any regex matching or scanning functionality. Users must integrate their own regex engine (e.g., Python's `re` module) to apply these patterns.
fix
Use `import re` and then `re.search(entry['regex'], text)` to perform matching with the provided patterns.
affects: 0.0.1 - current
gotchaAs a pre-1.0.0 package (current version 0.0.7), the structure of regex entries (e.g., dictionary keys like 'id', 'name', 'regex', 'tags') might change in minor versions without strict backward compatibility guarantees.
fix
When consuming regex entries, use `.get()` for dictionary access (e.g., `entry.get('regex')`) to gracefully handle potentially missing keys after an upgrade. Monitor the GitHub repository for updates if relying on specific entry fields.
affects: 0.0.1 - current
Upgrade
Version history
0.0.7latest on PyPI · released Dec 17, 2018
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
26
OpenAI (training)
1
Resources
trufflehogregexes — pip install trufflehogregexes · libregistry