The PSF License Agreement Version 2 is the licence under which the Python Software Foundation (PSF) distributes CPython and its documentation. It is a short permissive licence. It grants broad rights to use, modify and distribute Python, and attaches conditions only to keeping notices and describing changes.[1] Because Python’s code base passed through several owners before the PSF, the full licence text shipped with CPython stacks four agreements: the PSF licence, the BeOpen.com licence for Python 2.0, the CNRI licence for Python 1.6.1 and the CWI licence for Python 0.9.0 to 1.2.[1] SPDX identifies the whole stack as Python-2.0 and the PSF component alone as PSF-2.0.[3][4]
History
Python was created in the early 1990s at Stichting Mathematisch Centrum (CWI) in the Netherlands. Development continued at the Corporation for National Research Initiatives (CNRI) in Virginia from 1995, then moved to BeOpen.com in May 2000 and on to Digital Creations (later Zope Corporation) in October 2000. The PSF was formed in 2001 to own Python-related intellectual property.[1] Each owner released Python under its own licence. The licence page summarises GPL compatibility by release:[1]
| Release | Year | Owner | GPL-compatible |
|---|---|---|---|
| 0.9.0 to 1.2 | 1991 to 1995 | CWI | Yes |
| 1.3 to 1.5.2 | 1995 to 1999 | CNRI | Yes |
| 1.6 | 2000 | CNRI | No |
| 2.0 | 2000 | BeOpen.com | No |
| 1.6.1 | 2001 | CNRI | Yes (disputed, see note) |
| 2.1 | 2001 | PSF | No |
| 2.0.1, 2.1.1, 2.1.2, 2.1.3 | 2001 to 2002 | PSF | Yes |
| 2.2 and above | 2001 to now | PSF | Yes |
The licence page adds a caveat on 1.6.1. According to Richard Stallman its licence is not GPL-compatible because of a choice-of-law clause, while CNRI reports being told by Stallman’s lawyer that it is “not incompatible”.[1] GPL compatibility does not mean Python is distributed under the GPL. It means Python can be combined with GPL-licensed software.[1] Catalog proof: GPL compatibility depends on the Python release.
Clauses of the PSF License
| Clause | Effect | Catalog row |
|---|---|---|
| 1 Parties | Agreement between the PSF and the individual or organization using Python in source or binary form, with its documentation[1] | n/a |
| 2 Grant | Nonexclusive, royalty-free, world-wide licence to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute and otherwise use Python alone or in any derivative version, provided the PSF licence and copyright notice are retained[1] | PSF License grants royalty-free use, modification and distribution; PSF License Agreement and copyright notice must be retained |
| 3 Derivative works | A licensee that makes a derivative work available to others agrees to include a brief summary of the changes made to Python[1] | Derivative works made available to others must summarise changes |
| 4 No warranty | Python is provided “AS IS”. Warranties of merchantability, fitness and non-infringement are disclaimed[1] | Python is provided as is without warranty |
| 5 Liability | No liability for incidental, special or consequential damages from modifying, distributing or using Python[1] | Python is provided as is without warranty |
| 6 Termination | Automatic termination on material breach[1] | PSF License terminates automatically on material breach |
| 7 Relationship and trademarks | No agency or partnership. No permission to use PSF trademarks or trade name to endorse or promote products[1] | PSF License grants no trademark rights |
| 8 Acceptance | Copying, installing or otherwise using Python binds the licensee to the terms[1] | Licence to Python is accepted by copying, installing or using it |
The grant draws no line between internal and external, or commercial and non-commercial, use. The Python FAQ confirms that commercial use, sale of copies in source or binary form (modified or unmodified), and sale of products incorporating Python are allowed if the copyright rules are honoured.[2] Catalog proof: Commercial use and sale of Python are permitted.
The older agreements in the stack follow the same pattern with small differences. The BeOpen licence requires the BeOpen Python License to be retained, and is governed by California law.[1] The CNRI licence requires CNRI’s licence and notice to be retained, or a substitute text pointing to the handle 1895.22/1013. It also requires a summary of changes in derivative works, and is governed by US federal law and Virginia law.[1] The CWI licence asks that the copyright and permission notice appear in all copies and supporting documentation, and forbids using the CWI name in advertising without permission.[1]
Copyleft and linking
The PSF licence has no copyleft. The licence page states that all Python licences, unlike the GPL, let you distribute a modified version without making your changes open source.[1] None of the four agreements contains a source-code offer, a licence-inheritance clause or a condition tied to linking.[1] An application written in Python, or a native application that loads the Python interpreter, may therefore carry any licence, including a proprietary one. The PSF conditions attach only to the Python component shipped inside it. Catalog proof: Python licences are not copyleft.
Documentation code and Zero-Clause BSD
Python’s documentation is itself licensed under the PSF License Version 2. Starting with Python 3.8.6, examples, recipes and other code in the documentation are dual licensed under the PSF License and the Zero-Clause BSD licence.[1] Zero-Clause BSD (SPDX 0BSD) grants permission to use, copy, modify and/or distribute the software for any purpose, with or without fee. It has no condition to retain a notice.[5] The OSI approved it in 2015 under the name “Free Public License 1.0.0”. It is an alteration of the ISC licence and is not textually derived from the BSD family.[6] Code copied from docs.python.org into an application can therefore be used without carrying a PSF notice. Catalog proof: Documentation code examples are dual licensed PSF-2.0 and 0BSD.
Incorporated third-party software
Some software incorporated into Python is under different licences, which the licence page lists alongside the code they cover. The list is described as incomplete, but growing.[1]
| Component | Where it is used | Licence family (as reproduced on the licence page) |
|---|---|---|
| Mersenne Twister | _random extension behind the random module | BSD-style (3 clauses)[1] |
| WIDE Project getaddrinfo/getnameinfo | socket module | BSD-style (3 clauses)[1] |
| SipHash24 | Python/pyhash.c | MIT[1] |
| dtoa / strtod | Python/dtoa.c | Permissive notice licence[1] |
| OpenSSL | hashlib, posix and ssl modules; may be included in the Windows and macOS installers | Apache License 2.0 for OpenSSL 3.0 and later[1] |
| expat | pyexpat extension, unless built with --with-system-expat | MIT-style[1] |
| libffi | _ctypes extension, unless built with --with-system-libffi | MIT-style[1] |
| zlib | zlib extension, if the system version is too old | zlib notice (permissive, with origin and alteration conditions)[1] |
| cfuhash | hash table used by tracemalloc | BSD-style (3 clauses)[1] |
| libmpdec | _decimal extension, unless built with --with-system-libmpdec | BSD-style (2 clauses)[1] |
| W3C C14N test suite | test package | 3-clause BSD[1] |
| mimalloc | memory allocator | MIT[1] |
uvloop 0.16 (parts of asyncio) | asyncio | MIT[1] |
| Global Unbounded Sequences | Python/qsbr.c | 2-Clause BSD[1] |
| pyzstd | Zstandard bindings | 3-Clause BSD[1] |
| Unicode Character Database | unicodedata module and str Unicode support | Unicode License V3[1] |
These licences are permissive, but most carry their own notice conditions. The BSD-style licences, for example, require binary redistributions to reproduce the copyright notice, conditions and disclaimer in the documentation or other materials.[1] Apache License 2.0 applies to the OpenSSL copy that the Windows and macOS installers may carry.[1] Which bundled copies a given binary contains depends on its build configuration.[1] CPython records its bundled dependencies in an SPDX software bill of materials, Misc/sbom.spdx.json, and updates it whenever a dependency changes.[8] Catalog proof: Software incorporated in Python carries its own licences; Windows and macOS installers may include OpenSSL under Apache 2.0; Bundled library copies depend on build configuration.
Embedding Python in products
The Windows documentation describes an embeddable package: a ZIP file with a minimal Python environment. It is intended to act as part of another application rather than to be accessed directly by end users. It leaves out Tcl/Tk, IDLE, pip and the documentation.[7] It supports two cases. A Python application can ship a private Python, optionally behind a custom launcher so that users cannot see the program is running on Python. A native application can embed Python as a scripting language.[7] Third-party packages should be installed by the application installer and treated as part of the application (“vendoring”).[7] Catalog proof: Embedded distribution: third-party packages are part of the application.
Applied to the licence, the vendor of such a product is redistributing Python. The PSF licence and copyright notice must be retained, and a summary of changes included if Python was modified.[1] The notices of incorporated components, and the licences of every vendored package, must travel with the product. A custom launcher that hides Python from users does not remove these conditions. Nothing in the licence requires the product to disclose its own source code.[1]
Trademark conditions on redistribution
The licence itself grants no trademark rights.[1] Under the PSF Trademark Usage Policy, using the word “Python” when redistributing Python as part of a freely distributed application is allowed. A modified standard version should be clearly indicated as modified. Commercial distributions should contact the PSF if their use is not covered by the nominative use rules.[9] Stating accurately that software contains the Python programming language is always allowed, including for commercial products.[9] Catalog proof: Modified Python redistributed in a product must be marked as modified; Nominative use of the Python name and logo never requires approval.
Identifying the licence in inventories
For software bills of materials and licence inventories, SPDX offers two identifiers. Python-2.0 is “the overall Python license as published on the OSI website”, made up of several licences, and is flagged OSI-approved. PSF-2.0 is the PSF component alone, which some other projects, such as matplotlib, use independently. Its SPDX record is not flagged OSI-approved.[3][4] The OSI lists the Python License, Version 2 in its “Superseded” category.[10] Catalog proof: SPDX distinguishes PSF-2.0 from the full Python-2.0 licence stack.
Out of scope
- Licences of packages installed from PyPI; see PyPI package licensing and organization accounts.
- Python builds and runtimes published by operating-system vendors or other distributors, which may add their own components and terms.
- Tcl/Tk and IDLE, which the Windows documentation names as parts of a full installation left out of the embeddable package, and any other component not listed on the licence page.[7]
- Legal interpretation of the choice-of-law clauses in the CNRI and BeOpen licences.