A Python library for interacting with the Deps.dev API. Easily fetch package, version, and project data from the API.
To install pydepsdev
, simply run:
pip3 install pydepsdev
Start by importing the library and initializing the main class:
from pydepsdev import DepsdevAPI
api = DepsdevAPI()
The library provides methods that correspond to different endpoints in the Deps.dev API. Here's a breakdown of each method and how to use them:
-
Get Package Information
Fetch package details including available versions.
package_info = await api.get_package("system_name", "package_name")
-
Get Version Information
Fetch detailed information about a specific package version.
version_info = await api.get_version("system_name", "package_name", "version_number")
-
Get Requirements
Return the requirements for a specific package version. (Note: Only available for NuGet.)
requirements = await api.get_requirements("NuGet", "package_name", "version_number")
-
Get Dependencies
Fetch the resolved dependency graph for a specific package version.
dependencies = await api.get_dependencies("system_name", "package_name", "version_number")
-
Get Project Information
Retrieve details about projects hosted by platforms like GitHub, GitLab, or BitBucket.
project_info = await api.get_project("project_id")
-
Get Project Package Versions
Fetch the package versions created from a specified source code repository.
project_package_versions = await api.get_project_package_versions("project_id")
-
Get Advisory Details
Fetch information about a security advisory from OSV.
advisory_info = await api.get_advisory("advisory_id")
-
Query Package Versions
Query package versions based on content hash or version key.
package_versions = await api.query_package_versions(hash_type="type", hash_value="value", version_system="system_name", version_name="name", version="version_number")
Get more informating about the query parameters and response values on the official API documentation
We welcome contributions! If you find a bug or have suggestions, feel free to open an issue or submit a pull request.
This project is licensed under the Apache Software License 2.0.