DockerHub Extractor is a Python package designed to fetch and process detailed information about repositories hosted on Docker Hub. This package is particularly useful for users who want to retrieve and analyze metadata for repositories maintained by a specific Docker Hub user.
- Retrieve a list of repositories maintained by a specific Docker Hub user.
- Fetch detailed metadata for each repository, including information such as tags, stars, pulls, and more.
- Custom exceptions for handling errors gracefully.
- Option to set the Docker Hub username after initializing the class.
You can install the package using pip:
pip install wolfsoftware.dockerhub-extractor
Here's a basic example of how to use the DockerHub Extractor:
from wolfsoftware.dockerhub_extractor import DockerHubExtractor
# Initialize without username
dockerhub_extractor = DockerHubExtractor()
# Set username later
dockerhub_extractor.set_username("your_dockerhub_username")
# Get detailed information for all repositories
try:
repositories_details = dockerhub_extractor.get_all_repositories_details()
print(repositories_details)
except DockerHubExtractorError as e:
print(f"An error occurred: {e.message}")
You can also set the username during initialization:
dockerhub_extractor = DockerHubExtractor("your_dockerhub_username")
You can retrieve a list of repositories maintained by a specific user:
repositories = dockerhub_extractor.get_user_repositories()
print(repositories)
To get detailed information about a specific repository:
repository_details = dockerhub_extractor.get_repository_details("repository_name")
print(repository_details)
A class to fetch and process repository details for a given Docker Hub user.
- Initializes the
DockerHubExtractor
with a username. - Parameters:
username
(str): The Docker Hub username.
- Raises:
DockerHubExtractorError
: If the username is not provided.
- Sets the Docker Hub username.
- Parameters:
username
(str): The Docker Hub username.
- Raises:
DockerHubExtractorError
: If the username is not provided.
- Fetches the list of repositories for the given Docker Hub user.
- Returns:
list
: A list of dictionaries containing repository names and summaries.
- Raises:
DockerHubExtractorError
: If there is an error fetching or parsing the user profile.
- Fetches detailed information for a specific repository.
- Parameters:
repository_name
(str): The name of the repository.
- Returns:
dict
: A dictionary containing detailed information about the repository.
- Raises:
DockerHubExtractorError
: If there is an error fetching or parsing the repository details.
- Fetches detailed information for all repositories of the given Docker Hub user.
- Returns:
list
: A list of dictionaries containing detailed information about each repository.
- Raises:
DockerHubExtractorError
: If there is an error fetching or processing the repository details.
Custom exception class for DockerHubExtractor
errors.