wolfsoftware.pypi-extractor


Namewolfsoftware.pypi-extractor JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/DevelopersToolbox/pypi-extractor-package
SummaryExtract package information for a given user in PyPi.
upload_time2024-06-11 17:38:04
maintainerNone
docs_urlNone
authorWolf Software
requires_python>=3.9
licenseMIT
keywords python pypi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable -->
<p align="center">
    <a href="https://github.com/DevelopersToolbox/">
        <img src="https://cdn.wolfsoftware.com/assets/images/github/organisations/developerstoolbox/black-and-white-circle-256.png" alt="DevelopersToolbox logo" />
    </a>
    <br />
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/actions/workflows/cicd.yml">
        <img src="https://img.shields.io/github/actions/workflow/status/DevelopersToolbox/pypi-extractor-package/cicd.yml?branch=master&label=build%20status&style=for-the-badge" alt="Github Build Status" />
    </a>
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/LICENSE.md">
        <img src="https://img.shields.io/github/license/DevelopersToolbox/pypi-extractor-package?color=blue&label=License&style=for-the-badge" alt="License">
    </a>
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package">
        <img src="https://img.shields.io/github/created-at/DevelopersToolbox/pypi-extractor-package?color=blue&label=Created&style=for-the-badge" alt="Created">
    </a>
    <br />
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/releases/latest">
        <img src="https://img.shields.io/github/v/release/DevelopersToolbox/pypi-extractor-package?color=blue&label=Latest%20Release&style=for-the-badge" alt="Release">
    </a>
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/releases/latest">
        <img src="https://img.shields.io/github/release-date/DevelopersToolbox/pypi-extractor-package?color=blue&label=Released&style=for-the-badge" alt="Released">
    </a>
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/releases/latest">
        <img src="https://img.shields.io/github/commits-since/DevelopersToolbox/pypi-extractor-package/latest.svg?color=blue&style=for-the-badge" alt="Commits since release">
    </a>
    <br />
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/.github/CODE_OF_CONDUCT.md">
        <img src="https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge" />
    </a>
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/.github/CONTRIBUTING.md">
        <img src="https://img.shields.io/badge/Contributing-blue?style=for-the-badge" />
    </a>
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/.github/SECURITY.md">
        <img src="https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge" />
    </a>
    <a href="https://github.com/DevelopersToolbox/pypi-extractor-package/issues">
        <img src="https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge" />
    </a>
</p>

## Overview

PyPI Extractor is a Python package designed to fetch and process detailed information about packages hosted on the
Python Package Index (PyPI). This package is particularly useful for users who want to retrieve and analyze metadata for packages
maintained by a specific PyPI user.

## Features

- Retrieve a list of packages maintained by a specific PyPI user.
- Fetch detailed metadata for each package, including versions, author information, dependencies, and more.
- Custom exceptions for handling errors gracefully.
- Option to set the PyPI username after initializing the class.

## Installation

You can install the package using pip:

```sh
pip install wolfsoftware.pypi-extractor
```

## Usage

### Basic Usage

Here's a basic example of how to use the PyPI Extractor:

```python
from wolfsoftware.pypi_extractor import PyPiExtractor

# Initialize without username
pypi_info = PyPiExtractor()

# Set username later
pypi_info.set_username("your_pypi_username")

# Get detailed information for all packages
try:
    packages_details = pypi_info.get_all_packages_details()
    print(packages_details)
except PyPiExtractorError as e:
    print(f"An error occurred: {e.message}")
```

### Setting Username During Initialization

You can also set the username during initialization:

```python
pypi_info = PyPiExtractor("your_pypi_username")
```

### Retrieving User Packages

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

```python
packages = pypi_info.get_user_packages()
print(packages)
```

### Retrieving Package Details

To get detailed information about a specific package:

```python
package_details = pypi_info.get_package_details("package_name")
print(package_details)
```

## API Reference

### Classes

#### `PyPiExtractor`

A class to fetch and process package details for a given PyPI user.

##### `__init__(self, username: str)`

- Initializes the `PyPiExtractor` with a username.
- Parameters:
  - `username` (str): The PyPI username.
- Raises:
  - `PyPiExtractorError`: If the username is not provided.

##### `set_username(self, username: str)`

- Sets the PyPI username.
- Parameters:
  - `username` (str): The PyPI username.
- Raises:
  - `PyPiExtractorError`: If the username is not provided.

##### `get_user_packages(self) -> list`

- Fetches the list of packages for the given PyPI user.
- Returns:
  - `list`: A list of dictionaries containing package names and summaries.
- Raises:
  - `PyPiExtractorError`: If there is an error fetching or parsing the user profile.

##### `get_package_details(self, package_name: str) -> dict`

- Fetches detailed information for a specific package.
- Parameters:
  - `package_name` (str): The name of the package.
- Returns:
  - `dict`: A dictionary containing detailed information about the package.
- Raises:
  - `PyPiExtractorError`: If there is an error fetching or parsing the package details.

##### `get_all_packages_details(self) -> list`

- Fetches detailed information for all packages of the given PyPI user.
- Returns:
  - `list`: A list of dictionaries containing detailed information about each package.
- Raises:
  - `PyPiExtractorError`: If there is an error fetching or processing the package details.

#### `PyPiExtractorError`

Custom exception class for `PyPiExtractor` errors.

<br />
<p align="right"><a href="https://wolfsoftware.com/"><img src="https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge" /></a></p>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DevelopersToolbox/pypi-extractor-package",
    "name": "wolfsoftware.pypi-extractor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "python, pypi",
    "author": "Wolf Software",
    "author_email": "pypi@wolfsoftware.com",
    "download_url": "https://files.pythonhosted.org/packages/86/c7/1784d341dd536f757d4890b6f4c14e331259b1fc37710fdf658e056a6c11/wolfsoftware_pypi_extractor-0.1.1.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable -->\n<p align=\"center\">\n    <a href=\"https://github.com/DevelopersToolbox/\">\n        <img src=\"https://cdn.wolfsoftware.com/assets/images/github/organisations/developerstoolbox/black-and-white-circle-256.png\" alt=\"DevelopersToolbox logo\" />\n    </a>\n    <br />\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/actions/workflows/cicd.yml\">\n        <img src=\"https://img.shields.io/github/actions/workflow/status/DevelopersToolbox/pypi-extractor-package/cicd.yml?branch=master&label=build%20status&style=for-the-badge\" alt=\"Github Build Status\" />\n    </a>\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/LICENSE.md\">\n        <img src=\"https://img.shields.io/github/license/DevelopersToolbox/pypi-extractor-package?color=blue&label=License&style=for-the-badge\" alt=\"License\">\n    </a>\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package\">\n        <img src=\"https://img.shields.io/github/created-at/DevelopersToolbox/pypi-extractor-package?color=blue&label=Created&style=for-the-badge\" alt=\"Created\">\n    </a>\n    <br />\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/releases/latest\">\n        <img src=\"https://img.shields.io/github/v/release/DevelopersToolbox/pypi-extractor-package?color=blue&label=Latest%20Release&style=for-the-badge\" alt=\"Release\">\n    </a>\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/releases/latest\">\n        <img src=\"https://img.shields.io/github/release-date/DevelopersToolbox/pypi-extractor-package?color=blue&label=Released&style=for-the-badge\" alt=\"Released\">\n    </a>\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/releases/latest\">\n        <img src=\"https://img.shields.io/github/commits-since/DevelopersToolbox/pypi-extractor-package/latest.svg?color=blue&style=for-the-badge\" alt=\"Commits since release\">\n    </a>\n    <br />\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/.github/CODE_OF_CONDUCT.md\">\n        <img src=\"https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge\" />\n    </a>\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/.github/CONTRIBUTING.md\">\n        <img src=\"https://img.shields.io/badge/Contributing-blue?style=for-the-badge\" />\n    </a>\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/blob/master/.github/SECURITY.md\">\n        <img src=\"https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge\" />\n    </a>\n    <a href=\"https://github.com/DevelopersToolbox/pypi-extractor-package/issues\">\n        <img src=\"https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge\" />\n    </a>\n</p>\n\n## Overview\n\nPyPI Extractor is a Python package designed to fetch and process detailed information about packages hosted on the\nPython Package Index (PyPI). This package is particularly useful for users who want to retrieve and analyze metadata for packages\nmaintained by a specific PyPI user.\n\n## Features\n\n- Retrieve a list of packages maintained by a specific PyPI user.\n- Fetch detailed metadata for each package, including versions, author information, dependencies, and more.\n- Custom exceptions for handling errors gracefully.\n- Option to set the PyPI username after initializing the class.\n\n## Installation\n\nYou can install the package using pip:\n\n```sh\npip install wolfsoftware.pypi-extractor\n```\n\n## Usage\n\n### Basic Usage\n\nHere's a basic example of how to use the PyPI Extractor:\n\n```python\nfrom wolfsoftware.pypi_extractor import PyPiExtractor\n\n# Initialize without username\npypi_info = PyPiExtractor()\n\n# Set username later\npypi_info.set_username(\"your_pypi_username\")\n\n# Get detailed information for all packages\ntry:\n    packages_details = pypi_info.get_all_packages_details()\n    print(packages_details)\nexcept PyPiExtractorError as e:\n    print(f\"An error occurred: {e.message}\")\n```\n\n### Setting Username During Initialization\n\nYou can also set the username during initialization:\n\n```python\npypi_info = PyPiExtractor(\"your_pypi_username\")\n```\n\n### Retrieving User Packages\n\nYou can retrieve a list of packages maintained by a specific user:\n\n```python\npackages = pypi_info.get_user_packages()\nprint(packages)\n```\n\n### Retrieving Package Details\n\nTo get detailed information about a specific package:\n\n```python\npackage_details = pypi_info.get_package_details(\"package_name\")\nprint(package_details)\n```\n\n## API Reference\n\n### Classes\n\n#### `PyPiExtractor`\n\nA class to fetch and process package details for a given PyPI user.\n\n##### `__init__(self, username: str)`\n\n- Initializes the `PyPiExtractor` with a username.\n- Parameters:\n  - `username` (str): The PyPI username.\n- Raises:\n  - `PyPiExtractorError`: If the username is not provided.\n\n##### `set_username(self, username: str)`\n\n- Sets the PyPI username.\n- Parameters:\n  - `username` (str): The PyPI username.\n- Raises:\n  - `PyPiExtractorError`: If the username is not provided.\n\n##### `get_user_packages(self) -> list`\n\n- Fetches the list of packages for the given PyPI user.\n- Returns:\n  - `list`: A list of dictionaries containing package names and summaries.\n- Raises:\n  - `PyPiExtractorError`: If there is an error fetching or parsing the user profile.\n\n##### `get_package_details(self, package_name: str) -> dict`\n\n- Fetches detailed information for a specific package.\n- Parameters:\n  - `package_name` (str): The name of the package.\n- Returns:\n  - `dict`: A dictionary containing detailed information about the package.\n- Raises:\n  - `PyPiExtractorError`: If there is an error fetching or parsing the package details.\n\n##### `get_all_packages_details(self) -> list`\n\n- Fetches detailed information for all packages of the given PyPI user.\n- Returns:\n  - `list`: A list of dictionaries containing detailed information about each package.\n- Raises:\n  - `PyPiExtractorError`: If there is an error fetching or processing the package details.\n\n#### `PyPiExtractorError`\n\nCustom exception class for `PyPiExtractor` errors.\n\n<br />\n<p align=\"right\"><a href=\"https://wolfsoftware.com/\"><img src=\"https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge\" /></a></p>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Extract package information for a given user in PyPi.",
    "version": "0.1.1",
    "project_urls": {
        "Documentation": "https://github.com/DevelopersToolbox/pypi-extractor-package",
        "Homepage": "https://github.com/DevelopersToolbox/pypi-extractor-package",
        "Source": "https://github.com/DevelopersToolbox/pypi-extractor-package",
        "Sponsor": "https://github.com/sponsors/WolfSoftware",
        "Tracker": "https://github.com/wDevelopersToolbox/pypi-extractor-package/issues/"
    },
    "split_keywords": [
        "python",
        " pypi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f51ba99ced43c4cdad41c7a43a5d12a702b80d56494f1b35d07f5b054b7fb76",
                "md5": "f458d7e3a610b96842e88cf2527af1c1",
                "sha256": "5b0e9758f0e99cc8b1dd73ee833b448f5ff56e56e5c80208e04330d8ed929a76"
            },
            "downloads": -1,
            "filename": "wolfsoftware.pypi_extractor-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f458d7e3a610b96842e88cf2527af1c1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6949,
            "upload_time": "2024-06-11T17:38:02",
            "upload_time_iso_8601": "2024-06-11T17:38:02.600524Z",
            "url": "https://files.pythonhosted.org/packages/1f/51/ba99ced43c4cdad41c7a43a5d12a702b80d56494f1b35d07f5b054b7fb76/wolfsoftware.pypi_extractor-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86c71784d341dd536f757d4890b6f4c14e331259b1fc37710fdf658e056a6c11",
                "md5": "d6518a24f8cd9b9826a261cf4ecc3897",
                "sha256": "ad247184c07de8216a2ddc3aee71f4afe6f0e3f3e1efc76651f7568571611ce1"
            },
            "downloads": -1,
            "filename": "wolfsoftware_pypi_extractor-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d6518a24f8cd9b9826a261cf4ecc3897",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10338,
            "upload_time": "2024-06-11T17:38:04",
            "upload_time_iso_8601": "2024-06-11T17:38:04.225078Z",
            "url": "https://files.pythonhosted.org/packages/86/c7/1784d341dd536f757d4890b6f4c14e331259b1fc37710fdf658e056a6c11/wolfsoftware_pypi_extractor-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-11 17:38:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DevelopersToolbox",
    "github_project": "pypi-extractor-package",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "wolfsoftware.pypi-extractor"
}
        
Elapsed time: 3.72039s