matlab-versions 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ dist/
4
+ .venv/
5
+ .pytest_cache/
6
+ uv.lock
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Josef Dvořáček
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,178 @@
1
+ Metadata-Version: 2.5
2
+ Name: matlab-versions
3
+ Version: 0.1.0
4
+ Summary: Translate between MATLAB release names, MATLAB versions, MATLAB Runtime versions and FlexLM licence versions
5
+ Project-URL: Homepage, https://github.com/jose-d/matlab-versions
6
+ Project-URL: Issues, https://github.com/jose-d/matlab-versions/issues
7
+ Author: Josef Dvořáček
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: flexlm,flexnet,license,lmstat,mathworks,matlab,matlab-runtime,mcr,version
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: System :: Monitoring
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+
20
+ # matlab-versions
21
+
22
+ Translate between the identifiers of a MATLAB release. Every release has
23
+ several, and they are easy to mix up:
24
+
25
+ | Release | MATLAB version | Runtime version | Runtime folder | FlexLM licence (lmstat) |
26
+ |---|---|---|---|---|
27
+ | R2015b | 8.6 | **9.0** | v90 | v34 |
28
+ | R2016a | **9.0** | 9.0.1 | v901 | v35 |
29
+ | R2021a | 9.10 | 9.10 | v910 | v45 |
30
+ | R2023a | 9.14 | 9.14 | R2023a | v49 |
31
+ | R2024a | 24.1 | 24.1 | R2024a | v51 |
32
+
33
+ - **MATLAB version:** what `version()` and `VersionInfo.xml` report. It used
34
+ the 7.x, 8.x and 9.x scheme up to R2023a, then switched to year.half (23.2,
35
+ 24.1, …).
36
+ - **MATLAB Runtime version:** what a compiled application needs. It is usually
37
+ the same as the MATLAB version, but not always (R2012a = 7.17, R2015b = 9.0,
38
+ R2016a = 9.0.1). The Runtime installs under a folder named `v910` up to
39
+ R2022a and under the release name (`R2022b`) from R2022b.
40
+ - **Licence version:** what a client checks out from a FlexLM licence server.
41
+ `lmutil lmstat -a` prints it on every checkout line, so a licence server
42
+ admin can see which release each client runs:
43
+
44
+ ```
45
+ bob host2 /dev/tty (v51) (lic.example.org/27000 3423), start Tue 11/10 10:15
46
+ ^^^^^ R2024a
47
+ ```
48
+
49
+ The table covers R2006a to R2026b, with evidence and sources for each value.
50
+ It has no dependencies and needs Python 3.9 or newer.
51
+
52
+ ## Install
53
+
54
+ ```bash
55
+ pip install matlab-versions
56
+ ```
57
+
58
+ ## Python
59
+
60
+ ```python
61
+ >>> import matlab_versions as mv
62
+ >>> mv.release("R2024a") # also "2024a"
63
+ Release(name='R2024a', matlab='24.1', runtime='24.1', license=51, evidence={...}, sources={...})
64
+ >>> mv.from_matlab("9.10.0.1739362 (R2021a)") # full version() strings work
65
+ Release(name='R2021a', matlab='9.10', runtime='9.10', license=45, ...)
66
+ >>> mv.from_runtime("v901").name # version or install folder
67
+ 'R2016a'
68
+ >>> mv.from_license("v51").name # also 51, "v51.0"
69
+ 'R2024a'
70
+ >>> mv.release("R2016a").runtime_folder
71
+ 'v901'
72
+ >>> mv.release("R2030a") # newer than the table: computed from the rules
73
+ Release(name='R2030a', matlab='30.1', runtime='30.1', license=63, evidence={'matlab': 'extrapolated', ...})
74
+ ```
75
+
76
+ Some numbers mean different releases depending on what they are: `9.0` is
77
+ the MATLAB version of R2016a but the Runtime version of R2015b. So each
78
+ `from_*` function reads its input one way only. `lookup()` returns every
79
+ possible reading:
80
+
81
+ ```python
82
+ >>> [(kind, r.name) for kind, r in mv.lookup("9.0")]
83
+ [('matlab', 'R2016a'), ('runtime', 'R2015b')]
84
+ ```
85
+
86
+ ### lmstat output
87
+
88
+ ```python
89
+ >>> for c in mv.parse_lmstat(text): # full `lmutil lmstat -a` output
90
+ ... print(c.feature, c.user, c.host, c.release)
91
+ MATLAB bob host2 R2024a
92
+ ```
93
+
94
+ `parse_checkout(line)` parses a single checkout line and returns a `Checkout`
95
+ with `user`, `host`, `display`, `version`, `server`, `port`, `handle`, `start`,
96
+ `pid` and `release`. It returns `None` for any other line.
97
+
98
+ ## Command line
99
+
100
+ ```
101
+ $ matlab-versions 9.14 9.0 v51
102
+ 9.14 (MATLAB version, Runtime) R2023a matlab 9.14 runtime 9.14 (R2023a) license v49
103
+ 9.0 (MATLAB version) R2016a matlab 9.0 runtime 9.0.1 (v901) license v35
104
+ 9.0 (Runtime) R2015b matlab 8.6 runtime 9.0 (v90) license v34
105
+ v51 (licence version) R2024a matlab 24.1 runtime 24.1 (R2024a) license v51
106
+
107
+ $ lmutil lmstat -a -c 27000@licserver | matlab-versions # one line per checkout
108
+ MATLAB bob host2 v51 R2024a
109
+
110
+ $ lmutil lmstat -a -c 27000@licserver | matlab-versions --summary # count per feature and release
111
+ MATLAB R2024a 1
112
+
113
+ $ matlab-versions --table # every release (* = extrapolated)
114
+ $ matlab-versions --json # the full table with rules, sources and caveats
115
+ ```
116
+
117
+ ## Evidence
118
+
119
+ Each value in the table has its own evidence level:
120
+
121
+ - **observed:** seen side by side with its release in a primary artefact. That
122
+ means an installation's `VersionInfo.xml`, a licence file with a `# Rxxxx`
123
+ header above its `INCREMENT` lines, an lmstat checkout from a client of a
124
+ known release, or a MathWorks documentation example.
125
+ - **documented:** listed in a published table (MathWorks or an independent
126
+ compilation), but not checked against an artefact.
127
+ - **extrapolated:** follows from the rule, but no source was found.
128
+
129
+ Sources:
130
+
131
+ - MATLAB versions: [Wikipedia's release table](https://en.wikipedia.org/wiki/MATLAB#Release_history),
132
+ checked against four installations.
133
+ - Runtime versions: [MathWorks' MATLAB Runtime page](https://www.mathworks.com/products/compiler/matlab-runtime.html).
134
+ - Runtime folder names: [MathWorks Answers 438125](https://www.mathworks.com/matlabcentral/answers/438125-how-can-i-determine-if-matlab-or-matlab-runtime-are-installed).
135
+ - Licence versions: MathWorks publishes no official table. They come from
136
+ public licence files, the
137
+ [MathWorks licence file example](https://www.mathworks.com/help/install/ug/network-license-files.html),
138
+ [MATLAB Answers 277493](https://www.mathworks.com/matlabcentral/answers/277493-what-does-version-v35-with-lmutil-mean)
139
+ and own observations.
140
+
141
+ `matlab-versions --json` lists the sources for every value.
142
+
143
+ ## Rules for new releases
144
+
145
+ MathWorks ships two releases a year. Releases newer than the table resolve
146
+ automatically and are marked `extrapolated`:
147
+
148
+ - MATLAB and Runtime version: two-digit year, then `.1` for "a" and `.2` for
149
+ "b" (R2027a = 27.1).
150
+ - Licence version: from R2007a, exactly +1 per release:
151
+ `2 * (year - 2008) + 19 + (1 if b else 0)`.
152
+
153
+ To confirm a value, open an issue or pull request with the evidence: a
154
+ `VersionInfo.xml` line, an lmstat checkout line or a licence file header.
155
+ Leave out keys, since only the version field is needed.
156
+
157
+ ## Caveats
158
+
159
+ - The version on a licence file's `INCREMENT` lines, and on lmstat's
160
+ `"MATLAB" vNN` feature header, is the **newest release the licence allows**,
161
+ not what clients run. Only the `(vNN)` on a checkout line identifies the
162
+ client.
163
+ - Toolboxes share MATLAB's licence version within a release. The exception is
164
+ discontinued or frozen products, which keep the number of their last
165
+ release. For example, Stateflow_Coder stays at 24. Use MATLAB checkouts when
166
+ you count clients by release.
167
+ - Toolbox product versions (e.g. Statistics and Machine Learning Toolbox 24.1)
168
+ are not covered.
169
+
170
+ ## Disclaimer
171
+
172
+ Not affiliated with or endorsed by The MathWorks, Inc. MATLAB and Simulink are
173
+ registered trademarks of The MathWorks, Inc. FlexLM and FlexNet are trademarks
174
+ of Flexera.
175
+
176
+ ## License
177
+
178
+ MIT
@@ -0,0 +1,159 @@
1
+ # matlab-versions
2
+
3
+ Translate between the identifiers of a MATLAB release. Every release has
4
+ several, and they are easy to mix up:
5
+
6
+ | Release | MATLAB version | Runtime version | Runtime folder | FlexLM licence (lmstat) |
7
+ |---|---|---|---|---|
8
+ | R2015b | 8.6 | **9.0** | v90 | v34 |
9
+ | R2016a | **9.0** | 9.0.1 | v901 | v35 |
10
+ | R2021a | 9.10 | 9.10 | v910 | v45 |
11
+ | R2023a | 9.14 | 9.14 | R2023a | v49 |
12
+ | R2024a | 24.1 | 24.1 | R2024a | v51 |
13
+
14
+ - **MATLAB version:** what `version()` and `VersionInfo.xml` report. It used
15
+ the 7.x, 8.x and 9.x scheme up to R2023a, then switched to year.half (23.2,
16
+ 24.1, …).
17
+ - **MATLAB Runtime version:** what a compiled application needs. It is usually
18
+ the same as the MATLAB version, but not always (R2012a = 7.17, R2015b = 9.0,
19
+ R2016a = 9.0.1). The Runtime installs under a folder named `v910` up to
20
+ R2022a and under the release name (`R2022b`) from R2022b.
21
+ - **Licence version:** what a client checks out from a FlexLM licence server.
22
+ `lmutil lmstat -a` prints it on every checkout line, so a licence server
23
+ admin can see which release each client runs:
24
+
25
+ ```
26
+ bob host2 /dev/tty (v51) (lic.example.org/27000 3423), start Tue 11/10 10:15
27
+ ^^^^^ R2024a
28
+ ```
29
+
30
+ The table covers R2006a to R2026b, with evidence and sources for each value.
31
+ It has no dependencies and needs Python 3.9 or newer.
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pip install matlab-versions
37
+ ```
38
+
39
+ ## Python
40
+
41
+ ```python
42
+ >>> import matlab_versions as mv
43
+ >>> mv.release("R2024a") # also "2024a"
44
+ Release(name='R2024a', matlab='24.1', runtime='24.1', license=51, evidence={...}, sources={...})
45
+ >>> mv.from_matlab("9.10.0.1739362 (R2021a)") # full version() strings work
46
+ Release(name='R2021a', matlab='9.10', runtime='9.10', license=45, ...)
47
+ >>> mv.from_runtime("v901").name # version or install folder
48
+ 'R2016a'
49
+ >>> mv.from_license("v51").name # also 51, "v51.0"
50
+ 'R2024a'
51
+ >>> mv.release("R2016a").runtime_folder
52
+ 'v901'
53
+ >>> mv.release("R2030a") # newer than the table: computed from the rules
54
+ Release(name='R2030a', matlab='30.1', runtime='30.1', license=63, evidence={'matlab': 'extrapolated', ...})
55
+ ```
56
+
57
+ Some numbers mean different releases depending on what they are: `9.0` is
58
+ the MATLAB version of R2016a but the Runtime version of R2015b. So each
59
+ `from_*` function reads its input one way only. `lookup()` returns every
60
+ possible reading:
61
+
62
+ ```python
63
+ >>> [(kind, r.name) for kind, r in mv.lookup("9.0")]
64
+ [('matlab', 'R2016a'), ('runtime', 'R2015b')]
65
+ ```
66
+
67
+ ### lmstat output
68
+
69
+ ```python
70
+ >>> for c in mv.parse_lmstat(text): # full `lmutil lmstat -a` output
71
+ ... print(c.feature, c.user, c.host, c.release)
72
+ MATLAB bob host2 R2024a
73
+ ```
74
+
75
+ `parse_checkout(line)` parses a single checkout line and returns a `Checkout`
76
+ with `user`, `host`, `display`, `version`, `server`, `port`, `handle`, `start`,
77
+ `pid` and `release`. It returns `None` for any other line.
78
+
79
+ ## Command line
80
+
81
+ ```
82
+ $ matlab-versions 9.14 9.0 v51
83
+ 9.14 (MATLAB version, Runtime) R2023a matlab 9.14 runtime 9.14 (R2023a) license v49
84
+ 9.0 (MATLAB version) R2016a matlab 9.0 runtime 9.0.1 (v901) license v35
85
+ 9.0 (Runtime) R2015b matlab 8.6 runtime 9.0 (v90) license v34
86
+ v51 (licence version) R2024a matlab 24.1 runtime 24.1 (R2024a) license v51
87
+
88
+ $ lmutil lmstat -a -c 27000@licserver | matlab-versions # one line per checkout
89
+ MATLAB bob host2 v51 R2024a
90
+
91
+ $ lmutil lmstat -a -c 27000@licserver | matlab-versions --summary # count per feature and release
92
+ MATLAB R2024a 1
93
+
94
+ $ matlab-versions --table # every release (* = extrapolated)
95
+ $ matlab-versions --json # the full table with rules, sources and caveats
96
+ ```
97
+
98
+ ## Evidence
99
+
100
+ Each value in the table has its own evidence level:
101
+
102
+ - **observed:** seen side by side with its release in a primary artefact. That
103
+ means an installation's `VersionInfo.xml`, a licence file with a `# Rxxxx`
104
+ header above its `INCREMENT` lines, an lmstat checkout from a client of a
105
+ known release, or a MathWorks documentation example.
106
+ - **documented:** listed in a published table (MathWorks or an independent
107
+ compilation), but not checked against an artefact.
108
+ - **extrapolated:** follows from the rule, but no source was found.
109
+
110
+ Sources:
111
+
112
+ - MATLAB versions: [Wikipedia's release table](https://en.wikipedia.org/wiki/MATLAB#Release_history),
113
+ checked against four installations.
114
+ - Runtime versions: [MathWorks' MATLAB Runtime page](https://www.mathworks.com/products/compiler/matlab-runtime.html).
115
+ - Runtime folder names: [MathWorks Answers 438125](https://www.mathworks.com/matlabcentral/answers/438125-how-can-i-determine-if-matlab-or-matlab-runtime-are-installed).
116
+ - Licence versions: MathWorks publishes no official table. They come from
117
+ public licence files, the
118
+ [MathWorks licence file example](https://www.mathworks.com/help/install/ug/network-license-files.html),
119
+ [MATLAB Answers 277493](https://www.mathworks.com/matlabcentral/answers/277493-what-does-version-v35-with-lmutil-mean)
120
+ and own observations.
121
+
122
+ `matlab-versions --json` lists the sources for every value.
123
+
124
+ ## Rules for new releases
125
+
126
+ MathWorks ships two releases a year. Releases newer than the table resolve
127
+ automatically and are marked `extrapolated`:
128
+
129
+ - MATLAB and Runtime version: two-digit year, then `.1` for "a" and `.2` for
130
+ "b" (R2027a = 27.1).
131
+ - Licence version: from R2007a, exactly +1 per release:
132
+ `2 * (year - 2008) + 19 + (1 if b else 0)`.
133
+
134
+ To confirm a value, open an issue or pull request with the evidence: a
135
+ `VersionInfo.xml` line, an lmstat checkout line or a licence file header.
136
+ Leave out keys, since only the version field is needed.
137
+
138
+ ## Caveats
139
+
140
+ - The version on a licence file's `INCREMENT` lines, and on lmstat's
141
+ `"MATLAB" vNN` feature header, is the **newest release the licence allows**,
142
+ not what clients run. Only the `(vNN)` on a checkout line identifies the
143
+ client.
144
+ - Toolboxes share MATLAB's licence version within a release. The exception is
145
+ discontinued or frozen products, which keep the number of their last
146
+ release. For example, Stateflow_Coder stays at 24. Use MATLAB checkouts when
147
+ you count clients by release.
148
+ - Toolbox product versions (e.g. Statistics and Machine Learning Toolbox 24.1)
149
+ are not covered.
150
+
151
+ ## Disclaimer
152
+
153
+ Not affiliated with or endorsed by The MathWorks, Inc. MATLAB and Simulink are
154
+ registered trademarks of The MathWorks, Inc. FlexLM and FlexNet are trademarks
155
+ of Flexera.
156
+
157
+ ## License
158
+
159
+ MIT
@@ -0,0 +1,36 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "matlab-versions"
7
+ version = "0.1.0"
8
+ description = "Translate between MATLAB release names, MATLAB versions, MATLAB Runtime versions and FlexLM licence versions"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ authors = [{ name = "Josef Dvořáček" }]
13
+ requires-python = ">=3.9"
14
+ dependencies = []
15
+ keywords = ["matlab-runtime", "mcr", "version", "matlab", "flexlm", "flexnet", "lmstat", "license", "mathworks"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: System Administrators",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: System :: Monitoring",
22
+ "Typing :: Typed",
23
+ ]
24
+
25
+ [project.urls]
26
+ Homepage = "https://github.com/jose-d/matlab-versions"
27
+ Issues = "https://github.com/jose-d/matlab-versions/issues"
28
+
29
+ [project.scripts]
30
+ matlab-versions = "matlab_versions.__main__:main"
31
+
32
+ [tool.hatch.build.targets.sdist]
33
+ include = ["src", "tests", "README.md", "LICENSE"]
34
+
35
+ [tool.pytest.ini_options]
36
+ testpaths = ["tests"]