# Tumfl: The Ultimate Minimizer For Lua
[](https://codecov.io/github/stormworks-utils/tumfl)
[](https://github.com/psf/black)
This package contains the best minimizer you'll find on the market, or so I hope.
# Executable
Compile a source file into a destination file, resolving all requires. Optionally recompiles every time the source files
change (using `-f`). Optionally replaces placeholders (using `-c`).
## Placeholders
Using a lua config file like
```lua
parameter = "value"
numbered_parameter = 3.14
table_parameter = {foo = 1, "bar"}
```
it can replace placeholders like
```lua
foo("$$parameter")
bar = "$$numbered_parameter"
baz = "$$table_parameter"
```
by compiling using `tumfl source.lua -c config.lua` with
```lua
foo("value")
bar = 3.14
baz = {foo = 1, "bar"}
```
The prefix is configurable via `--config-prefix`
```
usage: tumfl [-h] [-d DESTINATION] [-v] [-f] [-c CONFIG_FILE] [--config-prefix CONFIG_PREFIX] source_file
Compile lua files
positional arguments:
source_file Source file to compile
options:
-h, --help show this help message and exit
-d DESTINATION, --destination DESTINATION
Destination file
-v, --verbose Be verbose
-f, --follow Follow file changes
-c CONFIG_FILE, --config-file CONFIG_FILE
Replace placeholders using config file. Config file is a normal lua file, with top level assignments of
`name = value`, not limited to strings. To use an replacement, just use a string int the target file like
`"$$name"` (if `$$` is your prefix, and `name` the name to look up).
--config-prefix CONFIG_PREFIX
Prefix for names to be replaced by config values (default: $$)
-m, --minify Minify the output
```
# Current status
## Parser
- On par with Lua
- No support for arbitrary byte strings (only valid UTF-8)
## Formatter
- Highly configurable formatter
- Can produce both minified and prettyfied results
- Minified results have minimal amount of characters (only required semicolons, etc.)
- Lossy in the sense that it does not preserve (all) comments
## Minifier
> [!CAUTION]
> The minifier is very experimental, and may change the semantics of your program. Use at your own risk.
> If it breaks, please open an issue.
- Minifies Names (normal variables)
- Creates aliases (i.e. when `table` is used often, creates `a=table` and uses `a` instead of `table`)
Raw data
{
"_id": null,
"home_page": null,
"name": "tumfl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "lua, minimizer, ast",
"author": "Fabian Wunsch",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/f9/4a/2ef989e173d96f535793d8646d37b2dc803d3de67596ddd2eb53865a0bdb/tumfl-0.3.14.tar.gz",
"platform": null,
"description": "# Tumfl: The Ultimate Minimizer For Lua\n\n[](https://codecov.io/github/stormworks-utils/tumfl)\n[](https://github.com/psf/black)\n\nThis package contains the best minimizer you'll find on the market, or so I hope.\n\n# Executable\n\nCompile a source file into a destination file, resolving all requires. Optionally recompiles every time the source files\nchange (using `-f`). Optionally replaces placeholders (using `-c`).\n\n## Placeholders\n\nUsing a lua config file like\n```lua\nparameter = \"value\"\nnumbered_parameter = 3.14\ntable_parameter = {foo = 1, \"bar\"}\n```\nit can replace placeholders like\n```lua\nfoo(\"$$parameter\")\nbar = \"$$numbered_parameter\"\nbaz = \"$$table_parameter\"\n```\nby compiling using `tumfl source.lua -c config.lua` with\n```lua\nfoo(\"value\")\nbar = 3.14\nbaz = {foo = 1, \"bar\"}\n```\n\nThe prefix is configurable via `--config-prefix`\n\n\n```\nusage: tumfl [-h] [-d DESTINATION] [-v] [-f] [-c CONFIG_FILE] [--config-prefix CONFIG_PREFIX] source_file\n\nCompile lua files\n\npositional arguments:\n source_file Source file to compile\n\noptions:\n -h, --help show this help message and exit\n -d DESTINATION, --destination DESTINATION\n Destination file\n -v, --verbose Be verbose\n -f, --follow Follow file changes\n -c CONFIG_FILE, --config-file CONFIG_FILE\n Replace placeholders using config file. Config file is a normal lua file, with top level assignments of\n `name = value`, not limited to strings. To use an replacement, just use a string int the target file like\n `\"$$name\"` (if `$$` is your prefix, and `name` the name to look up).\n --config-prefix CONFIG_PREFIX\n Prefix for names to be replaced by config values (default: $$)\n -m, --minify Minify the output\n```\n\n# Current status\n\n## Parser\n\n - On par with Lua\n - No support for arbitrary byte strings (only valid UTF-8)\n\n## Formatter\n\n - Highly configurable formatter\n - Can produce both minified and prettyfied results\n - Minified results have minimal amount of characters (only required semicolons, etc.)\n - Lossy in the sense that it does not preserve (all) comments\n\n## Minifier\n\n> [!CAUTION]\n> The minifier is very experimental, and may change the semantics of your program. Use at your own risk.\n> If it breaks, please open an issue.\n\n - Minifies Names (normal variables)\n - Creates aliases (i.e. when `table` is used often, creates `a=table` and uses `a` instead of `table`)\n",
"bugtrack_url": null,
"license": null,
"summary": "The Ultimate Minimizer For Lua: minimize your lua scripts",
"version": "0.3.14",
"project_urls": {
"homepage": "https://github.com/stormworks-utils/tumfl",
"repository": "https://github.com/stormworks-utils/tumfl"
},
"split_keywords": [
"lua",
" minimizer",
" ast"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "975b819cce35f5ce6fbb67dcdc843b1ff31f94bdab916b6d911fd0271a82f412",
"md5": "bdd8d348f8d210b3fb0c06f51ead5239",
"sha256": "df742280cbfccc9734cdcf6bcca0970398c93c06588535e1d60f4c35f3c6fbbe"
},
"downloads": -1,
"filename": "tumfl-0.3.14-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bdd8d348f8d210b3fb0c06f51ead5239",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 66932,
"upload_time": "2025-09-10T15:43:31",
"upload_time_iso_8601": "2025-09-10T15:43:31.618191Z",
"url": "https://files.pythonhosted.org/packages/97/5b/819cce35f5ce6fbb67dcdc843b1ff31f94bdab916b6d911fd0271a82f412/tumfl-0.3.14-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f94a2ef989e173d96f535793d8646d37b2dc803d3de67596ddd2eb53865a0bdb",
"md5": "35fceb7e260e798d37d8616bfe390691",
"sha256": "7a2fe39792b91e2771c1a87a45cd347fd9a19146c45e5e2160400f3a2efe021f"
},
"downloads": -1,
"filename": "tumfl-0.3.14.tar.gz",
"has_sig": false,
"md5_digest": "35fceb7e260e798d37d8616bfe390691",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 58784,
"upload_time": "2025-09-10T15:43:32",
"upload_time_iso_8601": "2025-09-10T15:43:32.827278Z",
"url": "https://files.pythonhosted.org/packages/f9/4a/2ef989e173d96f535793d8646d37b2dc803d3de67596ddd2eb53865a0bdb/tumfl-0.3.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-10 15:43:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "stormworks-utils",
"github_project": "tumfl",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "watchdog",
"specs": [
[
"==",
"6.0.0"
]
]
}
],
"lcname": "tumfl"
}