-
Notifications
You must be signed in to change notification settings - Fork 284
Description
SPDX (Software Package Data Exchange) license ID gives at least two benefits:
- Shorter source code, less clutter
- 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:
- Linux kernel https://www.kernel.org/doc/html/latest/process/license-rules.html#license-identifier-syntax
- Qt https://www.qt.io/blog/switching-to-spdx
- Fedora https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
- Blender https://projects.blender.org/blender/blender/issues/95597
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
Metadata
Metadata
Assignees
Labels
Type
Projects
Status