license-tools


Namelicense-tools JSON
Version 0.13.2 PyPI version JSON
download
home_pageNone
SummaryCollection of tools for working with Open Source licenses
upload_time2024-10-24 14:22:10
maintainerNone
docs_urlNone
authorstefan6419846
requires_python<4,>=3.9
licenseApache-2.0
keywords open source license package dependency licensing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # License tools

Collection of tools for working with Open Source licenses, focusing on Python packages.

## About

This tool initially started as some convenience wrapper around the [ScanCode toolkit](https://github.com/nexB/scancode-toolkit/) by nexB Inc. to be used as either a standalone CLI or library. In the meantime, I added some functionality which involves further tooling sometimes irrelevant for ScanCode, sometimes not (yet) implemented there.

I wrote this tool to simplify the initial scanning steps for third-party packages, mostly tailored to my specific use-cases. For this reason, some implementation or representation details might be opionated and rather tailored to my specific needs. I decided to make this library available as a dedicated package nevertheless, as easy-to-use license compliance (scanner) tooling is sparse, while everyone should care about such topics. If you think that something can be generalized or improved, feel free to open a corresponding issue to discuss this before possibly getting started with an actual PR.

## Features

* Automatically download a specific Python package from PyPI and analyze it.
* Aggregate how often each license has been used inside the current artifact.
* Look into shared object files and ELF binaries to see what they are linking to (dynamically).
* Look into font files to easily analyze their metadata.
* Look into RPM file metadata.
* Look into Python package metadata.
* Look into Rust crate metadata.
* Look into image metadata.
* Recursively look into nested archives, for example by unpacking the actual upstream source code archives inside RPM (source) files.
* Download the package versions declared inside a `Cargo.lock` file.
* Make everything available from the terminal.

## Installation

You can install this package from PyPI:

```bash
python -m pip install license_tools
```

Alternatively, you can use the package from source directly after installing the required dependencies.

Some features might require installing extras or OS-level packages:

* Analysis of shared objects requires the `ldd` command to be available inside the path.
* Analysis of image metadata requires the `exiftool` command to be available inside the path.
  You might obtain a recent distribution archive from https://exiftool.org/

## Usage

To see the supported CLI parameters, just run:

```bash
python -m license_tools --help
```

Example: To see the licenses of a specific *pypdf* package version, use something like this:

```bash
$ python -m license_tools --package "pypdf==3.4.17"
              pypdf-3.17.4.dist-info/LICENSE                            BSD-3-Clause [100.0]
             pypdf-3.17.4.dist-info/METADATA                            BSD-3-Clause [99.0]
               pypdf-3.17.4.dist-info/RECORD                            
                pypdf-3.17.4.dist-info/WHEEL                            
                           pypdf/__init__.py                            
                              pypdf/_cmap.py                            
                   pypdf/_codecs/__init__.py                            
               pypdf/_codecs/adobe_glyphs.py                            BSD-3-Clause [100.0]
                     pypdf/_codecs/pdfdoc.py                            
                        pypdf/_codecs/std.py                            
                     pypdf/_codecs/symbol.py                            
                   pypdf/_codecs/zapfding.py                            
          pypdf/_crypt_providers/__init__.py                            BSD-3-Clause [100.0]
             pypdf/_crypt_providers/_base.py                            BSD-3-Clause [100.0]
     pypdf/_crypt_providers/_cryptography.py                            BSD-3-Clause [100.0]
         pypdf/_crypt_providers/_fallback.py                            BSD-3-Clause [100.0]
     pypdf/_crypt_providers/_pycryptodome.py                            BSD-3-Clause [100.0]
                        pypdf/_encryption.py                            BSD-3-Clause [100.0]
                            pypdf/_merger.py                            BSD-3-Clause [100.0]
                              pypdf/_page.py                            BSD-3-Clause [100.0]
                       pypdf/_page_labels.py                            
                         pypdf/_protocols.py                            
                            pypdf/_reader.py                            BSD-3-Clause [100.0]
          pypdf/_text_extraction/__init__.py                            
                             pypdf/_utils.py                            BSD-3-Clause [100.0]
                           pypdf/_version.py                            
                            pypdf/_writer.py                            BSD-3-Clause [100.0]
                pypdf/_xobj_image_helpers.py                            
               pypdf/annotations/__init__.py                            
                  pypdf/annotations/_base.py                            
    pypdf/annotations/_markup_annotations.py                            
pypdf/annotations/_non_markup_annotations.py                            
                          pypdf/constants.py                            
                             pypdf/errors.py                            
                            pypdf/filters.py                            BSD-3-Clause [100.0]
                   pypdf/generic/__init__.py                            BSD-3-Clause [100.0]
                      pypdf/generic/_base.py                            BSD-3-Clause [100.0]
           pypdf/generic/_data_structures.py                            BSD-3-Clause [100.0]
                       pypdf/generic/_fit.py                            
                   pypdf/generic/_outline.py                            
                 pypdf/generic/_rectangle.py                            
                     pypdf/generic/_utils.py                            
                pypdf/generic/_viewerpref.py                            BSD-3-Clause [100.0]
                          pypdf/pagerange.py                            BSD-3-Clause [99.0]
                         pypdf/papersizes.py                            
                              pypdf/py.typed                            
                              pypdf/types.py                            
                                pypdf/xmp.py                            

=============================================================================================

                                                          BSD-3-Clause  20
                                                                  None  28
```

If you want to use the package as a library, have a look at the `license_tools.retrieval.run` method for example to see how everything interacts. In general:

* `license_tools.retrieval` implements most of the CLI/glue code for handling the different source types and starting the actual scanning process as well as displaying the results.
* `license_tools.tools` implements most of the actual checks and wrappers for the third-party libraries used for scanning/checking.

## License

This package is subject to the terms of the Apache-2.0 license.

## Disclaimer

All results are generated automatically and provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. No generated content should be considered or used as legal advice. Consult an Attorney for any legal advice.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "license-tools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.9",
    "maintainer_email": null,
    "keywords": "open source, license, package, dependency, licensing",
    "author": "stefan6419846",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b3/88/4a5dbac57b5f453a28e91fe8e685cd0ca99666d302efbce1088ab5837958/license_tools-0.13.2.tar.gz",
    "platform": null,
    "description": "# License tools\n\nCollection of tools for working with Open Source licenses, focusing on Python packages.\n\n## About\n\nThis tool initially started as some convenience wrapper around the [ScanCode toolkit](https://github.com/nexB/scancode-toolkit/) by nexB Inc. to be used as either a standalone CLI or library. In the meantime, I added some functionality which involves further tooling sometimes irrelevant for ScanCode, sometimes not (yet) implemented there.\n\nI wrote this tool to simplify the initial scanning steps for third-party packages, mostly tailored to my specific use-cases. For this reason, some implementation or representation details might be opionated and rather tailored to my specific needs. I decided to make this library available as a dedicated package nevertheless, as easy-to-use license compliance (scanner) tooling is sparse, while everyone should care about such topics. If you think that something can be generalized or improved, feel free to open a corresponding issue to discuss this before possibly getting started with an actual PR.\n\n## Features\n\n* Automatically download a specific Python package from PyPI and analyze it.\n* Aggregate how often each license has been used inside the current artifact.\n* Look into shared object files and ELF binaries to see what they are linking to (dynamically).\n* Look into font files to easily analyze their metadata.\n* Look into RPM file metadata.\n* Look into Python package metadata.\n* Look into Rust crate metadata.\n* Look into image metadata.\n* Recursively look into nested archives, for example by unpacking the actual upstream source code archives inside RPM (source) files.\n* Download the package versions declared inside a `Cargo.lock` file.\n* Make everything available from the terminal.\n\n## Installation\n\nYou can install this package from PyPI:\n\n```bash\npython -m pip install license_tools\n```\n\nAlternatively, you can use the package from source directly after installing the required dependencies.\n\nSome features might require installing extras or OS-level packages:\n\n* Analysis of shared objects requires the `ldd` command to be available inside the path.\n* Analysis of image metadata requires the `exiftool` command to be available inside the path.\n  You might obtain a recent distribution archive from https://exiftool.org/\n\n## Usage\n\nTo see the supported CLI parameters, just run:\n\n```bash\npython -m license_tools --help\n```\n\nExample: To see the licenses of a specific *pypdf* package version, use something like this:\n\n```bash\n$ python -m license_tools --package \"pypdf==3.4.17\"\n              pypdf-3.17.4.dist-info/LICENSE                            BSD-3-Clause [100.0]\n             pypdf-3.17.4.dist-info/METADATA                            BSD-3-Clause [99.0]\n               pypdf-3.17.4.dist-info/RECORD                            \n                pypdf-3.17.4.dist-info/WHEEL                            \n                           pypdf/__init__.py                            \n                              pypdf/_cmap.py                            \n                   pypdf/_codecs/__init__.py                            \n               pypdf/_codecs/adobe_glyphs.py                            BSD-3-Clause [100.0]\n                     pypdf/_codecs/pdfdoc.py                            \n                        pypdf/_codecs/std.py                            \n                     pypdf/_codecs/symbol.py                            \n                   pypdf/_codecs/zapfding.py                            \n          pypdf/_crypt_providers/__init__.py                            BSD-3-Clause [100.0]\n             pypdf/_crypt_providers/_base.py                            BSD-3-Clause [100.0]\n     pypdf/_crypt_providers/_cryptography.py                            BSD-3-Clause [100.0]\n         pypdf/_crypt_providers/_fallback.py                            BSD-3-Clause [100.0]\n     pypdf/_crypt_providers/_pycryptodome.py                            BSD-3-Clause [100.0]\n                        pypdf/_encryption.py                            BSD-3-Clause [100.0]\n                            pypdf/_merger.py                            BSD-3-Clause [100.0]\n                              pypdf/_page.py                            BSD-3-Clause [100.0]\n                       pypdf/_page_labels.py                            \n                         pypdf/_protocols.py                            \n                            pypdf/_reader.py                            BSD-3-Clause [100.0]\n          pypdf/_text_extraction/__init__.py                            \n                             pypdf/_utils.py                            BSD-3-Clause [100.0]\n                           pypdf/_version.py                            \n                            pypdf/_writer.py                            BSD-3-Clause [100.0]\n                pypdf/_xobj_image_helpers.py                            \n               pypdf/annotations/__init__.py                            \n                  pypdf/annotations/_base.py                            \n    pypdf/annotations/_markup_annotations.py                            \npypdf/annotations/_non_markup_annotations.py                            \n                          pypdf/constants.py                            \n                             pypdf/errors.py                            \n                            pypdf/filters.py                            BSD-3-Clause [100.0]\n                   pypdf/generic/__init__.py                            BSD-3-Clause [100.0]\n                      pypdf/generic/_base.py                            BSD-3-Clause [100.0]\n           pypdf/generic/_data_structures.py                            BSD-3-Clause [100.0]\n                       pypdf/generic/_fit.py                            \n                   pypdf/generic/_outline.py                            \n                 pypdf/generic/_rectangle.py                            \n                     pypdf/generic/_utils.py                            \n                pypdf/generic/_viewerpref.py                            BSD-3-Clause [100.0]\n                          pypdf/pagerange.py                            BSD-3-Clause [99.0]\n                         pypdf/papersizes.py                            \n                              pypdf/py.typed                            \n                              pypdf/types.py                            \n                                pypdf/xmp.py                            \n\n=============================================================================================\n\n                                                          BSD-3-Clause  20\n                                                                  None  28\n```\n\nIf you want to use the package as a library, have a look at the `license_tools.retrieval.run` method for example to see how everything interacts. In general:\n\n* `license_tools.retrieval` implements most of the CLI/glue code for handling the different source types and starting the actual scanning process as well as displaying the results.\n* `license_tools.tools` implements most of the actual checks and wrappers for the third-party libraries used for scanning/checking.\n\n## License\n\nThis package is subject to the terms of the Apache-2.0 license.\n\n## Disclaimer\n\nAll results are generated automatically and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. No generated content should be considered or used as legal advice. Consult an Attorney for any legal advice.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Collection of tools for working with Open Source licenses",
    "version": "0.13.2",
    "project_urls": {
        "Changelog": "https://github.com/stefan6419846/license_tools/blob/main/CHANGELOG.md",
        "Documentation": "https://license-tools.readthedocs.io/",
        "Homepage": "https://github.com/stefan6419846/license_tools",
        "Issues": "https://github.com/stefan6419846/license_tools/issues",
        "Repository": "https://github.com/stefan6419846/license_tools"
    },
    "split_keywords": [
        "open source",
        " license",
        " package",
        " dependency",
        " licensing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cffeb83f6521bdebdea302b01d90cdff7f39df3d5ec202df4e80757e5b94c5c3",
                "md5": "0e3b37e45b907a49b622972e4446a90b",
                "sha256": "b33facab5f1b1d2d0472bacac3cd666663791c2ac9280816fd493ecfc3b3fb90"
            },
            "downloads": -1,
            "filename": "license_tools-0.13.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e3b37e45b907a49b622972e4446a90b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 40175,
            "upload_time": "2024-10-24T14:22:09",
            "upload_time_iso_8601": "2024-10-24T14:22:09.588478Z",
            "url": "https://files.pythonhosted.org/packages/cf/fe/b83f6521bdebdea302b01d90cdff7f39df3d5ec202df4e80757e5b94c5c3/license_tools-0.13.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3884a5dbac57b5f453a28e91fe8e685cd0ca99666d302efbce1088ab5837958",
                "md5": "d999e4af9482776c4a6c0db69f314fab",
                "sha256": "37b69239975fd3dd5dba031f7afd4895d1a668566991fe3a3b686dd75bb24d9d"
            },
            "downloads": -1,
            "filename": "license_tools-0.13.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d999e4af9482776c4a6c0db69f314fab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 1200514,
            "upload_time": "2024-10-24T14:22:10",
            "upload_time_iso_8601": "2024-10-24T14:22:10.748714Z",
            "url": "https://files.pythonhosted.org/packages/b3/88/4a5dbac57b5f453a28e91fe8e685cd0ca99666d302efbce1088ab5837958/license_tools-0.13.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-24 14:22:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stefan6419846",
    "github_project": "license_tools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "license-tools"
}
        
Elapsed time: 0.36297s