Skip to main content

DevelopersToolbox logo
Github Build Status License Created
Release Released Commits since release

Overview

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.

Features

  • 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.

Installation

You can install the package using pip:

pip install wolfsoftware.dockerhub-extractor

Usage

Basic Usage

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}")

Setting Username During Initialization

You can also set the username during initialization:

dockerhub_extractor = DockerHubExtractor("your_dockerhub_username")

Retrieving User Repositories

You can retrieve a list of repositories maintained by a specific user:

repositories = dockerhub_extractor.get_user_repositories()
print(repositories)

Retrieving Repository Details

To get detailed information about a specific repository:

repository_details = dockerhub_extractor.get_repository_details("repository_name")
print(repository_details)

API Reference

Classes

DockerHubExtractor

A class to fetch and process repository details for a given Docker Hub user.

__init__(self, username: str)
  • Initializes the DockerHubExtractor with a username.
  • Parameters:
    • username (str): The Docker Hub username.
  • Raises:
    • DockerHubExtractorError: If the username is not provided.
set_username(self, username: str)
  • Sets the Docker Hub username.
  • Parameters:
    • username (str): The Docker Hub username.
  • Raises:
    • DockerHubExtractorError: If the username is not provided.
get_user_repositories(self) -> list
  • 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.
get_repository_details(self, repository_name: str) -> dict
  • 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.
get_all_repositories_details(self) -> list
  • 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.

DockerHubExtractorError

Custom exception class for DockerHubExtractor errors.


Release files for wolfsoftware.dockerhub-extractor 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wolfsoftware.dockerhub-extractor 0.1.1
File Size Uploaded
wolfsoftware_dockerhub_extractor-0.1.1.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wolfsoftware.dockerhub-extractor 0.1.1
File Interpreter ABI Platform
wolfsoftware.dockerhub_extractor-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / wolfsoftware_dockerhub_extractor-0.1.1.tar.gz

Download URL wolfsoftware_dockerhub_extractor-0.1.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aad027904f4399890b0cc7f3a25cd57d73d8a68a038551bf6070daf62b3cdb63
BLAKE2b-256 checksum
How to use checksums
ace72aadb7c8d64513b3997eff05d0730f94a715622d57b5ebdc9cf2f53b59fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / wolfsoftware.dockerhub_extractor-0.1.1-py3-none-any.whl

Download URL wolfsoftware.dockerhub_extractor-0.1.1-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97e616f09837ef9fcf096373ce8b24a5a7ee4404095587df7a0073a71076a5f3
BLAKE2b-256 checksum
How to use checksums
be60faec5d5ccb0f928965b22cd95a48d5c9e75828ff438447060f856030253f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page