atarashi.license.licensePreprocessor module

Copyright 2018 Gaurav Mishra (gmishx@gmail.com)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class atarashi.license.licensePreprocessor.LicensePreprocessor[source]

Bases: object

static _LicensePreprocessor__load_licenses(licenseList, verbose=0)

Fetch license short name and description from the License List (CSV) and preprocess them

Parameters:
  • licenseList – Path to license list (CSV)
  • verbose – Specify if verbose mode is on or not (Default is Off/ None)
Returns:

Return pandas.DataFrame with processed fullname, header and text

static _LicensePreprocessor__write_csv(processedList, fileLocation)

Write the preprocessed license list to a CSV file

Parameters:
  • processedList – pandas.DataFrame to be written to a CSV file
  • fileLocation – Location/ Path of the file where you want to write CSV
static create_processed_file(licenseList, processedFile, verbose=0)[source]
Parameters:
  • licenseList – Specify the license list file which contains licenses
  • processedFile – Specify the destination to store processed list
  • verbose – Specify if verbose mode is on or not (Default is Off/ None)
Returns:

Path of processed license list to use. (This path will be default by further script)

static file_is_modified(source, destination)[source]

Check if source is modified before destination. If destination does not exists, create a new file.