๐ Application Programming Interface#
galactic.helpers.market.core
module.
- class Market#
Bases:
object
The Market class is used to produce a list of installable packages.
This class implements the Singleton pattern to ensure only one instance exists throughout the applicationโs lifecycle. It aggregates the functionality of both a PackageManager and a ProxyManager.
- __init__()#
Init the Market instance only once.
- static __new__(cls)#
Override the object creation method to implement the Singleton pattern.
- Return type:
- Returns:
Market: The singleton instance of the Market class.
- property package_manager: PackageManager#
Get the package manager.
- Returns:
The package manager
- Return type:
- property proxy_manager: ProxyManager#
Get the proxy manager.
- Returns:
The proxy manager
- Return type:
- class ProxyManager#
Bases:
object
A class to manage a list of PyPI proxy URLs.
- __init__()#
Initialize a ProxyManager instance with an empty list of proxy URLs.
- add_proxy(proxy_url)#
Add a new proxy URL to the internal proxy list.
- get_proxies()#
Retrieve the list of registered proxy URLs.
- get_proxy_name(url)#
Return the name of the proxy from a given URL.
- class PackageManager#
Bases:
object
PackageManager handles operations related to installed wheel (.whl) packages.
- __init__()#
Initialize the PackageManager.
- install_package(filename)#
Install a package by filename.
Note
This method is currently not implemented.
- is_matching_package(kwargs)#
Check if a package matches a set of filtering criteria.
- show_all_packages()#
Return full metadata for all packages found in the local cache.
Scans the user cache directory for wheel files and returns complete metadata for each one.
- show_all_packages_summary()#
Return a summary (basic info) for all packages found in the local cache.
For each wheel file found, returns a summary including name, version, author, license, and description.
- show_package(path)#
Extract and return full metadata from a wheel package.
- Parameters:
path (Path) โ Path to the wheel (.whl) file.
- Return type:
- Returns:
dict[str, str]: All metadata fields as key-value pairs.
- Raises:
FileNotFoundError โ If the file does not exist.:
- show_package_summary(path)#
Extract and return a summary of key metadata fields from a package.
- Parameters:
path (
Path
) โ Path to the wheel (.whl) file.- Returns:
Metadata fields (name, version, summary, author, license).
- Return type:
- Raises:
FileNotFoundError โ If the file does not exist.