| Crates.io | malwaredb-client-py |
| lib.rs | malwaredb-client-py |
| version | 0.2.2 |
| created_at | 2025-07-01 02:56:44.035574+00 |
| updated_at | 2025-12-31 05:16:38.290622+00 |
| description | Python client for MalwareDB. |
| homepage | https://malwaredb.net/ |
| repository | https://github.com/malwaredb/malwaredb-rs |
| max_upload_size | |
| id | 1732674 |
| size | 110,236 |
This is a Python module for interacting with an instance of Malware DB.
Assuming you already have Malware DB checked out:
python3 -m venv mdb-venvsource mdb-venv/bin/activatepip install maturincd client-pymaturin develop (or maturin build to create a distributable wheel)If using this crate with another library, be sure to use the rust_lib feature flag to avoid creating the Malware DB client module type. This could be useful for reusing the functions defined in this crate with another Python module.
from malwaredb import MalwareDBClientMalwareDBClient.from_file() to use a configuration fileMalwareDBClient() to have the client library find a configuration fileMalwareDBClient.connect(url, api_key, [cert_path]) to provide the URL, API key, and optional path for a certificate for encrypted communicationMalwareDBClient.login(url, username, password, save, [cert_path]) to provide the URL, username, password, whether to save the configuration, and optional path for a certificate for encrypted communicationMalwareDBCLient.discover() to find local servers via multicast DNS.get_file_bytes() get a file from Malware DB.server_info() get server information.submit_file() submit a file to Malware DB.get_supported_file_types() get a list of file types supported by the Malware DB server.search() search for files based on some criteria. Some optional keyword arguments, a minimum of one criterion is required:
hash=: specify a partial hashhash_type=: specify the type of the partial hash, options are md5, sha1, sha256, or sha512, default is sha256file_name=: specify all or part of a file namelabels=: specify a list of labelsfile_type=: specify a file type, which must match a file type from .get_supported_file_types()magic=: specify all or part of the file command (libmagic) output for a given fileresponse_hash=: specify the hash type to be returned, options are md5, sha1, sha256, or sha512, default is sha256limit=: integer specifying the maximum results to be returned, must be greater than zero.labels() get available labels for samples.whoami() get information about the user's accountmalwaredb.cart.create_cart() encodes bytes into a CaRT bytesmalwaredb.cart.decode_cart() decodes CaRT bytes back into the original binary long with header and footer data. See client-py/py_test/cart.py.create_cart() doesn't allow setting custom fields.decode_cart() will not be able to return fields which aren't plain float, integer, or string types.CaRT module which is probably more feature-rich.