본문 바로가기

Language/python

OSS Legal Notice 생성 스크립트

https://github.com/ppiazi/LegalNoticeMaker


OSS 사용 고지문을 작성하는 파이썬 스크립트이다.

python3과 템플릿 생성을 위하여 jinja2를 사용하였다.


사용법

python LegalNoticeMaker.py -s"swinfo.csv" -d"data.csv"



템플릿 변수와 각 csv 파일 컬럼은 아래와 같이 매핑된다.

swinfo.csv

  • SW Name : {{info.sw}}
  • SW Year : {{info.sw_year}}
  • Company Name : {{info.company_name}}
  • Company Email : {{info.company_email}}

data.csv

  • OSS : {{oss.oss}}
  • URL : {{oss.oss_url}}
  • Copyright : {{oss.oss_copyright}}
  • license : {{oss.oss_license}} : license-list 폴더 밑에 있는 확장을 제외한 문자열을 넣는다. Ex) LGPL-2.1, MIT
  • ETC : {{oss.oss_etc}}


legal-notice-txt.template

Open Source Software Notice


This application ({{info.sw}}) is Copyright (c) {{info.sw_year}}, {{info.company_name}}. All Rights Reserved.

This application use Open Source Software (OSS).

You can find the source code of these open source projects, along with applicable license information, below.

We are deeply grateful to these developers for their work and contributions.

Any questions about our use of licensed work can be sent to {{info.company_email}}


----------------------------------------------------------------------------------------------------------------

{% for oss in oss_list %}{{oss.oss}}

    {% if oss.oss_etc == "" %}{{oss.oss_url}}

    {{oss.oss_copyright}}

    {{oss.oss_license}}

    {% else %}{{oss.oss_url}}

    {{oss.oss_etc}}

    {{oss.oss_copyright}}

    {{oss.oss_license}}

    {% endif %}

{% endfor %}----------------------------------------------------------------------------------------------------------------

{% for oss_license in oss_license_list %}{{oss_license.oss_license}}


{{oss_license.oss_license_notice}}

----------------------------------------------------------------------------------------------------------------

{% endfor %}


출력 예제