pypi-extractor-package

Extract package information for a given user in PyPi.

https://github.com/developerstoolbox/pypi-extractor-package

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary

Keywords

pypi pypi-packages wolfsoftware
Last synced: 4 months ago · JSON representation ·

Repository

Extract package information for a given user in PyPi.

Basic Info
  • Host: GitHub
  • Owner: DevelopersToolbox
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 237 KB
Statistics
  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • Open Issues: 5
  • Releases: 7
Topics
pypi pypi-packages wolfsoftware
Created over 1 year ago · Last pushed 4 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Codeowners Security

README.md

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

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.

Significant Update From 0.1.3

pypi.org no longer allow you to scrap details using the requests package, or any package that does not support JavaScript. To resolve this we have updated this package to utilise PlayWright when retrieving a list of packages for a given user. While we have attempted to automate as much as possible you might want to do some of the work manually.

Playwright needs two commands to be run in order for it to function correctly:

playwright install playwright install-deps

We have added an auto_install option to the main class so that you can instruct the package to do the install for you, this helps when installing the package in a fully automated way, e.g. Puppet or similar.

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

pypiinfo.setusername("yourpypiusername")

Get detailed information for all packages

try: packagesdetails = pypiinfo.getallpackagesdetails() print(packagesdetails) 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, verbose: bool, auto_install: bool)
  • Initializes the PyPiExtractor with a username.
  • Parameters:
    • username (str): The PyPI username.
    • verbose (bool): Verbose output (Default: False)
    • auto_install (bool): Auto install PlayWright dependencies (Default: False)
  • 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.
enable_verbose(self)
  • Enable verbose mode.
enable_auto_install(self)
  • Enable auto install.
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.


Owner

  • Name: Developers Toolbox
  • Login: DevelopersToolbox
  • Kind: organization
  • Email: github@wolfsoftware.com
  • Location: United Kingdom

A selection of tools to help developers. Created by Wolf Software.

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite it using these metadata.
title: PyPi Extractor
abstract: Extract package information for a given user in PyPi.
type: software
version: 0.1.3
date-released: 2024-12-12
repository-code: https://github.com/DevelopersToolbox/pypi-extractor-package
keywords:
  - "Wolf Software"
  - "Software"
license: MIT
authors:
  - family-names: "Wolf"
    orcid: "https://orcid.org/0009-0007-0983-2072"

GitHub Events

Total
  • Release event: 1
  • Delete event: 92
  • Issue comment event: 176
  • Push event: 140
  • Pull request review event: 138
  • Pull request event: 179
  • Create event: 92
Last Year
  • Release event: 1
  • Delete event: 92
  • Issue comment event: 176
  • Push event: 140
  • Pull request review event: 138
  • Pull request event: 179
  • Create event: 92

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1
  • Total pull requests: 130
  • Average time to close issues: 14 days
  • Average time to close pull requests: 2 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.63
  • Merged pull requests: 97
  • Bot issues: 1
  • Bot pull requests: 128
Past Year
  • Issues: 1
  • Pull requests: 99
  • Average time to close issues: 14 days
  • Average time to close pull requests: 2 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.66
  • Merged pull requests: 70
  • Bot issues: 1
  • Bot pull requests: 99
Top Authors
Issue Authors
  • dependabot[bot] (1)
Pull Request Authors
  • dependabot[bot] (191)
  • TGWolf (5)
Top Labels
Issue Labels
dependabot: auto approve (1) dependabot: auto merge (1) dependabot: dependencies (1) dependabot: ecosystem : github actions (1)
Pull Request Labels
dependabot: dependencies (191) dependabot: auto approve (152) dependabot: auto merge (148) dependabot: ecosystem : github actions (128) dependabot: ecosystem : python (63) dependabot: manual merge (26)

Dependencies

.github/workflows/cicd.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
.github/workflows/citation-validation.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • citation-file-format/cffconvert-github-action 4cf11baa70a673bfdf9dad0acc7ee33b3f4b6084 composite
  • ruby/setup-ruby ff740bc00a01b3a50fffc55a1071b1060eeae9dc composite
.github/workflows/codeql.yml actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • github/codeql-action/analyze a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
  • github/codeql-action/autobuild a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
  • github/codeql-action/init a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
.github/workflows/codeql.yml.old actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
  • github/codeql-action/analyze a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
  • github/codeql-action/autobuild a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
  • github/codeql-action/init a57c67b89589d2d13d5ac85a9fc4679c7539f94c composite
.github/workflows/delete-old-workflow-runs.yml actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • Mattraks/delete-workflow-runs 39f0bbed25d76b34de5594dceab824811479e5de composite
.github/workflows/dependabot.yml actions
  • dependabot/fetch-metadata 5e5f99653a5b510e8555840e80cbf1514ad4af38 composite
.github/workflows/document-validation.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • actions/setup-node 60edb5dd545a775178f52524783378180af0d1f8 composite
  • ruby/setup-ruby ff740bc00a01b3a50fffc55a1071b1060eeae9dc composite
.github/workflows/generate-release.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • Bullrich/generate-release-changelog 6b60f004b4bf12ff271603dc32dbd261965ad2f2 composite
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
  • softprops/action-gh-release 69320dbe05506a9a39fc8ae11030b214ec2d1f87 composite
.github/workflows/generate-test-release.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • Bullrich/generate-release-changelog 6b60f004b4bf12ff271603dc32dbd261965ad2f2 composite
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
  • softprops/action-gh-release 69320dbe05506a9a39fc8ae11030b214ec2d1f87 composite
.github/workflows/greetings.yml actions
  • actions/first-interaction 34f15e814fe48ac9312ccf29db4e74fa767cbab7 composite
.github/workflows/purge-deprecated-workflow-runs.yml actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • otto-de/purge-deprecated-workflow-runs 31a4e821d43e9a354cbd65845922c76e4b4b3633 composite
.github/workflows/repository-validation.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • actions/setup-go cdcb36043654635271a94b9a6d1392de5bb323a7 composite
  • actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
.github/workflows/security-hardening.yml actions
  • actions/checkout 692973e3d937129bcbf40652eb9f2f61becf3332 composite
  • zgosalvez/github-actions-ensure-sha-pinned-actions 08d8d3cf383a5d9b02986e9fa05b7c4e85e1d495 composite
.github/workflows/stale.yml actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • actions/stale 28ca1036281a5e5922ead5184a1bbf96e5fc984e composite
requirements.txt pypi
  • beautifulsoup4 ==4.12.3
  • pytest ==8.2.2
  • requests ==2.32.3
  • setuptools ==70.0.0
setup.py pypi