All Projects → lunarmodules → Penlight

lunarmodules / Penlight

Licence: mit
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.

Programming Languages

lua
6591 projects

Labels

Projects that are alternatives of or similar to Penlight

Luaradio
A lightweight, embeddable software-defined radio framework built on LuaJIT
Stars: ✭ 509 (-59.76%)
Mutual labels:  luajit
Lqt
Lua Binding for Qt5
Stars: ✭ 30 (-97.63%)
Mutual labels:  luajit
Lgf
Game development framework for Lua
Stars: ✭ 68 (-94.62%)
Mutual labels:  luajit
Lua Nginx Redis
🌺 Redis、Lua、Nginx、OpenResty 笔记和资料
Stars: ✭ 757 (-40.16%)
Mutual labels:  luajit
Nano Nginx
Nano container with nginx preconfigured as reverse proxy
Stars: ✭ 15 (-98.81%)
Mutual labels:  luajit
Vanilla
An OpenResty Lua MVC Web Framework
Stars: ✭ 1,018 (-19.53%)
Mutual labels:  luajit
Turbo
Turbo is a framework built for LuaJIT 2 to simplify the task of building fast and scalable network applications. It uses a event-driven, non-blocking, no thread design to deliver excellent performance and minimal footprint to high-load applications while also providing excellent support for embedded uses.
Stars: ✭ 480 (-62.06%)
Mutual labels:  luajit
Brat
Brat is a little language for people who don't like to be told what to do.
Stars: ✭ 78 (-93.83%)
Mutual labels:  luajit
Kong
🦍 The Cloud-Native API Gateway
Stars: ✭ 30,838 (+2337.79%)
Mutual labels:  luajit
Pelagia
Automatic parallelization (lock-free multithreading thread) tool developed by Surparallel Open Source.Pelagia is embedded key value database that implements a small, fast, high-reliability on ANSI C.
Stars: ✭ 1,132 (-10.51%)
Mutual labels:  luajit
Raptorjit
RaptorJIT: A dynamic language for system programming (LuaJIT fork)
Stars: ✭ 784 (-38.02%)
Mutual labels:  luajit
Luaty
Lua with more or less typing. You type less; we type check.
Stars: ✭ 9 (-99.29%)
Mutual labels:  luajit
Koreader
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
Stars: ✭ 9,467 (+648.38%)
Mutual labels:  luajit
Grid Sdk
The Grid SDK - Game engine for Lua
Stars: ✭ 612 (-51.62%)
Mutual labels:  luajit
Luajit Msgpack Pure
MessagePack for LuaJIT (using FFI, no bindings, V4 API)
Stars: ✭ 71 (-94.39%)
Mutual labels:  luajit
Apisix
The Cloud-Native API Gateway
Stars: ✭ 7,920 (+526.09%)
Mutual labels:  luajit
Lua Resty Post
HTTP post utility for openresty
Stars: ✭ 30 (-97.63%)
Mutual labels:  luajit
Koreader Base
Base framework offering a Lua scriptable environment for creating document readers
Stars: ✭ 81 (-93.6%)
Mutual labels:  luajit
Pure lua sha
SHA1, SHA2 and SHA3 functions written in pure Lua and optimized for speed
Stars: ✭ 78 (-93.83%)
Mutual labels:  luajit
Luamqtt
luamqtt - Pure-lua MQTT v3.1.1 and v5.0 client
Stars: ✭ 58 (-95.42%)
Mutual labels:  luajit

Penlight Lua Libraries

Travis build status AppVeyor build status Coveralls code coverage Luacheck SemVer

Why a new set of libraries?

Penlight brings together a set of generally useful pure Lua modules, 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.

Module Overview

Paths, Files and Directories

  • path: queries like isdir,isfile,exists, splitting paths like dirname and basename
  • dir: listing files in directories (getfiles,getallfiles) and creating/removing directory paths
  • file: copy,move; read/write contents with read and write

Application Support

  • app: require_here to rebase require to work with main script path; simple argument parsing parse_args
  • lapp: sophisticated usage-text-driven argument parsing for applications
  • config: flexibly read Unix config files and Windows INI files
  • strict: check for undefined global variables - can use strict.module for modules
  • utils,compat: Penlight support for unified Lua 5.1/5.2 codebases
  • types: predicates like is_callable and is_integer; extended type function.

Extra String Operations

  • utils: can split a string with a delimiter using utils.split
  • stringx: extended string functions covering the Python string type
  • stringio: open strings for reading, and creating strings using standard Lua IO methods
  • lexer: lexical scanner for splitting text into tokens; special cases for Lua and C
  • text: indenting and dedenting text, wrapping paragraphs; optionally make % work as in Python
  • template: small but powerful template expansion engine
  • sip: Simple Input Patterns - higher-level string patterns for parsing text

Extra Table Operations

  • tablex: copying, comparing and mapping over
  • pretty: pretty-printing Lua tables, and various safe ways to load Lua as data
  • List: implementation of Python 'list' type - slices, concatenation and partitioning
  • Map, Set, OrderedMap: classes for specialized kinds of tables
  • data: reading tabular data into 2D arrays and efficient queries
  • array2d: operations on 2D arrays
  • permute: generate permutations

Iterators, OOP and Functional

  • seq: working with iterator pipelines; collecting iterators as tables
  • class: a simple reusable class framework
  • func: symbolic manipulation of expressions and lambda expressions
  • utils: utils.string_lambda converts short strings like '|x| x^2' into functions
  • comprehension: list comprehensions: C'x for x=1,4'()=={1,2,3,4}

Versioning

Penlight is strictly versioned according to Semantic Versioning.

In scope of the version:

  • functionality provided by Penlight modules/classes
  • based on stock Lua PuC-Rio or LuaJIT

Not in scope of the version:

  • Documentation
  • Error messages (textual changes)
  • Deprecation warnings (by default to stderr)

Deprecating functionality

Any version may deprecate functionality. So new deprecation notices may appear in major, minor, and patch releases. Final removal of functionality (assuming it is a breaking change) will only be done in a major version.

It is strongly suggested to use the deprecation warning mechanism to test usage of deprecated functionalities when upgrading. This is done by enabling the warning system (in Lua 5.4, or the Penlight compatibility function for earlier versions):

require "pl.compat"
warn "@on"

See pl.utils.raise_deprecation for more info.

License

Penlight is distributed under the MIT license.

Installation

Using LuaRocks: simply run luarocks install penlight.

Manually: copy lua/pl directory into your Lua module path. It's typically /usr/local/share/lua/5.x on a Linux system and C:\Program Files\Lua\5.x\lua for Lua for Windows.

Dependencies

The file and directory functions depend on LuaFileSystem, which is installed automatically if you are using LuaRocks. Additionally, if you want dir.copyfile to work elegantly on Windows, then you need Alien. Both libraries are present in Lua for Windows.

Building the Documentation

Requires ldoc, which is available through LuaRocks. Then it's a simple matter of running ldoc . from the repo.

Contributing

Contributions are most welcome, please check the contribution guidelines.

Running tests

Execute lua run.lua tests to run the tests. Execute lua run.lua examples to run examples.

History

For a complete history of the development of Penlight, please check the changelog.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].