PyThaiNLP / pythainlp

Thai Natural Language Processing in Python.
https://pythainlp.org/
Apache License 2.0
936 stars 272 forks source link

Switching to SPDX license identifiers in PyThaiNLP sources #874

Closed bact closed 7 months ago

bact commented 7 months ago

SPDX (Software Package Data Exchange) license ID gives at least two benefits: 1) Shorter source code, less clutter 2) Provide opportunity for automatic identification of the source code's license

More free and open source projects are now switching to SPDX license identifier, replacing full license text at the top of each source file. For example:

There is also a PEP proposing to use SPDX as a standard way to specify license in Python package: https://peps.python.org/pep-0639/

What is SPDX License ID?

"The SPDX License List includes a standardized short identifier, the full name, the license text, and a canonical permanent URL for each license and exception. The purpose of the SPDX License List is to enable efficient and reliable identification of such licenses." https://spdx.org/licenses/

SPDX license id examples: License name SPDX ID
Apache License 2.0 Apache-2.0
BSD 2-Clause "Simplified" License BSD-2-Clause
Creative Commons Attribution 4.0 International CC-BY-4.0
GNU General Public License v3.0 or later GPL-3.0-or-later

How to use SPDX License ID?

To specify a license/licenses to a source code file, simply put in a comment the SPDX license ID, with the tag name "SPDX-License-Identifier:" in front of the license ID.

# SPDX-License-Identifier: MIT
# SPDX-License-Identifier: MIT OR Apache-2.0 */
# SPDX-License-Identifier: GPL-2.0-or-later

How to switch PyThaiNLP source code to SPDX license ID?

Replace this comment block at the file header:

# Copyright (C) 2016-2023 PyThaiNLP Project
#
# 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.

with this SPDX tags:

# SPDX-FileCopyrightText: Copyright 2016-2023 PyThaiNLP Project
# SPDX-License-Identifier: Apache-2.0
pavaris-pm commented 7 months ago

@bact i already switched to the SPDX license, you can take a look at my new PR #876 krub