{"id":10047,"library":"pkg-about","title":"pkg-about library","description":"pkg-about provides unified access to Python package metadata at runtime. It's designed to fetch information like version, summary, author, and license for installed packages, abstracting away differences between `pkg_resources` and `importlib.metadata`. The current version is 2.3.0, and it generally follows a release cadence driven by new features or bug fixes, typically every few months.","status":"active","version":"2.3.0","language":"en","source_language":"en","source_url":"https://github.com/karpierz/pkg_about","tags":["package management","metadata","introspection","runtime","pypi"],"install":[{"cmd":"pip install pkg-about","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"While 'About' class exists, 'get_about' is the primary factory function for retrieving package metadata in v2.x.x and simplifies usage.","wrong":"from pkg_about.about import About","symbol":"get_about","correct":"from pkg_about import get_about"}],"quickstart":{"code":"from pkg_about import get_about\n\n# Get metadata for pkg-about itself\nabout_pkg = get_about('pkg-about')\n\nprint(f\"Package Name: {about_pkg.name}\")\nprint(f\"Version: {about_pkg.version}\")\nprint(f\"Summary: {about_pkg.summary}\")\nprint(f\"Author: {about_pkg.author}\")\nprint(f\"License: {about_pkg.license}\")","lang":"python","description":"This quickstart demonstrates how to fetch metadata for an installed package using `get_about`. It retrieves information like name, version, summary, author, and license for the 'pkg-about' library itself."},"warnings":[{"fix":"Migrate to using `pkg_about.get_about()` which returns an `About` object. Access attributes directly on the returned object (e.g., `about.version`).","message":"Major refactor in version 2.0.0 changed the primary entry point for accessing package metadata. Direct instantiation or attribute access patterns from v1.x.x versions are no longer valid.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure your environment uses Python 3.10, 3.11, or 3.12. Upgrade your Python interpreter if necessary.","message":"The library explicitly requires Python >=3.10.0 and <4.0.0. Attempting to use it on older Python versions (e.g., 3.9 or earlier) will result in installation failure or runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify the exact spelling of the package as it appears in `pip list` or `site-packages`. Wrap calls to `get_about()` in a `try...except pkg_about.exceptions.PackageNotFoundError` block for robust applications.","message":"Attempts to retrieve metadata for a non-existent or misspelled package name will raise a `PackageNotFoundError`. This can happen even if the package is installed but has a different internal name than assumed.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Double-check the package name's spelling. Ensure the package is actually installed in the environment where the code is running by using `pip list`.","cause":"The specified package name does not correspond to an installed Python package on the system, or there's a typo in the name.","error":"pkg_about.exceptions.PackageNotFoundError: No package found with name 'my-non-existent-lib'"},{"fix":"Ensure you are using `get_about()` (for v2.x.x) and accessing standard attributes like `.name`, `.version`, `.summary`, etc. Consult the `About` object's available attributes (e.g., by `dir(about_obj)` or documentation) if you're looking for less common fields.","cause":"This error often indicates that you are trying to access an attribute that doesn't exist on the `About` object, or you are using an older pattern for `pkg-about` (e.g., from v1.x.x) that is incompatible with v2.x.x, or the underlying metadata is missing that specific field.","error":"AttributeError: 'About' object has no attribute 'version'"}]}