Skip to main content

licenses-generator

Generate a file containing all (locally found) licenses from your project.

About

This script is used in production @ Prisma to generate the required attributions for our license page.

How?

It walks the given directory and searches for license files, and after it's done, it will write all of them to a new file, following the given template.

Compatibility

At this time, it's only been tested on JS project (the default folder is node_modules), but it should be compatible with anything that stores licenses locally.

Usage

Recomanded

from generate_licenses import Generator, Template # <- Or you can use DefaultTemplate

template = Template(
    wrapper_template='<div>\n$ctnt\n</div>',
    title_template='<h1>$ctnt</h1>\n',
    license_template='<pre>\n<code>\n$ctnt\n</code>\n</pre>'
)

generator = Generator(template, <initial_dir>, <out_file>, <out_separator>)
generator.write_licenses()

CLI (Not recomanded)

See help: generate_licenses.py -h


How does the Templating work?

Let's start with the given example (from above) - That will generate the following:

<div>
<h1>PACKAGE_NAME</h1>
<pre>
<code>
LICENSE
</code>
</pre>
</div>

Basically you can write whatever you want, and put $ctnt where you want the actual "content" to be put


Contributing Guide

If you wish to contribute to generate_licenses please see CONTRIBUTING.md

Code of Conduct

Please respect our Code of Conduct. It can be found here


Authors

License

Copyright 2021 Prisma

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

(C) Prisma 2021 - https://buyprisma.netlify.app/

Metadata

Release files for generate-licenses 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for generate-licenses 1.2.0
File Size Uploaded Provenance Actions
generate_licenses-1.2.0.tar.gz 8.8 kB Without provenance Details for generate_licenses-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for generate-licenses 1.2.0
File Interpreter ABI Platform Actions
generate_licenses-1.2.0-py3-none-any.whl Python 3 none any Details for generate_licenses-1.2.0-py3-none-any.whl

Total release size: 19.6 kB

Release files / generate_licenses-1.2.0.tar.gz

Download URL generate_licenses-1.2.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4da1b3000fb38f2369ab6687cc3eebcf7decfccfb0b7c9be7ba6f233c092c752
BLAKE2b-256 checksum
How to use checksums
b24a0c61c7641443fff5d26cf7181bbf4395bd059748d9032ac5a7ff92c3a90e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

Release files / generate_licenses-1.2.0-py3-none-any.whl

Download URL generate_licenses-1.2.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f57428ae03fd217704ab971313a844ba0e4b49f2b3e2cae89f2a6d060da48cb
BLAKE2b-256 checksum
How to use checksums
3043d405631a837cdb1f56870967cc921982e52eb86f39c399ed2d2889a8a100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

Security for generate-licenses 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page