texlive[74446] branches/branch2024.final/Master/texmf-dist:

commits+karl at tug.org commits+karl at tug.org
Tue Mar 4 22:15:11 CET 2025


Revision: 74446
          https://tug.org/svn/texlive?view=revision&revision=74446
Author:   karl
Date:     2025-03-04 22:15:11 +0100 (Tue, 04 Mar 2025)
Log Message:
-----------
latex2pydata (branch) (4mar25)

Modified Paths:
--------------
    branches/branch2024.final/Master/texmf-dist/doc/latex/latex2pydata/CHANGELOG.md
    branches/branch2024.final/Master/texmf-dist/doc/latex/latex2pydata/latex2pydata.pdf
    branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.dtx
    branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.ins
    branches/branch2024.final/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/latex2pydata/CHANGELOG.md
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/latex2pydata/CHANGELOG.md	2025-03-04 21:14:31 UTC (rev 74445)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/latex2pydata/CHANGELOG.md	2025-03-04 21:15:11 UTC (rev 74446)
@@ -1,6 +1,19 @@
 # Changelog — latex2pydata LaTeX package
 
 
+## v0.5.0 (2025/03/03)
+
+*  Renamed schema missing setting `rawstr` to `verbatim`.
+
+*  Improved schema documentation.
+
+*  Renamed `*mlvaluestart` macros to `*mlvalueopen` and renamed `*mlvalueend`
+   macros to `*mlvalueclose`, so that `mlvalue` macros are consistent with
+   `dict` and `list` macros for handling opening/closing delimiters.  The old
+   macros are retained for now for backward compatibility.
+
+
+
 ## v0.4.0 (2024/11/17)
 
 *  Replaced buffer index counter with a macro to prevent issues with commands

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/latex2pydata/latex2pydata.pdf
===================================================================
(Binary files differ)

Modified: branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.dtx
===================================================================
--- branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.dtx	2025-03-04 21:14:31 UTC (rev 74445)
+++ branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.dtx	2025-03-04 21:15:11 UTC (rev 74446)
@@ -1,6 +1,7 @@
 % \iffalse meta-comment
+% !TEX TS-program = pdflatexmk
 %
-% Copyright (C) 2023-2024 by Geoffrey M. Poore <gpoore at gmail.com>
+% Copyright (C) 2023-2025 by Geoffrey M. Poore <gpoore at gmail.com>
 % ---------------------------------------------------------------------------
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either version 1.3c
@@ -26,7 +27,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{latex2pydata}
 %<*package>
-    [2024/11/17 v0.4.0 latex2pydata - write data to file in Python literal format]
+    [2025/03/03 v0.5.0 latex2pydata - write data to file in Python literal format]
 %</package>
 %
 %<*driver>
@@ -387,21 +388,23 @@
 %
 % \subsection{Metadata}
 %
-% \pkg{latex2pydata} optionally supports writing metadata to file, including basic schema definitions for values.  When data is loaded with the \pydatapy, the schema is used to perform type conversion and type checking.  When a schema definition exists for a given value, the value is initially loaded as a string, and then (for non-string data types) it is evaluated with \astliteval.  An error is raised if this process does not result in an object with the data type specified in the schema.
+% \pkg{latex2pydata} optionally supports writing metadata to file, including basic schema definitions for values.  When data is loaded with the \pydatapy, the schema is used to perform type conversion and type checking.  When a schema definition exists for a given value, the value is initially loaded as a string, and then it is evaluated with \astliteval.  An error is raised if this process does not result in an object with the data type specified in the schema.
 %
 % \DescMacro{\pydatasetschemamissing\marg{missing behavior}}
 % This determines how the schema is processed when the schema is missing definitions for one or more key-value pairs.  Options for \meta{missing behavior}:
 % \begin{itemize}
 % \item |error| (default):  If a schema is defined then a complete schema is required.  That is, a schema definition must exist for all key-value pairs or an error is raised.
-% \item |rawstr|:  The schema is enforced for all key-value pairs for which it is defined, and any other key-value pairs are kept with string values.  These string values are the raw verbatim text passed from \LaTeX.
-% \item |evalany|:  The schema is enforced for all key-value pairs for which it is defined, and any other key-value pairs have the value evaluated with \astliteval, with all value data types being permitted.  Because all values without a schema definition are evaluated, any string values without a schema definition must be quoted and escaped as strings on the \LaTeX\ side.
+% \item |verbatim|:  The schema is enforced for all key-value pairs for which it is defined, and any other key-value pairs are kept with string values.  These string values are the raw verbatim text passed from \LaTeX.
+% \item |evalany|:  The schema is enforced for all key-value pairs for which it is defined, and any other key-value pairs have the value evaluated with \astliteval, with all value data types being permitted.  Because all values without a schema definition are evaluated, any string values without a schema definition must be quoted and escaped as Python strings on the \LaTeX\ side.
 % \end{itemize}
 %
 % \DescMacro{\pydatasetschemakeytype\marg{key}\marg{value type}}
-% Define a key's schema.  For example, |\pydatasetschemakeytype{key}{int}|.
+% Define a key's schema.  For example, |\pydatasetschemakeytype{key}{int}|.  The value is initially loaded as a string, and then this is evaluated with \astliteval.  An error is raised if this process does not result in an object with the specified data type.  \meta{value type} should be a standard Python type annotation, such as |list[int]| or |dict[str, float]|.  To keep a string value received from \LaTeX\ verbatim without any evaluation, use the special |verbatim| type.
 %
-% \meta{value type} should be a standard Python type annotation, such as |list[int]| or |dict[str, float]|.  See the \pydatapy\ documentation for information about value data types that are currently supported.
+% The following scalar data types are supported:  |bool|, |bytes|, |float|, |int|, |None|, |str|, and |tuple|.  The following collection types are supported:  |dict|, |list|, and |set|.  |Any| is supported for scalars and for collections (subscripting |Any[...]| is not supported for collections).  There is also a |verbatim| data type that is defined specifically for \pkg{latex2pydata}.  This keeps the string data received from \LaTeX\ verbatim, without any interpretation by \astliteval.
 %
+% See the \pydatapy\ documentation for more details.
+%
 % \DescMacro{\pydataclearschema}
 % Delete the existing schema.  If the schema is not deleted, it can be reused across multiple output files.
 %
@@ -469,11 +472,11 @@
 %
 % This environment uses \fvextra\ and \fancyvrb\ internally to capture the environment contents verbatim.  If a new environment is defined as a wrapper for |pydatawritemlvalue|, then |\VerbatimEnvironment| must be used at the beginning of the new environment definition.  This configures \fancyvrb\ to find the end of the new environment correctly.
 %
-% \DescMacro{\pydatawritemlvaluestart}
+% \DescMacro{\pydatawritemlvalueopen}
 %
 % \DescMacro{\pydatawritemlvalueline\marg{line}}
 %
-% \DescMacro{\pydatawritemlvalueend}
+% \DescMacro{\pydatawritemlvalueclose}
 % These commands allow writing a multi-line value to file one line at a time.  \meta{line} is interpreted verbatim.
 %
 %
@@ -534,11 +537,11 @@
 %
 % This environment uses \fvextra\ and \fancyvrb\ internally to capture the environment contents verbatim.  If a new environment is defined as a wrapper for |pydatabuffermlvalue|, then |\VerbatimEnvironment| must be used at the beginning of the new environment definition.  This configures \fancyvrb\ to find the end of the new environment correctly.
 %
-% \DescMacro{\pydatabuffermlvaluestart}
+% \DescMacro{\pydatabuffermlvalueopen}
 %
 % \DescMacro{\pydatabuffermlvalueline\marg{line}}
 %
-% \DescMacro{\pydatabuffermlvalueend}
+% \DescMacro{\pydatabuffermlvalueclose}
 % These commands allow buffering a multi-line value one line at a time.  \meta{line} is interpreted verbatim.
 %
 %
@@ -995,7 +998,7 @@
 % Define behavior for missing key-value pairs in a schema.
 %    \begin{macrocode}
 \let\pydata at schemamissing@error\relax
-\let\pydata at schemamissing@rawstr\relax
+\let\pydata at schemamissing@verbatim\relax
 \let\pydata at schemamissing@evalany\relax
 \def\pydatasetschemamissing#1{%
   \ifcsname pydata at schemamissing@\detokenize{#1}\endcsname
@@ -1249,12 +1252,12 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\pydatawritemlvaluestart, \pydatawritemlvalueline, \pydatawritemlvalueend, \pydatabuffermlvaluestart, \pydatabuffermlvalueline, \pydatabuffermlvalueend}
+% \begin{macro}{\pydatawritemlvalueopen, \pydatawritemlvalueline, \pydatawritemlvalueclose, \pydatabuffermlvalueopen, \pydatabuffermlvalueline, \pydatabuffermlvalueclose}
 %  Write a line of a multi-line value to file or append it to the buffer.  Write the end delimiter of the value to file or append it to the buffer.
 %    \begin{macrocode}
 \begingroup
 \catcode`\,=12\relax
-\gdef\pydatawritemlvaluestart{%
+\gdef\pydatawritemlvalueopen{%
   \ifbool{pydata at haskey}{}{\pydata at error{Cannot write value when waiting for a key}}%
   \immediate\write\pydata at filehandle{%
     \pydata at mlstropen
@@ -1264,13 +1267,13 @@
   \immediate\write\pydata at filehandle{%
     \pydata at escstrtext{#1}%
   }}
-\gdef\pydatawritemlvalueend{%
+\gdef\pydatawritemlvalueclose{%
   \ifbool{pydata at haskey}{}{\pydata at error{Cannot write value when waiting for a key}}%
   \immediate\write\pydata at filehandle{%
     \pydata at mlstrclose,%
   }%
   \boolfalse{pydata at haskey}}
-\gdef\pydatabuffermlvaluestart{%
+\gdef\pydatabuffermlvalueopen{%
   \ifbool{pydata at bufferhaskey}%
    {}{\pydata at error{Cannot buffer value when waiting for a key}}%
   \expandafter\xdef\pydata at bufferlengthmacro{%
@@ -1286,7 +1289,7 @@
   \expandafter\xdef\csname\pydata at bufferlinename\pydata at bufferlengthmacro\endcsname{%
       \pydata at escstrtext{#1}%
     }}
-\gdef\pydatabuffermlvalueend{%
+\gdef\pydatabuffermlvalueclose{%
   \ifbool{pydata at bufferhaskey}%
    {}{\pydata at error{Cannot buffer value when waiting for a key}}%
   \expandafter\xdef\pydata at bufferlengthmacro{%
@@ -1297,6 +1300,13 @@
   \boolfalse{pydata at bufferhaskey}}
 \endgroup
 %    \end{macrocode}
+% |*start| and |*end| variants for backward compatibility with versions before v0.5.0.
+%    \begin{macrocode}
+\let\pydatawritemlvaluestart\pydatawritemlvalueopen
+\let\pydatawritemlvalueend\pydatawritemlvalueclose
+\let\pydatabuffermlvaluestart\pydatabuffermlvalueopen
+\let\pydatabuffermlvalueend\pydatabuffermlvalueclose
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{pydatawritemlvalue}
@@ -1303,10 +1313,10 @@
 %    \begin{macrocode}
 \newenvironment{pydatawritemlvalue}%
  {\VerbatimEnvironment
-  \pydatawritemlvaluestart
+  \pydatawritemlvalueopen
   \begin{VerbatimWrite}[writer=\pydatawritemlvalueline]}%
  {\end{VerbatimWrite}}
-\AfterEndEnvironment{pydatawritemlvalue}{\pydatawritemlvalueend}
+\AfterEndEnvironment{pydatawritemlvalue}{\pydatawritemlvalueclose}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1314,10 +1324,10 @@
 %    \begin{macrocode}
 \newenvironment{pydatabuffermlvalue}%
  {\VerbatimEnvironment
-  \pydatabuffermlvaluestart
+  \pydatabuffermlvalueopen
   \begin{VerbatimBuffer}[bufferer=\pydatabuffermlvalueline]}%
  {\end{VerbatimBuffer}%
-  \pydatabuffermlvalueend}
+  \pydatabuffermlvalueclose}
 %    \end{macrocode}
 % \end{macro}
 %

Modified: branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.ins
===================================================================
--- branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.ins	2025-03-04 21:14:31 UTC (rev 74445)
+++ branches/branch2024.final/Master/texmf-dist/source/latex/latex2pydata/latex2pydata.ins	2025-03-04 21:15:11 UTC (rev 74446)
@@ -1,4 +1,4 @@
-%% Copyright (C) 2023-2024 by Geoffrey M. Poore <gpoore at gmail.com>
+%% Copyright (C) 2023-2025 by Geoffrey M. Poore <gpoore at gmail.com>
 %% --------------------------------------------------------------------------
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
@@ -26,7 +26,7 @@
 
 This is a generated file.
 
-Copyright (C) 2023-2024 by Geoffrey M. Poore <gpoore at gmail.com>
+Copyright (C) 2023-2025 by Geoffrey M. Poore <gpoore at gmail.com>
 --------------------------------------------------------------------------
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either version 1.3c

Modified: branches/branch2024.final/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty	2025-03-04 21:14:31 UTC (rev 74445)
+++ branches/branch2024.final/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty	2025-03-04 21:15:11 UTC (rev 74446)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2023-2024 by Geoffrey M. Poore <gpoore at gmail.com>
+%% Copyright (C) 2023-2025 by Geoffrey M. Poore <gpoore at gmail.com>
 %% --------------------------------------------------------------------------
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
@@ -20,7 +20,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{latex2pydata}
-    [2024/11/17 v0.4.0 latex2pydata - write data to file in Python literal format]
+    [2025/03/03 v0.5.0 latex2pydata - write data to file in Python literal format]
 \def\pydata at error#1{%
   \PackageError{latex2pydata}{#1}{}%
   \batchmode\read -1 to \pydata at exitnow}
@@ -255,7 +255,7 @@
 \endgroup
 \def\pydata at schema{}
 \let\pydata at schemamissing@error\relax
-\let\pydata at schemamissing@rawstr\relax
+\let\pydata at schemamissing@verbatim\relax
 \let\pydata at schemamissing@evalany\relax
 \def\pydatasetschemamissing#1{%
   \ifcsname pydata at schemamissing@\detokenize{#1}\endcsname
@@ -443,7 +443,7 @@
 \endgroup
 \begingroup
 \catcode`\,=12\relax
-\gdef\pydatawritemlvaluestart{%
+\gdef\pydatawritemlvalueopen{%
   \ifbool{pydata at haskey}{}{\pydata at error{Cannot write value when waiting for a key}}%
   \immediate\write\pydata at filehandle{%
     \pydata at mlstropen
@@ -453,13 +453,13 @@
   \immediate\write\pydata at filehandle{%
     \pydata at escstrtext{#1}%
   }}
-\gdef\pydatawritemlvalueend{%
+\gdef\pydatawritemlvalueclose{%
   \ifbool{pydata at haskey}{}{\pydata at error{Cannot write value when waiting for a key}}%
   \immediate\write\pydata at filehandle{%
     \pydata at mlstrclose,%
   }%
   \boolfalse{pydata at haskey}}
-\gdef\pydatabuffermlvaluestart{%
+\gdef\pydatabuffermlvalueopen{%
   \ifbool{pydata at bufferhaskey}%
    {}{\pydata at error{Cannot buffer value when waiting for a key}}%
   \expandafter\xdef\pydata at bufferlengthmacro{%
@@ -475,7 +475,7 @@
   \expandafter\xdef\csname\pydata at bufferlinename\pydata at bufferlengthmacro\endcsname{%
       \pydata at escstrtext{#1}%
     }}
-\gdef\pydatabuffermlvalueend{%
+\gdef\pydatabuffermlvalueclose{%
   \ifbool{pydata at bufferhaskey}%
    {}{\pydata at error{Cannot buffer value when waiting for a key}}%
   \expandafter\xdef\pydata at bufferlengthmacro{%
@@ -485,18 +485,22 @@
     }%
   \boolfalse{pydata at bufferhaskey}}
 \endgroup
+\let\pydatawritemlvaluestart\pydatawritemlvalueopen
+\let\pydatawritemlvalueend\pydatawritemlvalueclose
+\let\pydatabuffermlvaluestart\pydatabuffermlvalueopen
+\let\pydatabuffermlvalueend\pydatabuffermlvalueclose
 \newenvironment{pydatawritemlvalue}%
  {\VerbatimEnvironment
-  \pydatawritemlvaluestart
+  \pydatawritemlvalueopen
   \begin{VerbatimWrite}[writer=\pydatawritemlvalueline]}%
  {\end{VerbatimWrite}}
-\AfterEndEnvironment{pydatawritemlvalue}{\pydatawritemlvalueend}
+\AfterEndEnvironment{pydatawritemlvalue}{\pydatawritemlvalueclose}
 \newenvironment{pydatabuffermlvalue}%
  {\VerbatimEnvironment
-  \pydatabuffermlvaluestart
+  \pydatabuffermlvalueopen
   \begin{VerbatimBuffer}[bufferer=\pydatabuffermlvalueline]}%
  {\end{VerbatimBuffer}%
-  \pydatabuffermlvalueend}
+  \pydatabuffermlvalueclose}
 %% \Finale
 \endinput
 %%



More information about the tex-live-commits mailing list.