Skip to main content

Enumerate funding links for Python packages

Project description

pip‑fund

pip‑fund is a small command‑line tool that scans your Python environment (or a list of package names) and reports any funding or sponsorship links it can find. It is inspired by Node.js’s npm fund command and uses Python’s packaging metadata to discover funding information. The goal is to make it easy for developers to discover how to support the open‑source libraries they depend on.

Features

  • Normalises labels and URLs: Funding links are detected by examining Project‑URL metadata and matching normalised labels against a set of known aliases such as funding, sponsor, donate and donation. Labels containing the words fund or sponsor are also matched. Query strings and fragments are stripped from URLs before grouping, so links that differ only by tracking parameters are treated as the same.
  • Groups duplicate links: When multiple packages share the same funding URL, the tool groups them into a single entry and lists all associated package names.
  • Multiple output formats: Choose human‑readable text (default), JSON (--json) or Markdown (--markdown).
  • Remote lookups: Use the --remote flag to query the PyPI JSON API for funding links of packages that are not installed locally.
  • Optional GitHub sponsor support: When installed with the github extra (pip install pip‑fund[github]), the tool can attempt to fetch sponsor links from a repository’s .github/FUNDING.yml file on GitHub if no funding metadata is present. This requires a GitHub access token.

Installation

Basic usage

pip install pip-fund

# Scan all installed packages for funding information
pip-fund

# Check specific packages (installed or not) and query PyPI if needed
pip-fund --remote requests flask

# Output Markdown instead of plain text
pip-fund --markdown

Enabling GitHub sponsor integration

To enable GitHub sponsor discovery, install the github extra and provide a GitHub personal access token via the GITHUB_TOKEN environment variable. Without a token the GitHub API will operate with very limited rate limits.

pip install pip-fund[github]

export GITHUB_TOKEN=ghp_yourtokenhere
pip-fund --github flask

Usage

Running pip-fund without arguments scans all installed distributions in the current Python environment. For each unique funding link found, it prints the label, the URL and the names of packages that declare it. If no funding information is discovered, the tool explains why this might be the case.

Use the --json or --markdown flags to produce machine‑readable output. Combine --remote with package names to query funding information for packages that aren’t installed.

Project structure

This project follows the modern Python packaging guidelines:

  • A pyproject.toml file declares the build system (setuptools) and metadata such as the project name, version and console script entry point. The [project.scripts] table instructs the build backend to generate a pip-fund command that invokes the main() function in pip_fund/fund.py【917575989859582†L503-L507】.
  • Source code lives in the src/pip_fund/ package. The main module fund.py implements the logic of detecting funding links.
  • Optional dependencies for GitHub sponsor support are defined under [project.optional-dependencies] in pyproject.toml. Installing with pip install pip-fund[github] adds the PyGithub and PyYAML libraries.

Contributing

Contributions are welcome! Feature requests, bug reports and pull requests are greatly appreciated. Areas of interest include:

  • Improving detection of funding links in package metadata
  • Supporting additional donation platforms
  • Enhancing the GitHub sponsor integration
  • Adding interactive prompts or browser integration to open funding pages directly from the CLI

License

This project is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pip_fund-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pip_fund-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file pip_fund-0.1.0.tar.gz.

File metadata

  • Download URL: pip_fund-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pip_fund-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a98309a059a6aa1ca7f3c2d56996c09a37309a91cc87db4b805185b7f2dba17e
MD5 abbfa76ed76c482c64f8b8fd5f534382
BLAKE2b-256 5ee2146532ed4d9a48b76c056b74def481fcbf03c0feadf52c52fee2775b8bfb

See more details on using hashes here.

File details

Details for the file pip_fund-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pip_fund-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pip_fund-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddae6943eeff4b896015d666070486fcb78c6b7fa2d063ea7e0620e6a480cfb2
MD5 326ec69e11da0b5d11989318223fb020
BLAKE2b-256 206b7c1eda8a17c8d7ca9b7bf46754c44d9a44a7a56d4d038fb57bcd8b68099b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page