Code Monkey home page Code Monkey logo

aboutcode-toolkit's Introduction

AboutCode Toolkit

Introduction

The AboutCode Toolkit and ABOUT files provide a simple way to document the origin, license, usage and other important or interesting information about third-party software components that you use in your project.

You start by storing ABOUT files (a small YAML formatted text file with field/value pairs) side-by-side with each of the third-party software components you use. Each ABOUT file documents origin and license for one software. There are many examples of ABOUT files (valid or invalid) in the testdata/ directory of the whole repository.

The current version of the AboutCode Toolkit can read these ABOUT files so that you can collect and validate the inventory of third-party components that you use.

In addition, this tool is able to generate attribution notices and identify redistributable source code used in your project to help you comply with open source licenses conditions.

This version of the AboutCode Toolkit follows the ABOUT specification version 3.3.2 at: https://aboutcode-toolkit.readthedocs.io/en/latest/specification.html

Build and tests status

Branch Linux/macOS Windows
Master Linux Master branch tests status Windows Master branch tests status
Develop Linux Develop branch tests status Windows Develop branch tests status

REQUIREMENTS

The AboutCode Toolkit is tested with Python 3.7 or above only on Linux, Mac and Windows. You will need to install a Python interpreter if you do not have one already installed.

On Linux and Mac, Python is typically pre-installed. To verify which version may be pre-installed, open a terminal and type:

python --version

Note

Debian has decided that distutils is not a core python package, so it is not included in the last versions of debian and debian-based OSes. A solution is to run: sudo apt install python3-distutils
On Windows or Mac, you can download the latest Python here:
https://www.python.org/downloads/

Download the .msi installer for Windows or the .dmg archive for Mac. Open and run the installer using all the default options.

INSTALLATION

Checkout or download and extract the AboutCode Toolkit from:
https://github.com/nexB/aboutcode-toolkit/
To install all the needed dependencies in a virtualenv, run (on posix):
./configure
or on windows:
configure

ACTIVATE the VIRTUALENV

To activate the virtualenv, run (on posix):
source venv/bin/activate
or on windows:
venv\bin\activate

DEACTIVATE the VIRTUALENV

To deactivate the virtualenv, run (on both posix and windows):
deactivate

VERSIONING SCHEMA

Starting at AboutCode version 4.0.0, the AboutCode Toolkit will follow SemVer for the versioning schema.

i.e. MAJOR.MINOR.PATCH format
  1. MAJOR version when making incompatible API changes,
  2. MINOR version when making functionality in a backwards compatible manner, and
  3. PATCH version when making backwards compatible bug fixes.

REFERENCE

See https://aboutcode-toolkit.readthedocs.io/en/latest/ for documentation.

See https://aboutcode-toolkit.readthedocs.io/en/latest/reference.html for reference.

TESTS and DEVELOPMENT

To install all the needed development dependencies, run (on posix):
./configure --dev
or on windows:
configure --dev
To verify that everything works fine you can run the test suite with:
pytest

CLEAN BUILD AND INSTALLED FILES

To clean the built and installed files, run (on posix):
./configure --clean
or on windows:
configure --clean

HELP and SUPPORT

If you have a question or find a bug, enter a ticket at:

https://github.com/nexB/aboutcode-toolkit

For issues, you can use:

https://github.com/nexB/aboutcode-toolkit/issues

SOURCE CODE

The AboutCode Toolkit is available through GitHub. For the latest version visit:
https://github.com/nexB/aboutcode-toolkit

HACKING

We accept pull requests provided under the same license as this tool. You agree to the http://developercertificate.org/

LICENSE

The AboutCode Toolkit is released under the Apache 2.0 license. See (of course) the about.ABOUT file for details.

aboutcode-toolkit's People

Contributors

agustinhenze avatar arijitde92 avatar armintaenzertng avatar arnav-mandal1234 avatar ayansinhamahapatra avatar chinyeungli avatar ddmesh avatar dennisclark avatar dependabot[bot] avatar farialima avatar hesa avatar jdaguil avatar johnmhoran avatar jonoyang avatar keshav-space avatar maxbrito avatar mjherzog avatar orientalperil avatar pombredanne avatar silverhook avatar srthkdb avatar steven-esser avatar swastkk avatar tardyp avatar tdruez avatar tg1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aboutcode-toolkit's Issues

Collect redistributable sources

Given a directory with ABOUT files OR a csv and directory as an input, I want to collect all the source code archives that have the redistribute flag set , and bundle all these in a zip or tar

genabout.py : bug for the --action 1

1 - Overwrites the current ABOUT field value if existed

The current behavior is kinda like replace the whole ABOUT file.

For instance,
if my ABOUT file already have a version value but my input csv doesn't have any value in the version column, the version field value will be removed which is not correct.

Pass as an option a list of fields that are mandatory

I would like to have a configurable command line option to pass a list of fields considered as mandatory overriding the basics... This is important because for a certain usage certain fields will be needed. For instance generating attribution or redistribution requires certain fields to be set which may be otherwise considered as optional.

generate ABOUT files from a CSV

user should be able to generate ABOUT files from a CSV as an input

Current proposals:

A. An interactive prompt.

For instance, user only needs to type

python about.py
Then the script will prompt:

  1. Collect ABOUT files context
  2. Generate ABOUT files
  3. Exit
    Select:
    something like the above, and the ask for input/output and all kind of options.

B. Create another script, maybe, called generate_about_file.py

Create an output file error.txt when generating attribution

When creating attribution, an error log should be created containing the warnings and errors
For example:
Mandatory fields are missing from the .ABOUT files.
The error log would show which components are missing the mandatory fields and specifically which mandatory fields are missing.

genabout.py : "Update" the ABOUT file if ABOUT file already exist and have different context.

The current design is to do nothing if the ABOUT file exist.

The tool should be able to look into the ABOUT file to see if there is anything that need to be updated if the ABOUT file exist.

Provide options, such as:

  1. overwrite the current field value
  2. keep the current field value and only add the "new" field and field value
  3. replace the ABOUT file with the current generation

In addition, if no option is set, the tool will not touch the ABOUT file and prompt "ABOUT file already existed."

Generate attribution

Given ABOUT files or a list of ABOUT files in a CSV and a base directory, I want to generate an attribution notice for all these components:

  • supported output should be text and HTML
  • the output should be based on a template. Mustache or Jinja2 are a good candidates
  • for this to work, there need to be some mandatory fields present

Extract license text from a license_url

The tool should be able to extract the license text based on the user license_url provided in the ABOUT file and save the license text in the user specific directory.

Generate an ABOUT "Scorecard"

If an engineering organization were to take up using ABOUT in a serious, ongoing way, it probably would be very helpful to provide a tool/utility that would generate a "scorecard" on a target codebase directory. Some of the scorecard points would include:

Percentage/counts of the directories that (1) have no ABOUT info, (2) have some ABOUT info, (3) appear to be fully-documented in ABOUT.

The value of this would be that as new code is checked into a codebase, the scorecard could help determine if it's time to review the ABOUT files.

The scorecard tool might also identify potentially obsolete ABOUT files, where the date (timestamp) on the ABOUT file is older (by a number of days, perhaps parameter-driven) that the file/directory that it describes.

Generate attribution from an input list

Generate attribution from ABOUT files for a specific list of components. User should be able to pass a list of components they would specifically like to generate attribution for.

In other words, from a given set of about files and an input list (that contains component names which map to about file field "name") be able to generate attribution.

Define how we are packaging ABOUT

For now a simple .py script is best.
Later we need to have extra libs and the single file approach will no longer work.
We need to pick what packaging works knowing that target users may not be python developers. Some possibilities include:

  • sdist on Pypi for Python developers. see #4
  • pyz zip for general usage that requires a Python installation
  • py2exe, pyinstaller or similar for Windows/Mac/Linux that could work without a Python installed

Should ABOUT be system-wide installed? with man pages? as .deb or .rpm packages?

Problem if I use '..' in the project input

For instance,
if I run it like the following:
$ python about.py ../about-code-tool/testdata/ /cygdrive/z/tmp/t2.csv

The output of the about_file is
../about-code-tool/testdata/

which is incorrect.

Do not check format if field is null

('download_url', '', 'This optional field has no value.'),('download_url', '', 'URL is either not in a valid format, or it is not reachable.')

If a field doesn't contains any value, we should not check for format.

Verbosity option for about.py

It would be nice to offer the possibility to log the warnings and errors in the stdout.

Probably a new option "--verbosity"

0 is default
1 is errors
2 is errors + warnings
So I can see the issues in my terminal without having to open the output file as I'm fixing the issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.