Skip to main content

Python SDK for the Spidercob DLP API — scan, detect, and remediate sensitive data at scale

Project description

spidercob

Python SDK for the Spidercob DLP API.

Scan text, files, and data pipelines for PII, secrets, and sensitive data. Get AI-powered analysis, compliance alerts, and remediation guidance — all from a single API call.

from spidercob import Client

client = Client(api_key="your-api-key")
result = client.scan("postgresql://admin:s3cr3t@prod-db:5432/mydb")

print(result.highest_severity)       # CRITICAL
print(result.critical[0].type)       # db_connection_string
print(result.ai_insight)             # CISO-grade analysis
print(result.compliance_alerts)      # ["PCI-DSS", "SOC2"]

Install

pip install spidercob

Zero dependencies. Python 3.9+.

Get your API key at spidercob.com/settings.

Authentication

# Pass directly
client = Client(api_key="your-api-key")

# Or set environment variable
export SPIDERCOB_API_KEY=your-api-key
client = Client()

Scan text

result = client.scan("My SSN is 432-78-9012 and AWS key AKIAIOSFODNN7EXAMPLE")

result.has_findings          # True
result.highest_severity      # "CRITICAL"
result.critical              # list[Finding]
result.high
result.medium
result.low

# Each Finding:
f = result.critical[0]
f.type                       # "aws_access_key"
f.description                # "AWS Access Key ID"
f.value                      # masked value
f.severity                   # "CRITICAL"
f.position                   # "char 10-30"
f.remediation                # "Rotate this key immediately in AWS IAM"

# AI analysis
result.ai_insight            # CISO-grade explanation
result.compliance_alerts     # ["PCI-DSS 3.2", "SOC 2 CC6"]
result.threat_score          # 0-100

Scan a file

result = client.scan_file("src/config.py")
if result.has_findings:
    print(result.to_dict())

Retrieve past scans

# Get a scan by ID
result = client.get_scan(scan_id=1234)

# List recent scans
scans = client.list_scans(limit=20)

Use in CI

import sys
from spidercob import Client

client = Client()
result = client.scan_file("config.py")

if result.critical:
    for f in result.critical:
        print(f"CRITICAL: {f.type} at {f.position}")
        print(f"  Remediation: {f.remediation}")
    sys.exit(1)

Error handling

from spidercob import Client, AuthenticationError, RateLimitError, SpidercobError

try:
    result = client.scan(text)
except AuthenticationError:
    print("Invalid API key")
except RateLimitError:
    print("Rate limit hit — slow down or upgrade plan")
except SpidercobError as e:
    print(f"API error {e.status_code}: {e}")

Free tier — no API key needed

Want to scan locally without an API key? Use dlp-patterns — the open source pattern engine this SDK is built on:

pip install dlp-patterns

The SDK adds: AI-powered CISO analysis, compliance mapping (GDPR/HIPAA/PCI-DSS/SOC2), audit logs, dashboard, team management, and policy enforcement.

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spidercob-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spidercob-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file spidercob-0.1.0.tar.gz.

File metadata

  • Download URL: spidercob-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for spidercob-0.1.0.tar.gz
Algorithm Hash digest
SHA256 957d0ee369925f4fef47a700cb583b68b9f1ee1ceca7c3017ae2a1b41fd11aee
MD5 6ff20933acc27ea32d582f3fa5ea618a
BLAKE2b-256 263c27cf0e66523c50fffe7b75cb847cbc05ba82ffcbb59de46c6fd4fd44ee67

See more details on using hashes here.

File details

Details for the file spidercob-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spidercob-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for spidercob-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0e5b01734d251d8914b3f23830b5d99753a08c426f3df9adf83e370dfec3e0b
MD5 4984c309a8216452e7c6998e8759b437
BLAKE2b-256 5d4cf31c823ec559b0aaf1da93bbf9fe32baf20924d927b8f98402f5acb70e60

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page