refac: fetch pyodide deps at build time, not checked into git

This commit is contained in:
Jun Siang Cheah
2024-05-18 14:30:42 +08:00
parent 3aa6b0fea9
commit 781c904c91
44 changed files with 65 additions and 7970 deletions
-55
View File
@@ -1,55 +0,0 @@
// webworker.js
// Setup your project to serve `py-worker.js`. You should also serve
// `pyodide.js`, and all its associated `.asm.js`, `.json`,
// and `.wasm` files as well:
importScripts('/pyodide/pyodide.js');
async function loadPyodideAndPackages(packages = []) {
self.stdout = null;
self.stderr = null;
self.result = null;
self.pyodide = await loadPyodide({
indexURL: '/pyodide/',
stdout: (text) => {
console.log('Python output:', text);
if (self.stdout) {
self.stdout += `${text}\n`;
} else {
self.stdout = `${text}\n`;
}
},
stderr: (text) => {
console.log('An error occured:', text);
if (self.stderr) {
self.stderr += `${text}\n`;
} else {
self.stderr = `${text}\n`;
}
}
});
await self.pyodide.loadPackage('micropip');
const micropip = self.pyodide.pyimport('micropip');
await micropip.set_index_urls('https://pypi.org/pypi/{package_name}/json');
await micropip.install(packages);
}
self.onmessage = async (event) => {
const { id, code, ...context } = event.data;
console.log(event.data)
// The worker copies the context in its own "memory" (an object mapping name to values)
for (const key of Object.keys(context)) {
self[key] = context[key];
}
// make sure loading is done
await loadPyodideAndPackages(self.packages);
self.result = await self.pyodide.runPythonAsync(code);
self.postMessage({ id, result: self.result, stdout: self.stdout, stderr: self.stderr });
};
Binary file not shown.
@@ -1,78 +0,0 @@
Metadata-Version: 2.1
Name: cycler
Version: 0.12.1
Summary: Composable style cycles
Author-email: Thomas A Caswell <matplotlib-users@python.org>
License: Copyright (c) 2015, matplotlib project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the matplotlib project nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project-URL: homepage, https://matplotlib.org/cycler/
Project-URL: repository, https://github.com/matplotlib/cycler
Keywords: cycle kwargs
Classifier: License :: OSI Approved :: BSD License
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: docs
Requires-Dist: ipython ; extra == 'docs'
Requires-Dist: matplotlib ; extra == 'docs'
Requires-Dist: numpydoc ; extra == 'docs'
Requires-Dist: sphinx ; extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-cov ; extra == 'tests'
Requires-Dist: pytest-xdist ; extra == 'tests'
|PyPi|_ |Conda|_ |Supported Python versions|_ |GitHub Actions|_ |Codecov|_
.. |PyPi| image:: https://img.shields.io/pypi/v/cycler.svg?style=flat
.. _PyPi: https://pypi.python.org/pypi/cycler
.. |Conda| image:: https://img.shields.io/conda/v/conda-forge/cycler
.. _Conda: https://anaconda.org/conda-forge/cycler
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/cycler.svg
.. _Supported Python versions: https://pypi.python.org/pypi/cycler
.. |GitHub Actions| image:: https://github.com/matplotlib/cycler/actions/workflows/tests.yml/badge.svg
.. _GitHub Actions: https://github.com/matplotlib/cycler/actions
.. |Codecov| image:: https://codecov.io/github/matplotlib/cycler/badge.svg?branch=main&service=github
.. _Codecov: https://codecov.io/github/matplotlib/cycler?branch=main
cycler: composable cycles
=========================
Docs: https://matplotlib.org/cycler/
Binary file not shown.
@@ -1,3237 +0,0 @@
Metadata-Version: 2.1
Name: fonttools
Version: 4.48.1
Summary: Tools to manipulate font files
Home-page: http://github.com/fonttools/fonttools
Author: Just van Rossum
Author-email: just@letterror.com
Maintainer: Behdad Esfahbod
Maintainer-email: behdad@behdad.org
License: MIT
Platform: Any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: Fonts
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Requires-Python: >=3.8
License-File: LICENSE
Provides-Extra: all
Requires-Dist: fs <3,>=2.2.0 ; extra == 'all'
Requires-Dist: lxml >=4.0 ; extra == 'all'
Requires-Dist: zopfli >=0.1.4 ; extra == 'all'
Requires-Dist: lz4 >=1.7.4.2 ; extra == 'all'
Requires-Dist: pycairo ; extra == 'all'
Requires-Dist: matplotlib ; extra == 'all'
Requires-Dist: sympy ; extra == 'all'
Requires-Dist: skia-pathops >=0.5.0 ; extra == 'all'
Requires-Dist: uharfbuzz >=0.23.0 ; extra == 'all'
Requires-Dist: brotlicffi >=0.8.0 ; (platform_python_implementation != "CPython") and extra == 'all'
Requires-Dist: scipy ; (platform_python_implementation != "PyPy") and extra == 'all'
Requires-Dist: brotli >=1.0.1 ; (platform_python_implementation == "CPython") and extra == 'all'
Requires-Dist: munkres ; (platform_python_implementation == "PyPy") and extra == 'all'
Requires-Dist: unicodedata2 >=15.1.0 ; (python_version <= "3.12") and extra == 'all'
Requires-Dist: xattr ; (sys_platform == "darwin") and extra == 'all'
Provides-Extra: graphite
Requires-Dist: lz4 >=1.7.4.2 ; extra == 'graphite'
Provides-Extra: interpolatable
Requires-Dist: pycairo ; extra == 'interpolatable'
Requires-Dist: scipy ; (platform_python_implementation != "PyPy") and extra == 'interpolatable'
Requires-Dist: munkres ; (platform_python_implementation == "PyPy") and extra == 'interpolatable'
Provides-Extra: lxml
Requires-Dist: lxml >=4.0 ; extra == 'lxml'
Provides-Extra: pathops
Requires-Dist: skia-pathops >=0.5.0 ; extra == 'pathops'
Provides-Extra: plot
Requires-Dist: matplotlib ; extra == 'plot'
Provides-Extra: repacker
Requires-Dist: uharfbuzz >=0.23.0 ; extra == 'repacker'
Provides-Extra: symfont
Requires-Dist: sympy ; extra == 'symfont'
Provides-Extra: type1
Requires-Dist: xattr ; (sys_platform == "darwin") and extra == 'type1'
Provides-Extra: ufo
Requires-Dist: fs <3,>=2.2.0 ; extra == 'ufo'
Provides-Extra: unicode
Requires-Dist: unicodedata2 >=15.1.0 ; (python_version <= "3.12") and extra == 'unicode'
Provides-Extra: woff
Requires-Dist: zopfli >=0.1.4 ; extra == 'woff'
Requires-Dist: brotlicffi >=0.8.0 ; (platform_python_implementation != "CPython") and extra == 'woff'
Requires-Dist: brotli >=1.0.1 ; (platform_python_implementation == "CPython") and extra == 'woff'
|CI Build Status| |Coverage Status| |PyPI| |Gitter Chat|
What is this?
~~~~~~~~~~~~~
| fontTools is a library for manipulating fonts, written in Python. The
project includes the TTX tool, that can convert TrueType and OpenType
fonts to and from an XML text format, which is also called TTX. It
supports TrueType, OpenType, AFM and to an extent Type 1 and some
Mac-specific formats. The project has an `MIT open-source
licence <LICENSE>`__.
| Among other things this means you can use it free of charge.
`User documentation <https://fonttools.readthedocs.io/en/latest/>`_ and
`developer documentation <https://fonttools.readthedocs.io/en/latest/developer.html>`_
are available at `Read the Docs <https://fonttools.readthedocs.io/>`_.
Installation
~~~~~~~~~~~~
FontTools requires `Python <http://www.python.org/download/>`__ 3.8
or later. We try to follow the same schedule of minimum Python version support as
NumPy (see `NEP 29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`__).
The package is listed in the Python Package Index (PyPI), so you can
install it with `pip <https://pip.pypa.io>`__:
.. code:: sh
pip install fonttools
If you would like to contribute to its development, you can clone the
repository from GitHub, install the package in 'editable' mode and
modify the source code in place. We recommend creating a virtual
environment, using `virtualenv <https://virtualenv.pypa.io>`__ or
Python 3 `venv <https://docs.python.org/3/library/venv.html>`__ module.
.. code:: sh
# download the source code to 'fonttools' folder
git clone https://github.com/fonttools/fonttools.git
cd fonttools
# create new virtual environment called e.g. 'fonttools-venv', or anything you like
python -m virtualenv fonttools-venv
# source the `activate` shell script to enter the environment (Unix-like); to exit, just type `deactivate`
. fonttools-venv/bin/activate
# to activate the virtual environment in Windows `cmd.exe`, do
fonttools-venv\Scripts\activate.bat
# install in 'editable' mode
pip install -e .
Optional Requirements
---------------------
The ``fontTools`` package currently has no (required) external dependencies
besides the modules included in the Python Standard Library.
However, a few extra dependencies are required by some of its modules, which
are needed to unlock optional features.
The ``fonttools`` PyPI distribution also supports so-called "extras", i.e. a
set of keywords that describe a group of additional dependencies, which can be
used when installing via pip, or when specifying a requirement.
For example:
.. code:: sh
pip install fonttools[ufo,lxml,woff,unicode]
This command will install fonttools, as well as the optional dependencies that
are required to unlock the extra features named "ufo", etc.
- ``Lib/fontTools/misc/etree.py``
The module exports a ElementTree-like API for reading/writing XML files, and
allows to use as the backend either the built-in ``xml.etree`` module or
`lxml <https://lxml.de>`__. The latter is preferred whenever present,
as it is generally faster and more secure.
*Extra:* ``lxml``
- ``Lib/fontTools/ufoLib``
Package for reading and writing UFO source files; it requires:
* `fs <https://pypi.org/pypi/fs>`__: (aka ``pyfilesystem2``) filesystem
abstraction layer.
* `enum34 <https://pypi.org/pypi/enum34>`__: backport for the built-in ``enum``
module (only required on Python < 3.4).
*Extra:* ``ufo``
- ``Lib/fontTools/ttLib/woff2.py``
Module to compress/decompress WOFF 2.0 web fonts; it requires:
* `brotli <https://pypi.python.org/pypi/Brotli>`__: Python bindings of
the Brotli compression library.
*Extra:* ``woff``
- ``Lib/fontTools/ttLib/sfnt.py``
To better compress WOFF 1.0 web fonts, the following module can be used
instead of the built-in ``zlib`` library:
* `zopfli <https://pypi.python.org/pypi/zopfli>`__: Python bindings of
the Zopfli compression library.
*Extra:* ``woff``
- ``Lib/fontTools/unicode.py``
To display the Unicode character names when dumping the ``cmap`` table
with ``ttx`` we use the ``unicodedata`` module in the Standard Library.
The version included in there varies between different Python versions.
To use the latest available data, you can install:
* `unicodedata2 <https://pypi.python.org/pypi/unicodedata2>`__:
``unicodedata`` backport for Python 3.x updated to the latest Unicode
version 15.0.
*Extra:* ``unicode``
- ``Lib/fontTools/varLib/interpolatable.py``
Module for finding wrong contour/component order between different masters.
It requires one of the following packages in order to solve the so-called
"minimum weight perfect matching problem in bipartite graphs", or
the Assignment problem:
* `scipy <https://pypi.python.org/pypi/scipy>`__: the Scientific Library
for Python, which internally uses `NumPy <https://pypi.python.org/pypi/numpy>`__
arrays and hence is very fast;
* `munkres <https://pypi.python.org/pypi/munkres>`__: a pure-Python
module that implements the Hungarian or Kuhn-Munkres algorithm.
To plot the results to a PDF or HTML format, you also need to install:
* `pycairo <https://pypi.org/project/pycairo/>`__: Python bindings for the
Cairo graphics library. Note that wheels are currently only available for
Windows, for other platforms see pycairo's `installation instructions
<https://pycairo.readthedocs.io/en/latest/getting_started.html>`__.
*Extra:* ``interpolatable``
- ``Lib/fontTools/varLib/plot.py``
Module for visualizing DesignSpaceDocument and resulting VariationModel.
* `matplotlib <https://pypi.org/pypi/matplotlib>`__: 2D plotting library.
*Extra:* ``plot``
- ``Lib/fontTools/misc/symfont.py``
Advanced module for symbolic font statistics analysis; it requires:
* `sympy <https://pypi.python.org/pypi/sympy>`__: the Python library for
symbolic mathematics.
*Extra:* ``symfont``
- ``Lib/fontTools/t1Lib.py``
To get the file creator and type of Macintosh PostScript Type 1 fonts
on Python 3 you need to install the following module, as the old ``MacOS``
module is no longer included in Mac Python:
* `xattr <https://pypi.python.org/pypi/xattr>`__: Python wrapper for
extended filesystem attributes (macOS platform only).
*Extra:* ``type1``
- ``Lib/fontTools/ttLib/removeOverlaps.py``
Simplify TrueType glyphs by merging overlapping contours and components.
* `skia-pathops <https://pypi.python.org/pypy/skia-pathops>`__: Python
bindings for the Skia library's PathOps module, performing boolean
operations on paths (union, intersection, etc.).
*Extra:* ``pathops``
- ``Lib/fontTools/pens/cocoaPen.py`` and ``Lib/fontTools/pens/quartzPen.py``
Pens for drawing glyphs with Cocoa ``NSBezierPath`` or ``CGPath`` require:
* `PyObjC <https://pypi.python.org/pypi/pyobjc>`__: the bridge between
Python and the Objective-C runtime (macOS platform only).
- ``Lib/fontTools/pens/qtPen.py``
Pen for drawing glyphs with Qt's ``QPainterPath``, requires:
* `PyQt5 <https://pypi.python.org/pypi/PyQt5>`__: Python bindings for
the Qt cross platform UI and application toolkit.
- ``Lib/fontTools/pens/reportLabPen.py``
Pen to drawing glyphs as PNG images, requires:
* `reportlab <https://pypi.python.org/pypi/reportlab>`__: Python toolkit
for generating PDFs and graphics.
- ``Lib/fontTools/pens/freetypePen.py``
Pen to drawing glyphs with FreeType as raster images, requires:
* `freetype-py <https://pypi.python.org/pypi/freetype-py>`__: Python binding
for the FreeType library.
- ``Lib/fontTools/ttLib/tables/otBase.py``
Use the Harfbuzz library to serialize GPOS/GSUB using ``hb_repack`` method, requires:
* `uharfbuzz <https://pypi.python.org/pypi/uharfbuzz>`__: Streamlined Cython
bindings for the harfbuzz shaping engine
*Extra:* ``repacker``
How to make a new release
~~~~~~~~~~~~~~~~~~~~~~~~~
1) Update ``NEWS.rst`` with all the changes since the last release. Write a
changelog entry for each PR, with one or two short sentences summarizing it,
as well as links to the PR and relevant issues addressed by the PR. Do not
put a new title, the next command will do it for you.
2) Use semantic versioning to decide whether the new release will be a 'major',
'minor' or 'patch' release. It's usually one of the latter two, depending on
whether new backward compatible APIs were added, or simply some bugs were fixed.
3) Run ``python setup.py release`` command from the tip of the ``main`` branch.
By default this bumps the third or 'patch' digit only, unless you pass ``--major``
or ``--minor`` to bump respectively the first or second digit.
This bumps the package version string, extracts the changes since the latest
version from ``NEWS.rst``, and uses that text to create an annotated git tag
(or a signed git tag if you pass the ``--sign`` option and your git and Github
account are configured for `signing commits <https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/signing-commits>`__
using a GPG key).
It also commits an additional version bump which opens the main branch for
the subsequent developmental cycle
4) Push both the tag and commit to the upstream repository, by running the command
``git push --follow-tags``. Note: it may push other local tags as well, be
careful.
5) Let the CI build the wheel and source distribution packages and verify both
get uploaded to the Python Package Index (PyPI).
6) [Optional] Go to fonttools `Github Releases <https://github.com/fonttools/fonttools/releases>`__
page and create a new release, copy-pasting the content of the git tag
message. This way, the release notes are nicely formatted as markdown, and
users watching the repo will get an email notification. One day we shall
automate that too.
Acknowledgements
~~~~~~~~~~~~~~~~
In alphabetical order:
aschmitz, Olivier Berten, Samyak Bhuta, Erik van Blokland, Petr van Blokland,
Jelle Bosma, Sascha Brawer, Tom Byrer, Antonio Cavedoni, Frédéric Coiffier,
Vincent Connare, David Corbett, Simon Cozens, Dave Crossland, Simon Daniels,
Peter Dekkers, Behdad Esfahbod, Behnam Esfahbod, Hannes Famira, Sam Fishman,
Matt Fontaine, Takaaki Fuji, Rob Hagemans, Yannis Haralambous, Greg Hitchcock,
Jeremie Hornus, Khaled Hosny, John Hudson, Denis Moyogo Jacquerye, Jack Jansen,
Tom Kacvinsky, Jens Kutilek, Antoine Leca, Werner Lemberg, Tal Leming, Peter
Lofting, Cosimo Lupo, Olli Meier, Masaya Nakamura, Dave Opstad, Laurence Penney,
Roozbeh Pournader, Garret Rieger, Read Roberts, Colin Rofls, Guido van Rossum,
Just van Rossum, Andreas Seidel, Georg Seifert, Chris Simpkins, Miguel Sousa,
Adam Twardoch, Adrien Tétar, Vitaly Volkov, Paul Wise.
Copyrights
~~~~~~~~~~
| Copyright (c) 1999-2004 Just van Rossum, LettError
(just@letterror.com)
| See `LICENSE <LICENSE>`__ for the full license.
Copyright (c) 2000 BeOpen.com. All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All
Rights Reserved.
Have fun!
.. |CI Build Status| image:: https://github.com/fonttools/fonttools/workflows/Test/badge.svg
:target: https://github.com/fonttools/fonttools/actions?query=workflow%3ATest
.. |Coverage Status| image:: https://codecov.io/gh/fonttools/fonttools/branch/main/graph/badge.svg
:target: https://codecov.io/gh/fonttools/fonttools
.. |PyPI| image:: https://img.shields.io/pypi/v/fonttools.svg
:target: https://pypi.org/project/FontTools
.. |Gitter Chat| image:: https://badges.gitter.im/fonttools-dev/Lobby.svg
:alt: Join the chat at https://gitter.im/fonttools-dev/Lobby
:target: https://gitter.im/fonttools-dev/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
Changelog
~~~~~~~~~
4.48.1 (released 2024-02-06)
----------------------------
- Fixed uploading wheels to PyPI, no code changes since v4.48.0.
4.48.0 (released 2024-02-06)
----------------------------
- [varLib] Do not log when there are no OTL tables to be merged.
- [setup.py] Do not restrict lxml<5 any more, tests pass just fine with lxml>=5.
- [feaLib] Remove glyph and class names length restrictions in FEA (#3424).
- [roundingPens] Added ``transformRoundFunc`` parameter to the rounding pens to allow
for custom rounding of the components' transforms (#3426).
- [feaLib] Keep declaration order of ligature components within a ligature set, instead
of sorting by glyph name (#3429).
- [feaLib] Fixed ordering of alternates in ``aalt`` lookups, following the declaration
order of feature references within the ``aalt`` feature block (#3430).
- [varLib.instancer] Fixed a bug in the instancer's IUP optimization (#3432).
- [sbix] Support sbix glyphs with new graphicType "flip" (#3433).
- [svgPathPen] Added ``--glyphs`` option to dump the SVG paths for the named glyphs
in the font (0572f78).
- [designspaceLib] Added "description" attribute to ``<mappings>`` and ``<mapping>``
elements, and allow multiple ``<mappings>`` elements to group ``<mapping>`` elements
that are logically related (#3435, #3437).
- [otlLib] Correctly choose the most compact GSUB contextual lookup format (#3439).
4.47.2 (released 2024-01-11)
----------------------------
Minor release to fix uploading wheels to PyPI.
4.47.1 (released 2024-01-11)
----------------------------
- [merge] Improve help message and add standard command line options (#3408)
- [otlLib] Pass ``ttFont`` to ``name.addName`` in ``buildStatTable`` (#3406)
- [featureVars] Re-use ``FeatureVariationRecord``'s when possible (#3413)
4.47.0 (released 2023-12-18)
----------------------------
- [varLib.models] New API for VariationModel: ``getMasterScalars`` and
``interpolateFromValuesAndScalars``.
- [varLib.interpolatable] Various bugfixes and rendering improvements. In particular,
add a Summary page in the front, and an Index and Table-of-Contents in the back.
Change the page size to Letter.
- [Docs/designspaceLib] Defined a new ``public.fontInfo`` lib key, not used anywhere yet (#3358).
4.46.0 (released 2023-12-02)
----------------------------
- [featureVars] Allow to register the same set of substitution rules to multiple features.
The ``addFeatureVariations`` function can now take a list of featureTags; similarly, the
lib key 'com.github.fonttools.varLib.featureVarsFeatureTag' can now take a
comma-separateed string of feature tags (e.g. "salt,ss01") instead of a single tag (#3360).
- [featureVars] Don't overwrite GSUB FeatureVariations, but append new records to it
for features which are not already there. But raise ``VarLibError`` if the feature tag
already has feature variations associated with it (#3363).
- [varLib] Added ``addGSUBFeatureVariations`` function to add GSUB Feature Variations
to an existing variable font from rules defined in a DesignSpace document (#3362).
- [varLib.interpolatable] Various bugfixes and rendering improvements. In particular,
a new test for "underweight" glyphs. The new test reports quite a few false-positives
though. Please send feedback.
4.45.1 (released 2023-11-23)
----------------------------
- [varLib.interpolatable] Various bugfixes and improvements, better reporting, reduced
false positives.
- [ttGlyphSet] Added option to not recalculate glyf bounds (#3348).
4.45.0 (released 2023-11-20)
----------------------------
- [varLib.interpolatable] Vastly improved algorithms. Also available now is ``--pdf``
and ``--html`` options to generate a PDF or HTML report of the interpolation issues.
The PDF/HTML report showcases the problematic masters, the interpolated broken
glyph, as well as the proposed fixed version.
4.44.3 (released 2023-11-15)
----------------------------
- [subset] Only prune codepage ranges for OS/2.version >= 1, ignore otherwise (#3334).
- [instancer] Ensure hhea vertical metrics stay in sync with OS/2 ones after instancing
MVAR table containing 'hasc', 'hdsc' or 'hlgp' tags (#3297).
4.44.2 (released 2023-11-14)
----------------------------
- [glyf] Have ``Glyph.recalcBounds`` skip empty components (base glyph with no contours)
when computing the bounding box of composite glyphs. This simply restores the existing
behavior before some changes were introduced in fonttools 4.44.0 (#3333).
4.44.1 (released 2023-11-14)
----------------------------
- [feaLib] Ensure variable mark anchors are deep-copied while building since they
get modified in-place and later reused (#3330).
- [OS/2|subset] Added method to ``recalcCodePageRanges`` to OS/2 table class; added
``--prune-codepage-ranges`` to `fonttools subset` command (#3328, #2607).
4.44.0 (released 2023-11-03)
----------------------------
- [instancer] Recalc OS/2 AvgCharWidth after instancing if default changes (#3317).
- [otlLib] Make ClassDefBuilder class order match varLib.merger's, i.e. large
classes first, then glyph lexicographic order (#3321, #3324).
- [instancer] Allow not specifying any of min:default:max values and let be filled
up with fvar's values (#3322, #3323).
- [instancer] When running --update-name-table ignore axes that have no STAT axis
values (#3318, #3319).
- [Debg] When dumping to ttx, write the embedded JSON as multi-line string with
indentation (92cbfee0d).
- [varStore] Handle > 65535 items per encoding by splitting VarData subtable (#3310).
- [subset] Handle null-offsets in MarkLigPos subtables.
- [subset] Keep East Asian spacing fatures vhal, halt, chws, vchw by default (#3305).
- [instancer.solver] Fixed case where axisDef < lower and upper < axisMax (#3304).
- [glyf] Speed up compilation, mostly around ``recalcBounds`` (#3301).
- [varLib.interpolatable] Speed it up when working on variable fonts, plus various
micro-optimizations (#3300).
- Require unicodedata2 >= 15.1.0 when installed with 'unicode' extra, contains UCD 15.1.
4.43.1 (released 2023-10-06)
----------------------------
- [EBDT] Fixed TypeError exception in `_reverseBytes` method triggered when dumping
some bitmap fonts with `ttx -z bitwise` option (#3162).
- [v/hhea] Fixed UnboundLocalError exception in ``recalc`` method when no vmtx or hmtx
tables are present (#3290).
- [bezierTools] Fixed incorrectly typed cython local variable leading to TypeError when
calling ``calcQuadraticArcLength`` (#3288).
- [feaLib/otlLib] Better error message when building Coverage table with missing glyph (#3286).
4.43.0 (released 2023-09-29)
----------------------------
- [subset] Set up lxml ``XMLParser(resolve_entities=False)`` when parsing OT-SVG documents
to prevent XML External Entity (XXE) attacks (9f61271dc):
https://codeql.github.com/codeql-query-help/python/py-xxe/
- [varLib.iup] Added workaround for a Cython bug in ``iup_delta_optimize`` that was
leading to IUP tolerance being incorrectly initialised, resulting in sub-optimal deltas
(60126435d, cython/cython#5732).
- [varLib] Added new command-line entry point ``fonttools varLib.avar`` to add an
``avar`` table to an existing VF from axes mappings in a .designspace file (0a3360e52).
- [instancer] Fixed bug whereby no longer used variation regions were not correctly pruned
after VarData optimization (#3268).
- Added support for Python 3.12 (#3283).
4.42.1 (released 2023-08-20)
----------------------------
- [t1Lib] Fixed several Type 1 issues (#3238, #3240).
- [otBase/packer] Allow sharing tables reached by different offset sizes (#3241, #3236).
- [varLib/merger] Fix Cursive attachment merging error when all anchors are NULL (#3248, #3247).
- [ttLib] Fixed warning when calling ``addMultilingualName`` and ``ttFont`` parameter was not
passed on to ``findMultilingualName`` (#3253).
4.42.0 (released 2023-08-02)
----------------------------
- [varLib] Use sentinel value 0xFFFF to mark a glyph advance in hmtx/vmtx as non
participating, allowing sparse masters to contain glyphs for variation purposes other
than {H,V}VAR (#3235).
- [varLib/cff] Treat empty glyphs in non-default masters as missing, thus not participating
in CFF2 delta computation, similarly to how varLib already treats them for gvar (#3234).
- Added varLib.avarPlanner script to deduce 'correct' avar v1 axis mappings based on
glyph average weights (#3223).
4.41.1 (released 2023-07-21)
----------------------------
- [subset] Fixed perf regression in v4.41.0 by making ``NameRecordVisitor`` only visit
tables that do contain nameID references (#3213, #3214).
- [varLib.instancer] Support instancing fonts containing null ConditionSet offsets in
FeatureVariationRecords (#3211, #3212).
- [statisticsPen] Report font glyph-average weight/width and font-wide slant.
- [fontBuilder] Fixed head.created date incorrectly set to 0 instead of the current
timestamp, regression introduced in v4.40.0 (#3210).
- [varLib.merger] Support sparse ``CursivePos`` masters (#3209).
4.41.0 (released 2023-07-12)
----------------------------
- [fontBuilder] Fixed bug in setupOS2 with default panose attribute incorrectly being
set to a dict instead of a Panose object (#3201).
- [name] Added method to ``removeUnusedNameRecords`` in the user range (#3185).
- [varLib.instancer] Fixed issue with L4 instancing (moving default) (#3179).
- [cffLib] Use latin1 so we can roundtrip non-ASCII in {Full,Font,Family}Name (#3202).
- [designspaceLib] Mark <source name="..."> as optional in docs (as it is in the code).
- [glyf-1] Fixed drawPoints() bug whereby last cubic segment becomes quadratic (#3189, #3190).
- [fontBuilder] Propagate the 'hidden' flag to the fvar Axis instance (#3184).
- [fontBuilder] Update setupAvar() to also support avar 2, fixing ``_add_avar()`` call
site (#3183).
- Added new ``voltLib.voltToFea`` submodule (originally Tiro Typeworks' "Volto") for
converting VOLT OpenType Layout sources to FEA format (#3164).
4.40.0 (released 2023-06-12)
----------------------------
- Published native binary wheels to PyPI for all the python minor versions and platform
and architectures currently supported that would benefit from this. They will include
precompiled Cython-accelerated modules (e.g. cu2qu) without requiring to compile them
from source. The pure-python wheel and source distribution will continue to be
published as always (pip will automatically chose them when no binary wheel is
available for the given platform, e.g. pypy). Use ``pip install --no-binary=fonttools fonttools``
to expliclity request pip to install from the pure-python source.
- [designspaceLib|varLib] Add initial support for specifying axis mappings and build
``avar2`` table from those (#3123).
- [feaLib] Support variable ligature caret position (#3130).
- [varLib|glyf] Added option to --drop-implied-oncurves; test for impliable oncurve
points either before or after rounding (#3146, #3147, #3155, #3156).
- [TTGlyphPointPen] Don't error with empty contours, simply ignore them (#3145).
- [sfnt] Fixed str vs bytes remnant of py3 transition in code dealing with de/compiling
WOFF metadata (#3129).
- [instancer-solver] Fixed bug when moving default instance with sparse masters (#3139, #3140).
- [feaLib] Simplify variable scalars that dont vary (#3132).
- [pens] Added filter pen that explicitly emits closing line when lastPt != movePt (#3100).
- [varStore] Improve optimize algorithm and better document the algorithm (#3124, #3127).
Added ``quantization`` option (#3126).
- Added CI workflow config file for building native binary wheels (#3121).
- [fontBuilder] Added glyphDataFormat=0 option; raise error when glyphs contain cubic
outlines but glyphDataFormat was not explicitly set to 1 (#3113, #3119).
- [subset] Prune emptied GDEF.MarkGlyphSetsDef and remap indices; ensure GDEF is
subsetted before GSUB and GPOS (#3114, #3118).
- [xmlReader] Fixed issue whereby DSIG table data was incorrectly parsed (#3115, #2614).
- [varLib/merger] Fixed merging of SinglePos with pos=0 (#3111, #3112).
- [feaLib] Demote "Feature has not been defined" error to a warning when building aalt
and referenced feature is empty (#3110).
- [feaLib] Dedupe multiple substitutions with classes (#3105).
4.39.4 (released 2023-05-10)
----------------------------
- [varLib.interpolatable] Allow for sparse masters (#3075)
- [merge] Handle differing default/nominalWidthX in CFF (#3070)
- [ttLib] Add missing main.py file to ttLib package (#3088)
- [ttx] Fix missing composite instructions in XML (#3092)
- [ttx] Fix split tables option to work on filenames containing '%' (#3096)
- [featureVars] Process lookups for features other than rvrn last (#3099)
- [feaLib] support multiple substitution with classes (#3103)
4.39.3 (released 2023-03-28)
----------------------------
- [sbix] Fixed TypeError when compiling empty glyphs whose imageData is None, regression
was introduced in v4.39 (#3059).
- [ttFont] Fixed AttributeError on python <= 3.10 when opening a TTFont from a tempfile
SpooledTemporaryFile, seekable method only added on python 3.11 (#3052).
4.39.2 (released 2023-03-16)
----------------------------
- [varLib] Fixed regression introduced in 4.39.1 whereby an incomplete 'STAT' table
would be built even though a DesignSpace v5 did contain 'STAT' definitions (#3045, #3046).
4.39.1 (released 2023-03-16)
----------------------------
- [avar2] Added experimental support for reading/writing avar version 2 as specified in
this draft proposal: https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2.md
- [glifLib] Wrap underlying XML library exceptions with GlifLibError when parsing GLIFs,
and also print the name and path of the glyph that fails to be parsed (#3042).
- [feaLib] Consult avar for normalizing user-space values in ConditionSets and in
VariableScalars (#3042, #3043).
- [ttProgram] Handle string input to Program.fromAssembly() (#3038).
- [otlLib] Added a config option to emit GPOS 7 lookups, currently disabled by default
because of a macOS bug (#3034).
- [COLRv1] Added method to automatically compute ClipBoxes (#3027).
- [ttFont] Fixed getGlyphID to raise KeyError on missing glyphs instead of returning
None. The regression was introduced in v4.27.0 (#3032).
- [sbix] Fixed UnboundLocalError: cannot access local variable 'rawdata' (#3031).
- [varLib] When building VF, do not overwrite a pre-existing ``STAT`` table that was built
with feaLib from FEA feature file. Also, added support for building multiple VFs
defined in Designspace v5 from ``fonttools varLib`` script (#3024).
- [mtiLib] Only add ``Debg`` table with lookup names when ``FONTTOOLS_LOOKUP_DEBUGGING``
env variable is set (#3023).
4.39.0 (released 2023-03-06)
----------------------------
- [mtiLib] Optionally add `Debg` debug info for MTI feature builds (#3018).
- [ttx] Support reading input file from standard input using special `-` character,
similar to existing `-o -` option to write output to standard output (#3020).
- [cython] Prevent ``cython.compiled`` raise AttributeError if cython not installed
properly (#3017).
- [OS/2] Guard against ZeroDivisionError when calculating xAvgCharWidth in the unlikely
scenario no glyph has non-zero advance (#3015).
- [subset] Recompute xAvgCharWidth independently of --no-prune-unicode-ranges,
previously the two options were involuntarily bundled together (#3012).
- [fontBuilder] Add ``debug`` parameter to addOpenTypeFeatures method to add source
debugging information to the font in the ``Debg`` private table (#3008).
- [name] Make NameRecord `__lt__` comparison not fail on Unicode encoding errors (#3006).
- [featureVars] Fixed bug in ``overlayBox`` (#3003, #3005).
- [glyf] Added experimental support for cubic bezier curves in TrueType glyf table, as
outlined in glyf v1 proposal (#2988):
https://github.com/harfbuzz/boring-expansion-spec/blob/main/glyf1-cubicOutlines.md
- Added new qu2cu module and related qu2cuPen, the reverse of cu2qu for converting
TrueType quadratic splines to cubic bezier curves (#2993).
- [glyf] Added experimental support for reading and writing Variable Composites/Components
as defined in glyf v1 spec proposal (#2958):
https://github.com/harfbuzz/boring-expansion-spec/blob/main/glyf1-varComposites.md.
- [pens]: Added `addVarComponent` method to pen protocols' base classes, which pens can implement
to handle varcomponents (by default they get decomposed) (#2958).
- [misc.transform] Added DecomposedTransform class which implements an affine transformation
with separate translate, rotation, scale, skew, and transformation-center components (#2598)
- [sbix] Ensure Glyph.referenceGlyphName is set; fixes error after dumping and
re-compiling sbix table with 'dupe' glyphs (#2984).
- [feaLib] Be cleverer when merging chained single substitutions into same lookup
when they are specified using the inline notation (#2150, #2974).
- [instancer] Clamp user-inputted axis ranges to those of fvar (#2959).
- [otBase/subset] Define ``__getstate__`` for BaseTable so that a copied/pickled 'lazy'
object gets its own OTTableReader to read from; incidentally fixes a bug while
subsetting COLRv1 table containing ClipBoxes on python 3.11 (#2965, #2968).
- [sbix] Handle glyphs with "dupe" graphic type on compile correctly (#2963).
- [glyf] ``endPointsOfContours`` field should be unsigned! Kudos to behdad for
spotting one of the oldest bugs in FT. Probably nobody has ever dared to make
glyphs with more than 32767 points... (#2957).
- [feaLib] Fixed handling of ``ignore`` statements with unmarked glyphs to match
makeotf behavior, which assumes the first glyph is marked (#2950).
- Reformatted code with ``black`` and enforce new code style via CI check (#2925).
- [feaLib] Sort name table entries following OT spec prescribed order in the builder (#2927).
- [cu2quPen] Add Cu2QuMultiPen that converts multiple outlines at a time in
interpolation compatible way; its methods take a list of tuples arguments
that would normally be passed to individual segment pens, and at the end it
dispatches the converted outlines to each pen (#2912).
- [reverseContourPen/ttGlyphPen] Add outputImpliedClosingLine option (#2913, #2914,
#2921, #2922, #2995).
- [gvar] Avoid expanding all glyphs unnecessarily upon compile (#2918).
- [scaleUpem] Fixed bug whereby CFF2 vsindex was scaled; it should not (#2893, #2894).
- [designspaceLib] Add DS.getAxisByTag and refactor getAxis (#2891).
- [unicodedata] map Zmth<->math in ot_tag_{to,from}_script (#1737, #2889).
- [woff2] Support encoding/decoding OVERLAP_SIMPLE glyf flags (#2576, #2884).
- [instancer] Update OS/2 class and post.italicAngle when default moved (L4)
- Dropped support for Python 3.7 which reached EOL, fontTools requires 3.8+.
- [instancer] Fixed instantiateFeatureVariations logic when a rule range becomes
default-applicable (#2737, #2880).
- [ttLib] Add main to ttFont and ttCollection that just decompile and re-compile the
input font (#2869).
- [featureVars] Insert 'rvrn' lookup at the beginning of LookupList, to work around bug
in Apple implementation of 'rvrn' feature which the spec says it should be processed
early whereas on macOS 10.15 it follows lookup order (#2140, #2867).
- [instancer/mutator] Remove 'DSIG' table if present.
- [svgPathPen] Don't close path in endPath(), assume open unless closePath() (#2089, #2865).
4.38.0 (released 2022-10-21)
----------------------------
- [varLib.instancer] Added support for L4 instancing, i.e. moving the default value of
an axis while keeping it variable. Thanks Behdad! (#2728, #2861).
It's now also possible to restrict an axis min/max values beyond the current default
value, e.g. a font wght has min=100, def=400, max=900 and you want a partial VF that
only varies between 500 and 700, you can now do that.
You can either specify two min/max values (wght=500:700), and the new default will be
set to either the minimum or maximum, depending on which one is closer to the current
default (e.g. 500 in this case). Or you can specify three values (e.g. wght=500:600:700)
to specify the new default value explicitly.
- [otlLib/featureVars] Set a few Count values so one doesn't need to compile the font
to update them (#2860).
- [varLib.models] Make extrapolation work for 2-master models as well where one master
is at the default location (#2843, #2846).
Add optional extrapolate=False to normalizeLocation() (#2847, #2849).
- [varLib.cff] Fixed sub-optimal packing of CFF2 deltas by no longer rounding them to
integer (#2838).
- [scaleUpem] Calculate numShorts in VarData after scale; handle CFF hintmasks (#2840).
4.37.4 (released 2022-09-30)
----------------------------
- [subset] Keep nameIDs used by CPAL palette entry labels (#2837).
- [varLib] Avoid negative hmtx values when creating font from variable CFF2 font (#2827).
- [instancer] Don't prune stat.ElidedFallbackNameID (#2828).
- [unicodedata] Update Scripts/Blocks to Unicode 15.0 (#2833).
4.37.3 (released 2022-09-20)
----------------------------
- Fix arguments in calls to (glyf) glyph.draw() and drawPoints(), whereby offset wasn't
correctly passed down; this fix also exposed a second bug, where lsb and tsb were not
set (#2824, #2825, adobe-type-tools/afdko#1560).
4.37.2 (released 2022-09-15)
----------------------------
- [subset] Keep CPAL table and don't attempt to prune unused color indices if OT-SVG
table is present even if COLR table was subsetted away; OT-SVG may be referencing the
CPAL table; for now we assume that's the case (#2814, #2815).
- [varLib.instancer] Downgrade GPOS/GSUB version if there are no more FeatureVariations
after instancing (#2812).
- [subset] Added ``--no-lazy`` to optionally load fonts eagerly (mostly to ease
debugging of table lazy loading, no practical effects) (#2807).
- [varLib] Avoid building empty COLR.DeltaSetIndexMap with only identity mappings (#2803).
- [feaLib] Allow multiple value record types (by promoting to the most general format)
within the same PairPos subtable; e.g. this allows variable and non variable kerning
rules to share the same subtable. This also fixes a bug whereby some kerning pairs
would become unreachable while shapiong because of premature subtable splitting (#2772, #2776).
- [feaLib] Speed up ``VarScalar`` by caching models for recurring master locations (#2798).
- [feaLib] Optionally cythonize ``feaLib.lexer``, speeds up parsing FEA a bit (#2799).
- [designspaceLib] Avoid crash when handling unbounded rule conditions (#2797).
- [post] Don't crash if ``post`` legacy format 1 is malformed/improperly used (#2786)
- [gvar] Don't be "lazy" (load all glyph variations up front) when TTFont.lazy=False (#2771).
- [TTFont] Added ``normalizeLocation`` method to normalize a location dict from the
font's defined axes space (also known as "user space") into the normalized (-1..+1)
space. It applies ``avar`` mapping if the font contains an ``avar`` table (#2789).
- [TTVarGlyphSet] Support drawing glyph instances from CFF2 variable glyph set (#2784).
- [fontBuilder] Do not error when building cmap if there are zero code points (#2785).
- [varLib.plot] Added ability to plot a variation model and set of accompaning master
values corresponding to the model's master locations into a pyplot figure (#2767).
- [Snippets] Added ``statShape.py`` script to draw statistical shape of a glyph as an
ellips (requires pycairo) (baecd88).
- [TTVarGlyphSet] implement drawPoints natively, avoiding going through
SegmentToPointPen (#2778).
- [TTVarGlyphSet] Fixed bug whereby drawing a composite glyph multiple times, its
components would shif; needed an extra copy (#2774).
4.37.1 (released 2022-08-24)
----------------------------
- [subset] Fixed regression introduced with v4.37.0 while subsetting the VarStore of
``HVAR`` and ``VVAR`` tables, whereby an ``AttributeError: subset_varidxes`` was
thrown because an apparently unused import statement (with the side-effect of
dynamically binding that ``subset_varidxes`` method to the VarStore class) had been
accidentally deleted in an unrelated PR (#2679, #2773).
- [pens] Added ``cairoPen`` (#2678).
- [gvar] Read ``gvar`` more lazily by not parsing all of the ``glyf`` table (#2771).
- [ttGlyphSet] Make ``drawPoints(pointPen)`` method work for CFF fonts as well via
adapter pen (#2770).
4.37.0 (released 2022-08-23)
----------------------------
- [varLib.models] Reverted PR #2717 which added support for "narrow tents" in v4.36.0,
as it introduced a regression (#2764, #2765). It will be restored in upcoming release
once we found a solution to the bug.
- [cff.specializer] Fixed issue in charstring generalizer with the ``blend`` operator
(#2750, #1975).
- [varLib.models] Added support for extrapolation (#2757).
- [ttGlyphSet] Ensure the newly added ``_TTVarGlyphSet`` inherits from ``_TTGlyphSet``
to keep backward compatibility with existing API (#2762).
- [kern] Allow compiling legacy kern tables with more than 64k entries (d21cfdede).
- [visitor] Added new visitor API to traverse tree of objects and dispatch based
on the attribute type: cf. ``fontTools.misc.visitor`` and ``fontTools.ttLib.ttVisitor``. Added ``fontTools.ttLib.scaleUpem`` module that uses the latter to
change a font's units-per-em and scale all the related fields accordingly (#2718,
#2755).
4.36.0 (released 2022-08-17)
----------------------------
- [varLib.models] Use a simpler model that generates narrower "tents" (regions, master
supports) whenever possible: specifically when any two axes that actively "cooperate"
(have masters at non-zero positions for both axes) have a complete set of intermediates.
The simpler algorithm produces fewer overlapping regions and behaves better with
respect to rounding at the peak positions than the generic solver, always matching
intermediate masters exactly, instead of maximally 0.5 units off. This may be useful
when 100% metrics compatibility is desired (#2218, #2717).
- [feaLib] Remove warning when about ``GDEF`` not being built when explicitly not
requested; don't build one unconditonally even when not requested (#2744, also works
around #2747).
- [ttFont] ``TTFont.getGlyphSet`` method now supports selecting a location that
represents an instance of a variable font (supports both user-scale and normalized
axes coordinates via the ``normalized=False`` parameter). Currently this only works
for TrueType-flavored variable fonts (#2738).
4.35.0 (released 2022-08-15)
----------------------------
- [otData/otConverters] Added support for 'biased' PaintSweepGradient start/end angles
to match latest COLRv1 spec (#2743).
- [varLib.instancer] Fixed bug in ``_instantiateFeatureVariations`` when at the same
time pinning one axis and restricting the range of a subsequent axis; the wrong axis
tag was being used in the latter step (as the records' axisIdx was updated in the
preceding step but looked up using the old axes order in the following step) (#2733,
#2734).
- [mtiLib] Pad script tags with space when less than 4 char long (#1727).
- [merge] Use ``'.'`` instead of ``'#'`` in duplicate glyph names (#2742).
- [gvar] Added support for lazily loading glyph variations (#2741).
- [varLib] In ``build_many``, we forgot to pass on ``colr_layer_reuse`` parameter to
the ``build`` method (#2730).
- [svgPathPen] Add a main that prints SVG for input text (6df779fd).
- [cffLib.width] Fixed off-by-one in optimized values; previous code didn't match the
code block above it (2963fa50).
- [varLib.interpolatable] Support reading .designspace and .glyphs files (via optional
``glyphsLib``).
- Compile some modules with Cython when available and building/installing fonttools
from source: ``varLib.iup`` (35% faster), ``pens.momentsPen`` (makes
``varLib.interpolatable`` 3x faster).
- [feaLib] Allow features to be built for VF without also building a GDEF table (e.g.
only build GSUB); warn when GDEF would be needed but isn't requested (#2705, 2694).
- [otBase] Fixed ``AttributeError`` when uharfbuzz < 0.23.0 and 'repack' method is
missing (32aa8eaf). Use new ``uharfbuzz.repack_with_tag`` when available (since
uharfbuzz>=0.30.0), enables table-specific optimizations to be performed during
repacking (#2724).
- [statisticsPen] By default report all glyphs (4139d891). Avoid division-by-zero
(52b28f90).
- [feaLib] Added missing required argument to FeatureLibError exception (#2693)
- [varLib.merge] Fixed error during error reporting (#2689). Fixed undefined
``NotANone`` variable (#2714).
4.34.4 (released 2022-07-07)
----------------------------
- Fixed typo in varLib/merger.py that causes NameError merging COLR glyphs
containing more than 255 layers (#2685).
4.34.3 (released 2022-07-07)
----------------------------
- [designspaceLib] Don't make up bad PS names when no STAT data (#2684)
4.34.2 (released 2022-07-06)
----------------------------
- [varStore/subset] fixed KeyError exception to do with NO_VARIATION_INDEX while
subsetting varidxes in GPOS/GDEF (a08140d).
4.34.1 (released 2022-07-06)
----------------------------
- [instancer] When optimizing HVAR/VVAR VarStore, use_NO_VARIATION_INDEX=False to avoid
including NO_VARIATION_INDEX in AdvWidthMap, RsbMap, LsbMap mappings, which would
push the VarIdx width to maximum (4bytes), which is not desirable. This also fixes
a hard crash when attempting to subset a varfont after it had been partially instanced
with use_NO_VARIATION_INDEX=True.
4.34.0 (released 2022-07-06)
----------------------------
- [instancer] Set RIBBI bits in head and OS/2 table when cutting instances and the
subfamily nameID=2 contains strings like 'Italic' or 'Bold' (#2673).
- [otTraverse] Addded module containing methods for traversing trees of otData tables
(#2660).
- [otTables] Made DeltaSetIndexMap TTX dump less verbose by omitting no-op entries
(#2660).
- [colorLib.builder] Added option to disable PaintColrLayers's reuse of layers from
LayerList (#2660).
- [varLib] Added support for merging multiple master COLRv1 tables into a variable
COLR table (#2660, #2328). Base color glyphs of same name in different masters must have
identical paint graph structure (incl. number of layers, palette indices, number
of color line stops, corresponding paint formats at each level of the graph),
but can differ in the variable fields (e.g. PaintSolid.Alpha). PaintVar* tables
are produced when this happens and a VarStore/DeltaSetIndexMap is added to the
variable COLR table. It is possible for non-default masters to be 'sparse', i.e.
omit some of the color glyphs present in the default master.
- [feaLib] Let the Parser set nameIDs 1 through 6 that were previously reserved (#2675).
- [varLib.varStore] Support NO_VARIATION_INDEX in optimizer and instancer.
- [feaLib] Show all missing glyphs at once at end of parsing (#2665).
- [varLib.iup] Rewrite force-set conditions and limit DP loopback length (#2651).
For Noto Sans, IUP time drops from 23s down to 9s, with only a slight size increase
in the final font. This basically turns the algorithm from O(n^3) into O(n).
- [featureVars] Report about missing glyphs in substitution rules (#2654).
- [mutator/instancer] Added CLI flag to --no-recalc-timestamp (#2649).
- [SVG] Allow individual SVG documents in SVG OT table to be compressed on uncompressed,
and remember that when roundtripping to/from ttx. The SVG.docList is now a list
of SVGDocument namedtuple-like dataclass containing an extra ``compressed`` field,
and no longer a bare 3-tuple (#2645).
- [designspaceLib] Check for descriptor types with hasattr() to allow custom classes
that don't inherit the default descriptors (#2634).
- [subset] Enable sharing across subtables of extension lookups for harfbuzz packing
(#2626). Updated how table packing falls back to fontTools from harfbuzz (#2668).
- [subset] Updated default feature tags following current Harfbuzz (#2637).
- [svgLib] Fixed regex for real number to support e.g. 1e-4 in addition to 1.0e-4.
Support parsing negative rx, ry on arc commands (#2596, #2611).
- [subset] Fixed subsetting SinglePosFormat2 when ValueFormat=0 (#2603).
4.33.3 (released 2022-04-26)
----------------------------
- [designspaceLib] Fixed typo in ``deepcopyExceptFonts`` method, preventing font
references to be transferred (#2600). Fixed another typo in the name of ``Range``
dataclass's ``__post_init__`` magic method (#2597).
4.33.2 (released 2022-04-22)
----------------------------
- [otBase] Make logging less verbose when harfbuzz fails to serialize. Do not exit
at the first failure but continue attempting to fix offset overflow error using
the pure-python serializer even when the ``USE_HARFBUZZ_REPACKER`` option was
explicitly set to ``True``. This is normal with fonts with relatively large
tables, at least until hb.repack implements proper table splitting.
4.33.1 (released 2022-04-22)
----------------------------
- [otlLib] Put back the ``FONTTOOLS_GPOS_COMPACT_MODE`` environment variable to fix
regression in ufo2ft (and thus fontmake) introduced with v4.33.0 (#2592, #2593).
This is deprecated and will be removed one ufo2ft gets updated to use the new
config setup.
4.33.0 (released 2022-04-21)
----------------------------
- [OS/2 / merge] Automatically recalculate ``OS/2.xAvgCharWidth`` after merging
fonts with ``fontTools.merge`` (#2591, #2538).
- [misc/config] Added ``fontTools.misc.configTools`` module, a generic configuration
system (#2416, #2439).
Added ``fontTools.config`` module, a fontTools-specific configuration
system using ``configTools`` above.
Attached a ``Config`` object to ``TTFont``.
- [otlLib] Replaced environment variable for GPOS compression level with an
equivalent option using the new config system.
- [designspaceLib] Incremented format version to 5.0 (#2436).
Added discrete axes, variable fonts, STAT information, either design- or
user-space location on instances.
Added ``fontTools.designspaceLib.split`` module to split a designspace
into sub-spaces that interpolate and that represent the variable fonts
listed in the document.
Made instance names optional and allow computing them from STAT data instead.
Added ``fontTools.designspaceLib.statNames`` module.
Allow instances to have the same location as a previously defined STAT label.
Deprecated some attributes:
``SourceDescriptor``: ``copyLib``, ``copyInfo``, ``copyGroups``, ``copyFeatures``.
``InstanceDescriptor``: ``kerning``, ``info``; ``glyphs``: use rules or sparse
sources.
For both, ``location``: use the more explicit designLocation.
Note: all are soft deprecations and existing code should keep working.
Updated documentation for Python methods and the XML format.
- [varLib] Added ``build_many`` to build several variable fonts from a single
designspace document (#2436).
Added ``fontTools.varLib.stat`` module to build STAT tables from a designspace
document.
- [otBase] Try to use the Harfbuzz Repacker for packing GSUB/GPOS tables when
``uharfbuzz`` python bindings are available (#2552). Disable it by setting the
"fontTools.ttLib.tables.otBase:USE_HARFBUZZ_REPACKER" config option to ``False``.
If the option is set explicitly to ``True`` but ``uharfbuzz`` can't be imported
or fails to serialize for any reasons, an error will be raised (ImportError or
uharfbuzz errors).
- [CFF/T2] Ensure that ``pen.closePath()`` gets called for CFF2 charstrings (#2577).
Handle implicit CFF2 closePath within ``T2OutlineExtractor`` (#2580).
4.32.0 (released 2022-04-08)
----------------------------
- [otlLib] Disable GPOS7 optimization to work around bug in Apple CoreText.
Always force Chaining GPOS8 for now (#2540).
- [glifLib] Added ``outputImpliedClosingLine=False`` parameter to ``Glyph.draw()``,
to control behaviour of ``PointToSegmentPen`` (6b4e2e7).
- [varLib.interpolatable] Check for wrong contour starting point (#2571).
- [cffLib] Remove leftover ``GlobalState`` class and fix calls to ``TopDictIndex()``
(#2569, #2570).
- [instancer] Clear ``AxisValueArray`` if it is empty after instantiating (#2563).
4.31.2 (released 2022-03-22)
----------------------------
- [varLib] fix instantiation of GPOS SinglePos values (#2555).
4.31.1 (released 2022-03-18)
----------------------------
- [subset] fix subsetting OT-SVG when glyph id attribute is on the root ``<svg>``
element (#2553).
4.31.0 (released 2022-03-18)
----------------------------
- [ttCollection] Fixed 'ResourceWarning: unclosed file' warning (#2549).
- [varLib.merger] Handle merging SinglePos with valueformat=0 (#2550).
- [ttFont] Update glyf's glyphOrder when calling TTFont.setGlyphOrder() (#2544).
- [ttFont] Added ``ensureDecompiled`` method to load all tables irrespective
of the ``lazy`` attribute (#2551).
- [otBase] Added ``iterSubTable`` method to iterate over BaseTable's children of
type BaseTable; useful for traversing a tree of otTables (#2551).
4.30.0 (released 2022-03-10)
----------------------------
- [varLib] Added debug logger showing the glyph name for which ``gvar`` is built (#2542).
- [varLib.errors] Fixed undefined names in ``FoundANone`` and ``UnsupportedFormat``
exceptions (ac4d5611).
- [otlLib.builder] Added ``windowsNames`` and ``macNames`` (bool) parameters to the
``buildStatTabe`` function, so that one can select whether to only add one or both
of the two sets (#2528).
- [t1Lib] Added the ability to recreate PostScript stream (#2504).
- [name] Added ``getFirstDebugName``, ``getBest{Family,SubFamily,Full}Name`` methods (#2526).
4.29.1 (released 2022-02-01)
----------------------------
- [colorLib] Fixed rounding issue with radial gradient's start/end circles inside
one another (#2521).
- [freetypePen] Handle rotate/skew transform when auto-computing width/height of the
buffer; raise PenError wen missing moveTo (#2517)
4.29.0 (released 2022-01-24)
----------------------------
- [ufoLib] Fixed illegal characters and expanded reserved filenames (#2506).
- [COLRv1] Don't emit useless PaintColrLayers of lenght=1 in LayerListBuilder (#2513).
- [ttx] Removed legacy ``waitForKeyPress`` method on Windows (#2509).
- [pens] Added FreeTypePen that uses ``freetype-py`` and the pen protocol for
rasterizating outline paths (#2494).
- [unicodedata] Updated the script direction list to Unicode 14.0 (#2484).
Bumped unicodedata2 dependency to 14.0 (#2499).
- [psLib] Fixed type of ``fontName`` in ``suckfont`` (#2496).
4.28.5 (released 2021-12-19)
----------------------------
- [svgPathPen] Continuation of #2471: make sure all occurrences of ``str()`` are now
replaced with user-defined ``ntos`` callable.
- [merge] Refactored code into submodules, plus several bugfixes and improvements:
fixed duplicate-glyph-resolution GSUB-lookup generation code; use tolerance in glyph
comparison for empty glyph's width; ignore space of default ignorable glyphs;
downgrade duplicates-resolution missing-GSUB from assert to warn; added --drop-tables
option (#2473, #2475, #2476).
4.28.4 (released 2021-12-15)
----------------------------
- [merge] Merge GDEF marksets in Lookups properly (#2474).
- [feaLib] Have ``fontTools feaLib`` script exit with error code when build fails (#2459)
- [svgPathPen] Added ``ntos`` option to customize number formatting (e.g. rounding) (#2471).
- [subset] Speed up subsetting of large CFF fonts (#2467).
- [otTables] Speculatively promote lookups to extension to speed up compilation. If the
offset to lookup N is too big to fit in a ushort, the offset to lookup N+1 is going to
be too big as well, so we promote to extension all lookups from lookup N onwards (#2465).
4.28.3 (released 2021-12-03)
----------------------------
- [subset] Fixed bug while subsetting ``COLR`` table, whereby incomplete layer records
pointing to missing glyphs were being retained leading to ``struct.error`` upon
compiling. Make it so that ``glyf`` glyph closure, which follows the ``COLR`` glyph
closure, does not influence the ``COLR`` table subsetting (#2461, #2462).
- [docs] Fully document the ``cmap`` and ``glyf`` tables (#2454, #2457).
- [colorLib.unbuilder] Fixed CLI by deleting no longer existing parameter (180bb1867).
4.28.2 (released 2021-11-22)
----------------------------
- [otlLib] Remove duplicates when building coverage (#2433).
- [docs] Add interrogate configuration (#2443).
- [docs] Remove comment about missing “start” optional argument to ``calcChecksum`` (#2448).
- [cu2qu/cli] Adapt to the latest ufoLib2.
- [subset] Support subsetting SVG table and remove it from the list of drop by default tables (#534).
- [subset] add ``--pretty-svg`` option to pretty print SVG table contents (#2452).
- [merge] Support merging ``CFF`` tables (CID-keyed ``CFF`` is still not supported) (#2447).
- [merge] Support ``--output-file`` (#2447).
- [docs] Split table docs into individual pages (#2444).
- [feaLib] Forbid empty classes (#2446).
- [docs] Improve documentation for ``fontTools.ttLib.ttFont`` (#2442).
4.28.1 (released 2021-11-08)
----------------------------
- [subset] Fixed AttributeError while traversing a color glyph's Paint graph when there is no
LayerList, which is optional (#2441).
4.28.0 (released 2021-11-05)
----------------------------
- Dropped support for EOL Python 3.6, require Python 3.7 (#2417).
- [ufoLib/glifLib] Make filename-clash checks faster by using a set instead of a list (#2422).
- [subset] Don't crash if optional ClipList and LayerList are ``None`` (empty) (#2424, 2439).
- [OT-SVG] Removed support for old deprecated version 1 and embedded color palettes,
which were never officially part of the OpenType SVG spec. Upon compile, reuse offsets
to SVG documents that are identical (#2430).
- [feaLib] Added support for Variable Feature File syntax. This is experimental and subject
to change until it is finalized in the Adobe FEA spec (#2432).
- [unicodedata] Update Scripts/ScriptExtensions/Blocks to UnicodeData 14.0 (#2437).
4.27.1 (released 2021-09-23)
----------------------------
- [otlLib] Fixed error when chained contextual lookup builder overflows (#2404, #2411).
- [bezierTools] Fixed two floating-point bugs: one when computing `t` for a point
lying on an almost horizontal/vertical line; another when computing the intersection
point between a curve and a line (#2413).
4.27.0 (released 2021-09-14)
----------------------------
- [ttLib/otTables] Cleaned up virtual GID handling: allow virtual GIDs in ``Coverage``
and ``ClassDef`` readers; removed unused ``allowVID`` argument from ``TTFont``
constructor, and ``requireReal`` argument in ``TTFont.getGlyphID`` method.
Make ``TTFont.setGlyphOrder`` clear reverse glyphOrder map, and assume ``glyphOrder``
internal attribute is never modified outside setGlyphOrder; added ``TTFont.getGlyphNameMany``
and ``getGlyphIDMany`` (#1536, #1654, #2334, #2398).
- [py23] Dropped internal use of ``fontTools.py23`` module to fix deprecation warnings
in client code that imports from fontTools (#2234, #2399, #2400).
- [subset] Fix subsetting COLRv1 clip boxes when font is loaded lazily (#2408).
4.26.2 (released 2021-08-09)
----------------------------
- [otTables] Added missing ``CompositeMode.PLUS`` operator (#2390).
4.26.1 (released 2021-08-03)
----------------------------
- [transform] Added ``transformVector`` and ``transformVectors`` methods to the
``Transform`` class. Similar to ``transformPoint`` but ignore the translation
part (#2386).
4.26.0 (released 2021-08-03)
----------------------------
- [xmlWriter] Default to ``"\n"`` for ``newlinestr`` instead of platform-specific
``os.linesep`` (#2384).
- [otData] Define COLRv1 ClipList and ClipBox (#2379).
- [removeOverlaps/instancer] Added --ignore-overlap-errors option to work around
Skia PathOps.Simplify bug (#2382, #2363, google/fonts#3365).
- NOTE: This will be the last version to support Python 3.6. FontTools will require
Python 3.7 or above from the next release (#2350)
4.25.2 (released 2021-07-26)
----------------------------
- [COLRv1] Various changes to sync with the latest CORLv1 draft spec. In particular:
define COLR.VarIndexMap, remove/inline ColorIndex struct, add VarIndexBase to ``PaintVar*`` tables (#2372);
add reduced-precicion specialized transform Paints;
define Angle as fraction of half circle encoded as F2Dot14;
use FWORD (int16) for all Paint center coordinates;
change PaintTransform to have an offset to Affine2x3;
- [ttLib] when importing XML, only set sfntVersion if the font has no reader and is empty (#2376)
4.25.1 (released 2021-07-16)
----------------------------
- [ttGlyphPen] Fixed bug in ``TTGlyphPointPen``, whereby open contours (i.e. starting
with segmentType "move") would throw ``NotImplementedError``. They are now treated
as if they are closed, like with the ``TTGlyphPen`` (#2364, #2366).
4.25.0 (released 2021-07-05)
----------------------------
- [tfmLib] Added new library for parsing TeX Font Metric (TFM) files (#2354).
- [TupleVariation] Make shared tuples order deterministic on python < 3.7 where
Counter (subclass of dict) doesn't remember insertion order (#2351, #2353).
- [otData] Renamed COLRv1 structs to remove 'v1' suffix and match the updated draft
spec: 'LayerV1List' -> 'LayerList', 'BaseGlyphV1List' -> 'BaseGlyphList',
'BaseGlyphV1Record' -> 'BaseGlyphPaintRecord' (#2346).
Added 8 new ``PaintScale*`` tables: with/without centers, uniform vs non-uniform.
Added ``*AroundCenter`` variants to ``PaintRotate`` and ``PaintSkew``: the default
versions no longer have centerX/Y, but default to origin.
``PaintRotate``, ``PaintSkew`` and ``PaintComposite`` formats were re-numbered.
NOTE: these are breaking changes; clients using the experimental COLRv1 API will
have to be updated (#2348).
- [pointPens] Allow ``GuessSmoothPointPen`` to accept a tolerance. Fixed call to
``math.atan2`` with x/y parameters inverted. Sync the code with fontPens (#2344).
- [post] Fixed parsing ``post`` table format 2.0 when it contains extra garbage
at the end of the stringData array (#2314).
- [subset] drop empty features unless 'size' with FeatureParams table (#2324).
- [otlLib] Added ``otlLib.optimize`` module; added GPOS compaction algorithm.
The compaction can be run on existing fonts with ``fonttools otlLib.optimize``
or using the snippet ``compact_gpos.py``. There's experimental support for
compacting fonts at compilation time using an environment variable, but that
might be removed later (#2326).
4.24.4 (released 2021-05-25)
----------------------------
- [subset/instancer] Fixed ``AttributeError`` when instantiating a VF that
contains GPOS ValueRecords with ``Device`` tables but without the respective
non-Device values (e.g. ``XAdvDevice`` without ``XAdvance``). When not
explicitly set, the latter are assumed to be 0 (#2323).
4.24.3 (released 2021-05-20)
----------------------------
- [otTables] Fixed ``AttributeError`` in methods that split LigatureSubst,
MultipleSubst and AlternateSubst subtables when an offset overflow occurs.
The ``Format`` attribute was removed in v4.22.0 (#2319).
4.24.2 (released 2021-05-20)
----------------------------
- [ttGlyphPen] Fixed typing annotation of TTGlyphPen glyphSet parameter (#2315).
- Fixed two instances of DeprecationWarning: invalid escape sequence (#2311).
4.24.1 (released 2021-05-20)
----------------------------
- [subset] Fixed AttributeError when SinglePos subtable has None Value (ValueFormat 0)
(#2312, #2313).
4.24.0 (released 2021-05-17)
----------------------------
- [pens] Add ``ttGlyphPen.TTGlyphPointPen`` similar to ``TTGlyphPen`` (#2205).
4.23.1 (released 2021-05-14)
----------------------------
- [subset] Fix ``KeyError`` after subsetting ``COLR`` table that initially contains
both v0 and v1 color glyphs when the subset only requested v1 glyphs; we were
not pruning the v0 portion of the table (#2308).
- [colorLib] Set ``LayerV1List`` attribute to ``None`` when empty, it's optional
in CORLv1 (#2308).
4.23.0 (released 2021-05-13)
----------------------------
- [designspaceLib] Allow to use ``\\UNC`` absolute paths on Windows (#2299, #2306).
- [varLib.merger] Fixed bug where ``VarLibMergeError`` was raised with incorrect
parameters (#2300).
- [feaLib] Allow substituting a glyph class with ``NULL`` to delete multiple glyphs
(#2303).
- [glyf] Fixed ``NameError`` exception in ``getPhantomPoints`` (#2295, #2305).
- [removeOverlaps] Retry pathops.simplify after rounding path coordinates to integers
if it fails the first time using floats, to work around a rare and hard to debug
Skia bug (#2288).
- [varLib] Added support for building, reading, writing and optimizing 32-bit
``ItemVariationStore`` as used in COLRv1 table (#2285).
- [otBase/otConverters] Add array readers/writers for int types (#2285).
- [feaLib] Allow more than one lookahead glyph/class in contextual positioning with
"value at end" (#2293, #2294).
- [COLRv1] Default varIdx should be 0xFFFFFFFF (#2297, #2298).
- [pens] Make RecordingPointPen actually pass on identifiers; replace asserts with
explicit ``PenError`` exception (#2284).
- [mutator] Round lsb for CF2 fonts as well (#2286).
4.22.1 (released 2021-04-26)
----------------------------
- [feaLib] Skip references to named lookups if the lookup block definition
is empty, similarly to makeotf. This also fixes an ``AttributeError`` while
generating ``aalt`` feature (#2276, #2277).
- [subset] Fixed bug with ``--no-hinting`` implementation for Device tables (#2272,
#2275). The previous code was alwyas dropping Device tables if no-hinting was
requested, but some Device tables (DeltaFormat=0x8000) are also used to encode
variation indices and need to be retained.
- [otBase] Fixed bug in getting the ValueRecordSize when decompiling ``MVAR``
table with ``lazy=True`` (#2273, #2274).
- [varLib/glyf/gvar] Optimized and simplified ``GlyphCoordinates`` and
``TupleVariation`` classes, use ``bytearray`` where possible, refactored
phantom-points calculations. We measured about 30% speedup in total time
of loading master ttfs, building gvar, and saving (#2261, #2266).
- [subset] Fixed ``AssertionError`` while pruning unused CPAL palettes when
``0xFFFF`` is present (#2257, #2259).
4.22.0 (released 2021-04-01)
----------------------------
- [ttLib] Remove .Format from Coverage, ClassDef, SingleSubst, LigatureSubst,
AlternateSubst, MultipleSubst (#2238).
ATTENTION: This will change your TTX dumps!
- [misc.arrayTools] move Vector to its own submodule, and rewrite as a tuple
subclass (#2201).
- [docs] Added a terminology section for varLib (#2209).
- [varLib] Move rounding to VariationModel, to avoid error accumulation from
multiple deltas (#2214)
- [varLib] Explain merge errors in more human-friendly terms (#2223, #2226)
- [otlLib] Correct some documentation (#2225)
- [varLib/otlLib] Allow merging into VariationFont without first saving GPOS
PairPos2 (#2229)
- [subset] Improve PairPosFormat2 subsetting (#2221)
- [ttLib] TTFont.save: create file on disk as late as possible (#2253)
- [cffLib] Add missing CFF2 dict operators LanguageGroup and ExpansionFactor
(#2249)
ATTENTION: This will change your TTX dumps!
4.21.1 (released 2021-02-26)
----------------------------
- [pens] Reverted breaking change that turned ``AbstractPen`` and ``AbstractPointPen``
into abstract base classes (#2164, #2198).
4.21.0 (released 2021-02-26)
----------------------------
- [feaLib] Indent anchor statements in ``asFea()`` to make them more legible and
diff-able (#2193).
- [pens] Turn ``AbstractPen`` and ``AbstractPointPen`` into abstract base classes
(#2164).
- [feaLib] Added support for parsing and building ``STAT`` table from AFDKO feature
files (#2039).
- [instancer] Added option to update name table of generated instance using ``STAT``
table's axis values (#2189).
- [bezierTools] Added functions to compute bezier point-at-time, as well as line-line,
curve-line and curve-curve intersections (#2192).
4.20.0 (released 2021-02-15)
----------------------------
- [COLRv1] Added ``unbuildColrV1`` to deconstruct COLRv1 otTables to raw json-able
data structure; it does the reverse of ``buildColrV1`` (#2171).
- [feaLib] Allow ``sub X by NULL`` sequence to delete a glyph (#2170).
- [arrayTools] Fixed ``Vector`` division (#2173).
- [COLRv1] Define new ``PaintSweepGradient`` (#2172).
- [otTables] Moved ``Paint.Format`` enum class outside of ``Paint`` class definition,
now named ``PaintFormat``. It was clashing with paint instance ``Format`` attribute
and thus was breaking lazy load of COLR table which relies on magic ``__getattr__``
(#2175).
- [COLRv1] Replace hand-coded builder functions with otData-driven dynamic
implementation (#2181).
- [COLRv1] Define additional static (non-variable) Paint formats (#2181).
- [subset] Added support for subsetting COLR v1 and CPAL tables (#2174, #2177).
- [fontBuilder] Allow ``setupFvar`` to optionally take ``designspaceLib.AxisDescriptor``
objects. Added new ``setupAvar`` method. Support localised names for axes and
named instances (#2185).
4.19.1 (released 2021-01-28)
----------------------------
- [woff2] An initial off-curve point with an overlap flag now stays an off-curve
point after compression.
4.19.0 (released 2021-01-25)
----------------------------
- [codecs] Handle ``errors`` parameter different from 'strict' for the custom
extended mac encodings (#2137, #2132).
- [featureVars] Raise better error message when a script is missing the required
default language system (#2154).
- [COLRv1] Avoid abrupt change caused by rounding ``PaintRadialGradient.c0`` when
the start circle almost touches the end circle's perimeter (#2148).
- [COLRv1] Support building unlimited lists of paints as 255-ary trees of
``PaintColrLayers`` tables (#2153).
- [subset] Prune redundant format-12 cmap subtables when all non-BMP characters
are dropped (#2146).
- [basePen] Raise ``MissingComponentError`` instead of bare ``KeyError`` when a
referenced component is missing (#2145).
4.18.2 (released 2020-12-16)
----------------------------
- [COLRv1] Implemented ``PaintTranslate`` paint format (#2129).
- [varLib.cff] Fixed unbound local variable error (#1787).
- [otlLib] Don't crash when creating OpenType class definitions if some glyphs
occur more than once (#2125).
4.18.1 (released 2020-12-09)
----------------------------
- [colorLib] Speed optimization for ``LayerV1ListBuilder`` (#2119).
- [mutator] Fixed missing tab in ``interpolate_cff2_metrics`` (0957dc7a).
4.18.0 (released 2020-12-04)
----------------------------
- [COLRv1] Update to latest draft: added ``PaintRotate`` and ``PaintSkew`` (#2118).
- [woff2] Support new ``brotlicffi`` bindings for PyPy (#2117).
- [glifLib] Added ``expectContentsFile`` parameter to ``GlyphSet``, for use when
reading existing UFOs, to comply with the specification stating that a
``contents.plist`` file must exist in a glyph set (#2114).
- [subset] Allow ``LangSys`` tags in ``--layout-scripts`` option (#2112). For example:
``--layout-scripts=arab.dflt,arab.URD,latn``; this will keep ``DefaultLangSys``
and ``URD`` language for ``arab`` script, and all languages for ``latn`` script.
- [varLib.interpolatable] Allow UFOs to be checked; report open paths, non existant
glyphs; add a ``--json`` option to produce a machine-readable list of
incompatibilities
- [pens] Added ``QuartzPen`` to create ``CGPath`` from glyph outlines on macOS.
Requires pyobjc (#2107).
- [feaLib] You can export ``FONTTOOLS_LOOKUP_DEBUGGING=1`` to enable feature file
debugging info stored in ``Debg`` table (#2106).
- [otlLib] Build more efficient format 1 and format 2 contextual lookups whenever
possible (#2101).
4.17.1 (released 2020-11-16)
----------------------------
- [colorLib] Fixed regression in 4.17.0 when building COLR v0 table; when color
layers are stored in UFO lib plist, we can't distinguish tuples from lists so
we need to accept either types (e5439eb9, googlefonts/ufo2ft/issues#426).
4.17.0 (released 2020-11-12)
----------------------------
- [colorLib/otData] Updated to latest draft ``COLR`` v1 spec (#2092).
- [svgLib] Fixed parsing error when arc commands' boolean flags are not separated
by space or comma (#2094).
- [varLib] Interpret empty non-default glyphs as 'missing', if the default glyph is
not empty (#2082).
- [feaLib.builder] Only stash lookup location for ``Debg`` if ``Builder.buildLookups_``
has cooperated (#2065, #2067).
- [varLib] Fixed bug in VarStore optimizer (#2073, #2083).
- [varLib] Add designspace lib key for custom feavar feature tag (#2080).
- Add HashPointPen adapted from psautohint. With this pen, a hash value of a glyph
can be computed, which can later be used to detect glyph changes (#2005).
4.16.1 (released 2020-10-05)
----------------------------
- [varLib.instancer] Fixed ``TypeError`` exception when instantiating a VF with
a GSUB table 1.1 in which ``FeatureVariations`` attribute is present but set to
``None`` -- indicating that optional ``FeatureVariations`` is missing (#2077).
- [glifLib] Make ``x`` and ``y`` attributes of the ``point`` element required
even when validation is turned off, and raise a meaningful ``GlifLibError``
message when that happens (#2075).
4.16.0 (released 2020-09-30)
----------------------------
- [removeOverlaps] Added new module and ``removeOverlaps`` function that merges
overlapping contours and components in TrueType glyphs. It requires the
`skia-pathops <https://github.com/fonttools/skia-pathops>`__ module.
Note that removing overlaps invalidates the TrueType hinting (#2068).
- [varLib.instancer] Added ``--remove-overlaps`` command-line option.
The ``overlap`` option in ``instantiateVariableFont`` now takes an ``OverlapMode``
enum: 0: KEEP_AND_DONT_SET_FLAGS, 1: KEEP_AND_SET_FLAGS (default), and 2: REMOVE.
The latter is equivalent to calling ``removeOverlaps`` on the generated static
instance. The option continues to accept ``bool`` value for backward compatibility.
4.15.0 (released 2020-09-21)
----------------------------
- [plistlib] Added typing annotations to plistlib module. Set up mypy static
typechecker to run automatically on CI (#2061).
- [ttLib] Implement private ``Debg`` table, a reverse-DNS namespaced JSON dict.
- [feaLib] Optionally add an entry into the ``Debg`` table with the original
lookup name (if any), feature name / script / language combination (if any),
and original source filename and line location. Annotate the ttx output for
a lookup with the information from the Debg table (#2052).
- [sfnt] Disabled checksum checking by default in ``SFNTReader`` (#2058).
- [Docs] Document ``mtiLib`` module (#2027).
- [varLib.interpolatable] Added checks for contour node count and operation type
of each node (#2054).
- [ttLib] Added API to register custom table packer/unpacker classes (#2055).
4.14.0 (released 2020-08-19)
----------------------------
- [feaLib] Allow anonymous classes in LookupFlags definitions (#2037).
- [Docs] Better document DesignSpace rules processing order (#2041).
- [ttLib] Fixed 21-year old bug in ``maxp.maxComponentDepth`` calculation (#2044,
#2045).
- [varLib.models] Fixed misspelled argument name in CLI entry point (81d0042a).
- [subset] When subsetting GSUB v1.1, fixed TypeError by checking whether the
optional FeatureVariations table is present (e63ecc5b).
- [Snippets] Added snippet to show how to decompose glyphs in a TTF (#2030).
- [otlLib] Generate GSUB type 5 and GPOS type 7 contextual lookups where appropriate
(#2016).
4.13.0 (released 2020-07-10)
----------------------------
- [feaLib/otlLib] Moved lookup subtable builders from feaLib to otlLib; refactored
some common code (#2004, #2007).
- [docs] Document otlLib module (#2009).
- [glifLib] Fixed bug with some UFO .glif filenames clashing on case-insensitive
filesystems (#2001, #2002).
- [colorLib] Updated COLRv1 implementation following changes in the draft spec:
(#2008, googlefonts/colr-gradients-spec#24).
4.12.1 (released 2020-06-16)
----------------------------
- [_n_a_m_e] Fixed error in ``addMultilingualName`` with one-character names.
Only attempt to recovered malformed UTF-16 data from a ``bytes`` string,
not from unicode ``str`` (#1997, #1998).
4.12.0 (released 2020-06-09)
----------------------------
- [otlLib/varLib] Ensure that the ``AxisNameID`` in the ``STAT`` and ``fvar``
tables is grater than 255 as per OpenType spec (#1985, #1986).
- [docs] Document more modules in ``fontTools.misc`` package: ``filenames``,
``fixedTools``, ``intTools``, ``loggingTools``, ``macCreatorType``, ``macRes``,
``plistlib`` (#1981).
- [OS/2] Don't calculate whole sets of unicode codepoints, use faster and more memory
efficient ranges and bisect lookups (#1984).
- [voltLib] Support writing back abstract syntax tree as VOLT data (#1983).
- [voltLib] Accept DO_NOT_TOUCH_CMAP keyword (#1987).
- [subset/merge] Fixed a namespace clash involving a private helper class (#1955).
4.11.0 (released 2020-05-28)
----------------------------
- [feaLib] Introduced ``includeDir`` parameter on Parser and IncludingLexer to
explicitly specify the directory to search when ``include()`` statements are
encountered (#1973).
- [ufoLib] Silently delete duplicate glyphs within the same kerning group when reading
groups (#1970).
- [ttLib] Set version of COLR table when decompiling COLRv1 (commit 9d8a7e2).
4.10.2 (released 2020-05-20)
----------------------------
- [sfnt] Fixed ``NameError: SimpleNamespace`` while reading TTC header. The regression
was introduced with 4.10.1 after removing ``py23`` star import.
4.10.1 (released 2020-05-19)
----------------------------
- [sfnt] Make ``SFNTReader`` pickleable even when TTFont is loaded with lazy=True
option and thus keeps a reference to an external file (#1962, #1967).
- [feaLib.ast] Restore backward compatibility (broken in 4.10 with #1905) for
``ChainContextPosStatement`` and ``ChainContextSubstStatement`` classes.
Make them accept either list of lookups or list of lists of lookups (#1961).
- [docs] Document some modules in ``fontTools.misc`` package: ``arrayTools``,
``bezierTools`` ``cliTools`` and ``eexec`` (#1956).
- [ttLib._n_a_m_e] Fixed ``findMultilingualName()`` when name record's ``string`` is
encoded as bytes sequence (#1963).
4.10.0 (released 2020-05-15)
----------------------------
- [varLib] Allow feature variations to be active across the entire space (#1957).
- [ufoLib] Added support for ``formatVersionMinor`` in UFO's ``fontinfo.plist`` and for
``formatMinor`` attribute in GLIF file as discussed in unified-font-object/ufo-spec#78.
No changes in reading or writing UFOs until an upcoming (non-0) minor update of the
UFO specification is published (#1786).
- [merge] Fixed merging fonts with different versions of ``OS/2`` table (#1865, #1952).
- [subset] Fixed ``AttributeError`` while subsetting ``ContextSubst`` and ``ContextPos``
Format 3 subtable (#1879, #1944).
- [ttLib.table._m_e_t_a] if data happens to be ascii, emit comment in TTX (#1938).
- [feaLib] Support multiple lookups per glyph position (#1905).
- [psCharStrings] Use inheritance to avoid repeated code in initializer (#1932).
- [Doc] Improved documentation for the following modules: ``afmLib`` (#1933), ``agl``
(#1934), ``cffLib`` (#1935), ``cu2qu`` (#1937), ``encodings`` (#1940), ``feaLib``
(#1941), ``merge`` (#1949).
- [Doc] Split off developer-centric info to new page, making front page of docs more
user-focused. List all utilities and sub-modules with brief descriptions.
Make README more concise and focused (#1914).
- [otlLib] Add function to build STAT table from high-level description (#1926).
- [ttLib._n_a_m_e] Add ``findMultilingualName()`` method (#1921).
- [unicodedata] Update ``RTL_SCRIPTS`` for Unicode 13.0 (#1925).
- [gvar] Sort ``gvar`` XML output by glyph name, not glyph order (#1907, #1908).
- [Doc] Added help options to ``fonttools`` command line tool (#1913, #1920).
Ensure all fonttools CLI tools have help documentation (#1948).
- [ufoLib] Only write fontinfo.plist when there actually is content (#1911).
4.9.0 (released 2020-04-29)
---------------------------
- [subset] Fixed subsetting of FeatureVariations table. The subsetter no longer drops
FeatureVariationRecords that have empty substitutions as that will keep the search
going and thus change the logic. It will only drop empty records that occur at the
end of the FeatureVariationRecords array (#1881).
- [subset] Remove FeatureVariations table and downgrade GSUB/GPOS to version 0x10000
when FeatureVariations contain no FeatureVariationRecords after subsetting (#1903).
- [agl] Add support for legacy Adobe Glyph List of glyph names in ``fontTools.agl``
(#1895).
- [feaLib] Ignore superfluous script statements (#1883).
- [feaLib] Hide traceback by default on ``fonttools feaLib`` command line.
Use ``--traceback`` option to show (#1898).
- [feaLib] Check lookup index in chaining sub/pos lookups and print better error
message (#1896, #1897).
- [feaLib] Fix building chained alt substitutions (#1902).
- [Doc] Included all fontTools modules in the sphinx-generated documentation, and
published it to ReadTheDocs for continuous documentation of the fontTools project
(#1333). Check it out at https://fonttools.readthedocs.io/. Thanks to Chris Simpkins!
- [transform] The ``Transform`` class is now subclass of ``typing.NamedTuple``. No
change in functionality (#1904).
4.8.1 (released 2020-04-17)
---------------------------
- [feaLib] Fixed ``AttributeError: 'NoneType' has no attribute 'getAlternateGlyphs'``
when ``aalt`` feature references a chain contextual substitution lookup
(googlefonts/fontmake#648, #1878).
4.8.0 (released 2020-04-16)
---------------------------
- [feaLib] If Parser is initialized without a ``glyphNames`` parameter, it cannot
distinguish between a glyph name containing an hyphen, or a range of glyph names;
instead of raising an error, it now interprets them as literal glyph names, while
also outputting a logging warning to alert user about the ambiguity (#1768, #1870).
- [feaLib] When serializing AST to string, emit spaces around hyphens that denote
ranges. Also, fixed an issue with CID ranges when round-tripping AST->string->AST
(#1872).
- [Snippets/otf2ttf] In otf2ttf.py script update LSB in hmtx to match xMin (#1873).
- [colorLib] Added experimental support for building ``COLR`` v1 tables as per
the `colr-gradients-spec <https://github.com/googlefonts/colr-gradients-spec/blob/main/colr-gradients-spec.md>`__
draft proposal. **NOTE**: both the API and the XML dump of ``COLR`` v1 are
susceptible to change while the proposal is being discussed and formalized (#1822).
4.7.0 (released 2020-04-03)
---------------------------
- [cu2qu] Added ``fontTools.cu2qu`` package, imported from the original
`cu2qu <https://github.com/googlefonts/cu2qu>`__ project. The ``cu2qu.pens`` module
was moved to ``fontTools.pens.cu2quPen``. The optional cu2qu extension module
can be compiled by installing `Cython <https://cython.org/>`__ before installing
fonttools from source (i.e. git repo or sdist tarball). The wheel package that
is published on PyPI (i.e. the one ``pip`` downloads, unless ``--no-binary``
option is used), will continue to be pure-Python for now (#1868).
4.6.0 (released 2020-03-24)
---------------------------
- [varLib] Added support for building variable ``BASE`` table version 1.1 (#1858).
- [CPAL] Added ``fromRGBA`` method to ``Color`` class (#1861).
4.5.0 (released 2020-03-20)
---------------------------
- [designspaceLib] Added ``add{Axis,Source,Instance,Rule}Descriptor`` methods to
``DesignSpaceDocument`` class, to initialize new descriptor objects using keyword
arguments, and at the same time append them to the current document (#1860).
- [unicodedata] Update to Unicode 13.0 (#1859).
4.4.3 (released 2020-03-13)
---------------------------
- [varLib] Always build ``gvar`` table for TrueType-flavored Variable Fonts,
even if it contains no variation data. The table is required according to
the OpenType spec (#1855, #1857).
4.4.2 (released 2020-03-12)
---------------------------
- [ttx] Annotate ``LookupFlag`` in XML dump with comment explaining what bits
are set and what they mean (#1850).
- [feaLib] Added more descriptive message to ``IncludedFeaNotFound`` error (#1842).
4.4.1 (released 2020-02-26)
---------------------------
- [woff2] Skip normalizing ``glyf`` and ``loca`` tables if these are missing from
a font (e.g. in NotoColorEmoji using ``CBDT/CBLC`` tables).
- [timeTools] Use non-localized date parsing in ``timestampFromString``, to fix
error when non-English ``LC_TIME`` locale is set (#1838, #1839).
- [fontBuilder] Make sure the CFF table generated by fontBuilder can be used by varLib
without having to compile and decompile the table first. This was breaking in
converting the CFF table to CFF2 due to some unset attributes (#1836).
4.4.0 (released 2020-02-18)
---------------------------
- [colorLib] Added ``fontTools.colorLib.builder`` module, initially with ``buildCOLR``
and ``buildCPAL`` public functions. More color font formats will follow (#1827).
- [fontBuilder] Added ``setupCOLR`` and ``setupCPAL`` methods (#1826).
- [ttGlyphPen] Quantize ``GlyphComponent.transform`` floats to ``F2Dot14`` to fix
round-trip issue when computing bounding boxes of transformed components (#1830).
- [glyf] If a component uses reference points (``firstPt`` and ``secondPt``) for
alignment (instead of X and Y offsets), compute the effective translation offset
*after* having applied any transform (#1831).
- [glyf] When all glyphs have zero contours, compile ``glyf`` table data as a single
null byte in order to pass validation by OTS and Windows (#1829).
- [feaLib] Parsing feature code now ensures that referenced glyph names are part of
the known glyph set, unless a glyph set was not provided.
- [varLib] When filling in the default axis value for a missing location of a source or
instance, correctly map the value forward.
- [varLib] The avar table can now contain mapping output values that are greater than
OR EQUAL to the preceeding value, as the avar specification allows this.
- [varLib] The errors of the module are now ordered hierarchically below VarLibError.
See #1821.
4.3.0 (released 2020-02-03)
---------------------------
- [EBLC/CBLC] Fixed incorrect padding length calculation for Format 3 IndexSubTable
(#1817, #1818).
- [varLib] Fixed error when merging OTL tables and TTFonts were loaded as ``lazy=True``
(#1808, #1809).
- [varLib] Allow to use master fonts containing ``CFF2`` table when building VF (#1816).
- [ttLib] Make ``recalcBBoxes`` option work also with ``CFF2`` table (#1816).
- [feaLib] Don't reset ``lookupflag`` in lookups defined inside feature blocks.
They will now inherit the current ``lookupflag`` of the feature. This is what
Adobe ``makeotf`` also does in this case (#1815).
- [feaLib] Fixed bug with mixed single/multiple substitutions. If a single substitution
involved a glyph class, we were incorrectly using only the first glyph in the class
(#1814).
4.2.5 (released 2020-01-29)
---------------------------
- [feaLib] Do not fail on duplicate multiple substitutions, only warn (#1811).
- [subset] Optimize SinglePos subtables to Format 1 if all ValueRecords are the same
(#1802).
4.2.4 (released 2020-01-09)
---------------------------
- [unicodedata] Update RTL_SCRIPTS for Unicode 11 and 12.
4.2.3 (released 2020-01-07)
---------------------------
- [otTables] Fixed bug when splitting `MarkBasePos` subtables as offsets overflow.
The mark class values in the split subtable were not being updated, leading to
invalid mark-base attachments (#1797, googlefonts/noto-source#145).
- [feaLib] Only log a warning instead of error when features contain duplicate
substitutions (#1767).
- [glifLib] Strip XML comments when parsing with lxml (#1784, #1785).
4.2.2 (released 2019-12-12)
---------------------------
- [subset] Fixed issue with subsetting FeatureVariations table when the index
of features changes as features get dropped. The feature index need to be
remapped to point to index of the remaining features (#1777, #1782).
- [fontBuilder] Added `addFeatureVariations` method to `FontBuilder` class. This
is a shorthand for calling `featureVars.addFeatureVariations` on the builder's
TTFont object (#1781).
- [glyf] Fixed the flags bug in glyph.drawPoints() like we did for glyph.draw()
(#1771, #1774).
4.2.1 (released 2019-12-06)
---------------------------
- [glyf] Use the ``flagOnCurve`` bit mask in ``glyph.draw()``, so that we ignore
the ``overlap`` flag that may be set when instantiating variable fonts (#1771).
4.2.0 (released 2019-11-28)
---------------------------
- [pens] Added the following pens:
* ``roundingPen.RoundingPen``: filter pen that rounds coordinates and components'
offsets to integer;
* ``roundingPen.RoundingPointPen``: like the above, but using PointPen protocol.
* ``filterPen.FilterPointPen``: base class for filter point pens;
* ``transformPen.TransformPointPen``: filter point pen to apply affine transform;
* ``recordingPen.RecordingPointPen``: records and replays point-pen commands.
- [ttGlyphPen] Always round float coordinates and component offsets to integers
(#1763).
- [ufoLib] When converting kerning groups from UFO2 to UFO3, avoid confusing
groups with the same name as one of the glyphs (#1761, #1762,
unified-font-object/ufo-spec#98).
4.1.0 (released 2019-11-18)
---------------------------
- [instancer] Implemented restricting axis ranges (level 3 partial instancing).
You can now pass ``{axis_tag: (min, max)}`` tuples as input to the
``instantiateVariableFont`` function. Note that changing the default axis
position is not supported yet. The command-line script also accepts axis ranges
in the form of colon-separated float values, e.g. ``wght=400:700`` (#1753, #1537).
- [instancer] Never drop STAT ``DesignAxis`` records, but only prune out-of-range
``AxisValue`` records.
- [otBase/otTables] Enforce that VarStore.RegionAxisCount == fvar.axisCount, even
when regions list is empty to appease OTS < v8.0 (#1752).
- [designspaceLib] Defined new ``processing`` attribute for ``<rules>`` element,
with values "first" or "last", plus other editorial changes to DesignSpace
specification. Bumped format version to 4.1 (#1750).
- [varLib] Improved error message when masters' glyph orders do not match (#1758,
#1759).
- [featureVars] Allow to specify custom feature tag in ``addFeatureVariations``;
allow said feature to already exist, in which case we append new lookup indices
to existing features. Implemented ``<rules>`` attribute ``processing`` according to
DesignSpace specification update in #1750. Depending on this flag, we generate
either an 'rvrn' (always processed first) or a 'rclt' feature (follows lookup order,
therefore last) (#1747, #1625, #1371).
- [ttCollection] Added support for context manager auto-closing via ``with`` statement
like with ``TTFont`` (#1751).
- [unicodedata] Require unicodedata2 >= 12.1.0.
- [py2.py3] Removed yet more PY2 vestiges (#1743).
- [_n_a_m_e] Fixed issue when comparing NameRecords with different string types (#1742).
- [fixedTools] Changed ``fixedToFloat`` to not do any rounding but simply return
``value / (1 << precisionBits)``. Added ``floatToFixedToStr`` and
``strToFixedToFloat`` functions to be used when loading from or dumping to XML.
Fixed values (e.g. fvar axes and instance coordinates, avar mappings, etc.) are
are now stored as un-rounded decimal floats upon decompiling (#1740, #737).
- [feaLib] Fixed handling of multiple ``LigatureCaret`` statements for the same glyph.
Only the first rule per glyph is used, additional ones are ignored (#1733).
4.0.2 (released 2019-09-26)
---------------------------
- [voltLib] Added support for ``ALL`` and ``NONE`` in ``PROCESS_MARKS`` (#1732).
- [Silf] Fixed issue in ``Silf`` table compilation and decompilation regarding str vs
bytes in python3 (#1728).
- [merge] Handle duplicate glyph names better: instead of appending font index to
all glyph names, use similar code like we use in ``post`` and ``CFF`` tables (#1729).
4.0.1 (released 2019-09-11)
---------------------------
- [otTables] Support fixing offset overflows in ``MultipleSubst`` lookup subtables
(#1706).
- [subset] Prune empty strikes in ``EBDT`` and ``CBDT`` table data (#1698, #1633).
- [pens] Fixed issue in ``PointToSegmentPen`` when last point of closed contour has
same coordinates as the starting point and was incorrectly dropped (#1720).
- [Graphite] Fixed ``Sill`` table output to pass OTS (#1705).
- [name] Added ``removeNames`` method to ``table__n_a_m_e`` class (#1719).
- [ttLib] Added aliases for renamed entries ``ascender`` and ``descender`` in
``hhea`` table (#1715).
4.0.0 (released 2019-08-22)
---------------------------
- NOTE: The v4.x version series only supports Python 3.6 or greater. You can keep
using fonttools 3.x if you need support for Python 2.
- [py23] Removed all the python2-only code since it is no longer reachable, thus
unused; only the Python3 symbols were kept, but these are no-op. The module is now
DEPRECATED and will removed in the future.
- [ttLib] Fixed UnboundLocalError for empty loca/glyph tables (#1680). Also, allow
the glyf table to be incomplete when dumping to XML (#1681).
- [varLib.models] Fixed KeyError while sorting masters and there are no on-axis for
a given axis (38a8eb0e).
- [cffLib] Make sure glyph names are unique (#1699).
- [feaLib] Fix feature parser to correctly handle octal numbers (#1700).
3.44.0 (released 2019-08-02)
----------------------------
- NOTE: This is the last scheduled release to support Python 2.7. The upcoming fonttools
v4.x series is going to require Python 3.6 or greater.
- [varLib] Added new ``varLib.instancer`` module for partially instantiating variable
fonts. This extends (and will eventually replace) ``varLib.mutator`` module, as
it allows to create not just full static instances from a variable font, but also
"partial" or "less variable" fonts where some of the axes are dropped or
instantiated at a particular value.
Also available from the command-line as `fonttools varLib.instancer --help`
(#1537, #1628).
- [cffLib] Added support for ``FDSelect`` format 4 (#1677).
- [subset] Added support for subsetting ``sbix`` (Apple bitmap color font) table.
- [t1Lib] Fixed issue parsing ``eexec`` section in Type1 fonts when whitespace
characters are interspersed among the trailing zeros (#1676).
- [cffLib.specializer] Fixed bug in ``programToCommands`` with CFF2 charstrings (#1669).
3.43.2 (released 2019-07-10)
----------------------------
- [featureVars] Fixed region-merging code on python3 (#1659).
- [varLib.cff] Fixed merging of sparse PrivateDict items (#1653).
3.43.1 (released 2019-06-19)
----------------------------
- [subset] Fixed regression when passing ``--flavor=woff2`` option with an input font
that was already compressed as WOFF 1.0 (#1650).
3.43.0 (released 2019-06-18)
----------------------------
- [woff2] Added support for compressing/decompressing WOFF2 fonts with non-transformed
``glyf`` and ``loca`` tables, as well as with transformed ``hmtx`` table.
Removed ``Snippets/woff2_compress.py`` and ``Snippets/woff2_decompress.py`` scripts,
and replaced them with a new console entry point ``fonttools ttLib.woff2``
that provides two sub-commands ``compress`` and ``decompress``.
- [varLib.cff] Fixed bug when merging CFF2 ``PrivateDicts``. The ``PrivateDict``
data from the first region font was incorrecty used for all subsequent fonts.
The bug would only affect variable CFF2 fonts with hinting (#1643, #1644).
Also, fixed a merging bug when VF masters have no blends or marking glyphs (#1632,
#1642).
- [loggingTools] Removed unused backport of ``LastResortLogger`` class.
- [subset] Gracefully handle partial MATH table (#1635).
- [featureVars] Avoid duplicate references to ``rvrn`` feature record in
``DefaultLangSys`` tables when calling ``addFeatureVariations`` on a font that
does not already have a ``GSUB`` table (aa8a5bc6).
- [varLib] Fixed merging of class-based kerning. Before, the process could introduce
rogue kerning values and variations for random classes against class zero (everything
not otherwise classed).
- [varLib] Fixed merging GPOS tables from master fonts with different number of
``SinglePos`` subtables (#1621, #1641).
- [unicodedata] Updated Blocks, Scripts and ScriptExtensions to Unicode 12.1.
3.42.0 (released 2019-05-28)
----------------------------
- [OS/2] Fixed sign of ``fsType``: it should be ``uint16``, not ``int16`` (#1619).
- [subset] Skip out-of-range class values in mark attachment (#1478).
- [fontBuilder] Add an empty ``DSIG`` table with ``setupDummyDSIG`` method (#1621).
- [varLib.merger] Fixed bug whereby ``GDEF.GlyphClassDef`` were being dropped
when generating instance via ``varLib.mutator`` (#1614).
- [varLib] Added command-line options ``-v`` and ``-q`` to configure logging (#1613).
- [subset] Update font extents in head table (#1612).
- [subset] Make --retain-gids truncate empty glyphs after the last non-empty glyph
(#1611).
- [requirements] Updated ``unicodedata2`` backport for Unicode 12.0.
3.41.2 (released 2019-05-13)
----------------------------
- [cffLib] Fixed issue when importing a ``CFF2`` variable font from XML, whereby
the VarStore state was not propagated to PrivateDict (#1598).
- [varLib] Don't drop ``post`` glyph names when building CFF2 variable font (#1609).
3.41.1 (released 2019-05-13)
----------------------------
- [designspaceLib] Added ``loadSourceFonts`` method to load source fonts using
custom opener function (#1606).
- [head] Round font bounding box coordinates to integers to fix compile error
if CFF font has float coordinates (#1604, #1605).
- [feaLib] Don't write ``None`` in ``ast.ValueRecord.asFea()`` (#1599).
- [subset] Fixed issue ``AssertionError`` when using ``--desubroutinize`` option
(#1590, #1594).
- [graphite] Fixed bug in ``Silf`` table's ``decompile`` method unmasked by
previous typo fix (#1597). Decode languange code as UTF-8 in ``Sill`` table's
``decompile`` method (#1600).
3.41.0 (released 2019-04-29)
----------------------------
- [varLib/cffLib] Added support for building ``CFF2`` variable font from sparse
masters, or masters with more than one model (multiple ``VarStore.VarData``).
In ``cffLib.specializer``, added support for ``CFF2`` CharStrings with
``blend`` operators (#1547, #1591).
- [subset] Fixed subsetting ``HVAR`` and ``VVAR`` with ``--retain-gids`` option,
and when advances mapping is null while sidebearings mappings are non-null
(#1587, #1588).
- Added ``otlLib.maxContextCalc`` module to compute ``OS/2.usMaxContext`` value.
Calculate it automatically when compiling features with feaLib. Added option
``--recalc-max-context`` to ``subset`` module (#1582).
- [otBase/otTables] Fixed ``AttributeError`` on missing OT table fields after
importing font from TTX (#1584).
- [graphite] Fixed typo ``Silf`` table's ``decompile`` method (#1586).
- [otlLib] Better compress ``GPOS`` SinglePos (LookupType 1) subtables (#1539).
3.40.0 (released 2019-04-08)
----------------------------
- [subset] Fixed error while subsetting ``VVAR`` with ``--retain-gids``
option (#1552).
- [designspaceLib] Use up-to-date default location in ``findDefault`` method
(#1554).
- [voltLib] Allow passing file-like object to Parser.
- [arrayTools/glyf] ``calcIntBounds`` (used to compute bounding boxes of glyf
table's glyphs) now uses ``otRound`` instead of ``round3`` (#1566).
- [svgLib] Added support for converting more SVG shapes to path ``d`` strings
(ellipse, line, polyline), as well as support for ``transform`` attributes.
Only ``matrix`` transformations are currently supported (#1564, #1564).
- [varLib] Added support for building ``VVAR`` table from ``vmtx`` and ``VORG``
tables (#1551).
- [fontBuilder] Enable making CFF2 fonts with ``post`` table format 2 (#1557).
- Fixed ``DeprecationWarning`` on invalid escape sequences (#1562).
3.39.0 (released 2019-03-19)
----------------------------
- [ttLib/glyf] Raise more specific error when encountering recursive
component references (#1545, #1546).
- [Doc/designspaceLib] Defined new ``public.skipExportGlyphs`` lib key (#1534,
unified-font-object/ufo-spec#84).
- [varLib] Use ``vmtx`` to compute vertical phantom points; or ``hhea.ascent``
and ``head.unitsPerEM`` if ``vmtx`` is missing (#1528).
- [gvar/cvar] Sort XML element's min/value/max attributes in TupleVariation
toXML to improve readability of TTX dump (#1527).
- [varLib.plot] Added support for 2D plots with only 1 variation axis (#1522).
- [designspaceLib] Use axes maps when normalizing locations in
DesignSpaceDocument (#1226, #1521), and when finding default source (#1535).
- [mutator] Set ``OVERLAP_SIMPLE`` and ``OVERLAP_COMPOUND`` glyf flags by
default in ``instantiateVariableFont``. Added ``--no-overlap`` cli option
to disable this (#1518).
- [subset] Fixed subsetting ``VVAR`` table (#1516, #1517).
Fixed subsetting an ``HVAR`` table that has an ``AdvanceWidthMap`` when the
option ``--retain-gids`` is used.
- [feaLib] Added ``forceChained`` in MultipleSubstStatement (#1511).
Fixed double indentation of ``subtable`` statement (#1512).
Added support for ``subtable`` statement in more places than just PairPos
lookups (#1520).
Handle lookupflag 0 and lookupflag without a value (#1540).
- [varLib] In ``load_designspace``, provide a default English name for the
``ital`` axis tag.
- Remove pyftinspect because it is unmaintained and bitrotted.
3.38.0 (released 2019-02-18)
----------------------------
- [cffLib] Fixed RecursionError when unpickling or deepcopying TTFont with
CFF table (#1488, 649dc49).
- [subset] Fixed AttributeError when using --desubroutinize option (#1490).
Also, fixed desubroutinizing bug when subrs contain hints (#1499).
- [CPAL] Make Color a subclass of namedtuple (173a0f5).
- [feaLib] Allow hyphen in glyph class names.
- [feaLib] Added 'tables' option to __main__.py (#1497).
- [feaLib] Add support for special-case contextual positioning formatting
(#1501).
- [svgLib] Support converting SVG basic shapes (rect, circle, etc.) into
equivalent SVG paths (#1500, #1508).
- [Snippets] Added name-viewer.ipynb Jupyter notebook.
3.37.3 (released 2019-02-05)
----------------------------
- The previous release accidentally changed several files from Unix to DOS
line-endings. Fix that.
3.37.2 (released 2019-02-05)
----------------------------
- [varLib] Temporarily revert the fix to ``load_masters()``, which caused a
crash in ``interpolate_layout()`` when ``deepcopy``-ing OTFs.
3.37.1 (released 2019-02-05)
----------------------------
- [varLib] ``load_masters()`` now actually assigns the fonts it loads to the
source.font attributes.
- [varLib] Fixed an MVAR table generation crash when sparse masters were
involved.
- [voltLib] ``parse_coverage_()`` returns a tuple instead of an ast.Enum.
- [feaLib] A MarkClassDefinition inside a block is no longer doubly indented
compared to the rest of the block.
3.37.0 (released 2019-01-28)
----------------------------
- [svgLib] Added support for converting elliptical arcs to cubic bezier curves
(#1464).
- [py23] Added backport for ``math.isfinite``.
- [varLib] Apply HIDDEN flag to fvar axis if designspace axis has attribute
``hidden=1``.
- Fixed "DeprecationWarning: invalid escape sequence" in Python 3.7.
- [voltLib] Fixed parsing glyph groups. Distinguish different PROCESS_MARKS.
Accept COMPONENT glyph type.
- [feaLib] Distinguish missing value and explicit ``<NULL>`` for PairPos2
format A (#1459). Round-trip ``useExtension`` keyword. Implemented
``ValueRecord.asFea`` method.
- [subset] Insert empty widths into hdmx when retaining gids (#1458).
3.36.0 (released 2019-01-17)
----------------------------
- [ttx] Added ``--no-recalc-timestamp`` option to keep the original font's
``head.modified`` timestamp (#1455, #46).
- [ttx/psCharStrings] Fixed issues while dumping and round-tripping CFF2 table
with ttx (#1451, #1452, #1456).
- [voltLib] Fixed check for duplicate anchors (#1450). Don't try to read past
the ``END`` operator in .vtp file (#1453).
- [varLib] Use sentinel value -0x8000 (-32768) to ignore post.underlineThickness
and post.underlinePosition when generating MVAR deltas (#1449,
googlei18n/ufo2ft#308).
- [subset] Added ``--retain-gids`` option to subset font without modifying the
current glyph indices (#1443, #1447).
- [ufoLib] Replace deprecated calls to ``getbytes`` and ``setbytes`` with new
equivalent ``readbytes`` and ``writebytes`` calls. ``fs`` >= 2.2 no required.
- [varLib] Allow loading masters from TTX files as well (#1441).
3.35.2 (released 2019-01-14)
----------------------------
- [hmtx/vmtx]: Allow to compile/decompile ``hmtx`` and ``vmtx`` tables even
without the corresponding (required) metrics header tables, ``hhea`` and
``vhea`` (#1439).
- [varLib] Added support for localized axes' ``labelname`` and named instances'
``stylename`` (#1438).
3.35.1 (released 2019-01-09)
----------------------------
- [_m_a_x_p] Include ``maxComponentElements`` in ``maxp`` table's recalculation.
3.35.0 (released 2019-01-07)
----------------------------
- [psCharStrings] In ``encodeFloat`` function, use float's "general format" with
8 digits of precision (i.e. ``%8g``) instead of ``str()``. This works around
a macOS rendering issue when real numbers in CFF table are too long, and
also makes sure that floats are encoded with the same precision in python 2.7
and 3.x (#1430, googlei18n/ufo2ft#306).
- [_n_a_m_e/fontBuilder] Make ``_n_a_m_e_table.addMultilingualName`` also add
Macintosh (platformID=1) names by default. Added options to ``FontBuilder``
``setupNameTable`` method to optionally disable Macintosh or Windows names.
(#1359, #1431).
- [varLib] Make ``build`` optionally accept a ``DesignSpaceDocument`` object,
instead of a designspace file path. The caller can now set the ``font``
attribute of designspace's sources to a TTFont object, thus allowing to
skip filenames manipulation altogether (#1416, #1425).
- [sfnt] Allow SFNTReader objects to be deep-copied.
- Require typing>=3.6.4 on py27 to fix issue with singledispatch (#1423).
- [designspaceLib/t1Lib/macRes] Fixed some cases where pathlib.Path objects were
not accepted (#1421).
- [varLib] Fixed merging of multiple PairPosFormat2 subtables (#1411).
- [varLib] The default STAT table version is now set to 1.1, to improve
compatibility with legacy applications (#1413).
3.34.2 (released 2018-12-17)
----------------------------
- [merge] Fixed AssertionError when none of the script tables in GPOS/GSUB have
a DefaultLangSys record (#1408, 135a4a1).
3.34.1 (released 2018-12-17)
----------------------------
- [varLib] Work around macOS rendering issue for composites without gvar entry (#1381).
3.34.0 (released 2018-12-14)
----------------------------
- [varLib] Support generation of CFF2 variable fonts. ``model.reorderMasters()``
now supports arbitrary mapping. Fix handling of overlapping ranges for feature
variations (#1400).
- [cffLib, subset] Code clean-up and fixing related to CFF2 support.
- [ttLib.tables.ttProgram] Use raw strings for regex patterns (#1389).
- [fontbuilder] Initial support for building CFF2 fonts. Set CFF's
``FontMatrix`` automatically from unitsPerEm.
- [plistLib] Accept the more general ``collections.Mapping`` instead of the
specific ``dict`` class to support custom data classes that should serialize
to dictionaries.
3.33.0 (released 2018-11-30)
----------------------------
- [subset] subsetter bug fix with variable fonts.
- [varLib.featureVar] Improve FeatureVariations generation with many rules.
- [varLib] Enable sparse masters when building variable fonts:
https://github.com/fonttools/fonttools/pull/1368#issuecomment-437257368
- [varLib.mutator] Add IDEF for GETVARIATION opcode, for handling hints in an
instance.
- [ttLib] Ignore the length of kern table subtable format 0
3.32.0 (released 2018-11-01)
----------------------------
- [ufoLib] Make ``UFOWriter`` a subclass of ``UFOReader``, and use mixins
for shared methods (#1344).
- [featureVars] Fixed normalization error when a condition's minimum/maximum
attributes are missing in designspace ``<rule>`` (#1366).
- [setup.py] Added ``[plot]`` to extras, to optionally install ``matplotlib``,
needed to use the ``fonTools.varLib.plot`` module.
- [varLib] Take total bounding box into account when resolving model (7ee81c8).
If multiple axes have the same range ratio, cut across both (62003f4).
- [subset] Don't error if ``STAT`` has no ``AxisValue`` tables.
- [fontBuilder] Added a new submodule which contains a ``FontBuilder`` wrapper
class around ``TTFont`` that makes it easier to create a working TTF or OTF
font from scratch with code. NOTE: the API is still experimental and may
change in future versions.
3.31.0 (released 2018-10-21)
----------------------------
- [ufoLib] Merged the `ufoLib <https://github.com/unified-font-objects/ufoLib>`__
master branch into a new ``fontTools.ufoLib`` package (#1335, #1095).
Moved ``ufoLib.pointPen`` module to ``fontTools.pens.pointPen``.
Moved ``ufoLib.etree`` module to ``fontTools.misc.etree``.
Moved ``ufoLib.plistlib`` module to ``fontTools.misc.plistlib``.
To use the new ``fontTools.ufoLib`` module you need to install fonttools
with the ``[ufo]`` extra, or you can manually install the required additional
dependencies (cf. README.rst).
- [morx] Support AAT action type to insert glyphs and clean up compilation
of AAT action tables (4a1871f, 2011ccf).
- [subset] The ``--no-hinting`` on a CFF font now also drops the optional
hinting keys in Private dict: ``ForceBold``, ``LanguageGroup``, and
``ExpansionFactor`` (#1322).
- [subset] Include nameIDs referenced by STAT table (#1327).
- [loggingTools] Added ``msg=None`` argument to
``CapturingLogHandler.assertRegex`` (0245f2c).
- [varLib.mutator] Implemented ``FeatureVariations`` instantiation (#1244).
- [g_l_y_f] Added PointPen support to ``_TTGlyph`` objects (#1334).
3.30.0 (released 2018-09-18)
----------------------------
- [feaLib] Skip building noop class PairPos subtables when Coverage is NULL
(#1318).
- [ttx] Expose the previously reserved bit flag ``OVERLAP_SIMPLE`` of
glyf table's contour points in the TTX dump. This is used in some
implementations to specify a non-zero fill with overlapping contours (#1316).
- [ttLib] Added support for decompiling/compiling ``TS1C`` tables containing
VTT sources for ``cvar`` variation table (#1310).
- [varLib] Use ``fontTools.designspaceLib`` to read DesignSpaceDocument. The
``fontTools.varLib.designspace`` module is now deprecated and will be removed
in future versions. The presence of an explicit ``axes`` element is now
required in order to build a variable font (#1224, #1313).
- [varLib] Implemented building GSUB FeatureVariations table from the ``rules``
element of DesignSpace document (#1240, #713, #1314).
- [subset] Added ``--no-layout-closure`` option to not expand the subset with
the glyphs produced by OpenType layout features. Instead, OpenType features
will be subset to only rules that are relevant to the otherwise-specified
glyph set (#43, #1121).
3.29.1 (released 2018-09-10)
----------------------------
- [feaLib] Fixed issue whereby lookups from DFLT/dflt were not included in the
DFLT/non-dflt language systems (#1307).
- [graphite] Fixed issue on big-endian architectures (e.g. ppc64) (#1311).
- [subset] Added ``--layout-scripts`` option to add/exclude set of OpenType
layout scripts that will be preserved. By default all scripts are retained
(``'*'``) (#1303).
3.29.0 (released 2018-07-26)
----------------------------
- [feaLib] In the OTL table builder, when the ``name`` table is excluded
from the list of tables to be build, skip compiling ``featureNames`` blocks,
as the records referenced in ``FeatureParams`` table don't exist (68951b7).
- [otBase] Try ``ExtensionLookup`` if other offset-overflow methods fail
(05f95f0).
- [feaLib] Added support for explicit ``subtable;`` break statements in
PairPos lookups; previously these were ignored (#1279, #1300, #1302).
- [cffLib.specializer] Make sure the stack depth does not exceed maxstack - 1,
so that a subroutinizer can insert subroutine calls (#1301,
https://github.com/googlei18n/ufo2ft/issues/266).
- [otTables] Added support for fixing offset overflow errors occurring inside
``MarkBasePos`` subtables (#1297).
- [subset] Write the default output file extension based on ``--flavor`` option,
or the value of ``TTFont.sfntVersion`` (d7ac0ad).
- [unicodedata] Updated Blocks, Scripts and ScriptExtensions for Unicode 11
(452c85e).
- [xmlWriter] Added context manager to XMLWriter class to autoclose file
descriptor on exit (#1290).
- [psCharStrings] Optimize the charstring's bytecode by encoding as integers
all float values that have no decimal portion (8d7774a).
- [ttFont] Fixed missing import of ``TTLibError`` exception (#1285).
- [feaLib] Allow any languages other than ``dflt`` under ``DFLT`` script
(#1278, #1292).
3.28.0 (released 2018-06-19)
----------------------------
- [featureVars] Added experimental module to build ``FeatureVariations``
tables. Still needs to be hooked up to ``varLib.build`` (#1240).
- [fixedTools] Added ``otRound`` to round floats to nearest integer towards
positive Infinity. This is now used where we deal with visual data like X/Y
coordinates, advance widths/heights, variation deltas, and similar (#1274,
#1248).
- [subset] Improved GSUB closure memoize algorithm.
- [varLib.models] Fixed regression in model resolution (180124, #1269).
- [feaLib.ast] Fixed error when converting ``SubtableStatement`` to string
(#1275).
- [varLib.mutator] Set ``OS/2.usWeightClass`` and ``usWidthClass``, and
``post.italicAngle`` based on the 'wght', 'wdth' and 'slnt' axis values
(#1276, #1264).
- [py23/loggingTools] Don't automatically set ``logging.lastResort`` handler
on py27. Moved ``LastResortLogger`` to the ``loggingTools`` module (#1277).
3.27.1 (released 2018-06-11)
----------------------------
- [ttGlyphPen] Issue a warning and skip building non-existing components
(https://github.com/googlei18n/fontmake/issues/411).
- [tests] Fixed issue running ttx_test.py from a tagged commit.
3.27.0 (released 2018-06-11)
----------------------------
- [designspaceLib] Added new ``conditionSet`` element to ``rule`` element in
designspace document. Bumped ``format`` attribute to ``4.0`` (previously,
it was formatted as an integer). Removed ``checkDefault``, ``checkAxes``
methods, and any kind of guessing about the axes when the ``<axes>`` element
is missing. The default master is expected at the intersection of all default
values for each axis (#1254, #1255, #1267).
- [cffLib] Fixed issues when compiling CFF2 or converting from CFF when the
font has an FDArray (#1211, #1271).
- [varLib] Avoid attempting to build ``cvar`` table when ``glyf`` table is not
present, as is the case for CFF2 fonts.
- [subset] Handle None coverages in MarkGlyphSets; revert commit 02616ab that
sets empty Coverage tables in MarkGlyphSets to None, to make OTS happy.
- [ttFont] Allow to build glyph order from ``maxp.numGlyphs`` when ``post`` or
``cmap`` are missing.
- [ttFont] Added ``__len__`` method to ``_TTGlyphSet``.
- [glyf] Ensure ``GlyphCoordinates`` never overflow signed shorts (#1230).
- [py23] Added alias for ``itertools.izip`` shadowing the built-in ``zip``.
- [loggingTools] Memoize ``log`` property of ``LogMixin`` class (fbab12).
- [ttx] Impoved test coverage (#1261).
- [Snippets] Addded script to append a suffix to all family names in a font.
- [varLib.plot] Make it work with matplotlib >= 2.1 (b38e2b).
3.26.0 (released 2018-05-03)
----------------------------
- [designspace] Added a new optional ``layer`` attribute to the source element,
and a corresponding ``layerName`` attribute to the ``SourceDescriptor``
object (#1253).
Added ``conditionset`` element to the ``rule`` element to the spec, but not
implemented in designspace reader/writer yet (#1254).
- [varLib.models] Refine modeling one last time (0ecf5c5).
- [otBase] Fixed sharing of tables referred to by different offset sizes
(795f2f9).
- [subset] Don't drop a GDEF that only has VarStore (fc819d6). Set to None
empty Coverage tables in MarkGlyphSets (02616ab).
- [varLib]: Added ``--master-finder`` command-line option (#1249).
- [varLib.mutator] Prune fvar nameIDs from instance's name table (#1245).
- [otTables] Allow decompiling bad ClassDef tables with invalid format, with
warning (#1236).
- [varLib] Make STAT v1.2 and reuse nameIDs from fvar table (#1242).
- [varLib.plot] Show master locations. Set axis limits to -1, +1.
- [subset] Handle HVAR direct mapping. Passthrough 'cvar'.
Added ``--font-number`` command-line option for collections.
- [t1Lib] Allow a text encoding to be specified when parsing a Type 1 font
(#1234). Added ``kind`` argument to T1Font constructor (c5c161c).
- [ttLib] Added context manager API to ``TTFont`` class, so it can be used in
``with`` statements to auto-close the file when exiting the context (#1232).
3.25.0 (released 2018-04-03)
----------------------------
- [varLib] Improved support-resolution algorithm. Previously, the on-axis
masters would always cut the space. They don't anymore. That's more
consistent, and fixes the main issue Erik showed at TYPO Labs 2017.
Any varfont built that had an unusual master configuration will change
when rebuilt (42bef17, a523a697,
https://github.com/googlei18n/fontmake/issues/264).
- [varLib.models] Added a ``main()`` entry point, that takes positions and
prints model results.
- [varLib.plot] Added new module to plot a designspace's
VariationModel. Requires ``matplotlib``.
- [varLib.mutator] Added -o option to specify output file path (2ef60fa).
- [otTables] Fixed IndexError while pruning of HVAR pre-write (6b6c34a).
- [varLib.models] Convert delta array to floats if values overflows signed
short integer (0055f94).
3.24.2 (released 2018-03-26)
----------------------------
- [otBase] Don't fail during ``ValueRecord`` copy if src has more items.
We drop hinting in the subsetter by simply changing ValueFormat, without
cleaning up the actual ValueRecords. This was causing assertion error if
a variable font was subsetted without hinting and then passed directly to
the mutator for instantiation without first it saving to disk.
3.24.1 (released 2018-03-06)
----------------------------
- [varLib] Don't remap the same ``DeviceTable`` twice in VarStore optimizer
(#1206).
- [varLib] Add ``--disable-iup`` option to ``fonttools varLib`` script,
and a ``optimize=True`` keyword argument to ``varLib.build`` function,
to optionally disable IUP optimization while building varfonts.
- [ttCollection] Fixed issue while decompiling ttc with python3 (#1207).
3.24.0 (released 2018-03-01)
----------------------------
- [ttGlyphPen] Decompose composite glyphs if any components' transform is too
large to fit a ``F2Dot14`` value, or clamp transform values that are
(almost) equal to +2.0 to make them fit and avoid decomposing (#1200,
#1204, #1205).
- [ttx] Added new ``-g`` option to dump glyphs from the ``glyf`` table
splitted as individual ttx files (#153, #1035, #1132, #1202).
- Copied ``ufoLib.filenames`` module to ``fontTools.misc.filenames``, used
for the ttx split-glyphs option (#1202).
- [feaLib] Added support for ``cvParameters`` blocks in Character Variant
feautures ``cv01-cv99`` (#860, #1169).
- [Snippets] Added ``checksum.py`` script to generate/check SHA1 hash of
ttx files (#1197).
- [varLib.mutator] Fixed issue while instantiating some variable fonts
whereby the horizontal advance width computed from ``gvar`` phantom points
could turn up to be negative (#1198).
- [varLib/subset] Fixed issue with subsetting GPOS variation data not
picking up ``ValueRecord`` ``Device`` objects (54fd71f).
- [feaLib/voltLib] In all AST elements, the ``location`` is no longer a
required positional argument, but an optional kewyord argument (defaults
to ``None``). This will make it easier to construct feature AST from
code (#1201).
3.23.0 (released 2018-02-26)
----------------------------
- [designspaceLib] Added an optional ``lib`` element to the designspace as a
whole, as well as to the instance elements, to store arbitrary data in a
property list dictionary, similar to the UFO's ``lib``. Added an optional
``font`` attribute to the ``SourceDescriptor``, to allow operating on
in-memory font objects (#1175).
- [cffLib] Fixed issue with lazy-loading of attributes when attempting to
set the CFF TopDict.Encoding (#1177, #1187).
- [ttx] Fixed regression introduced in 3.22.0 that affected the split tables
``-s`` option (#1188).
- [feaLib] Added ``IncludedFeaNotFound`` custom exception subclass, raised
when an included feature file cannot be found (#1186).
- [otTables] Changed ``VarIdxMap`` to use glyph names internally instead of
glyph indexes. The old ttx dumps of HVAR/VVAR tables that contain indexes
can still be imported (21cbab8, 38a0ffb).
- [varLib] Implemented VarStore optimizer (#1184).
- [subset] Implemented pruning of GDEF VarStore, HVAR and MVAR (#1179).
- [sfnt] Restore backward compatiblity with ``numFonts`` attribute of
``SFNTReader`` object (#1181).
- [merge] Initial support for merging ``LangSysRecords`` (#1180).
- [ttCollection] don't seek(0) when writing to possibly unseekable strems.
- [subset] Keep all ``--name-IDs`` from 0 to 6 by default (#1170, #605, #114).
- [cffLib] Added ``width`` module to calculate optimal CFF default and
nominal glyph widths.
- [varLib] Dont fail if STAT already in the master fonts (#1166).
3.22.0 (released 2018-02-04)
----------------------------
- [subset] Support subsetting ``endchar`` acting as ``seac``-like components
in ``CFF`` (fixes #1162).
- [feaLib] Allow to build from pre-parsed ``ast.FeatureFile`` object.
Added ``tables`` argument to only build some tables instead of all (#1159,
#1163).
- [textTools] Replaced ``safeEval`` with ``ast.literal_eval`` (#1139).
- [feaLib] Added option to the parser to not resolve ``include`` statements
(#1154).
- [ttLib] Added new ``ttCollection`` module to read/write TrueType and
OpenType Collections. Exports a ``TTCollection`` class with a ``fonts``
attribute containing a list of ``TTFont`` instances, the methods ``save``
and ``saveXML``, plus some list-like methods. The ``importXML`` method is
not implemented yet (#17).
- [unicodeadata] Added ``ot_tag_to_script`` function that converts from
OpenType script tag to Unicode script code.
- Added new ``designspaceLib`` subpackage, originally from Erik Van Blokland's
``designSpaceDocument``: https://github.com/LettError/designSpaceDocument
NOTE: this is not yet used internally by varLib, and the API may be subject
to changes (#911, #1110, LettError/designSpaceDocument#28).
- Added new FontTools icon images (8ee7c32).
- [unicodedata] Added ``script_horizontal_direction`` function that returns
either "LTR" or "RTL" given a unicode script code.
- [otConverters] Don't write descriptive name string as XML comment if the
NameID value is 0 (== NULL) (#1151, #1152).
- [unicodedata] Add ``ot_tags_from_script`` function to get the list of
OpenType script tags associated with unicode script code (#1150).
- [feaLib] Don't error when "enumerated" kern pairs conflict with preceding
single pairs; emit warning and chose the first value (#1147, #1148).
- [loggingTools] In ``CapturingLogHandler.assertRegex`` method, match the
fully formatted log message.
- [sbix] Fixed TypeError when concatenating str and bytes (#1154).
- [bezierTools] Implemented cusp support and removed ``approximate_fallback``
arg in ``calcQuadraticArcLength``. Added ``calcCubicArcLength`` (#1142).
3.21.2 (released 2018-01-08)
----------------------------
- [varLib] Fixed merging PairPos Format1/2 with missing subtables (#1125).
3.21.1 (released 2018-01-03)
----------------------------
- [feaLib] Allow mixed single/multiple substitutions (#612)
- Added missing ``*.afm`` test assets to MAINFEST.in (#1137).
- Fixed dumping ``SVG`` tables containing color palettes (#1124).
3.21.0 (released 2017-12-18)
----------------------------
- [cmap] when compiling format6 subtable, don't assume gid0 is always called
'.notdef' (1e42224).
- [ot] Allow decompiling fonts with bad Coverage format number (1aafae8).
- Change FontTools licence to MIT (#1127).
- [post] Prune extra names already in standard Mac set (df1e8c7).
- [subset] Delete empty SubrsIndex after subsetting (#994, #1118).
- [varLib] Don't share points in cvar by default, as it currently fails on
some browsers (#1113).
- [afmLib] Make poor old afmLib work on python3.
3.20.1 (released 2017-11-22)
----------------------------
- [unicodedata] Fixed issue with ``script`` and ``script_extension`` functions
returning inconsistent short vs long names. They both return the short four-
letter script codes now. Added ``script_name`` and ``script_code`` functions
to look up the long human-readable script name from the script code, and
viceversa (#1109, #1111).
3.20.0 (released 2017-11-21)
----------------------------
- [unicodedata] Addded new module ``fontTools.unicodedata`` which exports the
same interface as the built-in ``unicodedata`` module, with the addition of
a few functions that are missing from the latter, such as ``script``,
``script_extension`` and ``block``. Added a ``MetaTools/buildUCD.py`` script
to download and parse data files from the Unicode Character Database and
generate python modules containing lists of ranges and property values.
- [feaLib] Added ``__str__`` method to all ``ast`` elements (delegates to the
``asFea`` method).
- [feaLib] ``Parser`` constructor now accepts a ``glyphNames`` iterable
instead of ``glyphMap`` dict. The latter still works but with a pending
deprecation warning (#1104).
- [bezierTools] Added arc length calculation functions originally from
``pens.perimeterPen`` module (#1101).
- [varLib] Started generating STAT table (8af4309). Right now it just reflects
the axes, and even that with certain limitations:
* AxisOrdering is set to the order axes are defined,
* Name-table entries are not shared with fvar.
- [py23] Added backports for ``redirect_stdout`` and ``redirect_stderr``
context managers (#1097).
- [Graphite] Fixed some round-trip bugs (#1093).
3.19.0 (released 2017-11-06)
----------------------------
- [varLib] Try set of used points instead of all points when testing whether to
share points between tuples (#1090).
- [CFF2] Fixed issue with reading/writing PrivateDict BlueValues to TTX file.
Read the commit message 8b02b5a and issue #1030 for more details.
NOTE: this change invalidates all the TTX files containing CFF2 tables
that where dumped with previous verisons of fonttools.
CFF2 Subr items can have values on the stack after the last operator, thus
a ``CFF2Subr`` class was added to accommodate this (#1091).
- [_k_e_r_n] Fixed compilation of AAT kern version=1.0 tables (#1089, #1094)
- [ttLib] Added getBestCmap() convenience method to TTFont class and cmap table
class that returns a preferred Unicode cmap subtable given a list of options
(#1092).
- [morx] Emit more meaningful subtable flags. Implement InsertionMorphAction
3.18.0 (released 2017-10-30)
----------------------------
- [feaLib] Fixed writing back nested glyph classes (#1086).
- [TupleVariation] Reactivated shared points logic, bugfixes (#1009).
- [AAT] Implemented ``morx`` ligature subtables (#1082).
- [reverseContourPen] Keep duplicate lineTo following a moveTo (#1080,
https://github.com/googlei18n/cu2qu/issues/51).
- [varLib.mutator] Suport instantiation of GPOS, GDEF and MVAR (#1079).
- [sstruct] Fixed issue with ``unicode_literals`` and ``struct`` module in
old versions of python 2.7 (#993).
3.17.0 (released 2017-10-16)
----------------------------
- [svgPathPen] Added an ``SVGPathPen`` that translates segment pen commands
into SVG path descriptions. Copied from Tal Leming's ``ufo2svg.svgPathPen``
https://github.com/typesupply/ufo2svg/blob/d69f992/Lib/ufo2svg/svgPathPen.py
- [reverseContourPen] Added ``ReverseContourPen``, a filter pen that draws
contours with the winding direction reversed, while keeping the starting
point (#1071).
- [filterPen] Added ``ContourFilterPen`` to manipulate contours as a whole
rather than segment by segment.
- [arrayTools] Added ``Vector`` class to apply math operations on an array
of numbers, and ``pairwise`` function to loop over pairs of items in an
iterable.
- [varLib] Added support for building and interpolation of ``cvar`` table
(f874cf6, a25a401).
3.16.0 (released 2017-10-03)
----------------------------
- [head] Try using ``SOURCE_DATE_EPOCH`` environment variable when setting
the ``head`` modified timestamp to ensure reproducible builds (#1063).
See https://reproducible-builds.org/specs/source-date-epoch/
- [VTT] Decode VTT's ``TSI*`` tables text as UTF-8 (#1060).
- Added support for Graphite font tables: Feat, Glat, Gloc, Silf and Sill.
Thanks @mhosken! (#1054).
- [varLib] Default to using axis "name" attribute if "labelname" element
is missing (588f524).
- [merge] Added support for merging Script records. Remove unused features
and lookups after merge (d802580, 556508b).
- Added ``fontTools.svgLib`` package. Includes a parser for SVG Paths that
supports the Pen protocol (#1051). Also, added a snippet to convert SVG
outlines to UFO GLIF (#1053).
- [AAT] Added support for ``ankr``, ``bsln``, ``mort``, ``morx``, ``gcid``,
and ``cidg``.
- [subset] Implemented subsetting of ``prop``, ``opbd``, ``bsln``, ``lcar``.
3.15.1 (released 2017-08-18)
----------------------------
- [otConverters] Implemented ``__add__`` and ``__radd__`` methods on
``otConverters._LazyList`` that decompile a lazy list before adding
it to another list or ``_LazyList`` instance. Fixes an ``AttributeError``
in the ``subset`` module when attempting to sum ``_LazyList`` objects
(6ef48bd2, 1aef1683).
- [AAT] Support the `opbd` table with optical bounds (a47f6588).
- [AAT] Support `prop` table with glyph properties (d05617b4).
3.15.0 (released 2017-08-17)
----------------------------
- [AAT] Added support for AAT lookups. The ``lcar`` table can be decompiled
and recompiled; futher work needed to handle ``morx`` table (#1025).
- [subset] Keep (empty) DefaultLangSys for Script 'DFLT' (6eb807b5).
- [subset] Support GSUB/GPOS.FeatureVariations (fe01d87b).
- [varLib] In ``models.supportScalars``, ignore an axis when its peak value
is 0 (fixes #1020).
- [varLib] Add default mappings to all axes in avar to fix rendering issue
in some rasterizers (19c4b377, 04eacf13).
- [varLib] Flatten multiple tail PairPosFormat2 subtables before merging
(c55ef525).
- [ttLib] Added support for recalculating font bounding box in ``CFF`` and
``head`` tables, and min/max values in ``hhea`` and ``vhea`` tables (#970).
3.14.0 (released 2017-07-31)
----------------------------
- [varLib.merger] Remove Extensions subtables before merging (f7c20cf8).
- [varLib] Initialize the avar segment map with required default entries
(#1014).
- [varLib] Implemented optimal IUP optmiziation (#1019).
- [otData] Add ``AxisValueFormat4`` for STAT table v1.2 from OT v1.8.2
(#1015).
- [name] Fixed BCP46 language tag for Mac langID=9: 'si' -> 'sl'.
- [subset] Return value from ``_DehintingT2Decompiler.op_hintmask``
(c0d672ba).
- [cffLib] Allow to get TopDict by index as well as by name (dca96c9c).
- [cffLib] Removed global ``isCFF2`` state; use one set of classes for
both CFF and CFF2, maintaining backward compatibility existing code (#1007).
- [cffLib] Deprecated maxstack operator, per OpenType spec update 1.8.1.
- [cffLib] Added missing default (-100) for UnderlinePosition (#983).
- [feaLib] Enable setting nameIDs greater than 255 (#1003).
- [varLib] Recalculate ValueFormat when merging SinglePos (#996).
- [varLib] Do not emit MVAR if there are no entries in the variation store
(#987).
- [ttx] For ``-x`` option, pad with space if table tag length is < 4.
3.13.1 (released 2017-05-30)
----------------------------
- [feaLib.builder] Removed duplicate lookups optimization. The original
lookup order and semantics of the feature file are preserved (#976).
3.13.0 (released 2017-05-24)
----------------------------
- [varLib.mutator] Implement IUP optimization (#969).
- [_g_l_y_f.GlyphCoordinates] Changed ``__bool__()`` semantics to match those
of other iterables (e46f949). Removed ``__abs__()`` (3db5be2).
- [varLib.interpolate_layout] Added ``mapped`` keyword argument to
``interpolate_layout`` to allow disabling avar mapping: if False (default),
the location is mapped using the map element of the axes in designspace file;
if True, it is assumed that location is in designspace's internal space and
no mapping is performed (#950, #975).
- [varLib.interpolate_layout] Import designspace-loading logic from varLib.
- [varLib] Fixed bug with recombining PairPosClass2 subtables (81498e5, #914).
- [cffLib.specializer] When copying iterables, cast to list (462b7f86).
3.12.1 (released 2017-05-18)
----------------------------
- [pens.t2CharStringPen] Fixed AttributeError when calling addComponent in
T2CharStringPen (#965).
3.12.0 (released 2017-05-17)
----------------------------
- [cffLib.specializer] Added new ``specializer`` module to optimize CFF
charstrings, used by the T2CharStringPen (#948).
- [varLib.mutator] Sort glyphs by component depth before calculating composite
glyphs' bounding boxes to ensure deltas are correctly caclulated (#945).
- [_g_l_y_f] Fixed loss of precision in GlyphCoordinates by using 'd' (double)
instead of 'f' (float) as ``array.array`` typecode (#963, #964).
3.11.0 (released 2017-05-03)
----------------------------
- [t2CharStringPen] Initial support for specialized Type2 path operators:
vmoveto, hmoveto, vlineto, hlineto, vvcurveto, hhcurveto, vhcurveto and
hvcurveto. This should produce more compact charstrings (#940, #403).
- [Doc] Added Sphinx sources for the documentation. Thanks @gferreira (#935).
- [fvar] Expose flags in XML (#932)
- [name] Add helper function for building multi-lingual names (#921)
- [varLib] Fixed kern merging when a PairPosFormat2 has ClassDef1 with glyphs
that are NOT present in the Coverage (1b5e1c4, #939).
- [varLib] Fixed non-deterministic ClassDef order with PY3 (f056c12, #927).
- [feLib] Throw an error when the same glyph is defined in multiple mark
classes within the same lookup (3e3ff00, #453).
3.10.0 (released 2017-04-14)
----------------------------
- [varLib] Added support for building ``avar`` table, using the designspace
``<map>`` elements.
- [varLib] Removed unused ``build(..., axisMap)`` argument. Axis map should
be specified in designspace file now. We do not accept nonstandard axes
if ``<axes>`` element is not present.
- [varLib] Removed "custom" axis from the ``standard_axis_map``. This was
added before when glyphsLib was always exporting the (unused) custom axis.
- [varLib] Added partial support for building ``MVAR`` table; does not
implement ``gasp`` table variations yet.
- [pens] Added FilterPen base class, for pens that control another pen;
factored out ``addComponent`` method from BasePen into a separate abstract
DecomposingPen class; added DecomposingRecordingPen, which records
components decomposed as regular contours.
- [TSI1] Fixed computation of the textLength of VTT private tables (#913).
- [loggingTools] Added ``LogMixin`` class providing a ``log`` property to
subclasses, which returns a ``logging.Logger`` named after the latter.
- [loggingTools] Added ``assertRegex`` method to ``CapturingLogHandler``.
- [py23] Added backport for python 3's ``types.SimpleNamespace`` class.
- [EBLC] Fixed issue with python 3 ``zip`` iterator.
3.9.2 (released 2017-04-08)
---------------------------
- [pens] Added pen to draw glyphs using WxPython ``GraphicsPath`` class:
https://wxpython.org/docs/api/wx.GraphicsPath-class.html
- [varLib.merger] Fixed issue with recombining multiple PairPosFormat2
subtables (#888)
- [varLib] Do not encode gvar deltas that are all zeroes, or if all values
are smaller than tolerance.
- [ttLib] _TTGlyphSet glyphs now also have ``height`` and ``tsb`` (top
side bearing) attributes from the ``vmtx`` table, if present.
- [glyf] In ``GlyphCoordintes`` class, added ``__bool__`` / ``__nonzero__``
methods, and ``array`` property to get raw array.
- [ttx] Support reading TTX files with BOM (#896)
- [CFF2] Fixed the reporting of the number of regions in the font.
3.9.1 (released 2017-03-20)
---------------------------
- [varLib.merger] Fixed issue while recombining multiple PairPosFormat2
subtables if they were split because of offset overflows (9798c30).
- [varLib.merger] Only merge multiple PairPosFormat1 subtables if there is
at least one of the fonts with a non-empty Format1 subtable (0f5a46b).
- [varLib.merger] Fixed IndexError with empty ClassDef1 in PairPosFormat2
(aad0d46).
- [varLib.merger] Avoid reusing Class2Record (mutable) objects (e6125b3).
- [varLib.merger] Calculate ClassDef1 and ClassDef2's Format when merging
PairPosFormat2 (23511fd).
- [macUtils] Added missing ttLib import (b05f203).
3.9.0 (released 2017-03-13)
---------------------------
- [feaLib] Added (partial) support for parsing feature file comments ``# ...``
appearing in between statements (#879).
- [feaLib] Cleaned up syntax tree for FeatureNames.
- [ttLib] Added support for reading/writing ``CFF2`` table (thanks to
@readroberts at Adobe), and ``TTFA`` (ttfautohint) table.
- [varLib] Fixed regression introduced with 3.8.0 in the calculation of
``NumShorts``, i.e. the number of deltas in ItemVariationData's delta sets
that use a 16-bit representation (b2825ff).
3.8.0 (released 2017-03-05)
---------------------------
- New pens: MomentsPen, StatisticsPen, RecordingPen, and TeePen.
- [misc] Added new ``fontTools.misc.symfont`` module, for symbolic font
statistical analysis; requires ``sympy`` (http://www.sympy.org/en/index.html)
- [varLib] Added experimental ``fontTools.varLib.interpolatable`` module for
finding wrong contour order between different masters
- [varLib] designspace.load() now returns a dictionary, instead of a tuple,
and supports <axes> element (#864); the 'masters' item was renamed 'sources',
like the <sources> element in the designspace document
- [ttLib] Fixed issue with recalculating ``head`` modified timestamp when
saving CFF fonts
- [ttLib] In TupleVariation, round deltas before compiling (#861, fixed #592)
- [feaLib] Ignore duplicate glyphs in classes used as MarkFilteringSet and
MarkAttachmentType (#863)
- [merge] Changed the ``gasp`` table merge logic so that only the one from
the first font is retained, similar to other hinting tables (#862)
- [Tests] Added tests for the ``varLib`` package, as well as test fonts
from the "Annotated OpenType Specification" (AOTS) to exercise ``ttLib``'s
table readers/writers (<https://github.com/adobe-type-tools/aots>)
3.7.2 (released 2017-02-17)
---------------------------
- [subset] Keep advance widths when stripping ".notdef" glyph outline in
CID-keyed CFF fonts (#845)
- [feaLib] Zero values now produce the same results as makeotf (#633, #848)
- [feaLib] More compact encoding for “Contextual positioning with in-line
single positioning rules” (#514)
3.7.1 (released 2017-02-15)
---------------------------
- [subset] Fixed issue with ``--no-hinting`` option whereby advance widths in
Type 2 charstrings were also being stripped (#709, #343)
- [feaLib] include statements now resolve relative paths like makeotf (#838)
- [feaLib] table ``name`` now handles Unicode codepoints beyond the Basic
Multilingual Plane, also supports old-style MacOS platform encodings (#842)
- [feaLib] correctly escape string literals when emitting feature syntax (#780)
3.7.0 (released 2017-02-11)
---------------------------
- [ttx, mtiLib] Preserve ordering of glyph alternates in GSUB type 3 (#833).
- [feaLib] Glyph names can have dashes, as per new AFDKO syntax v1.20 (#559).
- [feaLib] feaLib.Parser now needs the font's glyph map for parsing.
- [varLib] Fix regression where GPOS values were stored as 0.
- [varLib] Allow merging of class-based kerning when ClassDefs are different
3.6.3 (released 2017-02-06)
---------------------------
- [varLib] Fix building variation of PairPosFormat2 (b5c34ce).
- Populate defaults even for otTables that have postRead (e45297b).
- Fix compiling of MultipleSubstFormat1 with zero 'out' glyphs (b887860).
3.6.2 (released 2017-01-30)
---------------------------
- [varLib.merger] Fixed "TypeError: reduce() of empty sequence with no
initial value" (3717dc6).
3.6.1 (released 2017-01-28)
---------------------------
- [py23] Fixed unhandled exception occurring at interpreter shutdown in
the "last resort" logging handler (972b3e6).
- [agl] Ensure all glyph names are of native 'str' type; avoid mixing
'str' and 'unicode' in TTFont.glyphOrder (d8c4058).
- Fixed inconsistent title levels in README.rst that caused PyPI to
incorrectly render the reStructuredText page.
3.6.0 (released 2017-01-26)
---------------------------
- [varLib] Refactored and improved the variation-font-building process.
- Assembly code in the fpgm, prep, and glyf tables is now indented in
XML output for improved readability. The ``instruction`` element is
written as a simple tag if empty (#819).
- [ttx] Fixed 'I/O operation on closed file' error when dumping
multiple TTXs to standard output with the '-o -' option.
- The unit test modules (``*_test.py``) have been moved outside of the
fontTools package to the Tests folder, thus they are no longer
installed (#811).
3.5.0 (released 2017-01-14)
---------------------------
- Font tables read from XML can now be written back to XML with no
loss.
- GSUB/GPOS LookupType is written out in XML as an element, not
comment. (#792)
- When parsing cmap table, do not store items mapped to glyph id 0.
(#790)
- [otlLib] Make ClassDef sorting deterministic. Fixes #766 (7d1ddb2)
- [mtiLib] Added unit tests (#787)
- [cvar] Implemented cvar table
- [gvar] Renamed GlyphVariation to TupleVariation to match OpenType
terminology.
- [otTables] Handle gracefully empty VarData.Item array when compiling
XML. (#797)
- [varLib] Re-enabled generation of ``HVAR`` table for fonts with
TrueType outlines; removed ``--build-HVAR`` command-line option.
- [feaLib] The parser can now be extended to support non-standard
statements in FEA code by using a customized Abstract Syntax Tree.
See, for example, ``feaLib.builder_test.test_extensions`` and
baseClass.feax (#794, fixes #773).
- [feaLib] Added ``feaLib`` command to the 'fonttools' command-line
tool; applies a feature file to a font. ``fonttools feaLib -h`` for
help.
- [pens] The ``T2CharStringPen`` now takes an optional
``roundTolerance`` argument to control the rounding of coordinates
(#804, fixes #769).
- [ci] Measure test coverage on all supported python versions and OSes,
combine coverage data and upload to
https://codecov.io/gh/fonttools/fonttools (#786)
- [ci] Configured Travis and Appveyor for running tests on Python 3.6
(#785, 55c03bc)
- The manual pages installation directory can be customized through
``FONTTOOLS_MANPATH`` environment variable (#799, fixes #84).
- [Snippets] Added otf2ttf.py, for converting fonts from CFF to
TrueType using the googlei18n/cu2qu module (#802)
3.4.0 (released 2016-12-21)
---------------------------
- [feaLib] Added support for generating FEA text from abstract syntax
tree (AST) objects (#776). Thanks @mhosken
- Added ``agl.toUnicode`` function to convert AGL-compliant glyph names
to Unicode strings (#774)
- Implemented MVAR table (b4d5381)
3.3.1 (released 2016-12-15)
---------------------------
- [setup] We no longer use versioneer.py to compute fonttools version
from git metadata, as this has caused issues for some users (#767).
Now we bump the version strings manually with a custom ``release``
command of setup.py script.
3.3.0 (released 2016-12-06)
---------------------------
- [ttLib] Implemented STAT table from OpenType 1.8 (#758)
- [cffLib] Fixed decompilation of CFF fonts containing non-standard
key/value pairs in FontDict (issue #740; PR #744)
- [py23] minor: in ``round3`` function, allow the second argument to be
``None`` (#757)
- The standalone ``sstruct`` and ``xmlWriter`` modules, deprecated
since vesion 3.2.0, have been removed. They can be imported from the
``fontTools.misc`` package.
3.2.3 (released 2016-12-02)
---------------------------
- [py23] optimized performance of round3 function; added backport for
py35 math.isclose() (9d8dacb)
- [subset] fixed issue with 'narrow' (UCS-2) Python 2 builds and
``--text``/``--text-file`` options containing non-BMP chararcters
(16d0e5e)
- [varLib] fixed issuewhen normalizing location values (8fa2ee1, #749)
- [inspect] Made it compatible with both python2 and python3 (167ee60,
#748). Thanks @pnemade
3.2.2 (released 2016-11-24)
---------------------------
- [varLib] Do not emit null axes in fvar (1bebcec). Thanks @robmck-ms
- [varLib] Handle fonts without GPOS (7915a45)
- [merge] Ignore LangSys if None (a11bc56)
- [subset] Fix subsetting MathVariants (78d3cbe)
- [OS/2] Fix "Private Use (plane 15)" range (08a0d55). Thanks @mashabow
3.2.1 (released 2016-11-03)
---------------------------
- [OS/2] fix checking ``fsSelection`` bits matching ``head.macStyle``
bits
- [varLib] added ``--build-HVAR`` option to generate ``HVAR`` table for
fonts with TrueType outlines. For ``CFF2``, it is enabled by default.
3.2.0 (released 2016-11-02)
---------------------------
- [varLib] Improve support for OpenType 1.8 Variable Fonts:
- Implement GDEF's VariationStore
- Implement HVAR/VVAR tables
- Partial support for loading MutatorMath .designspace files with
varLib.designspace module
- Add varLib.models with Variation fonts interpolation models
- Implement GSUB/GPOS FeatureVariations
- Initial support for interpolating and merging OpenType Layout tables
(see ``varLib.interpolate_layout`` and ``varLib.merger`` modules)
- [API change] Change version to be an integer instead of a float in
XML output for GSUB, GPOS, GDEF, MATH, BASE, JSTF, HVAR, VVAR, feat,
hhea and vhea tables. Scripts that set the Version for those to 1.0
or other float values also need fixing. A warning is emitted when
code or XML needs fix.
- several bug fixes to the cffLib module, contributed by Adobe's
@readroberts
- The XML output for CFF table now has a 'major' and 'minor' elements
for specifying whether it's version 1.0 or 2.0 (support for CFF2 is
coming soon)
- [setup.py] remove undocumented/deprecated ``extra_path`` Distutils
argument. This means that we no longer create a "FontTools" subfolder
in site-packages containing the actual fontTools package, as well as
the standalone xmlWriter and sstruct modules. The latter modules are
also deprecated, and scheduled for removal in upcoming releases.
Please change your import statements to point to from fontTools.misc
import xmlWriter and from fontTools.misc import sstruct.
- [scripts] Add a 'fonttools' command-line tool that simply runs
``fontTools.*`` sub-modules: e.g. ``fonttools ttx``,
``fonttools subset``, etc.
- [hmtx/vmts] Read advance width/heights as unsigned short (uint16);
automatically round float values to integers.
- [ttLib/xmlWriter] add 'newlinestr=None' keyword argument to
``TTFont.saveXML`` for overriding os-specific line endings (passed on
to ``XMLWriter`` instances).
- [versioning] Use versioneer instead of ``setuptools_scm`` to
dynamically load version info from a git checkout at import time.
- [feaLib] Support backslash-prefixed glyph names.
3.1.2 (released 2016-09-27)
---------------------------
- restore Makefile as an alternative way to build/check/install
- README.md: update instructions for installing package from source,
and for running test suite
- NEWS: Change log was out of sync with tagged release
3.1.1 (released 2016-09-27)
---------------------------
- Fix ``ttLibVersion`` attribute in TTX files still showing '3.0'
instead of '3.1'.
- Use ``setuptools_scm`` to manage package versions.
3.1.0 (released 2016-09-26)
---------------------------
- [feaLib] New library to parse and compile Adobe FDK OpenType Feature
files.
- [mtiLib] New library to parse and compile Monotype 'FontDame'
OpenType Layout Tables files.
- [voltLib] New library to parse Microsoft VOLT project files.
- [otlLib] New library to work with OpenType Layout tables.
- [varLib] New library to work with OpenType Font Variations.
- [pens] Add ttGlyphPen to draw to TrueType glyphs, and t2CharStringPen
to draw to Type 2 Charstrings (CFF); add areaPen and perimeterPen.
- [ttLib.tables] Implement 'meta' and 'trak' tables.
- [ttx] Add --flavor option for compiling to 'woff' or 'woff2'; add
``--with-zopfli`` option to use Zopfli to compress WOFF 1.0 fonts.
- [subset] Support subsetting 'COLR'/'CPAL' and 'CBDT'/'CBLC' color
fonts tables, and 'gvar' table for variation fonts.
- [Snippets] Add ``symfont.py``, for symbolic font statistics analysis;
interpolatable.py, a preliminary script for detecting interpolation
errors; ``{merge,dump}_woff_metadata.py``.
- [classifyTools] Helpers to classify things into classes.
- [CI] Run tests on Windows, Linux and macOS using Appveyor and Travis
CI; check unit test coverage with Coverage.py/Coveralls; automatic
deployment to PyPI on tags.
- [loggingTools] Use Python built-in logging module to print messages.
- [py23] Make round() behave like Python 3 built-in round(); define
round2() and round3().
3.0 (released 2015-09-01)
-------------------------
- Add Snippet scripts for cmap subtable format conversion, printing
GSUB/GPOS features, building a GX font from two masters
- TTX WOFF2 support and a ``-f`` option to overwrite output file(s)
- Support GX tables: ``avar``, ``gvar``, ``fvar``, ``meta``
- Support ``feat`` and gzip-compressed SVG tables
- Upgrade Mac East Asian encodings to native implementation if
available
- Add Roman Croatian and Romanian encodings, codecs for mac-extended
East Asian encodings
- Implement optimal GLYF glyph outline packing; disabled by default
2.5 (released 2014-09-24)
-------------------------
- Add a Qt pen
- Add VDMX table converter
- Load all OpenType sub-structures lazily
- Add support for cmap format 13.
- Add pyftmerge tool
- Update to Unicode 6.3.0d3
- Add pyftinspect tool
- Add support for Google CBLC/CBDT color bitmaps, standard EBLC/EBDT
embedded bitmaps, and ``SVG`` table (thanks to Read Roberts at Adobe)
- Add support for loading, saving and ttx'ing WOFF file format
- Add support for Microsoft COLR/CPAL layered color glyphs
- Support PyPy
- Support Jython, by replacing numpy with array/lists modules and
removed it, pure-Python StringIO, not cStringIO
- Add pyftsubset and Subsetter object, supporting CFF and TTF
- Add to ttx args for -q for quiet mode, -z to choose a bitmap dump
format
2.4 (released 2013-06-22)
-------------------------
- Option to write to arbitrary files
- Better dump format for DSIG
- Better detection of OTF XML
- Fix issue with Apple's kern table format
- Fix mangling of TT glyph programs
- Fix issues related to mona.ttf
- Fix Windows Installer instructions
- Fix some modern MacOS issues
- Fix minor issues and typos
2.3 (released 2009-11-08)
-------------------------
- TrueType Collection (TTC) support
- Python 2.6 support
- Update Unicode data to 5.2.0
- Couple of bug fixes
2.2 (released 2008-05-18)
-------------------------
- ClearType support
- cmap format 1 support
- PFA font support
- Switched from Numeric to numpy
- Update Unicode data to 5.1.0
- Update AGLFN data to 1.6
- Many bug fixes
2.1 (released 2008-01-28)
-------------------------
- Many years worth of fixes and features
2.0b2 (released 2002-??-??)
---------------------------
- Be "forgiving" when interpreting the maxp table version field:
interpret any value as 1.0 if it's not 0.5. Fixes dumping of these
GPL fonts: http://www.freebsd.org/cgi/pds.cgi?ports/chinese/wangttf
- Fixed ttx -l: it turned out this part of the code didn't work with
Python 2.2.1 and earlier. My bad to do most of my testing with a
different version than I shipped TTX with :-(
- Fixed bug in ClassDef format 1 subtable (Andreas Seidel bumped into
this one).
2.0b1 (released 2002-09-10)
---------------------------
- Fixed embarrassing bug: the master checksum in the head table is now
calculated correctly even on little-endian platforms (such as Intel).
- Made the cmap format 4 compiler smarter: the binary data it creates
is now more or less as compact as possible. TTX now makes more
compact data than in any shipping font I've tested it with.
- Dump glyph names as a separate "GlyphOrder" pseudo table as opposed
to as part of the glyf table (obviously needed for CFF-OTF's).
- Added proper support for the CFF table.
- Don't barf on empty tables (questionable, but "there are font out
there...")
- When writing TT glyf data, align glyphs on 4-byte boundaries. This
seems to be the current recommendation by MS. Also: don't barf on
fonts which are already 4-byte aligned.
- Windows installer contributed bu Adam Twardoch! Yay!
- Changed the command line interface again, now by creating one new
tool replacing the old ones: ttx It dumps and compiles, depending on
input file types. The options have changed somewhat.
- The -d option is back (output dir)
- ttcompile's -i options is now called -m (as in "merge"), to avoid
clash with dump's -i.
- The -s option ("split tables") no longer creates a directory, but
instead outputs a small .ttx file containing references to the
individual table files. This is not a true link, it's a simple file
name, and the referenced file should be in the same directory so
ttcompile can find them.
- compile no longer accepts a directory as input argument. Instead it
can parse the new "mini-ttx" format as output by "ttx -s".
- all arguments are input files
- Renamed the command line programs and moved them to the Tools
subdirectory. They are now installed by the setup.py install script.
- Added OpenType support. BASE, GDEF, GPOS, GSUB and JSTF are (almost)
fully supported. The XML output is not yet final, as I'm still
considering to output certain subtables in a more human-friendly
manner.
- Fixed 'kern' table to correctly accept subtables it doesn't know
about, as well as interpreting Apple's definition of the 'kern' table
headers correctly.
- Fixed bug where glyphnames were not calculated from 'cmap' if it was
(one of the) first tables to be decompiled. More specifically: it
cmap was the first to ask for a glyphID -> glyphName mapping.
- Switched XML parsers: use expat instead of xmlproc. Should be faster.
- Removed my UnicodeString object: I now require Python 2.0 or up,
which has unicode support built in.
- Removed assert in glyf table: redundant data at the end of the table
is now ignored instead of raising an error. Should become a warning.
- Fixed bug in hmtx/vmtx code that only occured if all advances were
equal.
- Fixed subtle bug in TT instruction disassembler.
- Couple of fixes to the 'post' table.
- Updated OS/2 table to latest spec.
1.0b1 (released 2001-08-10)
---------------------------
- Reorganized the command line interface for ttDump.py and
ttCompile.py, they now behave more like "normal" command line tool,
in that they accept multiple input files for batch processing.
- ttDump.py and ttCompile.py don't silently override files anymore, but
ask before doing so. Can be overridden by -f.
- Added -d option to both ttDump.py and ttCompile.py.
- Installation is now done with distutils. (Needs work for environments
without compilers.)
- Updated installation instructions.
- Added some workarounds so as to handle certain buggy fonts more
gracefully.
- Updated Unicode table to Unicode 3.0 (Thanks Antoine!)
- Included a Python script by Adam Twardoch that adds some useful stuff
to the Windows registry.
- Moved the project to SourceForge.
1.0a6 (released 2000-03-15)
---------------------------
- Big reorganization: made ttLib a subpackage of the new fontTools
package, changed several module names. Called the entire suite
"FontTools"
- Added several submodules to fontTools, some new, some older.
- Added experimental CFF/GPOS/GSUB support to ttLib, read-only (but XML
dumping of GPOS/GSUB is for now disabled)
- Fixed hdmx endian bug
- Added -b option to ttCompile.py, it disables recalculation of
bounding boxes, as requested by Werner Lemberg.
- Renamed tt2xml.pt to ttDump.py and xml2tt.py to ttCompile.py
- Use ".ttx" as file extension instead of ".xml".
- TTX is now the name of the XML-based *format* for TT fonts, and not
just an application.
1.0a5
-----
Never released
- More tables supported: hdmx, vhea, vmtx
1.0a3 & 1.0a4
-------------
Never released
- fixed most portability issues
- retracted the "Euro_or_currency" change from 1.0a2: it was
nonsense!
1.0a2 (released 1999-05-02)
---------------------------
- binary release for MacOS
- genenates full FOND resources: including width table, PS font name
info and kern table if applicable.
- added cmap format 4 support. Extra: dumps Unicode char names as XML
comments!
- added cmap format 6 support
- now accepts true type files starting with "true" (instead of just
0x00010000 and "OTTO")
- 'glyf' table support is now complete: I added support for composite
scale, xy-scale and two-by-two for the 'glyf' table. For now,
component offset scale behaviour defaults to Apple-style. This only
affects the (re)calculation of the glyph bounding box.
- changed "Euro" to "Euro_or_currency" in the Standard Apple Glyph
order list, since we cannot tell from the 'post' table which is
meant. I should probably doublecheck with a Unicode encoding if
available. (This does not affect the output!)
Fixed bugs: - 'hhea' table is now recalculated correctly - fixed wrong
assumption about sfnt resource names
1.0a1 (released 1999-04-27)
---------------------------
- initial binary release for MacOS
@@ -1,122 +0,0 @@
Metadata-Version: 2.1
Name: kiwisolver
Version: 1.4.5
Summary: A fast implementation of the Cassowary constraint solver
Author-email: The Nucleic Development Team <sccolbert@gmail.com>
Maintainer-email: "Matthieu C. Dartiailh" <m.dartiailh@gmail.com>
License: =========================
The Kiwi licensing terms
=========================
Kiwi is licensed under the terms of the Modified BSD License (also known as
New or Revised BSD), as follows:
Copyright (c) 2013, Nucleic Development Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of the Nucleic Development Team nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
About Kiwi
----------
Chris Colbert began the Kiwi project in December 2013 in an effort to
create a blisteringly fast UI constraint solver. Chris is still the
project lead.
The Nucleic Development Team is the set of all contributors to the Nucleic
project and its subprojects.
The core team that coordinates development on GitHub can be found here:
http://github.com/nucleic. The current team consists of:
* Chris Colbert
Our Copyright Policy
--------------------
Nucleic uses a shared copyright model. Each contributor maintains copyright
over their contributions to Nucleic. But, it is important to note that these
contributions are typically only changes to the repositories. Thus, the Nucleic
source code, in its entirety is not the copyright of any single person or
institution. Instead, it is the collective copyright of the entire Nucleic
Development Team. If individual contributors want to maintain a record of what
changes/contributions they have specific copyright on, they should indicate
their copyright in the commit message of the change, when they commit the
change to one of the Nucleic repositories.
With this in mind, the following banner should be used in any source code file
to indicate the copyright and license terms:
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------------------------------------
Project-URL: homepage, https://github.com/nucleic/kiwi
Project-URL: documentation, https://kiwisolver.readthedocs.io/en/latest/
Project-URL: repository, https://github.com/nucleic/kiwi
Project-URL: changelog, https://github.com/nucleic/kiwi/blob/main/releasenotes.rst
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: typing-extensions ; python_version < "3.8"
Welcome to Kiwi
===============
.. image:: https://travis-ci.org/nucleic/kiwi.svg?branch=main
:target: https://travis-ci.org/nucleic/kiwi
.. image:: https://github.com/nucleic/kiwi/workflows/Continuous%20Integration/badge.svg
:target: https://github.com/nucleic/kiwi/actions
.. image:: https://github.com/nucleic/kiwi/workflows/Documentation%20building/badge.svg
:target: https://github.com/nucleic/kiwi/actions
.. image:: https://codecov.io/gh/nucleic/kiwi/branch/main/graph/badge.svg
:target: https://codecov.io/gh/nucleic/kiwi
.. image:: https://readthedocs.org/projects/kiwisolver/badge/?version=latest
:target: https://kiwisolver.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
Kiwi is an efficient C++ implementation of the Cassowary constraint solving
algorithm. Kiwi is an implementation of the algorithm based on the
`seminal Cassowary paper <https://constraints.cs.washington.edu/solvers/cassowary-tochi.pdf>`_.
It is *not* a refactoring of the original C++ solver. Kiwi has been designed
from the ground up to be lightweight and fast. Kiwi ranges from 10x to 500x
faster than the original Cassowary solver with typical use cases gaining a 40x
improvement. Memory savings are consistently > 5x.
In addition to the C++ solver, Kiwi ships with hand-rolled Python bindings for
Python 3.7+.
@@ -1,167 +0,0 @@
Metadata-Version: 2.1
Name: matplotlib
Version: 3.5.2
Summary: Python plotting package
Home-page: https://matplotlib.org
Download-URL: https://matplotlib.org/users/installing.html
Author: John D. Hunter, Michael Droettboom
Author-email: matplotlib-users@python.org
License: PSF
Project-URL: Documentation, https://matplotlib.org
Project-URL: Source Code, https://github.com/matplotlib/matplotlib
Project-URL: Bug Tracker, https://github.com/matplotlib/matplotlib/issues
Project-URL: Forum, https://discourse.matplotlib.org/
Project-URL: Donate, https://numfocus.org/donate-to-matplotlib
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Matplotlib
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE/LICENSE
License-File: LICENSE/LICENSE_AMSFONTS
License-File: LICENSE/LICENSE_BAKOMA
License-File: LICENSE/LICENSE_CARLOGO
License-File: LICENSE/LICENSE_COLORBREWER
License-File: LICENSE/LICENSE_JSXTOOLS_RESIZE_OBSERVER
License-File: LICENSE/LICENSE_QT4_EDITOR
License-File: LICENSE/LICENSE_SOLARIZED
License-File: LICENSE/LICENSE_STIX
License-File: LICENSE/LICENSE_YORICK
Requires-Dist: cycler >=0.10
Requires-Dist: fonttools >=4.22.0
Requires-Dist: kiwisolver >=1.0.1
Requires-Dist: numpy >=1.17
Requires-Dist: packaging >=20.0
Requires-Dist: pillow >=6.2.0
Requires-Dist: pyparsing >=2.2.1
Requires-Dist: python-dateutil >=2.7
|PyPi|_ |Downloads|_ |NUMFocus|_
|DiscourseBadge|_ |Gitter|_ |GitHubIssues|_ |GitTutorial|_
|GitHubActions|_ |AzurePipelines|_ |AppVeyor|_ |Codecov|_ |LGTM|_
.. |GitHubActions| image:: https://github.com/matplotlib/matplotlib/workflows/Tests/badge.svg
.. _GitHubActions: https://github.com/matplotlib/matplotlib/actions?query=workflow%3ATests
.. |AzurePipelines| image:: https://dev.azure.com/matplotlib/matplotlib/_apis/build/status/matplotlib.matplotlib?branchName=master
.. _AzurePipelines: https://dev.azure.com/matplotlib/matplotlib/_build/latest?definitionId=1&branchName=master
.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/github/matplotlib/matplotlib?branch=master&svg=true
.. _AppVeyor: https://ci.appveyor.com/project/matplotlib/matplotlib
.. |Codecov| image:: https://codecov.io/github/matplotlib/matplotlib/badge.svg?branch=master&service=github
.. _Codecov: https://codecov.io/github/matplotlib/matplotlib?branch=master
.. |LGTM| image:: https://img.shields.io/lgtm/grade/python/github/matplotlib/matplotlib.svg?logo=lgtm&logoWidth=18
.. _LGTM: https://lgtm.com/projects/g/matplotlib/matplotlib
.. |DiscourseBadge| image:: https://img.shields.io/badge/help_forum-discourse-blue.svg
.. _DiscourseBadge: https://discourse.matplotlib.org
.. |Gitter| image:: https://badges.gitter.im/matplotlib/matplotlib.svg
.. _Gitter: https://gitter.im/matplotlib/matplotlib
.. |GitHubIssues| image:: https://img.shields.io/badge/issue_tracking-github-blue.svg
.. _GitHubIssues: https://github.com/matplotlib/matplotlib/issues
.. |GitTutorial| image:: https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?
.. _GitTutorial: https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project
.. |PyPi| image:: https://badge.fury.io/py/matplotlib.svg
.. _PyPi: https://badge.fury.io/py/matplotlib
.. |Downloads| image:: https://pepy.tech/badge/matplotlib/month
.. _Downloads: https://pepy.tech/project/matplotlib
.. |NUMFocus| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
.. _NUMFocus: https://numfocus.org
.. image:: https://matplotlib.org/_static/logo2.svg
Matplotlib is a comprehensive library for creating static, animated, and
interactive visualizations in Python.
Check out our `home page <https://matplotlib.org/>`_ for more information.
.. image:: https://matplotlib.org/_static/readme_preview.png
Matplotlib produces publication-quality figures in a variety of hardcopy
formats and interactive environments across platforms. Matplotlib can be used
in Python scripts, the Python and IPython shell, web application servers, and
various graphical user interface toolkits.
Install
=======
For installation instructions and requirements, see the `install documentation
<https://matplotlib.org/stable/users/installing/index.html>`_ or
`installing.rst <doc/users/installing/index.rst>`_ in the source.
Contribute
==========
You've discovered a bug or something else you want to change - excellent!
You've worked out a way to fix it even better!
You want to tell us about it best of all!
Start at the `contributing guide
<https://matplotlib.org/devdocs/devel/contributing.html>`_!
Contact
=======
`Discourse <https://discourse.matplotlib.org/>`_ is the discussion forum for
general questions and discussions and our recommended starting point.
Our active mailing lists (which are mirrored on Discourse) are:
* `Users <https://mail.python.org/mailman/listinfo/matplotlib-users>`_ mailing
list: matplotlib-users@python.org
* `Announcement
<https://mail.python.org/mailman/listinfo/matplotlib-announce>`_ mailing
list: matplotlib-announce@python.org
* `Development <https://mail.python.org/mailman/listinfo/matplotlib-devel>`_
mailing list: matplotlib-devel@python.org
Gitter_ is for coordinating development and asking questions directly related
to contributing to matplotlib.
Citing Matplotlib
=================
If Matplotlib contributes to a project that leads to publication, please
acknowledge this by citing Matplotlib.
`A ready-made citation entry <https://matplotlib.org/stable/users/project/citing.html>`_ is
available.
Research notice
~~~~~~~~~~~~~~~
Please note that this repository is participating in a study into
sustainability of open source projects. Data will be gathered about this
repository for approximately the next 12 months, starting from June 2021.
Data collected will include number of contributors, number of PRs, time taken
to close/merge these PRs, and issues closed.
For more information, please visit `the informational page
<https://sustainable-open-science-and-software.github.io/>`__ or download the
`participant information sheet
<https://sustainable-open-science-and-software.github.io/assets/PIS_sustainable_software.pdf>`__.
@@ -1,440 +0,0 @@
Metadata-Version: 2.1
Name: matplotlib-pyodide
Version: 0.2.1
Summary: HTML5 backends for Matplotlib compatible with Pyodide
Author: Pyodide developers
License: Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
Project-URL: Homepage, https://github.com/pyodide/matplotlib-pyodide
Project-URL: Bug Tracker, https://github.com/pyodide/matplotlib-pyodide/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest-pyodide ==0.52.2 ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: build ==0.10 ; extra == 'test'
# matplotlib-pyodide
[![PyPI Latest Release](https://img.shields.io/pypi/v/matplotlib-pyodide.svg)](https://pypi.org/project/matplotlib-pyodide/)
![GHA](https://github.com/pyodide/matplotlib-pyodide/actions/workflows/main.yml/badge.svg)
[![codecov](https://codecov.io/gh/pyodide/matplotlib-pyodide/branch/main/graph/badge.svg)](https://codecov.io/gh/pyodide/matplotlib-pyodide)
HTML5 backends for Matplotlib compatible with Pyodide
This package includes two matplotlib backends,
- the `wasm_backend` which from allows rendering the Agg buffer as static images into an HTML canvas
- an interactive HTML5 canvas backend `html5_canvas_backend` described in
[this blog post](https://blog.pyodide.org/posts/canvas-renderer-matplotlib-in-pyodide/)
## Installation
This package will be installed as a dependency when you load `matplotlib` in Pyodide.
## Usage
To change the backend in matplotlib,
- for the wasm backend,
```py
import matplotlib
matplotlib.use("module://matplotlib_pyodide.wasm_backend")
```
- for the interactive HTML5 backend;
```py
import matplotlib
matplotlib.use("module://matplotlib_pyodide.html5_canvas_backend")
```
By default, matplotlib figures will be rendered inside a div that's appended to the end of `document.body`.
You can override this behavior by setting `document.pyodideMplTarget` to an HTML element. If you had an HTML
element with id "target", you could configure the backend to render visualizations inside it with this code:
```py
document.pyodideMplTarget = document.getElementById('target')
```
For more information see the [matplotlib documentation](https://matplotlib.org/stable/users/explain/backends.html).
## License
pyodide-cli uses the [Mozilla Public License Version
2.0](https://choosealicense.com/licenses/mpl-2.0/).
Binary file not shown.
@@ -1,421 +0,0 @@
Metadata-Version: 2.1
Name: micropip
Version: 0.6.0
Summary: A lightweight Python package installer for the web
Author: Pyodide developers
License: Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
Project-URL: Homepage, https://github.com/pyodide/micropip
Project-URL: Bug Tracker, https://github.com/pyodide/micropip/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: packaging >=23.0
Provides-Extra: test
Requires-Dist: pytest-httpserver ; extra == 'test'
Requires-Dist: pytest-pyodide ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pytest <8.0.0 ; extra == 'test'
Requires-Dist: build ==0.7.0 ; extra == 'test'
# micropip
[![PyPI Latest Release](https://img.shields.io/pypi/v/micropip.svg)](https://pypi.org/project/micropip/)
![GHA](https://github.com/pyodide/micropip/actions/workflows/main.yml/badge.svg)
A lightweight Python package installer for the web
## Installation
In [Pyodide](https://pyodide.org), you can install micropip,
- either implicitly by importing it in the REPL
- or explicitly via `pyodide.loadPackage('micropip')`. You can also install by URL from PyPI for instance.
## Usage
```py
import micropip
await micropip.install(<list-of-packages>)
```
For more information see the
[documentation](https://pyodide.org/en/stable/usage/loading-packages.html#micropip).
## License
micropip uses the [Mozilla Public License Version
2.0](https://choosealicense.com/licenses/mpl-2.0/).
@@ -1,151 +0,0 @@
Metadata-Version: 2.1
Name: numpy
Version: 1.26.4
Summary: Fundamental package for array computing in Python
Home-page: https://numpy.org
Author: Travis E. Oliphant et al.
Maintainer-Email: NumPy Developers <numpy-discussion@python.org>
License: Copyright (c) 2005-2023, NumPy Developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the NumPy Developers nor the names of any
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Project-URL: Homepage, https://numpy.org
Project-URL: Documentation, https://numpy.org/doc/
Project-URL: Source, https://github.com/numpy/numpy
Project-URL: Download, https://pypi.org/project/numpy/#files
Project-URL: Tracker, https://github.com/numpy/numpy/issues
Project-URL: Release notes, https://numpy.org/doc/stable/release
Requires-Python: >=3.9
Description-Content-Type: text/markdown
<h1 align="center">
<img src="https://raw.githubusercontent.com/numpy/numpy/main/branding/logo/primary/numpylogo.svg" width="300">
</h1><br>
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](
https://numfocus.org)
[![PyPI Downloads](https://img.shields.io/pypi/dm/numpy.svg?label=PyPI%20downloads)](
https://pypi.org/project/numpy/)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/numpy.svg?label=Conda%20downloads)](
https://anaconda.org/conda-forge/numpy)
[![Stack Overflow](https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg)](
https://stackoverflow.com/questions/tagged/numpy)
[![Nature Paper](https://img.shields.io/badge/DOI-10.1038%2Fs41592--019--0686--2-blue)](
https://doi.org/10.1038/s41586-020-2649-2)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/numpy/numpy/badge)](https://api.securityscorecards.dev/projects/github.com/numpy/numpy)
NumPy is the fundamental package for scientific computing with Python.
- **Website:** https://www.numpy.org
- **Documentation:** https://numpy.org/doc
- **Mailing list:** https://mail.python.org/mailman/listinfo/numpy-discussion
- **Source code:** https://github.com/numpy/numpy
- **Contributing:** https://www.numpy.org/devdocs/dev/index.html
- **Bug reports:** https://github.com/numpy/numpy/issues
- **Report a security vulnerability:** https://tidelift.com/docs/security
It provides:
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools for integrating C/C++ and Fortran code
- useful linear algebra, Fourier transform, and random number capabilities
Testing:
NumPy requires `pytest` and `hypothesis`. Tests can then be run after installation with:
python -c "import numpy, sys; sys.exit(numpy.test() is False)"
Code of Conduct
----------------------
NumPy is a community-driven open source project developed by a diverse group of
[contributors](https://numpy.org/teams/). The NumPy leadership has made a strong
commitment to creating an open, inclusive, and positive community. Please read the
[NumPy Code of Conduct](https://numpy.org/code-of-conduct/) for guidance on how to interact
with others in a way that makes our community thrive.
Call for Contributions
----------------------
The NumPy project welcomes your expertise and enthusiasm!
Small improvements or fixes are always appreciated. If you are considering larger contributions
to the source code, please contact us through the [mailing
list](https://mail.python.org/mailman/listinfo/numpy-discussion) first.
Writing code isnt the only way to contribute to NumPy. You can also:
- review pull requests
- help us stay on top of new and old issues
- develop tutorials, presentations, and other educational materials
- maintain and improve [our website](https://github.com/numpy/numpy.org)
- develop graphic design for our brand assets and promotional materials
- translate website content
- help with outreach and onboard new contributors
- write grant proposals and help with other fundraising efforts
For more information about the ways you can contribute to NumPy, visit [our website](https://numpy.org/contribute/).
If youre unsure where to start or how your skills fit in, reach out! You can
ask on the mailing list or here, on GitHub, by opening a new issue or leaving a
comment on a relevant issue that is already open.
Our preferred channels of communication are all public, but if youd like to
speak to us in private first, contact our community coordinators at
numpy-team@googlegroups.com or on Slack (write numpy-team@googlegroups.com for
an invitation).
We also have a biweekly community call, details of which are announced on the
mailing list. You are very welcome to join.
If you are new to contributing to open source, [this
guide](https://opensource.guide/how-to-contribute/) helps explain why, what,
and how to successfully get involved.
-134
View File
@@ -1,134 +0,0 @@
{
"name": "pyodide",
"version": "0.25.1",
"description": "The Pyodide JavaScript package",
"keywords": [
"python",
"webassembly"
],
"homepage": "https://github.com/pyodide/pyodide",
"repository": {
"type": "git",
"url": "https://github.com/pyodide/pyodide"
},
"bugs": {
"url": "https://github.com/pyodide/pyodide/issues"
},
"license": "Apache-2.0",
"devDependencies": {
"@types/assert": "^1.5.6",
"@types/expect": "^24.3.0",
"@types/mocha": "^9.1.0",
"@types/node": "^20.8.4",
"@types/ws": "^8.5.3",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"cross-env": "^7.0.3",
"dts-bundle-generator": "^8.1.1",
"error-stack-parser": "^2.1.4",
"esbuild": "^0.17.12",
"express": "^4.17.3",
"mocha": "^9.0.2",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.2.1",
"ts-mocha": "^9.0.2",
"tsd": "^0.24.1",
"typedoc": "^0.25.1",
"typescript": "^4.6.4",
"wabt": "^1.0.32"
},
"main": "pyodide.js",
"exports": {
".": {
"require": "./pyodide.js",
"import": "./pyodide.mjs",
"types": "./pyodide.d.ts"
},
"./ffi": {
"types": "./ffi.d.ts"
},
"./pyodide.asm.wasm": "./pyodide.asm.wasm",
"./pyodide.asm.js": "./pyodide.asm.js",
"./python_stdlib.zip": "./python_stdlib.zip",
"./pyodide.mjs": "./pyodide.mjs",
"./pyodide.js": "./pyodide.js",
"./package.json": "./package.json",
"./pyodide-lock.json": "./pyodide-lock.json"
},
"files": [
"pyodide.asm.js",
"pyodide.asm.wasm",
"python_stdlib.zip",
"pyodide.mjs",
"pyodide.js.map",
"pyodide.mjs.map",
"pyodide.d.ts",
"ffi.d.ts",
"pyodide-lock.json",
"console.html"
],
"browser": {
"child_process": false,
"crypto": false,
"fs": false,
"fs/promises": false,
"path": false,
"url": false,
"vm": false,
"ws": false
},
"scripts": {
"build": "tsc --noEmit && node esbuild.config.mjs",
"test": "npm-run-all test:*",
"test:unit": "cross-env TEST_NODE=1 ts-mocha --node-option=experimental-loader=./test/loader.mjs --node-option=experimental-wasm-stack-switching -p tsconfig.test.json test/unit/**/*.test.*",
"test:node": "cross-env TEST_NODE=1 mocha test/integration/**/*.test.js",
"test:browser": "mocha test/integration/**/*.test.js",
"tsc": "tsc --noEmit",
"coverage": "cross-env TEST_NODE=1 npm-run-all coverage:*",
"coverage:build": "nyc npm run test:node"
},
"mocha": {
"bail": false,
"timeout": 30000,
"full-trace": true,
"inline-diffs": true,
"check-leaks": false,
"global": [
"pyodide",
"page",
"chai"
]
},
"nyc": {
"reporter": [
"html",
"text-summary"
],
"include": [
"*.ts"
],
"all": true,
"clean": true,
"cache": false,
"instrument": false,
"checkCoverage": true,
"statements": 95,
"functions": 95,
"branches": 80,
"lines": 95
},
"tsd": {
"compilerOptions": {
"lib": [
"ES2017",
"DOM"
]
}
},
"dependencies": {
"base-64": "^1.0.0",
"ws": "^8.5.0"
},
"types": "./pyodide.d.ts"
}
Binary file not shown.
@@ -1,102 +0,0 @@
Metadata-Version: 2.1
Name: packaging
Version: 23.2
Summary: Core utilities for Python packages
Author-email: Donald Stufft <donald@stufft.io>
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Typing :: Typed
Project-URL: Documentation, https://packaging.pypa.io/
Project-URL: Source, https://github.com/pypa/packaging
packaging
=========
.. start-intro
Reusable core utilities for various Python Packaging
`interoperability specifications <https://packaging.python.org/specifications/>`_.
This library provides utilities that implement the interoperability
specifications which have clearly one correct behaviour (eg: :pep:`440`)
or benefit greatly from having a single shared implementation (eg: :pep:`425`).
.. end-intro
The ``packaging`` project includes the following: version handling, specifiers,
markers, requirements, tags, utilities.
Documentation
-------------
The `documentation`_ provides information and the API for the following:
- Version Handling
- Specifiers
- Markers
- Requirements
- Tags
- Utilities
Installation
------------
Use ``pip`` to install these utilities::
pip install packaging
The ``packaging`` library uses calendar-based versioning (``YY.N``).
Discussion
----------
If you run into bugs, you can file them in our `issue tracker`_.
You can also join ``#pypa`` on Freenode to ask questions or get involved.
.. _`documentation`: https://packaging.pypa.io/
.. _`issue tracker`: https://github.com/pypa/packaging/issues
Code of Conduct
---------------
Everyone interacting in the packaging project's codebases, issue trackers, chat
rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
Contributing
------------
The ``CONTRIBUTING.rst`` file outlines how to contribute to this project as
well as how to report a potential security issue. The documentation for this
project also covers information about `project development`_ and `security`_.
.. _`project development`: https://packaging.pypa.io/en/latest/development/
.. _`security`: https://packaging.pypa.io/en/latest/security/
Project History
---------------
Please review the ``CHANGELOG.rst`` file or the `Changelog documentation`_ for
recent changes and project history.
.. _`Changelog documentation`: https://packaging.pypa.io/en/latest/changelog/
@@ -1,352 +0,0 @@
Metadata-Version: 2.1
Name: pandas
Version: 2.2.0
Summary: Powerful data structures for data analysis, time series, and statistics
Home-page: https://pandas.pydata.org
Author-Email: The Pandas Development Team <pandas-dev@python.org>
License: BSD 3-Clause License
Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
All rights reserved.
Copyright (c) 2011-2023, Open source contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Project-URL: Homepage, https://pandas.pydata.org
Project-URL: Documentation, https://pandas.pydata.org/docs/
Project-URL: Repository, https://github.com/pandas-dev/pandas
Requires-Python: >=3.9
Requires-Dist: numpy<2,>=1.22.4; python_version < "3.11"
Requires-Dist: numpy<2,>=1.23.2; python_version == "3.11"
Requires-Dist: numpy<2,>=1.26.0; python_version >= "3.12"
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pytz>=2020.1
Requires-Dist: tzdata>=2022.7
Requires-Dist: hypothesis>=6.46.1; extra == "test"
Requires-Dist: pytest>=7.3.2; extra == "test"
Requires-Dist: pytest-xdist>=2.2.0; extra == "test"
Requires-Dist: bottleneck>=1.3.6; extra == "performance"
Requires-Dist: numba>=0.56.4; extra == "performance"
Requires-Dist: numexpr>=2.8.4; extra == "performance"
Requires-Dist: scipy>=1.10.0; extra == "computation"
Requires-Dist: xarray>=2022.12.0; extra == "computation"
Requires-Dist: fsspec>=2022.11.0; extra == "fss"
Requires-Dist: s3fs>=2022.11.0; extra == "aws"
Requires-Dist: gcsfs>=2022.11.0; extra == "gcp"
Requires-Dist: pandas-gbq>=0.19.0; extra == "gcp"
Requires-Dist: odfpy>=1.4.1; extra == "excel"
Requires-Dist: openpyxl>=3.1.0; extra == "excel"
Requires-Dist: python-calamine>=0.1.7; extra == "excel"
Requires-Dist: pyxlsb>=1.0.10; extra == "excel"
Requires-Dist: xlrd>=2.0.1; extra == "excel"
Requires-Dist: xlsxwriter>=3.0.5; extra == "excel"
Requires-Dist: pyarrow>=10.0.1; extra == "parquet"
Requires-Dist: pyarrow>=10.0.1; extra == "feather"
Requires-Dist: tables>=3.8.0; extra == "hdf5"
Requires-Dist: pyreadstat>=1.2.0; extra == "spss"
Requires-Dist: SQLAlchemy>=2.0.0; extra == "postgresql"
Requires-Dist: psycopg2>=2.9.6; extra == "postgresql"
Requires-Dist: adbc-driver-postgresql>=0.8.0; extra == "postgresql"
Requires-Dist: SQLAlchemy>=2.0.0; extra == "mysql"
Requires-Dist: pymysql>=1.0.2; extra == "mysql"
Requires-Dist: SQLAlchemy>=2.0.0; extra == "sql-other"
Requires-Dist: adbc-driver-postgresql>=0.8.0; extra == "sql-other"
Requires-Dist: adbc-driver-sqlite>=0.8.0; extra == "sql-other"
Requires-Dist: beautifulsoup4>=4.11.2; extra == "html"
Requires-Dist: html5lib>=1.1; extra == "html"
Requires-Dist: lxml>=4.9.2; extra == "html"
Requires-Dist: lxml>=4.9.2; extra == "xml"
Requires-Dist: matplotlib>=3.6.3; extra == "plot"
Requires-Dist: jinja2>=3.1.2; extra == "output-formatting"
Requires-Dist: tabulate>=0.9.0; extra == "output-formatting"
Requires-Dist: PyQt5>=5.15.9; extra == "clipboard"
Requires-Dist: qtpy>=2.3.0; extra == "clipboard"
Requires-Dist: zstandard>=0.19.0; extra == "compression"
Requires-Dist: dataframe-api-compat>=0.1.7; extra == "consortium-standard"
Requires-Dist: adbc-driver-postgresql>=0.8.0; extra == "all"
Requires-Dist: adbc-driver-sqlite>=0.8.0; extra == "all"
Requires-Dist: beautifulsoup4>=4.11.2; extra == "all"
Requires-Dist: bottleneck>=1.3.6; extra == "all"
Requires-Dist: dataframe-api-compat>=0.1.7; extra == "all"
Requires-Dist: fastparquet>=2022.12.0; extra == "all"
Requires-Dist: fsspec>=2022.11.0; extra == "all"
Requires-Dist: gcsfs>=2022.11.0; extra == "all"
Requires-Dist: html5lib>=1.1; extra == "all"
Requires-Dist: hypothesis>=6.46.1; extra == "all"
Requires-Dist: jinja2>=3.1.2; extra == "all"
Requires-Dist: lxml>=4.9.2; extra == "all"
Requires-Dist: matplotlib>=3.6.3; extra == "all"
Requires-Dist: numba>=0.56.4; extra == "all"
Requires-Dist: numexpr>=2.8.4; extra == "all"
Requires-Dist: odfpy>=1.4.1; extra == "all"
Requires-Dist: openpyxl>=3.1.0; extra == "all"
Requires-Dist: pandas-gbq>=0.19.0; extra == "all"
Requires-Dist: psycopg2>=2.9.6; extra == "all"
Requires-Dist: pyarrow>=10.0.1; extra == "all"
Requires-Dist: pymysql>=1.0.2; extra == "all"
Requires-Dist: PyQt5>=5.15.9; extra == "all"
Requires-Dist: pyreadstat>=1.2.0; extra == "all"
Requires-Dist: pytest>=7.3.2; extra == "all"
Requires-Dist: pytest-xdist>=2.2.0; extra == "all"
Requires-Dist: python-calamine>=0.1.7; extra == "all"
Requires-Dist: pyxlsb>=1.0.10; extra == "all"
Requires-Dist: qtpy>=2.3.0; extra == "all"
Requires-Dist: scipy>=1.10.0; extra == "all"
Requires-Dist: s3fs>=2022.11.0; extra == "all"
Requires-Dist: SQLAlchemy>=2.0.0; extra == "all"
Requires-Dist: tables>=3.8.0; extra == "all"
Requires-Dist: tabulate>=0.9.0; extra == "all"
Requires-Dist: xarray>=2022.12.0; extra == "all"
Requires-Dist: xlrd>=2.0.1; extra == "all"
Requires-Dist: xlsxwriter>=3.0.5; extra == "all"
Requires-Dist: zstandard>=0.19.0; extra == "all"
Provides-Extra: test
Provides-Extra: performance
Provides-Extra: computation
Provides-Extra: fss
Provides-Extra: aws
Provides-Extra: gcp
Provides-Extra: excel
Provides-Extra: parquet
Provides-Extra: feather
Provides-Extra: hdf5
Provides-Extra: spss
Provides-Extra: postgresql
Provides-Extra: mysql
Provides-Extra: sql-other
Provides-Extra: html
Provides-Extra: xml
Provides-Extra: plot
Provides-Extra: output-formatting
Provides-Extra: clipboard
Provides-Extra: compression
Provides-Extra: consortium-standard
Provides-Extra: all
Description-Content-Type: text/markdown
<div align="center">
<img src="https://pandas.pydata.org/static/img/pandas.svg"><br>
</div>
-----------------
# pandas: powerful Python data analysis toolkit
| | |
| --- | --- |
| Testing | [![CI - Test](https://github.com/pandas-dev/pandas/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/pandas-dev/pandas/actions/workflows/unit-tests.yml) [![Coverage](https://codecov.io/github/pandas-dev/pandas/coverage.svg?branch=main)](https://codecov.io/gh/pandas-dev/pandas) |
| Package | [![PyPI Latest Release](https://img.shields.io/pypi/v/pandas.svg)](https://pypi.org/project/pandas/) [![PyPI Downloads](https://img.shields.io/pypi/dm/pandas.svg?label=PyPI%20downloads)](https://pypi.org/project/pandas/) [![Conda Latest Release](https://anaconda.org/conda-forge/pandas/badges/version.svg)](https://anaconda.org/conda-forge/pandas) [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/pandas.svg?label=Conda%20downloads)](https://anaconda.org/conda-forge/pandas) |
| Meta | [![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3509134.svg)](https://doi.org/10.5281/zenodo.3509134) [![License - BSD 3-Clause](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/main/LICENSE) [![Slack](https://img.shields.io/badge/join_Slack-information-brightgreen.svg?logo=slack)](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack) |
## What is it?
**pandas** is a Python package that provides fast, flexible, and expressive data
structures designed to make working with "relational" or "labeled" data both
easy and intuitive. It aims to be the fundamental high-level building block for
doing practical, **real world** data analysis in Python. Additionally, it has
the broader goal of becoming **the most powerful and flexible open source data
analysis / manipulation tool available in any language**. It is already well on
its way towards this goal.
## Table of Contents
- [Main Features](#main-features)
- [Where to get it](#where-to-get-it)
- [Dependencies](#dependencies)
- [Installation from sources](#installation-from-sources)
- [License](#license)
- [Documentation](#documentation)
- [Background](#background)
- [Getting Help](#getting-help)
- [Discussion and Development](#discussion-and-development)
- [Contributing to pandas](#contributing-to-pandas)
## Main Features
Here are just a few of the things that pandas does well:
- Easy handling of [**missing data**][missing-data] (represented as
`NaN`, `NA`, or `NaT`) in floating point as well as non-floating point data
- Size mutability: columns can be [**inserted and
deleted**][insertion-deletion] from DataFrame and higher dimensional
objects
- Automatic and explicit [**data alignment**][alignment]: objects can
be explicitly aligned to a set of labels, or the user can simply
ignore the labels and let `Series`, `DataFrame`, etc. automatically
align the data for you in computations
- Powerful, flexible [**group by**][groupby] functionality to perform
split-apply-combine operations on data sets, for both aggregating
and transforming data
- Make it [**easy to convert**][conversion] ragged,
differently-indexed data in other Python and NumPy data structures
into DataFrame objects
- Intelligent label-based [**slicing**][slicing], [**fancy
indexing**][fancy-indexing], and [**subsetting**][subsetting] of
large data sets
- Intuitive [**merging**][merging] and [**joining**][joining] data
sets
- Flexible [**reshaping**][reshape] and [**pivoting**][pivot-table] of
data sets
- [**Hierarchical**][mi] labeling of axes (possible to have multiple
labels per tick)
- Robust IO tools for loading data from [**flat files**][flat-files]
(CSV and delimited), [**Excel files**][excel], [**databases**][db],
and saving/loading data from the ultrafast [**HDF5 format**][hdfstore]
- [**Time series**][timeseries]-specific functionality: date range
generation and frequency conversion, moving window statistics,
date shifting and lagging
[missing-data]: https://pandas.pydata.org/pandas-docs/stable/user_guide/missing_data.html
[insertion-deletion]: https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html#column-selection-addition-deletion
[alignment]: https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html?highlight=alignment#intro-to-data-structures
[groupby]: https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#group-by-split-apply-combine
[conversion]: https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html#dataframe
[slicing]: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#slicing-ranges
[fancy-indexing]: https://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#advanced
[subsetting]: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#boolean-indexing
[merging]: https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html#database-style-dataframe-or-named-series-joining-merging
[joining]: https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html#joining-on-index
[reshape]: https://pandas.pydata.org/pandas-docs/stable/user_guide/reshaping.html
[pivot-table]: https://pandas.pydata.org/pandas-docs/stable/user_guide/reshaping.html
[mi]: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#hierarchical-indexing-multiindex
[flat-files]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#csv-text-files
[excel]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#excel-files
[db]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#sql-queries
[hdfstore]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#hdf5-pytables
[timeseries]: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#time-series-date-functionality
## Where to get it
The source code is currently hosted on GitHub at:
https://github.com/pandas-dev/pandas
Binary installers for the latest released version are available at the [Python
Package Index (PyPI)](https://pypi.org/project/pandas) and on [Conda](https://docs.conda.io/en/latest/).
```sh
# conda
conda install -c conda-forge pandas
```
```sh
# or PyPI
pip install pandas
```
The list of changes to pandas between each release can be found
[here](https://pandas.pydata.org/pandas-docs/stable/whatsnew/index.html). For full
details, see the commit logs at https://github.com/pandas-dev/pandas.
## Dependencies
- [NumPy - Adds support for large, multi-dimensional arrays, matrices and high-level mathematical functions to operate on these arrays](https://www.numpy.org)
- [python-dateutil - Provides powerful extensions to the standard datetime module](https://dateutil.readthedocs.io/en/stable/index.html)
- [pytz - Brings the Olson tz database into Python which allows accurate and cross platform timezone calculations](https://github.com/stub42/pytz)
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies) for minimum supported versions of required, recommended and optional dependencies.
## Installation from sources
To install pandas from source you need [Cython](https://cython.org/) in addition to the normal
dependencies above. Cython can be installed from PyPI:
```sh
pip install cython
```
In the `pandas` directory (same one where you found this file after
cloning the git repo), execute:
```sh
pip install .
```
or for installing in [development mode](https://pip.pypa.io/en/latest/cli/pip_install/#install-editable):
```sh
python -m pip install -ve . --no-build-isolation --config-settings=editable-verbose=true
```
See the full instructions for [installing from source](https://pandas.pydata.org/docs/dev/development/contributing_environment.html).
## License
[BSD 3](LICENSE)
## Documentation
The official documentation is hosted on [PyData.org](https://pandas.pydata.org/pandas-docs/stable/).
## Background
Work on ``pandas`` started at [AQR](https://www.aqr.com/) (a quantitative hedge fund) in 2008 and
has been under active development since then.
## Getting Help
For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/pandas).
Further, general questions and discussions can also take place on the [pydata mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata).
## Discussion and Development
Most development discussions take place on GitHub in this repo, via the [GitHub issue tracker](https://github.com/pandas-dev/pandas/issues).
Further, the [pandas-dev mailing list](https://mail.python.org/mailman/listinfo/pandas-dev) can also be used for specialized discussions or design issues, and a [Slack channel](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack) is available for quick development related questions.
There are also frequent [community meetings](https://pandas.pydata.org/docs/dev/development/community.html#community-meeting) for project maintainers open to the community as well as monthly [new contributor meetings](https://pandas.pydata.org/docs/dev/development/community.html#new-contributor-meeting) to help support new contributors.
Additional information on the communication channels can be found on the [contributor community](https://pandas.pydata.org/docs/development/community.html) page.
## Contributing to pandas
[![Open Source Helpers](https://www.codetriage.com/pandas-dev/pandas/badges/users.svg)](https://www.codetriage.com/pandas-dev/pandas)
All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.
A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**.
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
You can also triage issues which may include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to pandas on CodeTriage](https://www.codetriage.com/pandas-dev/pandas).
Or maybe through using pandas you have an idea of your own or are looking for something in the documentation and thinking this can be improved...you can do something about it!
Feel free to ask questions on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Slack](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack).
As contributors and maintainers to this project, you are expected to abide by pandas' code of conduct. More information can be found at: [Contributor Code of Conduct](https://github.com/pandas-dev/.github/blob/master/CODE_OF_CONDUCT.md)
<hr>
[Go to Top](#table-of-contents)
@@ -1,182 +0,0 @@
Metadata-Version: 2.1
Name: pillow
Version: 10.2.0
Summary: Python Imaging Library (Fork)
Author-email: "Jeffrey A. Clark (Alex)" <aclark@aclark.net>
License: HPND
Project-URL: Changelog, https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst
Project-URL: Documentation, https://pillow.readthedocs.io
Project-URL: Funding, https://tidelift.com/subscription/pkg/pypi-pillow?utm_source=pypi-pillow&utm_medium=pypi
Project-URL: Homepage, https://python-pillow.org
Project-URL: Mastodon, https://fosstodon.org/@pillow
Project-URL: Release notes, https://pillow.readthedocs.io/en/stable/releasenotes/index.html
Project-URL: Source, https://github.com/python-pillow/Pillow
Project-URL: Twitter, https://twitter.com/PythonPillow
Keywords: Imaging
Classifier: Development Status :: 6 - Mature
Classifier: License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND)
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Graphics :: Capture :: Digital Camera
Classifier: Topic :: Multimedia :: Graphics :: Capture :: Screen Capture
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Classifier: Topic :: Multimedia :: Graphics :: Viewers
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: docs
Requires-Dist: furo ; extra == 'docs'
Requires-Dist: olefile ; extra == 'docs'
Requires-Dist: sphinx >=2.4 ; extra == 'docs'
Requires-Dist: sphinx-copybutton ; extra == 'docs'
Requires-Dist: sphinx-inline-tabs ; extra == 'docs'
Requires-Dist: sphinx-removed-in ; extra == 'docs'
Requires-Dist: sphinxext-opengraph ; extra == 'docs'
Provides-Extra: fpx
Requires-Dist: olefile ; extra == 'fpx'
Provides-Extra: mic
Requires-Dist: olefile ; extra == 'mic'
Provides-Extra: tests
Requires-Dist: check-manifest ; extra == 'tests'
Requires-Dist: coverage ; extra == 'tests'
Requires-Dist: defusedxml ; extra == 'tests'
Requires-Dist: markdown2 ; extra == 'tests'
Requires-Dist: olefile ; extra == 'tests'
Requires-Dist: packaging ; extra == 'tests'
Requires-Dist: pyroma ; extra == 'tests'
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-cov ; extra == 'tests'
Requires-Dist: pytest-timeout ; extra == 'tests'
Provides-Extra: typing
Requires-Dist: typing-extensions ; (python_version < "3.10") and extra == 'typing'
Provides-Extra: xmp
Requires-Dist: defusedxml ; extra == 'xmp'
<p align="center">
<img width="248" height="250" src="https://raw.githubusercontent.com/python-pillow/pillow-logo/main/pillow-logo-248x250.png" alt="Pillow logo">
</p>
# Pillow
## Python Imaging Library (Fork)
Pillow is the friendly PIL fork by [Jeffrey A. Clark (Alex) and
contributors](https://github.com/python-pillow/Pillow/graphs/contributors).
PIL is the Python Imaging Library by Fredrik Lundh and Contributors.
As of 2019, Pillow development is
[supported by Tidelift](https://tidelift.com/subscription/pkg/pypi-pillow?utm_source=pypi-pillow&utm_medium=readme&utm_campaign=enterprise).
<table>
<tr>
<th>docs</th>
<td>
<a href="https://pillow.readthedocs.io/?badge=latest"><img
alt="Documentation Status"
src="https://readthedocs.org/projects/pillow/badge/?version=latest"></a>
</td>
</tr>
<tr>
<th>tests</th>
<td>
<a href="https://github.com/python-pillow/Pillow/actions/workflows/lint.yml"><img
alt="GitHub Actions build status (Lint)"
src="https://github.com/python-pillow/Pillow/workflows/Lint/badge.svg"></a>
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test.yml"><img
alt="GitHub Actions build status (Test Linux and macOS)"
src="https://github.com/python-pillow/Pillow/workflows/Test/badge.svg"></a>
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-windows.yml"><img
alt="GitHub Actions build status (Test Windows)"
src="https://github.com/python-pillow/Pillow/workflows/Test%20Windows/badge.svg"></a>
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-mingw.yml"><img
alt="GitHub Actions build status (Test MinGW)"
src="https://github.com/python-pillow/Pillow/workflows/Test%20MinGW/badge.svg"></a>
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-cygwin.yml"><img
alt="GitHub Actions build status (Test Cygwin)"
src="https://github.com/python-pillow/Pillow/workflows/Test%20Cygwin/badge.svg"></a>
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-docker.yml"><img
alt="GitHub Actions build status (Test Docker)"
src="https://github.com/python-pillow/Pillow/workflows/Test%20Docker/badge.svg"></a>
<a href="https://ci.appveyor.com/project/python-pillow/Pillow"><img
alt="AppVeyor CI build status (Windows)"
src="https://img.shields.io/appveyor/build/python-pillow/Pillow/main.svg?label=Windows%20build"></a>
<a href="https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml"><img
alt="GitHub Actions build status (Wheels)"
src="https://github.com/python-pillow/Pillow/workflows/Wheels/badge.svg"></a>
<a href="https://app.travis-ci.com/github/python-pillow/Pillow"><img
alt="Travis CI wheels build status (aarch64)"
src="https://img.shields.io/travis/com/python-pillow/Pillow/main.svg?label=aarch64%20wheels"></a>
<a href="https://app.codecov.io/gh/python-pillow/Pillow"><img
alt="Code coverage"
src="https://codecov.io/gh/python-pillow/Pillow/branch/main/graph/badge.svg"></a>
<a href="https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:pillow"><img
alt="Fuzzing Status"
src="https://oss-fuzz-build-logs.storage.googleapis.com/badges/pillow.svg"></a>
</td>
</tr>
<tr>
<th>package</th>
<td>
<a href="https://zenodo.org/badge/latestdoi/17549/python-pillow/Pillow"><img
alt="Zenodo"
src="https://zenodo.org/badge/17549/python-pillow/Pillow.svg"></a>
<a href="https://tidelift.com/subscription/pkg/pypi-pillow?utm_source=pypi-pillow&utm_medium=badge"><img
alt="Tidelift"
src="https://tidelift.com/badges/package/pypi/Pillow?style=flat"></a>
<a href="https://pypi.org/project/Pillow/"><img
alt="Newest PyPI version"
src="https://img.shields.io/pypi/v/pillow.svg"></a>
<a href="https://pypi.org/project/Pillow/"><img
alt="Number of PyPI downloads"
src="https://img.shields.io/pypi/dm/pillow.svg"></a>
<a href="https://www.bestpractices.dev/projects/6331"><img
alt="OpenSSF Best Practices"
src="https://www.bestpractices.dev/projects/6331/badge"></a>
</td>
</tr>
<tr>
<th>social</th>
<td>
<a href="https://gitter.im/python-pillow/Pillow?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img
alt="Join the chat at https://gitter.im/python-pillow/Pillow"
src="https://badges.gitter.im/python-pillow/Pillow.svg"></a>
<a href="https://twitter.com/PythonPillow"><img
alt="Follow on https://twitter.com/PythonPillow"
src="https://img.shields.io/badge/tweet-on%20Twitter-00aced.svg"></a>
<a href="https://fosstodon.org/@pillow"><img
alt="Follow on https://fosstodon.org/@pillow"
src="https://img.shields.io/badge/publish-on%20Mastodon-595aff.svg"
rel="me"></a>
</td>
</tr>
</table>
## Overview
The Python Imaging Library adds image processing capabilities to your Python interpreter.
This library provides extensive file format support, an efficient internal representation, and fairly powerful image processing capabilities.
The core image library is designed for fast access to data stored in a few basic pixel formats. It should provide a solid foundation for a general image processing tool.
## More Information
- [Documentation](https://pillow.readthedocs.io/)
- [Installation](https://pillow.readthedocs.io/en/latest/installation.html)
- [Handbook](https://pillow.readthedocs.io/en/latest/handbook/index.html)
- [Contribute](https://github.com/python-pillow/Pillow/blob/main/.github/CONTRIBUTING.md)
- [Issues](https://github.com/python-pillow/Pillow/issues)
- [Pull requests](https://github.com/python-pillow/Pillow/pulls)
- [Release notes](https://pillow.readthedocs.io/en/stable/releasenotes/index.html)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Pre-fork](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst#pre-fork)
## Report a Vulnerability
To report a security vulnerability, please follow the procedure described in the [Tidelift security policy](https://tidelift.com/docs/security).
File diff suppressed because one or more lines are too long
Binary file not shown.
-1479
View File
@@ -1,1479 +0,0 @@
// Generated by dts-bundle-generator v8.1.1
/**
*
* The Pyodide version.
*
* The version here is a Python version, following :pep:`440`. This is different
* from the version in ``package.json`` which follows the node package manager
* version convention.
*/
export declare const version: string;
/** @deprecated Use `import type { PyProxy } from "pyodide/ffi"` instead */
interface PyProxy {
[x: string]: any;
}
declare class PyProxy {
/** @private */
$$flags: number;
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
/**
* @hideconstructor
*/
constructor();
/** @hidden */
get [Symbol.toStringTag](): string;
/**
* The name of the type of the object.
*
* Usually the value is ``"module.name"`` but for builtins or
* interpreter-defined types it is just ``"name"``. As pseudocode this is:
*
* .. code-block:: python
*
* ty = type(x)
* if ty.__module__ == 'builtins' or ty.__module__ == "__main__":
* return ty.__name__
* else:
* ty.__module__ + "." + ty.__name__
*
*/
get type(): string;
/**
* Returns `str(o)` (unless `pyproxyToStringRepr: true` was passed to
* :js:func:`loadPyodide` in which case it will return `repr(o)`)
*/
toString(): string;
/**
* Destroy the :js:class:`~pyodide.ffi.PyProxy`. This will release the memory. Any further attempt
* to use the object will raise an error.
*
* In a browser supporting :js:data:`FinalizationRegistry`, Pyodide will
* automatically destroy the :js:class:`~pyodide.ffi.PyProxy` when it is garbage collected, however
* there is no guarantee that the finalizer will be run in a timely manner so
* it is better to destroy the proxy explicitly.
*
* @param options
* @param options.message The error message to print if use is attempted after
* destroying. Defaults to "Object has already been destroyed".
*
*/
destroy(options?: {
message?: string;
destroyRoundtrip?: boolean;
}): void;
/**
* Make a new :js:class:`~pyodide.ffi.PyProxy` pointing to the same Python object.
* Useful if the :js:class:`~pyodide.ffi.PyProxy` is destroyed somewhere else.
*/
copy(): PyProxy;
/**
* Converts the :js:class:`~pyodide.ffi.PyProxy` into a JavaScript object as best as possible. By
* default does a deep conversion, if a shallow conversion is desired, you can
* use ``proxy.toJs({depth : 1})``. See :ref:`Explicit Conversion of PyProxy
* <type-translations-pyproxy-to-js>` for more info.
* @param options
* @return The JavaScript object resulting from the conversion.
*/
toJs({ depth, pyproxies, create_pyproxies, dict_converter, default_converter, }?: {
/** How many layers deep to perform the conversion. Defaults to infinite */
depth?: number;
/**
* If provided, :js:meth:`toJs` will store all PyProxies created in this
* list. This allows you to easily destroy all the PyProxies by iterating
* the list without having to recurse over the generated structure. The most
* common use case is to create a new empty list, pass the list as
* ``pyproxies``, and then later iterate over ``pyproxies`` to destroy all of
* created proxies.
*/
pyproxies?: PyProxy[];
/**
* If false, :js:meth:`toJs` will throw a
* :py:exc:`~pyodide.ffi.ConversionError` rather than producing a
* :js:class:`~pyodide.ffi.PyProxy`.
*/
create_pyproxies?: boolean;
/**
* A function to be called on an iterable of pairs ``[key, value]``. Convert
* this iterable of pairs to the desired output. For instance,
* :js:func:`Object.fromEntries` would convert the dict to an object,
* :js:func:`Array.from` converts it to an :js:class:`Array` of pairs, and
* ``(it) => new Map(it)`` converts it to a :js:class:`Map` (which is the
* default behavior).
*/
dict_converter?: (array: Iterable<[
key: string,
value: any
]>) => any;
/**
* Optional argument to convert objects with no default conversion. See the
* documentation of :meth:`~pyodide.ffi.to_js`.
*/
default_converter?: (obj: PyProxy, convert: (obj: PyProxy) => any, cacheConversion: (obj: PyProxy, result: any) => void) => any;
}): any;
}
declare class PyProxyWithLength extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyProxyWithLength } from "pyodide/ffi"` instead */
interface PyProxyWithLength extends PyLengthMethods {
}
declare class PyLengthMethods {
/**
* The length of the object.
*/
get length(): number;
}
declare class PyProxyWithGet extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyProxyWithGet } from "pyodide/ffi"` instead */
interface PyProxyWithGet extends PyGetItemMethods {
}
declare class PyGetItemMethods {
/**
* This translates to the Python code ``obj[key]``.
*
* @param key The key to look up.
* @returns The corresponding value.
*/
get(key: any): any;
}
declare class PyProxyWithSet extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyProxyWithSet } from "pyodide/ffi"` instead */
interface PyProxyWithSet extends PySetItemMethods {
}
declare class PySetItemMethods {
/**
* This translates to the Python code ``obj[key] = value``.
*
* @param key The key to set.
* @param value The value to set it to.
*/
set(key: any, value: any): void;
/**
* This translates to the Python code ``del obj[key]``.
*
* @param key The key to delete.
*/
delete(key: any): void;
}
declare class PyProxyWithHas extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyProxyWithHas } from "pyodide/ffi"` instead */
interface PyProxyWithHas extends PyContainsMethods {
}
declare class PyContainsMethods {
/**
* This translates to the Python code ``key in obj``.
*
* @param key The key to check for.
* @returns Is ``key`` present?
*/
has(key: any): boolean;
}
declare class PyIterable extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyIterable } from "pyodide/ffi"` instead */
interface PyIterable extends PyIterableMethods {
}
declare class PyIterableMethods {
/**
* This translates to the Python code ``iter(obj)``. Return an iterator
* associated to the proxy. See the documentation for
* :js:data:`Symbol.iterator`.
*
* This will be used implicitly by ``for(let x of proxy){}``.
*/
[Symbol.iterator](): Iterator<any, any, any>;
}
declare class PyAsyncIterable extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyAsyncIterable } from "pyodide/ffi"` instead */
interface PyAsyncIterable extends PyAsyncIterableMethods {
}
declare class PyAsyncIterableMethods {
/**
* This translates to the Python code ``aiter(obj)``. Return an async iterator
* associated to the proxy. See the documentation for :js:data:`Symbol.asyncIterator`.
*
* This will be used implicitly by ``for(await let x of proxy){}``.
*/
[Symbol.asyncIterator](): AsyncIterator<any, any, any>;
}
declare class PyIterator extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyIterator } from "pyodide/ffi"` instead */
interface PyIterator extends PyIteratorMethods {
}
declare class PyIteratorMethods {
/** @private */
[Symbol.iterator](): this;
/**
* This translates to the Python code ``next(obj)``. Returns the next value of
* the generator. See the documentation for :js:meth:`Generator.next` The
* argument will be sent to the Python generator.
*
* This will be used implicitly by ``for(let x of proxy){}``.
*
* @param any The value to send to the generator. The value will be assigned
* as a result of a yield expression.
* @returns An Object with two properties: ``done`` and ``value``. When the
* generator yields ``some_value``, ``next`` returns ``{done : false, value :
* some_value}``. When the generator raises a :py:exc:`StopIteration`
* exception, ``next`` returns ``{done : true, value : result_value}``.
*/
next(arg?: any): IteratorResult<any, any>;
}
declare class PyGenerator extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyGenerator } from "pyodide/ffi"` instead */
interface PyGenerator extends PyGeneratorMethods {
}
declare class PyGeneratorMethods {
/**
* Throws an exception into the Generator.
*
* See the documentation for :js:meth:`Generator.throw`.
*
* @param exception Error The error to throw into the generator. Must be an
* instanceof ``Error``.
* @returns An Object with two properties: ``done`` and ``value``. When the
* generator yields ``some_value``, ``return`` returns ``{done : false, value
* : some_value}``. When the generator raises a
* ``StopIteration(result_value)`` exception, ``return`` returns ``{done :
* true, value : result_value}``.
*/
throw(exc: any): IteratorResult<any, any>;
/**
* Throws a :py:exc:`GeneratorExit` into the generator and if the
* :py:exc:`GeneratorExit` is not caught returns the argument value ``{done:
* true, value: v}``. If the generator catches the :py:exc:`GeneratorExit` and
* returns or yields another value the next value of the generator this is
* returned in the normal way. If it throws some error other than
* :py:exc:`GeneratorExit` or :py:exc:`StopIteration`, that error is propagated. See
* the documentation for :js:meth:`Generator.return`.
*
* @param any The value to return from the generator.
* @returns An Object with two properties: ``done`` and ``value``. When the
* generator yields ``some_value``, ``return`` returns ``{done : false, value
* : some_value}``. When the generator raises a
* ``StopIteration(result_value)`` exception, ``return`` returns ``{done :
* true, value : result_value}``.
*/
return(v: any): IteratorResult<any, any>;
}
declare class PyAsyncIterator extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyAsyncIterator } from "pyodide/ffi"` instead */
interface PyAsyncIterator extends PyAsyncIteratorMethods {
}
declare class PyAsyncIteratorMethods {
/** @private */
[Symbol.asyncIterator](): this;
/**
* This translates to the Python code ``anext(obj)``. Returns the next value
* of the asynchronous iterator. The argument will be sent to the Python
* iterator (if it's a generator for instance).
*
* This will be used implicitly by ``for(let x of proxy){}``.
*
* @param any The value to send to a generator. The value will be assigned as
* a result of a yield expression.
* @returns An Object with two properties: ``done`` and ``value``. When the
* iterator yields ``some_value``, ``next`` returns ``{done : false, value :
* some_value}``. When the giterator is done, ``next`` returns
* ``{done : true }``.
*/
next(arg?: any): Promise<IteratorResult<any, any>>;
}
declare class PyAsyncGenerator extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyAsyncGenerator } from "pyodide/ffi"` instead */
interface PyAsyncGenerator extends PyAsyncGeneratorMethods {
}
declare class PyAsyncGeneratorMethods {
/**
* Throws an exception into the Generator.
*
* See the documentation for :js:meth:`AsyncGenerator.throw`.
*
* @param exception Error The error to throw into the generator. Must be an
* instanceof ``Error``.
* @returns An Object with two properties: ``done`` and ``value``. When the
* generator yields ``some_value``, ``return`` returns ``{done : false, value
* : some_value}``. When the generator raises a
* ``StopIteration(result_value)`` exception, ``return`` returns ``{done :
* true, value : result_value}``.
*/
throw(exc: any): Promise<IteratorResult<any, any>>;
/**
* Throws a :py:exc:`GeneratorExit` into the generator and if the
* :py:exc:`GeneratorExit` is not caught returns the argument value ``{done:
* true, value: v}``. If the generator catches the :py:exc:`GeneratorExit` and
* returns or yields another value the next value of the generator this is
* returned in the normal way. If it throws some error other than
* :py:exc:`GeneratorExit` or :py:exc:`StopAsyncIteration`, that error is
* propagated. See the documentation for :js:meth:`AsyncGenerator.throw`
*
* @param any The value to return from the generator.
* @returns An Object with two properties: ``done`` and ``value``. When the
* generator yields ``some_value``, ``return`` returns ``{done : false, value
* : some_value}``. When the generator raises a :py:exc:`StopAsyncIteration`
* exception, ``return`` returns ``{done : true, value : result_value}``.
*/
return(v: any): Promise<IteratorResult<any, any>>;
}
declare class PySequence extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PySequence } from "pyodide/ffi"` instead */
interface PySequence extends PySequenceMethods {
}
declare class PySequenceMethods {
/** @hidden */
get [Symbol.isConcatSpreadable](): boolean;
/**
* See :js:meth:`Array.join`. The :js:meth:`Array.join` method creates and
* returns a new string by concatenating all of the elements in the
* :py:class:`~collections.abc.Sequence`.
*
* @param separator A string to separate each pair of adjacent elements of the
* Sequence.
*
* @returns A string with all Sequence elements joined.
*/
join(separator?: string): string;
/**
* See :js:meth:`Array.slice`. The :js:meth:`Array.slice` method returns a
* shallow copy of a portion of a :py:class:`~collections.abc.Sequence` into a
* new array object selected from ``start`` to ``stop`` (`stop` not included)
* @param start Zero-based index at which to start extraction. Negative index
* counts back from the end of the Sequence.
* @param stop Zero-based index at which to end extraction. Negative index
* counts back from the end of the Sequence.
* @returns A new array containing the extracted elements.
*/
slice(start?: number, stop?: number): any;
/**
* See :js:meth:`Array.lastIndexOf`. Returns the last index at which a given
* element can be found in the Sequence, or -1 if it is not present.
* @param elt Element to locate in the Sequence.
* @param fromIndex Zero-based index at which to start searching backwards,
* converted to an integer. Negative index counts back from the end of the
* Sequence.
* @returns The last index of the element in the Sequence; -1 if not found.
*/
lastIndexOf(elt: any, fromIndex?: number): number;
/**
* See :js:meth:`Array.indexOf`. Returns the first index at which a given
* element can be found in the Sequence, or -1 if it is not present.
* @param elt Element to locate in the Sequence.
* @param fromIndex Zero-based index at which to start searching, converted to
* an integer. Negative index counts back from the end of the Sequence.
* @returns The first index of the element in the Sequence; -1 if not found.
*/
indexOf(elt: any, fromIndex?: number): number;
/**
* See :js:meth:`Array.forEach`. Executes a provided function once for each
* ``Sequence`` element.
* @param callbackfn A function to execute for each element in the ``Sequence``. Its
* return value is discarded.
* @param thisArg A value to use as ``this`` when executing ``callbackFn``.
*/
forEach(callbackfn: (elt: any) => void, thisArg?: any): void;
/**
* See :js:meth:`Array.map`. Creates a new array populated with the results of
* calling a provided function on every element in the calling ``Sequence``.
* @param callbackfn A function to execute for each element in the ``Sequence``. Its
* return value is added as a single element in the new array.
* @param thisArg A value to use as ``this`` when executing ``callbackFn``.
*/
map<U>(callbackfn: (elt: any, index: number, array: any) => U, thisArg?: any): U[];
/**
* See :js:meth:`Array.filter`. Creates a shallow copy of a portion of a given
* ``Sequence``, filtered down to just the elements from the given array that pass
* the test implemented by the provided function.
* @param callbackfn A function to execute for each element in the array. It
* should return a truthy value to keep the element in the resulting array,
* and a falsy value otherwise.
* @param thisArg A value to use as ``this`` when executing ``predicate``.
*/
filter(predicate: (elt: any, index: number, array: any) => boolean, thisArg?: any): any[];
/**
* See :js:meth:`Array.some`. Tests whether at least one element in the
* ``Sequence`` passes the test implemented by the provided function.
* @param callbackfn A function to execute for each element in the
* ``Sequence``. It should return a truthy value to indicate the element
* passes the test, and a falsy value otherwise.
* @param thisArg A value to use as ``this`` when executing ``predicate``.
*/
some(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean;
/**
* See :js:meth:`Array.every`. Tests whether every element in the ``Sequence``
* passes the test implemented by the provided function.
* @param callbackfn A function to execute for each element in the
* ``Sequence``. It should return a truthy value to indicate the element
* passes the test, and a falsy value otherwise.
* @param thisArg A value to use as ``this`` when executing ``predicate``.
*/
every(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean;
/**
* See :js:meth:`Array.reduce`. Executes a user-supplied "reducer" callback
* function on each element of the Sequence, in order, passing in the return
* value from the calculation on the preceding element. The final result of
* running the reducer across all elements of the Sequence is a single value.
* @param callbackfn A function to execute for each element in the ``Sequence``. Its
* return value is discarded.
* @param thisArg A value to use as ``this`` when executing ``callbackfn``.
*/
reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any) => any, initialValue?: any): any;
/**
* See :js:meth:`Array.reduceRight`. Applies a function against an accumulator
* and each value of the Sequence (from right to left) to reduce it to a
* single value.
* @param callbackfn A function to execute for each element in the Sequence.
* Its return value is discarded.
* @param thisArg A value to use as ``this`` when executing ``callbackFn``.
*/
reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any) => any, initialValue: any): any;
/**
* See :js:meth:`Array.at`. Takes an integer value and returns the item at
* that index.
* @param index Zero-based index of the Sequence element to be returned,
* converted to an integer. Negative index counts back from the end of the
* Sequence.
* @returns The element in the Sequence matching the given index.
*/
at(index: number): any;
/**
* The :js:meth:`Array.concat` method is used to merge two or more arrays.
* This method does not change the existing arrays, but instead returns a new
* array.
* @param rest Arrays and/or values to concatenate into a new array.
* @returns A new Array instance.
*/
concat(...rest: ConcatArray<any>[]): any[];
/**
* The :js:meth:`Array.includes` method determines whether a Sequence
* includes a certain value among its entries, returning true or false as
* appropriate.
* @param elt
* @returns
*/
includes(elt: any): any;
/**
* The :js:meth:`Array.entries` method returns a new iterator object that
* contains the key/value pairs for each index in the ``Sequence``.
* @returns A new iterator object.
*/
entries(): IterableIterator<[
number,
any
]>;
/**
* The :js:meth:`Array.keys` method returns a new iterator object that
* contains the keys for each index in the ``Sequence``.
* @returns A new iterator object.
*/
keys(): IterableIterator<number>;
/**
* The :js:meth:`Array.values` method returns a new iterator object that
* contains the values for each index in the ``Sequence``.
* @returns A new iterator object.
*/
values(): IterableIterator<any>;
/**
* The :js:meth:`Array.find` method returns the first element in the provided
* array that satisfies the provided testing function.
* @param predicate A function to execute for each element in the
* ``Sequence``. It should return a truthy value to indicate a matching
* element has been found, and a falsy value otherwise.
* @param thisArg A value to use as ``this`` when executing ``predicate``.
* @returns The first element in the ``Sequence`` that satisfies the provided
* testing function.
*/
find(predicate: (value: any, index: number, obj: any[]) => any, thisArg?: any): any;
/**
* The :js:meth:`Array.findIndex` method returns the index of the first
* element in the provided array that satisfies the provided testing function.
* @param predicate A function to execute for each element in the
* ``Sequence``. It should return a truthy value to indicate a matching
* element has been found, and a falsy value otherwise.
* @param thisArg A value to use as ``this`` when executing ``predicate``.
* @returns The index of the first element in the ``Sequence`` that satisfies
* the provided testing function.
*/
findIndex(predicate: (value: any, index: number, obj: any[]) => any, thisArg?: any): number;
}
declare class PyMutableSequence extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyMutableSequence } from "pyodide/ffi"` instead */
interface PyMutableSequence extends PyMutableSequenceMethods {
}
declare class PyMutableSequenceMethods {
/**
* The :js:meth:`Array.reverse` method reverses a :js:class:`PyMutableSequence` in
* place.
* @returns A reference to the same :js:class:`PyMutableSequence`
*/
reverse(): PyMutableSequence;
/**
* The :js:meth:`Array.sort` method sorts the elements of a
* :js:class:`PyMutableSequence` in place.
* @param compareFn A function that defines the sort order.
* @returns A reference to the same :js:class:`PyMutableSequence`
*/
sort(compareFn?: (a: any, b: any) => number): PyMutableSequence;
/**
* The :js:meth:`Array.splice` method changes the contents of a
* :js:class:`PyMutableSequence` by removing or replacing existing elements and/or
* adding new elements in place.
* @param start Zero-based index at which to start changing the
* :js:class:`PyMutableSequence`.
* @param deleteCount An integer indicating the number of elements in the
* :js:class:`PyMutableSequence` to remove from ``start``.
* @param items The elements to add to the :js:class:`PyMutableSequence`, beginning from
* ``start``.
* @returns An array containing the deleted elements.
*/
splice(start: number, deleteCount?: number, ...items: any[]): any[];
/**
* The :js:meth:`Array.push` method adds the specified elements to the end of
* a :js:class:`PyMutableSequence`.
* @param elts The element(s) to add to the end of the :js:class:`PyMutableSequence`.
* @returns The new length property of the object upon which the method was
* called.
*/
push(...elts: any[]): any;
/**
* The :js:meth:`Array.pop` method removes the last element from a
* :js:class:`PyMutableSequence`.
* @returns The removed element from the :js:class:`PyMutableSequence`; undefined if the
* :js:class:`PyMutableSequence` is empty.
*/
pop(): any;
/**
* The :js:meth:`Array.shift` method removes the first element from a
* :js:class:`PyMutableSequence`.
* @returns The removed element from the :js:class:`PyMutableSequence`; undefined if the
* :js:class:`PyMutableSequence` is empty.
*/
shift(): any;
/**
* The :js:meth:`Array.unshift` method adds the specified elements to the
* beginning of a :js:class:`PyMutableSequence`.
* @param elts The elements to add to the front of the :js:class:`PyMutableSequence`.
* @returns The new length of the :js:class:`PyMutableSequence`.
*/
unshift(...elts: any[]): any;
/**
* The :js:meth:`Array.copyWithin` method shallow copies part of a
* :js:class:`PyMutableSequence` to another location in the same :js:class:`PyMutableSequence`
* without modifying its length.
* @param target Zero-based index at which to copy the sequence to.
* @param start Zero-based index at which to start copying elements from.
* @param end Zero-based index at which to end copying elements from.
* @returns The modified :js:class:`PyMutableSequence`.
*/
copyWithin(target: number, start?: number, end?: number): any;
/**
* The :js:meth:`Array.fill` method changes all elements in an array to a
* static value, from a start index to an end index.
* @param value Value to fill the array with.
* @param start Zero-based index at which to start filling. Default 0.
* @param end Zero-based index at which to end filling. Default
* ``list.length``.
* @returns
*/
fill(value: any, start?: number, end?: number): any;
}
declare class PyAwaitable extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyAwaitable } from "pyodide/ffi"` instead */
interface PyAwaitable extends Promise<any> {
}
declare class PyCallable extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyCallable;
}
/** @deprecated Use `import type { PyCallable } from "pyodide/ffi"` instead */
interface PyCallable extends PyCallableMethods {
(...args: any[]): any;
}
declare class PyCallableMethods {
/**
* The ``apply()`` method calls the specified function with a given this
* value, and arguments provided as an array (or an array-like object). Like
* :js:meth:`Function.apply`.
*
* @param thisArg The ``this`` argument. Has no effect unless the
* :js:class:`~pyodide.ffi.PyCallable` has :js:meth:`captureThis` set. If
* :js:meth:`captureThis` is set, it will be passed as the first argument to
* the Python function.
* @param jsargs The array of arguments
* @returns The result from the function call.
*/
apply(thisArg: any, jsargs: any): any;
/**
* Calls the function with a given this value and arguments provided
* individually. See :js:meth:`Function.call`.
*
* @param thisArg The ``this`` argument. Has no effect unless the
* :js:class:`~pyodide.ffi.PyCallable` has :js:meth:`captureThis` set. If
* :js:meth:`captureThis` is set, it will be passed as the first argument to
* the Python function.
* @param jsargs The arguments
* @returns The result from the function call.
*/
call(thisArg: any, ...jsargs: any): any;
/**
* Call the function with keyword arguments. The last argument must be an
* object with the keyword arguments.
*/
callKwargs(...jsargs: any): any;
/**
* Call the function in a "relaxed" manner. Any extra arguments will be
* ignored. This matches the behavior of JavaScript functions more accurately.
*
* Any extra arguments will be ignored. This matches the behavior of
* JavaScript functions more accurately. Missing arguments are **NOT** filled
* with `None`. If too few arguments are passed, this will still raise a
* TypeError.
*
* This uses :py:func:`pyodide.code.relaxed_call`.
*/
callRelaxed(...jsargs: any): any;
/**
* Call the function with keyword arguments in a "relaxed" manner. The last
* argument must be an object with the keyword arguments. Any extra arguments
* will be ignored. This matches the behavior of JavaScript functions more
* accurately.
*
* Missing arguments are **NOT** filled with `None`. If too few arguments are
* passed, this will still raise a TypeError. Also, if the same argument is
* passed as both a keyword argument and a positional argument, it will raise
* an error.
*
* This uses :py:func:`pyodide.code.relaxed_call`.
*/
callKwargsRelaxed(...jsargs: any): any;
/**
* Call the function with stack switching enabled. Functions called this way
* can use
* :py:meth:`PyodideFuture.syncify() <pyodide.webloop.PyodideFuture.syncify>`
* to block until a :py:class:`~asyncio.Future` or :js:class:`Promise` is
* resolved. Only works in runtimes with JS Promise integration.
*
* .. admonition:: Experimental
* :class: warning
*
* This feature is not yet stable.
*
* @experimental
*/
callSyncifying(...jsargs: any): Promise<any>;
/**
* Call the function with stack switching enabled. The last argument must be
* an object with the keyword arguments. Functions called this way can use
* :py:meth:`PyodideFuture.syncify() <pyodide.webloop.PyodideFuture.syncify>`
* to block until a :py:class:`~asyncio.Future` or :js:class:`Promise` is
* resolved. Only works in runtimes with JS Promise integration.
*
* .. admonition:: Experimental
* :class: warning
*
* This feature is not yet stable.
*
* @experimental
*/
callSyncifyingKwargs(...jsargs: any): Promise<any>;
/**
* The ``bind()`` method creates a new function that, when called, has its
* ``this`` keyword set to the provided value, with a given sequence of
* arguments preceding any provided when the new function is called. See
* :js:meth:`Function.bind`.
*
* If the :js:class:`~pyodide.ffi.PyCallable` does not have
* :js:meth:`captureThis` set, the ``this`` parameter will be discarded. If it
* does have :js:meth:`captureThis` set, ``thisArg`` will be set to the first
* argument of the Python function. The returned proxy and the original proxy
* have the same lifetime so destroying either destroys both.
*
* @param thisArg The value to be passed as the ``this`` parameter to the
* target function ``func`` when the bound function is called.
* @param jsargs Extra arguments to prepend to arguments provided to the bound
* function when invoking ``func``.
* @returns
*/
bind(thisArg: any, ...jsargs: any): PyProxy;
/**
* Returns a :js:class:`~pyodide.ffi.PyProxy` that passes ``this`` as the first argument to the
* Python function. The returned :js:class:`~pyodide.ffi.PyProxy` has the internal ``captureThis``
* property set.
*
* It can then be used as a method on a JavaScript object. The returned proxy
* and the original proxy have the same lifetime so destroying either destroys
* both.
*
* For example:
*
* .. code-block:: pyodide
*
* let obj = { a : 7 };
* pyodide.runPython(`
* def f(self):
* return self.a
* `);
* // Without captureThis, it doesn't work to use f as a method for obj:
* obj.f = pyodide.globals.get("f");
* obj.f(); // raises "TypeError: f() missing 1 required positional argument: 'self'"
* // With captureThis, it works fine:
* obj.f = pyodide.globals.get("f").captureThis();
* obj.f(); // returns 7
*
* @returns The resulting :js:class:`~pyodide.ffi.PyProxy`. It has the same lifetime as the
* original :js:class:`~pyodide.ffi.PyProxy` but passes ``this`` to the wrapped function.
*
*/
captureThis(): PyProxy;
}
declare class PyBuffer extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyBuffer;
}
/** @deprecated Use `import type { PyBuffer } from "pyodide/ffi"` instead */
interface PyBuffer extends PyBufferMethods {
}
declare class PyBufferMethods {
/**
* Get a view of the buffer data which is usable from JavaScript. No copy is
* ever performed.
*
* We do not support suboffsets, if the buffer requires suboffsets we will
* throw an error. JavaScript nd array libraries can't handle suboffsets
* anyways. In this case, you should use the :js:meth:`~PyProxy.toJs` api or
* copy the buffer to one that doesn't use suboffsets (using e.g.,
* :py:func:`numpy.ascontiguousarray`).
*
* If the buffer stores big endian data or half floats, this function will
* fail without an explicit type argument. For big endian data you can use
* :js:meth:`~PyProxy.toJs`. :js:class:`DataView` has support for big endian
* data, so you might want to pass ``'dataview'`` as the type argument in that
* case.
*
* @param type The type of the :js:attr:`~pyodide.ffi.PyBufferView.data` field
* in the output. Should be one of: ``"i8"``, ``"u8"``, ``"u8clamped"``,
* ``"i16"``, ``"u16"``, ``"i32"``, ``"u32"``, ``"i32"``, ``"u32"``,
* ``"i64"``, ``"u64"``, ``"f32"``, ``"f64``, or ``"dataview"``. This argument
* is optional, if absent :js:meth:`~pyodide.ffi.PyBuffer.getBuffer` will try
* to determine the appropriate output type based on the buffer format string
* (see :std:ref:`struct-format-strings`).
*/
getBuffer(type?: string): PyBufferView;
}
declare class PyDict extends PyProxy {
/** @private */
static [Symbol.hasInstance](obj: any): obj is PyProxy;
}
/** @deprecated Use `import type { PyDict } from "pyodide/ffi"` instead */
interface PyDict extends PyProxyWithGet, PyProxyWithSet, PyProxyWithHas, PyProxyWithLength, PyIterable {
}
/** @deprecated Use `import type { PyBufferView } from "pyodide/ffi"` instead */
declare class PyBufferView {
/**
* The offset of the first entry of the array. For instance if our array
* is 3d, then you will find ``array[0,0,0]`` at
* ``pybuf.data[pybuf.offset]``
*/
offset: number;
/**
* If the data is read only, you should not modify it. There is no way for us
* to enforce this, but it may cause very weird behavior. See
* :py:attr:`memoryview.readonly`.
*/
readonly: boolean;
/**
* The format string for the buffer. See :ref:`struct-format-strings`
* and :py:attr:`memoryview.format`.
*/
format: string;
/**
* How large is each entry in bytes? See :py:attr:`memoryview.itemsize`.
*/
itemsize: number;
/**
* The number of dimensions of the buffer. If ``ndim`` is 0, the buffer
* represents a single scalar or struct. Otherwise, it represents an
* array. See :py:attr:`memoryview.ndim`.
*/
ndim: number;
/**
* The total number of bytes the buffer takes up. This is equal to
* :js:attr:`buff.data.byteLength <TypedArray.byteLength>`. See :py:attr:`memoryview.nbytes`.
*/
nbytes: number;
/**
* The shape of the buffer, that is how long it is in each dimension.
* The length will be equal to ``ndim``. For instance, a 2x3x4 array
* would have shape ``[2, 3, 4]``. See :py:attr:`memoryview.shape`.
*/
shape: number[];
/**
* An array of of length ``ndim`` giving the number of elements to skip
* to get to a new element in each dimension. See the example definition
* of a ``multiIndexToIndex`` function above. See :py:attr:`memoryview.strides`.
*/
strides: number[];
/**
* The actual data. A typed array of an appropriate size backed by a segment
* of the WASM memory.
*
* The ``type`` argument of :js:meth:`~pyodide.ffi.PyBuffer.getBuffer` determines
* which sort of :js:class:`TypedArray` or :js:class:`DataView` to return. By
* default :js:meth:`~pyodide.ffi.PyBuffer.getBuffer` will look at the format string
* to determine the most appropriate option. Most often the result is a
* :js:class:`Uint8Array`.
*
* .. admonition:: Contiguity
* :class: warning
*
* If the buffer is not contiguous, the :js:attr:`~PyBufferView.readonly`
* TypedArray will contain data that is not part of the buffer. Modifying
* this data leads to undefined behavior.
*
* .. admonition:: Read only buffers
* :class: warning
*
* If :js:attr:`buffer.readonly <PyBufferView.readonly>` is ``true``, you
* should not modify the buffer. Modifying a read only buffer leads to
* undefined behavior.
*
*/
data: TypedArray;
/**
* Is it C contiguous? See :py:attr:`memoryview.c_contiguous`.
*/
c_contiguous: boolean;
/**
* Is it Fortran contiguous? See :py:attr:`memoryview.f_contiguous`.
*/
f_contiguous: boolean;
_released: boolean;
_view_ptr: number;
/** @private */
constructor();
/**
* Release the buffer. This allows the memory to be reclaimed.
*/
release(): void;
}
type InFuncType = () => null | undefined | string | ArrayBuffer | Uint8Array | number;
declare function setStdin(options?: {
stdin?: InFuncType;
read?: (buffer: Uint8Array) => number;
error?: boolean;
isatty?: boolean;
autoEOF?: boolean;
}): void;
declare function setStdout(options?: {
batched?: (output: string) => void;
raw?: (charCode: number) => void;
write?: (buffer: Uint8Array) => number;
isatty?: boolean;
}): void;
declare function setStderr(options?: {
batched?: (output: string) => void;
raw?: (charCode: number) => void;
write?: (buffer: Uint8Array) => number;
isatty?: boolean;
}): void;
type PackageType = "package" | "cpython_module" | "shared_library" | "static_library";
export type PackageData = {
name: string;
version: string;
fileName: string;
/** @experimental */
packageType: PackageType;
};
declare function loadPackage(names: string | PyProxy | Array<string>, options?: {
messageCallback?: (message: string) => void;
errorCallback?: (message: string) => void;
checkIntegrity?: boolean;
}): Promise<Array<PackageData>>;
/** @deprecated Use `import type { TypedArray } from "pyodide/ffi"` instead */
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
interface CanvasInterface {
setCanvas2D(canvas: HTMLCanvasElement): void;
getCanvas2D(): HTMLCanvasElement | undefined;
setCanvas3D(canvas: HTMLCanvasElement): void;
getCanvas3D(): HTMLCanvasElement | undefined;
}
declare class PythonError extends Error {
/**
* The address of the error we are wrapping. We may later compare this
* against sys.last_exc.
* WARNING: we don't own a reference to this pointer, dereferencing it
* may be a use-after-free error!
* @private
*/
__error_address: number;
/**
* The name of the Python error class, e.g, :py:exc:`RuntimeError` or
* :py:exc:`KeyError`.
*/
type: string;
constructor(type: string, message: string, error_address: number);
}
type NativeFS = {
syncfs: () => Promise<void>;
};
declare class PyodideAPI {
/** @hidden */
static version: string;
/** @hidden */
static loadPackage: typeof loadPackage;
/** @hidden */
static loadedPackages: {
[key: string]: string;
};
/** @hidden */
static ffi: {
PyProxy: typeof PyProxy;
PyProxyWithLength: typeof PyProxyWithLength;
PyProxyWithGet: typeof PyProxyWithGet;
PyProxyWithSet: typeof PyProxyWithSet;
PyProxyWithHas: typeof PyProxyWithHas;
PyDict: typeof PyDict;
PyIterable: typeof PyIterable;
PyAsyncIterable: typeof PyAsyncIterable;
PyIterator: typeof PyIterator;
PyAsyncIterator: typeof PyAsyncIterator;
PyGenerator: typeof PyGenerator;
PyAsyncGenerator: typeof PyAsyncGenerator;
PyAwaitable: typeof PyAwaitable;
PyCallable: typeof PyCallable;
PyBuffer: typeof PyBuffer;
PyBufferView: typeof PyBufferView;
PythonError: typeof PythonError;
PySequence: typeof PySequence;
PyMutableSequence: typeof PyMutableSequence;
};
/** @hidden */
static setStdin: typeof setStdin;
/** @hidden */
static setStdout: typeof setStdout;
/** @hidden */
static setStderr: typeof setStderr;
/**
*
* An alias to the global Python namespace.
*
* For example, to access a variable called ``foo`` in the Python global
* scope, use ``pyodide.globals.get("foo")``
*/
static globals: PyProxy;
/**
* An alias to the `Emscripten File System API
* <https://emscripten.org/docs/api_reference/Filesystem-API.html>`_.
*
* This provides a wide range of POSIX-`like` file/device operations, including
* `mount
* <https://emscripten.org/docs/api_reference/Filesystem-API.html#FS.mount>`_
* which can be used to extend the in-memory filesystem with features like `persistence
* <https://emscripten.org/docs/api_reference/Filesystem-API.html#persistent-data>`_.
*
* While all the file systems implementations are enabled, only the default
* ``MEMFS`` is guaranteed to work in all runtime settings. The implementations
* are available as members of ``FS.filesystems``:
* ``IDBFS``, ``NODEFS``, ``PROXYFS``, ``WORKERFS``.
*/
static FS: any;
/**
* An alias to the `Emscripten Path API
* <https://github.com/emscripten-core/emscripten/blob/main/src/library_path.js>`_.
*
* This provides a variety of operations for working with file system paths, such as
* ``dirname``, ``normalize``, and ``splitPath``.
*/
static PATH: any;
/**
* See :ref:`js-api-pyodide-canvas`.
* @hidetype
*/
static canvas: CanvasInterface;
/**
* A map from posix error names to error codes.
*/
static ERRNO_CODES: {
[code: string]: number;
};
/**
* An alias to the Python :ref:`pyodide <python-api>` package.
*
* You can use this to call functions defined in the Pyodide Python package
* from JavaScript.
*/
static pyodide_py: PyProxy;
/**
* Inspect a Python code chunk and use :js:func:`pyodide.loadPackage` to install
* any known packages that the code chunk imports. Uses the Python API
* :func:`pyodide.code.find\_imports` to inspect the code.
*
* For example, given the following code as input
*
* .. code-block:: python
*
* import numpy as np
* x = np.array([1, 2, 3])
*
* :js:func:`loadPackagesFromImports` will call
* ``pyodide.loadPackage(['numpy'])``.
*
* @param code The code to inspect.
* @param options Options passed to :js:func:`pyodide.loadPackage`.
* @param options.messageCallback A callback, called with progress messages
* (optional)
* @param options.errorCallback A callback, called with error/warning messages
* (optional)
* @param options.checkIntegrity If true, check the integrity of the downloaded
* packages (default: true)
* @async
*/
static loadPackagesFromImports(code: string, options?: {
messageCallback?: (message: string) => void;
errorCallback?: (message: string) => void;
checkIntegrity?: boolean;
}): Promise<Array<PackageData>>;
/**
* Runs a string of Python code from JavaScript, using :py:func:`~pyodide.code.eval_code`
* to evaluate the code. If the last statement in the Python code is an
* expression (and the code doesn't end with a semicolon), the value of the
* expression is returned.
*
* @param code The Python code to run
* @param options
* @param options.globals An optional Python dictionary to use as the globals.
* Defaults to :js:attr:`pyodide.globals`.
* @param options.locals An optional Python dictionary to use as the locals.
* Defaults to the same as ``globals``.
* @param options.filename An optional string to use as the file name.
* Defaults to ``"<exec>"``. If a custom file name is given, the
* traceback for any exception that is thrown will show source lines
* (unless the given file name starts with ``<`` and ends with ``>``).
* @returns The result of the Python code translated to JavaScript. See the
* documentation for :py:func:`~pyodide.code.eval_code` for more info.
* @example
* async function main(){
* const pyodide = await loadPyodide();
* console.log(pyodide.runPython("1 + 2"));
* // 3
*
* const globals = pyodide.toPy({ x: 3 });
* console.log(pyodide.runPython("x + 1", { globals }));
* // 4
*
* const locals = pyodide.toPy({ arr: [1, 2, 3] });
* console.log(pyodide.runPython("sum(arr)", { locals }));
* // 6
* }
* main();
*/
static runPython(code: string, options?: {
globals?: PyProxy;
locals?: PyProxy;
filename?: string;
}): any;
/**
* Run a Python code string with top level await using
* :py:func:`~pyodide.code.eval_code_async` to evaluate the code. Returns a promise which
* resolves when execution completes. If the last statement in the Python code
* is an expression (and the code doesn't end with a semicolon), the returned
* promise will resolve to the value of this expression.
*
* For example:
*
* .. code-block:: pyodide
*
* let result = await pyodide.runPythonAsync(`
* from js import fetch
* response = await fetch("./pyodide-lock.json")
* packages = await response.json()
* # If final statement is an expression, its value is returned to JavaScript
* len(packages.packages.object_keys())
* `);
* console.log(result); // 79
*
* .. admonition:: Python imports
* :class: warning
*
* Since pyodide 0.18.0, you must call :js:func:`loadPackagesFromImports` to
* import any python packages referenced via ``import`` statements in your
* code. This function will no longer do it for you.
*
* @param code The Python code to run
* @param options
* @param options.globals An optional Python dictionary to use as the globals.
* Defaults to :js:attr:`pyodide.globals`.
* @param options.locals An optional Python dictionary to use as the locals.
* Defaults to the same as ``globals``.
* @param options.filename An optional string to use as the file name.
* Defaults to ``"<exec>"``. If a custom file name is given, the
* traceback for any exception that is thrown will show source lines
* (unless the given file name starts with ``<`` and ends with ``>``).
* @returns The result of the Python code translated to JavaScript.
* @async
*/
static runPythonAsync(code: string, options?: {
globals?: PyProxy;
locals?: PyProxy;
filename?: string;
}): Promise<any>;
/**
* Registers the JavaScript object ``module`` as a JavaScript module named
* ``name``. This module can then be imported from Python using the standard
* Python import system. If another module by the same name has already been
* imported, this won't have much effect unless you also delete the imported
* module from :py:data:`sys.modules`. This calls
* :func:`~pyodide.ffi.register_js_module`.
*
* Any attributes of the JavaScript objects which are themselves objects will
* be treated as submodules:
* ```pyodide
* pyodide.registerJsModule("mymodule", { submodule: { value: 7 } });
* pyodide.runPython(`
* from mymodule.submodule import value
* assert value == 7
* `);
* ```
* If you wish to prevent this, try the following instead:
* ```pyodide
* const sys = pyodide.pyimport("sys");
* sys.modules.set("mymodule", { obj: { value: 7 } });
* pyodide.runPython(`
* from mymodule import obj
* assert obj.value == 7
* # attempting to treat obj as a submodule raises ModuleNotFoundError:
* # "No module named 'mymodule.obj'; 'mymodule' is not a package"
* from mymodule.obj import value
* `);
* ```
*
* @param name Name of the JavaScript module to add
* @param module JavaScript object backing the module
*/
static registerJsModule(name: string, module: object): void;
/**
* Unregisters a JavaScript module with given name that has been previously
* registered with :js:func:`pyodide.registerJsModule` or
* :func:`~pyodide.ffi.register_js_module`. If a JavaScript module with that
* name does not already exist, will throw an error. Note that if the module has
* already been imported, this won't have much effect unless you also delete the
* imported module from :py:data:`sys.modules`. This calls
* :func:`~pyodide.ffi.unregister_js_module`.
*
* @param name Name of the JavaScript module to remove
*/
static unregisterJsModule(name: string): void;
/**
* Convert a JavaScript object to a Python object as best as possible.
*
* This is similar to :py:meth:`~pyodide.ffi.JsProxy.to_py` but for use from
* JavaScript. If the object is immutable or a :js:class:`~pyodide.ffi.PyProxy`,
* it will be returned unchanged. If the object cannot be converted into Python,
* it will be returned unchanged.
*
* See :ref:`type-translations-jsproxy-to-py` for more information.
*
* @param obj The object to convert.
* @param options
* @returns The object converted to Python.
*/
static toPy(obj: any, { depth, defaultConverter, }?: {
/**
* Optional argument to limit the depth of the conversion.
*/
depth: number;
/**
* Optional argument to convert objects with no default conversion. See the
* documentation of :py:meth:`~pyodide.ffi.JsProxy.to_py`.
*/
defaultConverter?: (value: any, converter: (value: any) => any, cacheConversion: (input: any, output: any) => void) => any;
}): any;
/**
* Imports a module and returns it.
*
* If `name` has no dot in it, then `pyimport(name)` is approximately
* equivalent to:
* ```js
* pyodide.runPython(`import ${name}; ${name}`)
* ```
* except that `name` is not introduced into the Python global namespace. If
* the name has one or more dots in it, say it is of the form `path.name`
* where `name` has no dots but path may have zero or more dots. Then it is
* approximately the same as:
* ```js
* pyodide.runPython(`from ${path} import ${name}; ${name}`);
* ```
*
* @param mod_name The name of the module to import
*
* @example
* pyodide.pyimport("math.comb")(4, 2) // returns 4 choose 2 = 6
*/
static pyimport(mod_name: string): any;
/**
* Unpack an archive into a target directory.
*
* @param buffer The archive as an :js:class:`ArrayBuffer` or :js:class:`TypedArray`.
* @param format The format of the archive. Should be one of the formats
* recognized by :py:func:`shutil.unpack_archive`. By default the options are
* ``'bztar'``, ``'gztar'``, ``'tar'``, ``'zip'``, and ``'wheel'``. Several
* synonyms are accepted for each format, e.g., for ``'gztar'`` any of
* ``'.gztar'``, ``'.tar.gz'``, ``'.tgz'``, ``'tar.gz'`` or ``'tgz'`` are
* considered to be
* synonyms.
*
* @param options
* @param options.extractDir The directory to unpack the archive into. Defaults
* to the working directory.
*/
static unpackArchive(buffer: TypedArray | ArrayBuffer, format: string, options?: {
extractDir?: string;
}): void;
/**
* Mounts a :js:class:`FileSystemDirectoryHandle` into the target directory.
* Currently it's only possible to acquire a
* :js:class:`FileSystemDirectoryHandle` in Chrome.
*
* @param path The absolute path in the Emscripten file system to mount the
* native directory. If the directory does not exist, it will be created. If
* it does exist, it must be empty.
* @param fileSystemHandle A handle returned by
* :js:func:`navigator.storage.getDirectory() <getDirectory>` or
* :js:func:`window.showDirectoryPicker() <showDirectoryPicker>`.
*/
static mountNativeFS(path: string, fileSystemHandle: FileSystemDirectoryHandle): Promise<NativeFS>;
/**
* Mounts a host directory into Pyodide file system. Only works in node.
*
* @param emscriptenPath The absolute path in the Emscripten file system to
* mount the native directory. If the directory does not exist, it will be
* created. If it does exist, it must be empty.
* @param hostPath The host path to mount. It must be a directory that exists.
*/
static mountNodeFS(emscriptenPath: string, hostPath: string): void;
/**
* Tell Pyodide about Comlink.
* Necessary to enable importing Comlink proxies into Python.
*/
static registerComlink(Comlink: any): void;
/**
* Sets the interrupt buffer to be ``interrupt_buffer``. This is only useful
* when Pyodide is used in a webworker. The buffer should be a
* :js:class:`SharedArrayBuffer` shared with the main browser thread (or another
* worker). In that case, signal ``signum`` may be sent by writing ``signum``
* into the interrupt buffer. If ``signum`` does not satisfy 0 < ``signum`` < 65
* it will be silently ignored.
*
* You can disable interrupts by calling ``setInterruptBuffer(undefined)``.
*
* If you wish to trigger a :py:exc:`KeyboardInterrupt`, write ``SIGINT`` (a 2)
* into the interrupt buffer.
*
* By default ``SIGINT`` raises a :py:exc:`KeyboardInterrupt` and all other signals
* are ignored. You can install custom signal handlers with the signal module.
* Even signals that normally have special meaning and can't be overridden like
* ``SIGKILL`` and ``SIGSEGV`` are ignored by default and can be used for any
* purpose you like.
*/
static setInterruptBuffer(interrupt_buffer: TypedArray): void;
/**
* Throws a :py:exc:`KeyboardInterrupt` error if a :py:exc:`KeyboardInterrupt` has
* been requested via the interrupt buffer.
*
* This can be used to enable keyboard interrupts during execution of JavaScript
* code, just as :c:func:`PyErr_CheckSignals` is used to enable keyboard interrupts
* during execution of C code.
*/
static checkInterrupt(): void;
/**
* Turn on or off debug mode. In debug mode, some error messages are improved
* at a performance cost.
* @param debug If true, turn debug mode on. If false, turn debug mode off.
* @returns The old value of the debug flag.
*/
static setDebug(debug: boolean): boolean;
}
/** @hidetype */
export type PyodideInterface = typeof PyodideAPI;
/**
* See documentation for loadPyodide.
* @private
*/
type ConfigType = {
indexURL: string;
packageCacheDir: string;
lockFileURL: string;
fullStdLib?: boolean;
stdLibURL?: string;
stdin?: () => string;
stdout?: (msg: string) => void;
stderr?: (msg: string) => void;
jsglobals?: object;
args: string[];
_node_mounts: string[];
env: {
[key: string]: string;
};
packages: string[];
};
/**
* Load the main Pyodide wasm module and initialize it.
*
* @returns The :ref:`js-api-pyodide` module.
* @memberof globalThis
* @async
* @example
* async function main() {
* const pyodide = await loadPyodide({
* fullStdLib: true,
* stdout: (msg) => console.log(`Pyodide: ${msg}`),
* });
* console.log("Loaded Pyodide");
* }
* main();
*/
export declare function loadPyodide(options?: {
/**
* The URL from which Pyodide will load the main Pyodide runtime and
* packages. It is recommended that you leave this unchanged, providing an
* incorrect value can cause broken behavior.
*
* Default: The url that Pyodide is loaded from with the file name
* (``pyodide.js`` or ``pyodide.mjs``) removed.
*/
indexURL?: string;
/**
* The file path where packages will be cached in node. If a package
* exists in ``packageCacheDir`` it is loaded from there, otherwise it is
* downloaded from the JsDelivr CDN and then cached into ``packageCacheDir``.
* Only applies when running in node; ignored in browsers.
*
* Default: same as indexURL
*/
packageCacheDir?: string;
/**
* The URL from which Pyodide will load the Pyodide ``pyodide-lock.json`` lock
* file. You can produce custom lock files with :py:func:`micropip.freeze`.
* Default: ```${indexURL}/pyodide-lock.json```
*/
lockFileURL?: string;
/**
* Load the full Python standard library. Setting this to false excludes
* unvendored modules from the standard library.
* Default: ``false``
*/
fullStdLib?: boolean;
/**
* The URL from which to load the standard library ``python_stdlib.zip``
* file. This URL includes the most of the Python standard library. Some
* stdlib modules were unvendored, and can be loaded separately
* with ``fullStdLib: true`` option or by their package name.
* Default: ```${indexURL}/python_stdlib.zip```
*/
stdLibURL?: string;
/**
* Override the standard input callback. Should ask the user for one line of
* input. The :js:func:`pyodide.setStdin` function is more flexible and
* should be preferred.
*/
stdin?: () => string;
/**
* Override the standard output callback. The :js:func:`pyodide.setStdout`
* function is more flexible and should be preferred in most cases, but
* depending on the ``args`` passed to ``loadPyodide``, Pyodide may write to
* stdout on startup, which can only be controlled by passing a custom
* ``stdout`` function.
*/
stdout?: (msg: string) => void;
/**
* Override the standard error output callback. The
* :js:func:`pyodide.setStderr` function is more flexible and should be
* preferred in most cases, but depending on the ``args`` passed to
* ``loadPyodide``, Pyodide may write to stdout on startup, which can only
* be controlled by passing a custom ``stdout`` function.
*/
stderr?: (msg: string) => void;
/**
* The object that Pyodide will use for the ``js`` module.
* Default: ``globalThis``
*/
jsglobals?: object;
/**
* Command line arguments to pass to Python on startup. See `Python command
* line interface options
* <https://docs.python.org/3.10/using/cmdline.html#interface-options>`_ for
* more details. Default: ``[]``
*/
args?: string[];
/**
* Environment variables to pass to Python. This can be accessed inside of
* Python at runtime via :py:data:`os.environ`. Certain environment variables change
* the way that Python loads:
* https://docs.python.org/3.10/using/cmdline.html#environment-variables
* Default: ``{}``.
* If ``env.HOME`` is undefined, it will be set to a default value of
* ``"/home/pyodide"``
*/
env?: {
[key: string]: string;
};
/**
* A list of packages to load as Pyodide is initializing.
*
* This is the same as loading the packages with
* :js:func:`pyodide.loadPackage` after Pyodide is loaded except using the
* ``packages`` option is more efficient because the packages are downloaded
* while Pyodide bootstraps itself.
*/
packages?: string[];
/**
* Opt into the old behavior where PyProxy.toString calls `repr` and not
* `str`.
* @deprecated
*/
pyproxyToStringRepr?: boolean;
/**
* @ignore
*/
_node_mounts?: string[];
}): Promise<PyodideInterface>;
export type {};
export type {};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,126 +0,0 @@
Metadata-Version: 2.1
Name: pyparsing
Version: 3.1.1
Summary: pyparsing module - Classes and methods to define and execute parsing grammars
Author-email: Paul McGuire <ptmcg.gm+pyparsing@gmail.com>
Requires-Python: >=3.6.8
Description-Content-Type: text/x-rst
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Text Processing
Classifier: Typing :: Typed
Requires-Dist: railroad-diagrams ; extra == "diagrams"
Requires-Dist: jinja2 ; extra == "diagrams"
Project-URL: Homepage, https://github.com/pyparsing/pyparsing/
Provides-Extra: diagrams
PyParsing -- A Python Parsing Module
====================================
|Version| |Build Status| |Coverage| |License| |Python Versions| |Snyk Score|
Introduction
============
The pyparsing module is an alternative approach to creating and
executing simple grammars, vs. the traditional lex/yacc approach, or the
use of regular expressions. The pyparsing module provides a library of
classes that client code uses to construct the grammar directly in
Python code.
*[Since first writing this description of pyparsing in late 2003, this
technique for developing parsers has become more widespread, under the
name Parsing Expression Grammars - PEGs. See more information on PEGs*
`here <https://en.wikipedia.org/wiki/Parsing_expression_grammar>`__
*.]*
Here is a program to parse ``"Hello, World!"`` (or any greeting of the form
``"salutation, addressee!"``):
.. code:: python
from pyparsing import Word, alphas
greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
print(hello, "->", greet.parseString(hello))
The program outputs the following::
Hello, World! -> ['Hello', ',', 'World', '!']
The Python representation of the grammar is quite readable, owing to the
self-explanatory class names, and the use of '+', '|' and '^' operator
definitions.
The parsed results returned from ``parseString()`` is a collection of type
``ParseResults``, which can be accessed as a
nested list, a dictionary, or an object with named attributes.
The pyparsing module handles some of the problems that are typically
vexing when writing text parsers:
- extra or missing whitespace (the above program will also handle ``"Hello,World!"``, ``"Hello , World !"``, etc.)
- quoted strings
- embedded comments
The examples directory includes a simple SQL parser, simple CORBA IDL
parser, a config file parser, a chemical formula parser, and a four-
function algebraic notation parser, among many others.
Documentation
=============
There are many examples in the online docstrings of the classes
and methods in pyparsing. You can find them compiled into `online docs <https://pyparsing-docs.readthedocs.io/en/latest/>`__. Additional
documentation resources and project info are listed in the online
`GitHub wiki <https://github.com/pyparsing/pyparsing/wiki>`__. An
entire directory of examples can be found `here <https://github.com/pyparsing/pyparsing/tree/master/examples>`__.
License
=======
MIT License. See header of the `pyparsing __init__.py <https://github.com/pyparsing/pyparsing/blob/master/pyparsing/__init__.py#L1-L23>`__ file.
History
=======
See `CHANGES <https://github.com/pyparsing/pyparsing/blob/master/CHANGES>`__ file.
.. |Build Status| image:: https://github.com/pyparsing/pyparsing/actions/workflows/ci.yml/badge.svg
:target: https://github.com/pyparsing/pyparsing/actions/workflows/ci.yml
.. |Coverage| image:: https://codecov.io/gh/pyparsing/pyparsing/branch/master/graph/badge.svg
:target: https://codecov.io/gh/pyparsing/pyparsing
.. |Version| image:: https://img.shields.io/pypi/v/pyparsing?style=flat-square
:target: https://pypi.org/project/pyparsing/
:alt: Version
.. |License| image:: https://img.shields.io/pypi/l/pyparsing.svg?style=flat-square
:target: https://pypi.org/project/pyparsing/
:alt: License
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/pyparsing.svg?style=flat-square
:target: https://pypi.org/project/python-liquid/
:alt: Python versions
.. |Snyk Score| image:: https://snyk.io//advisor/python/pyparsing/badge.svg
:target: https://snyk.io//advisor/python/pyparsing
:alt: pyparsing
@@ -1,204 +0,0 @@
Metadata-Version: 2.1
Name: python-dateutil
Version: 2.8.2
Summary: Extensions to the standard Python datetime module
Home-page: https://github.com/dateutil/dateutil
Author: Gustavo Niemeyer
Author-email: gustavo@niemeyer.net
Maintainer: Paul Ganssle
Maintainer-email: dateutil@python.org
License: Dual License
Project-URL: Documentation, https://dateutil.readthedocs.io/en/stable/
Project-URL: Source, https://github.com/dateutil/dateutil
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries
Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,>=2.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: six (>=1.5)
dateutil - powerful extensions to datetime
==========================================
|pypi| |support| |licence|
|gitter| |readthedocs|
|travis| |appveyor| |pipelines| |coverage|
.. |pypi| image:: https://img.shields.io/pypi/v/python-dateutil.svg?style=flat-square
:target: https://pypi.org/project/python-dateutil/
:alt: pypi version
.. |support| image:: https://img.shields.io/pypi/pyversions/python-dateutil.svg?style=flat-square
:target: https://pypi.org/project/python-dateutil/
:alt: supported Python version
.. |travis| image:: https://img.shields.io/travis/dateutil/dateutil/master.svg?style=flat-square&label=Travis%20Build
:target: https://travis-ci.org/dateutil/dateutil
:alt: travis build status
.. |appveyor| image:: https://img.shields.io/appveyor/ci/dateutil/dateutil/master.svg?style=flat-square&logo=appveyor
:target: https://ci.appveyor.com/project/dateutil/dateutil
:alt: appveyor build status
.. |pipelines| image:: https://dev.azure.com/pythondateutilazure/dateutil/_apis/build/status/dateutil.dateutil?branchName=master
:target: https://dev.azure.com/pythondateutilazure/dateutil/_build/latest?definitionId=1&branchName=master
:alt: azure pipelines build status
.. |coverage| image:: https://codecov.io/gh/dateutil/dateutil/branch/master/graphs/badge.svg?branch=master
:target: https://codecov.io/gh/dateutil/dateutil?branch=master
:alt: Code coverage
.. |gitter| image:: https://badges.gitter.im/dateutil/dateutil.svg
:alt: Join the chat at https://gitter.im/dateutil/dateutil
:target: https://gitter.im/dateutil/dateutil
.. |licence| image:: https://img.shields.io/pypi/l/python-dateutil.svg?style=flat-square
:target: https://pypi.org/project/python-dateutil/
:alt: licence
.. |readthedocs| image:: https://img.shields.io/readthedocs/dateutil/latest.svg?style=flat-square&label=Read%20the%20Docs
:alt: Read the documentation at https://dateutil.readthedocs.io/en/latest/
:target: https://dateutil.readthedocs.io/en/latest/
The `dateutil` module provides powerful extensions to
the standard `datetime` module, available in Python.
Installation
============
`dateutil` can be installed from PyPI using `pip` (note that the package name is
different from the importable name)::
pip install python-dateutil
Download
========
dateutil is available on PyPI
https://pypi.org/project/python-dateutil/
The documentation is hosted at:
https://dateutil.readthedocs.io/en/stable/
Code
====
The code and issue tracker are hosted on GitHub:
https://github.com/dateutil/dateutil/
Features
========
* Computing of relative deltas (next month, next year,
next Monday, last week of month, etc);
* Computing of relative deltas between two given
date and/or datetime objects;
* Computing of dates based on very flexible recurrence rules,
using a superset of the `iCalendar <https://www.ietf.org/rfc/rfc2445.txt>`_
specification. Parsing of RFC strings is supported as well.
* Generic parsing of dates in almost any string format;
* Timezone (tzinfo) implementations for tzfile(5) format
files (/etc/localtime, /usr/share/zoneinfo, etc), TZ
environment string (in all known formats), iCalendar
format files, given ranges (with help from relative deltas),
local machine timezone, fixed offset timezone, UTC timezone,
and Windows registry-based time zones.
* Internal up-to-date world timezone information based on
Olson's database.
* Computing of Easter Sunday dates for any given year,
using Western, Orthodox or Julian algorithms;
* A comprehensive test suite.
Quick example
=============
Here's a snapshot, just to give an idea about the power of the
package. For more examples, look at the documentation.
Suppose you want to know how much time is left, in
years/months/days/etc, before the next easter happening on a
year with a Friday 13th in August, and you want to get today's
date out of the "date" unix system command. Here is the code:
.. code-block:: python3
>>> from dateutil.relativedelta import *
>>> from dateutil.easter import *
>>> from dateutil.rrule import *
>>> from dateutil.parser import *
>>> from datetime import *
>>> now = parse("Sat Oct 11 17:13:46 UTC 2003")
>>> today = now.date()
>>> year = rrule(YEARLY,dtstart=now,bymonth=8,bymonthday=13,byweekday=FR)[0].year
>>> rdelta = relativedelta(easter(year), today)
>>> print("Today is: %s" % today)
Today is: 2003-10-11
>>> print("Year with next Aug 13th on a Friday is: %s" % year)
Year with next Aug 13th on a Friday is: 2004
>>> print("How far is the Easter of that year: %s" % rdelta)
How far is the Easter of that year: relativedelta(months=+6)
>>> print("And the Easter of that year is: %s" % (today+rdelta))
And the Easter of that year is: 2004-04-11
Being exactly 6 months ahead was **really** a coincidence :)
Contributing
============
We welcome many types of contributions - bug reports, pull requests (code, infrastructure or documentation fixes). For more information about how to contribute to the project, see the ``CONTRIBUTING.md`` file in the repository.
Author
======
The dateutil module was written by Gustavo Niemeyer <gustavo@niemeyer.net>
in 2003.
It is maintained by:
* Gustavo Niemeyer <gustavo@niemeyer.net> 2003-2011
* Tomi Pieviläinen <tomi.pievilainen@iki.fi> 2012-2014
* Yaron de Leeuw <me@jarondl.net> 2014-2016
* Paul Ganssle <paul@ganssle.io> 2015-
Starting with version 2.4.1 and running until 2.8.2, all source and binary
distributions will be signed by a PGP key that has, at the very least, been
signed by the key which made the previous release. A table of release signing
keys can be found below:
=========== ============================
Releases Signing key fingerprint
=========== ============================
2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_
=========== ============================
New releases *may* have signed tags, but binary and source distributions
uploaded to PyPI will no longer have GPG signatures attached.
Contact
=======
Our mailing list is available at `dateutil@python.org <https://mail.python.org/mailman/listinfo/dateutil>`_. As it is hosted by the PSF, it is subject to the `PSF code of
conduct <https://www.python.org/psf/conduct/>`_.
License
=======
All contributions after December 1, 2017 released under dual license - either `Apache 2.0 License <https://www.apache.org/licenses/LICENSE-2.0>`_ or the `BSD 3-Clause License <https://opensource.org/licenses/BSD-3-Clause>`_. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License.
.. _6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB:
https://pgp.mit.edu/pks/lookup?op=vindex&search=0xCD54FCE3D964BEFB
Binary file not shown.
Binary file not shown.
@@ -1,649 +0,0 @@
Metadata-Version: 2.1
Name: pytz
Version: 2024.1
Summary: World timezone definitions, modern and historical
Home-page: http://pythonhosted.org/pytz
Author: Stuart Bishop
Author-email: stuart@stuartbishop.net
Maintainer: Stuart Bishop
Maintainer-email: stuart@stuartbishop.net
License: MIT
Download-URL: https://pypi.org/project/pytz/
Keywords: timezone,tzinfo,datetime,olson,time
Platform: Independent
Classifier: Development Status :: 6 - Mature
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.4
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
License-File: LICENSE.txt
pytz - World Timezone Definitions for Python
============================================
:Author: Stuart Bishop <stuart@stuartbishop.net>
Introduction
~~~~~~~~~~~~
pytz brings the Olson tz database into Python. This library allows
accurate and cross platform timezone calculations using Python 2.4
or higher. It also solves the issue of ambiguous times at the end
of daylight saving time, which you can read more about in the Python
Library Reference (``datetime.tzinfo``).
Almost all of the Olson timezones are supported.
.. note::
Projects using Python 3.9 or later should be using the support
now included as part of the standard library, and third party
packages work with it such as `tzdata <https://pypi.org/project/tzdata/>`_.
pytz offers no advantages beyond backwards compatibility with
code written for earlier versions of Python.
.. note::
This library differs from the documented Python API for
tzinfo implementations; if you want to create local wallclock
times you need to use the ``localize()`` method documented in this
document. In addition, if you perform date arithmetic on local
times that cross DST boundaries, the result may be in an incorrect
timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get
2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A
``normalize()`` method is provided to correct this. Unfortunately these
issues cannot be resolved without modifying the Python datetime
implementation (see PEP-431).
Installation
~~~~~~~~~~~~
This package can either be installed using ``pip`` or from a tarball using the
standard Python distutils.
If you are installing using ``pip``, you don't need to download anything as the
latest version will be downloaded for you from PyPI::
pip install pytz
If you are installing from a tarball, run the following command as an
administrative user::
python setup.py install
pytz for Enterprise
~~~~~~~~~~~~~~~~~~~
Available as part of the Tidelift Subscription.
The maintainers of pytz and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. <https://tidelift.com/subscription/pkg/pypi-pytz?utm_source=pypi-pytz&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_.
Example & Usage
~~~~~~~~~~~~~~~
Localized times and date arithmetic
-----------------------------------
>>> from datetime import datetime, timedelta
>>> from pytz import timezone
>>> import pytz
>>> utc = pytz.utc
>>> utc.zone
'UTC'
>>> eastern = timezone('US/Eastern')
>>> eastern.zone
'US/Eastern'
>>> amsterdam = timezone('Europe/Amsterdam')
>>> fmt = '%Y-%m-%d %H:%M:%S %Z%z'
This library only supports two ways of building a localized time. The
first is to use the ``localize()`` method provided by the pytz library.
This is used to localize a naive datetime (datetime with no timezone
information):
>>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0))
>>> print(loc_dt.strftime(fmt))
2002-10-27 06:00:00 EST-0500
The second way of building a localized time is by converting an existing
localized time using the standard ``astimezone()`` method:
>>> ams_dt = loc_dt.astimezone(amsterdam)
>>> ams_dt.strftime(fmt)
'2002-10-27 12:00:00 CET+0100'
Unfortunately using the tzinfo argument of the standard datetime
constructors ''does not work'' with pytz for many timezones.
>>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt) # /!\ Does not work this way!
'2002-10-27 12:00:00 LMT+0018'
It is safe for timezones without daylight saving transitions though, such
as UTC:
>>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt) # /!\ Not recommended except for UTC
'2002-10-27 12:00:00 UTC+0000'
The preferred way of dealing with times is to always work in UTC,
converting to localtime only when generating output to be read
by humans.
>>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
>>> loc_dt = utc_dt.astimezone(eastern)
>>> loc_dt.strftime(fmt)
'2002-10-27 01:00:00 EST-0500'
This library also allows you to do date arithmetic using local
times, although it is more complicated than working in UTC as you
need to use the ``normalize()`` method to handle daylight saving time
and other timezone transitions. In this example, ``loc_dt`` is set
to the instant when daylight saving time ends in the US/Eastern
timezone.
>>> before = loc_dt - timedelta(minutes=10)
>>> before.strftime(fmt)
'2002-10-27 00:50:00 EST-0500'
>>> eastern.normalize(before).strftime(fmt)
'2002-10-27 01:50:00 EDT-0400'
>>> after = eastern.normalize(before + timedelta(minutes=20))
>>> after.strftime(fmt)
'2002-10-27 01:10:00 EST-0500'
Creating local times is also tricky, and the reason why working with
local times is not recommended. Unfortunately, you cannot just pass
a ``tzinfo`` argument when constructing a datetime (see the next
section for more details)
>>> dt = datetime(2002, 10, 27, 1, 30, 0)
>>> dt1 = eastern.localize(dt, is_dst=True)
>>> dt1.strftime(fmt)
'2002-10-27 01:30:00 EDT-0400'
>>> dt2 = eastern.localize(dt, is_dst=False)
>>> dt2.strftime(fmt)
'2002-10-27 01:30:00 EST-0500'
Converting between timezones is more easily done, using the
standard astimezone method.
>>> utc_dt = datetime.fromtimestamp(1143408899, tz=utc)
>>> utc_dt.strftime(fmt)
'2006-03-26 21:34:59 UTC+0000'
>>> au_tz = timezone('Australia/Sydney')
>>> au_dt = utc_dt.astimezone(au_tz)
>>> au_dt.strftime(fmt)
'2006-03-27 08:34:59 AEDT+1100'
>>> utc_dt2 = au_dt.astimezone(utc)
>>> utc_dt2.strftime(fmt)
'2006-03-26 21:34:59 UTC+0000'
>>> utc_dt == utc_dt2
True
You can take shortcuts when dealing with the UTC side of timezone
conversions. ``normalize()`` and ``localize()`` are not really
necessary when there are no daylight saving time transitions to
deal with.
>>> utc_dt = datetime.fromtimestamp(1143408899, tz=utc)
>>> utc_dt.strftime(fmt)
'2006-03-26 21:34:59 UTC+0000'
>>> au_tz = timezone('Australia/Sydney')
>>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz))
>>> au_dt.strftime(fmt)
'2006-03-27 08:34:59 AEDT+1100'
>>> utc_dt2 = au_dt.astimezone(utc)
>>> utc_dt2.strftime(fmt)
'2006-03-26 21:34:59 UTC+0000'
``tzinfo`` API
--------------
The ``tzinfo`` instances returned by the ``timezone()`` function have
been extended to cope with ambiguous times by adding an ``is_dst``
parameter to the ``utcoffset()``, ``dst()`` && ``tzname()`` methods.
>>> tz = timezone('America/St_Johns')
>>> normal = datetime(2009, 9, 1)
>>> ambiguous = datetime(2009, 10, 31, 23, 30)
The ``is_dst`` parameter is ignored for most timestamps. It is only used
during DST transition ambiguous periods to resolve that ambiguity.
>>> print(tz.utcoffset(normal, is_dst=True))
-1 day, 21:30:00
>>> print(tz.dst(normal, is_dst=True))
1:00:00
>>> tz.tzname(normal, is_dst=True)
'NDT'
>>> print(tz.utcoffset(ambiguous, is_dst=True))
-1 day, 21:30:00
>>> print(tz.dst(ambiguous, is_dst=True))
1:00:00
>>> tz.tzname(ambiguous, is_dst=True)
'NDT'
>>> print(tz.utcoffset(normal, is_dst=False))
-1 day, 21:30:00
>>> tz.dst(normal, is_dst=False).seconds
3600
>>> tz.tzname(normal, is_dst=False)
'NDT'
>>> print(tz.utcoffset(ambiguous, is_dst=False))
-1 day, 20:30:00
>>> tz.dst(ambiguous, is_dst=False)
datetime.timedelta(0)
>>> tz.tzname(ambiguous, is_dst=False)
'NST'
If ``is_dst`` is not specified, ambiguous timestamps will raise
an ``pytz.exceptions.AmbiguousTimeError`` exception.
>>> print(tz.utcoffset(normal))
-1 day, 21:30:00
>>> print(tz.dst(normal))
1:00:00
>>> tz.tzname(normal)
'NDT'
>>> import pytz.exceptions
>>> try:
... tz.utcoffset(ambiguous)
... except pytz.exceptions.AmbiguousTimeError:
... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
>>> try:
... tz.dst(ambiguous)
... except pytz.exceptions.AmbiguousTimeError:
... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
>>> try:
... tz.tzname(ambiguous)
... except pytz.exceptions.AmbiguousTimeError:
... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
Problems with Localtime
~~~~~~~~~~~~~~~~~~~~~~~
The major problem we have to deal with is that certain datetimes
may occur twice in a year. For example, in the US/Eastern timezone
on the last Sunday morning in October, the following sequence
happens:
- 01:00 EDT occurs
- 1 hour later, instead of 2:00am the clock is turned back 1 hour
and 01:00 happens again (this time 01:00 EST)
In fact, every instant between 01:00 and 02:00 occurs twice. This means
that if you try and create a time in the 'US/Eastern' timezone
the standard datetime syntax, there is no way to specify if you meant
before of after the end-of-daylight-saving-time transition. Using the
pytz custom syntax, the best you can do is make an educated guess:
>>> loc_dt = eastern.localize(datetime(2002, 10, 27, 1, 30, 00))
>>> loc_dt.strftime(fmt)
'2002-10-27 01:30:00 EST-0500'
As you can see, the system has chosen one for you and there is a 50%
chance of it being out by one hour. For some applications, this does
not matter. However, if you are trying to schedule meetings with people
in different timezones or analyze log files it is not acceptable.
The best and simplest solution is to stick with using UTC. The pytz
package encourages using UTC for internal timezone representation by
including a special UTC implementation based on the standard Python
reference implementation in the Python documentation.
The UTC timezone unpickles to be the same instance, and pickles to a
smaller size than other pytz tzinfo instances. The UTC implementation
can be obtained as pytz.utc, pytz.UTC, or pytz.timezone('UTC').
>>> import pickle, pytz
>>> dt = datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
>>> naive = dt.replace(tzinfo=None)
>>> p = pickle.dumps(dt, 1)
>>> naive_p = pickle.dumps(naive, 1)
>>> len(p) - len(naive_p)
17
>>> new = pickle.loads(p)
>>> new == dt
True
>>> new is dt
False
>>> new.tzinfo is dt.tzinfo
True
>>> pytz.utc is pytz.UTC is pytz.timezone('UTC')
True
Note that some other timezones are commonly thought of as the same (GMT,
Greenwich, Universal, etc.). The definition of UTC is distinct from these
other timezones, and they are not equivalent. For this reason, they will
not compare the same in Python.
>>> utc == pytz.timezone('GMT')
False
See the section `What is UTC`_, below.
If you insist on working with local times, this library provides a
facility for constructing them unambiguously:
>>> loc_dt = datetime(2002, 10, 27, 1, 30, 00)
>>> est_dt = eastern.localize(loc_dt, is_dst=True)
>>> edt_dt = eastern.localize(loc_dt, is_dst=False)
>>> print(est_dt.strftime(fmt) + ' / ' + edt_dt.strftime(fmt))
2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500
If you pass None as the is_dst flag to localize(), pytz will refuse to
guess and raise exceptions if you try to build ambiguous or non-existent
times.
For example, 1:30am on 27th Oct 2002 happened twice in the US/Eastern
timezone when the clocks where put back at the end of Daylight Saving
Time:
>>> dt = datetime(2002, 10, 27, 1, 30, 00)
>>> try:
... eastern.localize(dt, is_dst=None)
... except pytz.exceptions.AmbiguousTimeError:
... print('pytz.exceptions.AmbiguousTimeError: %s' % dt)
pytz.exceptions.AmbiguousTimeError: 2002-10-27 01:30:00
Similarly, 2:30am on 7th April 2002 never happened at all in the
US/Eastern timezone, as the clocks where put forward at 2:00am skipping
the entire hour:
>>> dt = datetime(2002, 4, 7, 2, 30, 00)
>>> try:
... eastern.localize(dt, is_dst=None)
... except pytz.exceptions.NonExistentTimeError:
... print('pytz.exceptions.NonExistentTimeError: %s' % dt)
pytz.exceptions.NonExistentTimeError: 2002-04-07 02:30:00
Both of these exceptions share a common base class to make error handling
easier:
>>> isinstance(pytz.AmbiguousTimeError(), pytz.InvalidTimeError)
True
>>> isinstance(pytz.NonExistentTimeError(), pytz.InvalidTimeError)
True
A special case is where countries change their timezone definitions
with no daylight savings time switch. For example, in 1915 Warsaw
switched from Warsaw time to Central European time with no daylight savings
transition. So at the stroke of midnight on August 5th 1915 the clocks
were wound back 24 minutes creating an ambiguous time period that cannot
be specified without referring to the timezone abbreviation or the
actual UTC offset. In this case midnight happened twice, neither time
during a daylight saving time period. pytz handles this transition by
treating the ambiguous period before the switch as daylight savings
time, and the ambiguous period after as standard time.
>>> warsaw = pytz.timezone('Europe/Warsaw')
>>> amb_dt1 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=True)
>>> amb_dt1.strftime(fmt)
'1915-08-04 23:59:59 WMT+0124'
>>> amb_dt2 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=False)
>>> amb_dt2.strftime(fmt)
'1915-08-04 23:59:59 CET+0100'
>>> switch_dt = warsaw.localize(datetime(1915, 8, 5, 00, 00, 00), is_dst=False)
>>> switch_dt.strftime(fmt)
'1915-08-05 00:00:00 CET+0100'
>>> str(switch_dt - amb_dt1)
'0:24:01'
>>> str(switch_dt - amb_dt2)
'0:00:01'
The best way of creating a time during an ambiguous time period is
by converting from another timezone such as UTC:
>>> utc_dt = datetime(1915, 8, 4, 22, 36, tzinfo=pytz.utc)
>>> utc_dt.astimezone(warsaw).strftime(fmt)
'1915-08-04 23:36:00 CET+0100'
The standard Python way of handling all these ambiguities is not to
handle them, such as demonstrated in this example using the US/Eastern
timezone definition from the Python documentation (Note that this
implementation only works for dates between 1987 and 2006 - it is
included for tests only!):
>>> from pytz.reference import Eastern # pytz.reference only for tests
>>> dt = datetime(2002, 10, 27, 0, 30, tzinfo=Eastern)
>>> str(dt)
'2002-10-27 00:30:00-04:00'
>>> str(dt + timedelta(hours=1))
'2002-10-27 01:30:00-05:00'
>>> str(dt + timedelta(hours=2))
'2002-10-27 02:30:00-05:00'
>>> str(dt + timedelta(hours=3))
'2002-10-27 03:30:00-05:00'
Notice the first two results? At first glance you might think they are
correct, but taking the UTC offset into account you find that they are
actually two hours appart instead of the 1 hour we asked for.
>>> from pytz.reference import UTC # pytz.reference only for tests
>>> str(dt.astimezone(UTC))
'2002-10-27 04:30:00+00:00'
>>> str((dt + timedelta(hours=1)).astimezone(UTC))
'2002-10-27 06:30:00+00:00'
Country Information
~~~~~~~~~~~~~~~~~~~
A mechanism is provided to access the timezones commonly in use
for a particular country, looked up using the ISO 3166 country code.
It returns a list of strings that can be used to retrieve the relevant
tzinfo instance using ``pytz.timezone()``:
>>> print(' '.join(pytz.country_timezones['nz']))
Pacific/Auckland Pacific/Chatham
The Olson database comes with a ISO 3166 country code to English country
name mapping that pytz exposes as a dictionary:
>>> print(pytz.country_names['nz'])
New Zealand
What is UTC
~~~~~~~~~~~
'UTC' is `Coordinated Universal Time`_. It is a successor to, but distinct
from, Greenwich Mean Time (GMT) and the various definitions of Universal
Time. UTC is now the worldwide standard for regulating clocks and time
measurement.
All other timezones are defined relative to UTC, and include offsets like
UTC+0800 - hours to add or subtract from UTC to derive the local time. No
daylight saving time occurs in UTC, making it a useful timezone to perform
date arithmetic without worrying about the confusion and ambiguities caused
by daylight saving time transitions, your country changing its timezone, or
mobile computers that roam through multiple timezones.
.. _Coordinated Universal Time: https://en.wikipedia.org/wiki/Coordinated_Universal_Time
Helpers
~~~~~~~
There are two lists of timezones provided.
``all_timezones`` is the exhaustive list of the timezone names that can
be used.
>>> from pytz import all_timezones
>>> len(all_timezones) >= 500
True
>>> 'Etc/Greenwich' in all_timezones
True
``common_timezones`` is a list of useful, current timezones. It doesn't
contain deprecated zones or historical zones, except for a few I've
deemed in common usage, such as US/Eastern (open a bug report if you
think other timezones are deserving of being included here). It is also
a sequence of strings.
>>> from pytz import common_timezones
>>> len(common_timezones) < len(all_timezones)
True
>>> 'Etc/Greenwich' in common_timezones
False
>>> 'Australia/Melbourne' in common_timezones
True
>>> 'US/Eastern' in common_timezones
True
>>> 'Canada/Eastern' in common_timezones
True
>>> 'Australia/Yancowinna' in all_timezones
True
>>> 'Australia/Yancowinna' in common_timezones
False
Both ``common_timezones`` and ``all_timezones`` are alphabetically
sorted:
>>> common_timezones_dupe = common_timezones[:]
>>> common_timezones_dupe.sort()
>>> common_timezones == common_timezones_dupe
True
>>> all_timezones_dupe = all_timezones[:]
>>> all_timezones_dupe.sort()
>>> all_timezones == all_timezones_dupe
True
``all_timezones`` and ``common_timezones`` are also available as sets.
>>> from pytz import all_timezones_set, common_timezones_set
>>> 'US/Eastern' in all_timezones_set
True
>>> 'US/Eastern' in common_timezones_set
True
>>> 'Australia/Victoria' in common_timezones_set
False
You can also retrieve lists of timezones used by particular countries
using the ``country_timezones()`` function. It requires an ISO-3166
two letter country code.
>>> from pytz import country_timezones
>>> print(' '.join(country_timezones('ch')))
Europe/Zurich
>>> print(' '.join(country_timezones('CH')))
Europe/Zurich
Internationalization - i18n/l10n
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pytz is an interface to the IANA database, which uses ASCII names. The `Unicode Consortium's Unicode Locales (CLDR) <http://cldr.unicode.org>`_
project provides translations. Python packages such as
`Babel <https://babel.pocoo.org/en/latest/api/dates.html#timezone-functionality>`_
and Thomas Khyn's `l18n <https://pypi.org/project/l18n/>`_ package can be used
to access these translations from Python.
License
~~~~~~~
MIT license.
This code is also available as part of Zope 3 under the Zope Public
License, Version 2.1 (ZPL).
I'm happy to relicense this code if necessary for inclusion in other
open source projects.
Latest Versions
~~~~~~~~~~~~~~~
This package will be updated after releases of the Olson timezone
database. The latest version can be downloaded from the `Python Package
Index <https://pypi.org/project/pytz/>`_. The code that is used
to generate this distribution is hosted on Github and available
using git::
git clone https://github.com/stub42/pytz.git
Announcements of new releases are made on
`Launchpad <https://launchpad.net/pytz>`_, and the
`Atom feed <http://feeds.launchpad.net/pytz/announcements.atom>`_
hosted there.
Bugs, Feature Requests & Patches
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bugs should be reported on `Github <https://github.com/stub42/pytz/issues>`_.
Feature requests are unlikely to be considered, and efforts instead directed
to timezone support now built into Python or packages that work with it.
Security Issues
~~~~~~~~~~~~~~~
Reports about security issues can be made via `Tidelift <https://tidelift.com/security>`_.
Issues & Limitations
~~~~~~~~~~~~~~~~~~~~
- This project is in maintenance mode. Projects using Python 3.9 or later
are best served by using the timezone functionaly now included in core
Python and packages that work with it such as `tzdata <https://pypi.org/project/tzdata/>`_.
- Offsets from UTC are rounded to the nearest whole minute, so timezones
such as Europe/Amsterdam pre 1937 will be up to 30 seconds out. This
was a limitation of the Python datetime library.
- If you think a timezone definition is incorrect, I probably can't fix
it. pytz is a direct translation of the Olson timezone database, and
changes to the timezone definitions need to be made to this source.
If you find errors they should be reported to the time zone mailing
list, linked from http://www.iana.org/time-zones.
Further Reading
~~~~~~~~~~~~~~~
More info than you want to know about timezones:
https://data.iana.org/time-zones/tz-link.html
Contact
~~~~~~~
Stuart Bishop <stuart@stuartbishop.net>
Binary file not shown.
@@ -1,49 +0,0 @@
Metadata-Version: 2.1
Name: six
Version: 1.16.0
Summary: Python 2 and 3 compatibility utilities
Home-page: https://github.com/benjaminp/six
Author: Benjamin Peterson
Author-email: benjamin@python.org
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*
.. image:: https://img.shields.io/pypi/v/six.svg
:target: https://pypi.org/project/six/
:alt: six on PyPI
.. image:: https://travis-ci.org/benjaminp/six.svg?branch=master
:target: https://travis-ci.org/benjaminp/six
:alt: six on TravisCI
.. image:: https://readthedocs.org/projects/six/badge/?version=latest
:target: https://six.readthedocs.io/
:alt: six's documentation on Read the Docs
.. image:: https://img.shields.io/badge/license-MIT-green.svg
:target: https://github.com/benjaminp/six/blob/master/LICENSE
:alt: MIT License badge
Six is a Python 2 and 3 compatibility library. It provides utility functions
for smoothing over the differences between the Python versions with the goal of
writing Python code that is compatible on both Python versions. See the
documentation for more information on what is provided.
Six supports Python 2.7 and 3.3+. It is contained in only one Python
file, so it can be easily copied into your project. (The copyright and license
notice must be retained.)
Online documentation is at https://six.readthedocs.io/.
Bugs can be reported to https://github.com/benjaminp/six. The code can also
be found there.