security.dev Python SDK
Project description
security.dev Python Client (securitydev)
A modern Python client for the security.dev API, built using httpx and pydantic. Supports both synchronous (default) and asynchronous usage.
Features
- Synchronous and Asynchronous interfaces.
- Data validation using
pydantic. - Simple and intuitive interface.
- Type-hinted.
Installation
Install using pip (or any other manager):
pip install securitydev
Requirements
- Python 3.8+
- A security.dev API key, available from security.dev.
Quick Examples
Synchronous Usage
import os
from securitydev import SecurityClient
key = os.getenv("SECURITYDEV_KEY")
with SecurityClient(key=key) as client:
reputation = client.ip_intel.reputation("8.8.8.8")
print(f"8.8.8.8 - Is Abuser: {reputation.is_abuser}")
You don't necessarily need to use the context manager.
import os
from securitydev import SecurityClient
key = os.getenv("SECURITYDEV_KEY")
client = SecurityClient(key=key)
ip = "1.1.1.1"
rep = client.ip_intel.reputation(ip)
if rep.is_tor_exit:
print(f"{ip} is a Tor exit.")
Asynchronous Usage
import os
import asyncio
from securitydev import AsyncSecurityClient
async def main():
async with AsyncSecurityClient(key=os.getenv("SECURITYDEV_KEY")) as client:
geoip = await client.ip_intel.geolocate("1.1.1.1")
print(f"1.1.1.1 - Country: {geoip.country.name}")
asyncio.run(main())
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
securitydev-1.0.1.tar.gz
(20.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file securitydev-1.0.1.tar.gz.
File metadata
- Download URL: securitydev-1.0.1.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4569c020ff52048df653ccc904e231bc07e86b3071b95055ad4eb75a8d1e022a
|
|
| MD5 |
f40506b36547239b6a18b04632ca1ac7
|
|
| BLAKE2b-256 |
af4bd31098b6efd985cb2d66a60f461660e9ba2776af1ce5d0c368a768b24fd5
|
File details
Details for the file securitydev-1.0.1-py3-none-any.whl.
File metadata
- Download URL: securitydev-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cf3274a5a57d190851a0ae26ca59a5e9273797e65f2d8871d4f870e8fbf2654
|
|
| MD5 |
714630685ff18984ed838ca37de2e125
|
|
| BLAKE2b-256 |
6b3f541d08015d8531c4c783aee6b5685deab634ba122a7da2ed62d2a1917c66
|