npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jpfulton/python-license-auditor-cli

v0.0.2

Published

A CLI for listing and auditing python project dependencies.

Downloads

39

Readme

python-license-auditor-cli

ci npm version License Visitors

A CLI designed to list and audit licenses in project dependencies in Python projects. The CLI can output both markdown reports and CSV files and is designed to run in CI workflows. Included in the package is a DangerJS plugin that can be used to audit licenses in the PR process.

Installation of the CLI

You can install this tool globally, using the following yarn command:

yarn global add @jpfulton/python-license-auditor-cli

Local Configuration

To override the default configuration, which is extremely minimal, place a .license-checker.json file in the root directory of your project with the following format:

{
  "blackList": ["blacklisted-license"],
  "whiteList": ["whitelisted-license"]
}

Licenses in the blackList array will generate errors in the report. Licenses in the whiteList array will generate information lines and licenses types that exist in neither array generate warnings for further investigation.

Remote Configurations

Remote configurations can be used to override the default configuration. To use a remote configuration, specify the URL to the configuration file using the --remote-config flag. Remote configurations are useful when applying the same configuration to multiple projects to avoid the need to copy the configuration file to each project and maintain the configurations in multiple places.

python-license-auditor-cli csv --remote-config https://raw.githubusercontent.com/jpfulton/node-license-auditor-cli/main/.license-checker.json . > report.csv
python-license-auditor-cli markdown --remote-config https://raw.githubusercontent.com/jpfulton/node-license-auditor-cli/main/.license-checker.json . > report.md

Usage as a DangerJS Plugin

This project can be used as a DangerJS plugin. To use the plugin, install the plugin using the following command:

yarn add -D danger @jpfulton/python-license-auditor-cli

Then, add the following to your dangerfile.ts:

import { pythonLicenseAuditor } from "@jpfulton/python-license-auditor-cli";

export default async () => {
  // Run the license auditor plugin
  await pythonLicenseAuditor({
    // optionally choose to fail the build if a blacklisted license is found
    failOnBlacklistedLicense: false,
    // specify the path to the project's package.json file, useful in a monorepo
    // defaults to the current working directory
    projectPath: ".",
    // optionally specify a remote configuration file
    // useful when applying the same configuration to multiple projects
    // defaults to usage of a local configuration file found at the root of the project repo
    remoteConfigurationUrl:
      "https://raw.githubusercontent.com/jpfulton/jpfulton-license-audits/main/.license-checker.json",
    // show a summary of the license audit in the PR comment
    // includes the number of unique dependencies and counts for each category of license found
    showMarkdownSummary: true,
    // show details of the license audit in the PR comment
    // includes a table with the name, version and license of each dependency
    // that was discovered that was not explicitly whitelisted in the configuration
    showMarkdownDetails: true,
  });
};

Usage with PIP

This project leverages the output of the pip inspect command. To use this tool, you must first install the dependencies of your project. Then, you can run the following command to generate a JSON report:

pip inspect > pip-inspect.json