Logics is a user-friendly formula language with a subset of Python''s expression syntax
Project description
About
Logics is a simple expression language with the goal to provide equal syntax and semantics for different runtime contexts and host languages.
- logics-js is a pure JavaScript implementation of Logics provided as npm-package.
- logics-py is a pure Python implementation of Logics provided as PyPI-package.
Both packages are under recent development and not stable right now. They are maintained in separate version numbers.
Features
- Secure, native, running in a sandboxed environment apart from the host language
- Disallows variable assignment, except in comprehensions
- logics-js: Implementation in JavaScript
- logics-py: Implementation in Python
- Python-inspired syntax and semantics
- Make use of all standard operators
- Unary
+
,-
,~
,not
- Binary
+
,*
,-
,/
,//
,**
- Comparison
==
,!=
,<>
,<
,<=
,>
,>=
,in
,not in
- Logical
and
,or
- Conditions
y if x else z
- Comprehensions
[x for x in y if z]
- Unary
- Slices
x[:]
- Attribute access
x[y]
# comments
in separate lines- Dedicated Value object abstraction of native types for
True
,False
,None
int
,float
,str
list
for arraysdict
for structured objects
- Make use of all standard operators
- Provides a set of functions that can be used in expressions
- Extendable to custom functions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
logics_py-0.0.9-py3-none-any.whl
(14.5 kB
view hashes)
Close
Hashes for logics_py-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46909b25dda6c06d7faa4be1fa9fc72bbf93d920c818fac3eb9db77086f760b5 |
|
MD5 | b01ad312ee62e6fb57c0f0e8bd2ee186 |
|
BLAKE2b-256 | d5727f6d82695d7bd910373c5808ba908439b84b178b529cf4e05dcee10d64f8 |