{"id":15032659,"url":"https://github.com/lunarmodules/penlight","last_synced_at":"2025-12-11T21:04:26.617Z","repository":{"id":834529,"uuid":"553803","full_name":"lunarmodules/Penlight","owner":"lunarmodules","description":"A set of pure Lua libraries focusing on input data handling (such as reading configuration files), functional programming (such as map, reduce, placeholder expressions,etc), and OS path management.  Much of the functionality is inspired by the Python standard libraries.","archived":false,"fork":false,"pushed_at":"2024-11-07T11:09:11.000Z","size":3167,"stargazers_count":2005,"open_issues_count":37,"forks_count":247,"subscribers_count":65,"default_branch":"master","last_synced_at":"2025-05-11T00:25:11.113Z","etag":null,"topics":["lua","lua-library","lua-modules","luajit","luarocks","penlight"],"latest_commit_sha":null,"homepage":"https://lunarmodules.github.io/Penlight/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lunarmodules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-03-09T07:43:52.000Z","updated_at":"2025-05-10T13:53:06.000Z","dependencies_parsed_at":"2023-07-05T18:17:48.975Z","dependency_job_id":"2659c4e9-6fbe-406b-977d-214104ddb606","html_url":"https://github.com/lunarmodules/Penlight","commit_stats":{"total_commits":783,"total_committers":85,"mean_commits":9.211764705882352,"dds":0.6168582375478927,"last_synced_commit":"e2ea9b7fc6bea62bebc9016ceba986d08be41230"},"previous_names":["stevedonovan/penlight"],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2FPenlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2FPenlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2FPenlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2FPenlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunarmodules","download_url":"https://codeload.github.com/lunarmodules/Penlight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","lua-library","lua-modules","luajit","luarocks","penlight"],"created_at":"2024-09-24T20:19:03.361Z","updated_at":"2025-12-11T21:04:26.610Z","avatar_url":"https://github.com/lunarmodules.png","language":"Lua","readme":"# Penlight Lua Libraries\n\n[![Unix build](https://img.shields.io/github/actions/workflow/status/lunarmodules/penlight/unix_build.yml?branch=master\u0026label=Unix%20build\u0026logo=linux)](https://github.com/lunarmodules/Penlight/actions)\n[![AppVeyor build status](https://img.shields.io/appveyor/build/Tieske/penlight-ta1gi/master?label=Windows%20build\u0026logo=windows)](https://ci.appveyor.com/project/Tieske/penlight-ta1gi/branch/master)\n[![Coveralls code coverage](https://img.shields.io/coveralls/github/lunarmodules/Penlight?logo=coveralls)](https://coveralls.io/github/lunarmodules/Penlight)\n[![Luacheck](https://github.com/lunarmodules/Penlight/workflows/Luacheck/badge.svg)](https://github.com/lunarmodules/Penlight/actions)\n[![SemVer](https://img.shields.io/github/v/tag/lunarmodules/Penlight?color=brightgreen\u0026label=SemVer\u0026logo=semver\u0026sort=semver)](CHANGELOG.md)\n\n## Why a new set of libraries?\n\nPenlight brings together a set of generally useful pure Lua modules,\nfocusing on input data handling (such as reading configuration files),\nfunctional programming (such as map, reduce, placeholder expressions, etc),\nand OS path management.  Much of the functionality is inspired by the\nPython standard libraries.\n\n## Module Overview\n\n### Paths, Files and Directories\n\n  * `path`: queries like `isdir`,`isfile`,`exists`, splitting paths like `dirname` and `basename`\n  * `dir`: listing files in directories (`getfiles`,`getallfiles`) and creating/removing directory paths\n  * `file`: `copy`,`move`; read/write contents with `read` and `write`\n\n### Application Support\n\n  * `app`: `require_here` to rebase `require` to work with main script path; simple argument parsing `parse_args`\n  * `lapp`: sophisticated usage-text-driven argument parsing for applications\n  * `config`: flexibly read Unix config files and Windows INI files\n  * `strict`: check for undefined global variables - can use `strict.module` for modules\n  * `utils`,`compat`: Penlight support for unified Lua 5.1/5.2 codebases\n  * `types`: predicates like `is_callable` and `is_integer`; extended `type` function.\n\n### Extra String Operations\n\n  * `utils`: can split a string with a delimiter using `utils.split`\n  * `stringx`: extended string functions covering the Python `string` type\n  * `stringio`:  open strings for reading, and creating strings using standard Lua IO methods\n  * `lexer`:  lexical scanner for splitting text into tokens; special cases for Lua and C\n  * `text`:  indenting and dedenting text, wrapping paragraphs; optionally make `%` work as in Python\n  * `template`:  small but powerful template expansion engine\n  * `sip`:  Simple Input Patterns - higher-level string patterns for parsing text\n\n### Extra Table Operations\n\n  * `tablex`: copying, comparing and mapping over\n  * `pretty`: pretty-printing Lua tables, and various safe ways to load Lua as data\n  * `List`: implementation of Python 'list' type - slices, concatenation and partitioning\n  * `Map`, `Set`, `OrderedMap`: classes for specialized kinds of tables\n  * `data`: reading tabular data into 2D arrays and efficient queries\n  * `array2d`: operations on 2D arrays\n  * `permute`: generate permutations\n\n### Iterators, OOP and Functional\n\n   * `seq`:  working with iterator pipelines; collecting iterators as tables\n   * `class`: a simple reusable class framework\n   * `func`: symbolic manipulation of expressions and lambda expressions\n   * `utils`: `utils.string_lambda` converts short strings like '|x| x^2' into functions\n   * `comprehension`: list comprehensions: `C'x for x=1,4'()=={1,2,3,4}`\n\n## Versioning\n\nPenlight is strictly versioned according to [Semantic Versioning](https://semver.org/).\n\nIn scope of the version:\n * functionality provided by Penlight modules/classes\n * based on stock Lua PuC-Rio or LuaJIT\n\nNot in scope of the version:\n * Documentation\n * Error messages (textual changes)\n * Deprecation warnings (by default to `stderr`)\n\n### Deprecating functionality\n\nAny version may deprecate functionality. So new deprecation notices may appear\nin major, minor, and patch releases. Final removal of functionality (assuming it\nis a breaking change) will only be done in a major version.\n\nIt is strongly suggested to use the deprecation warning mechanism to test usage\nof deprecated functionalities when upgrading. This is done by enabling the\nwarning system (in Lua 5.4, or the Penlight compatibility function for earlier\nversions):\n\n```lua\nrequire \"pl.compat\"\nwarn \"@on\"\n```\n\nSee `pl.utils.raise_deprecation` for more info.\n\n## License\n\nPenlight is distributed under the [MIT license](LICENSE.md).\n\n## Installation\n\nUsing [LuaRocks](https://luarocks.org/modules/tieske/penlight): simply run `luarocks install penlight`.\n\nManually: copy `lua/pl` directory into your Lua module path. It's typically\n`/usr/local/share/lua/5.x` on a Linux system and `C:\\Program Files\\Lua\\5.x\\lua`\nfor Lua for Windows.\n\n## Dependencies\n\nThe file and directory functions depend on [LuaFileSystem](https://lunarmodules.github.io/luafilesystem/),\nwhich is installed automatically if you are using LuaRocks. Additionally, if you want `dir.copyfile` to work\nelegantly on Windows, then you need [Alien](http://mascarenhas.github.io/alien/). Both libraries are present\nin Lua for Windows.\n\n## Building the Documentation\n\nRequires [ldoc](https://github.com/stevedonovan/LDoc), which is available\nthrough LuaRocks.  Then it's a simple matter of running `ldoc .` from the repo.\n\n## Contributing\n\nContributions are most welcome, please check the [contribution guidelines](CONTRIBUTING.md).\n\n## Running tests\n\nExecute `lua run.lua tests` to run the tests. Execute `lua run.lua examples` to run examples.\n\n## History\n\nFor a complete history of the development of Penlight, please check the [changelog](CHANGELOG.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarmodules%2Fpenlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunarmodules%2Fpenlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarmodules%2Fpenlight/lists"}