BSD Ports

devel/py-simpleeval 1.0.8 FreeBSD

Simple, safe single expression evaluator library

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
Last update
Commit
916caa0395
License
MIT
Categories
devel, python
Package size
31.5 KiB, 139.8 KiB installed

Description

A single file library for easily adding evaluatable expressions into python projects. Say you want to allow a user to set an alarm volume, which could depend on the time of day, alarm level, how many previous alarms had gone off, and if there is music playing at the time.

Or if you want to allow simple formulae in a web application, but don't want to give full eval() access, or don't want to run in javascript on the client side.

It's deliberately trying to stay simple to use and not have millions of features, pull it in from PyPI (pip or easy_install), or even just a single file you can dump into a project.

Internally, it's using the amazing python ast module to parse the expression, which allows very fine control of what is and isn't allowed. It should be completely safe in terms of what operations can be performed by the expression.

The only issue I know to be aware of is that you can create an expression which takes a long time to evaluate, or which evaluating requires an awful lot of memory, which leaves the potential for DOS attacks. There is basic protection against this, and you can lock it down further if you desire.

You should be aware of this when deploying in a public setting.

The defaults are pretty locked down and basic, and it's easy to add whatever extra specific functionality you need (your own functions, variable/name lookup, etc).

In the other systems

SystemPortVersion
FreeBSDdevel/py-simpleeval1.0.8
OpenBSDdevel/py-simpleeval1.0.7p0
DragonFlydevel/py-simpleeval0.9.13

Install

Binary package:

pkg install py312-simpleeval

From the ports tree:

cd /usr/ports/devel/py-simpleeval/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	py312-simpleeval>0:devel/py-simpleeval

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest1.0.81.0.80.9.120.9.131.0.8
FreeBSD:14:quarterly1.0.81.0.8n/a0.9.131.0.8
FreeBSD:15:latest1.0.81.0.8n/a0.9.130.9.13
FreeBSD:15:quarterly1.0.81.0.8n/an/an/a
FreeBSD:16:latest1.0.81.0.8n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Build 1

The full lists below include those, and their dependencies in turn.

Build dependencies 19
Run dependencies 7

Configuration

No options to configure.

USES
cpe python
Service scripts
none

Files

distinfo 1
FileSizeSHA256
simpleeval-1.0.8.tar.gz31846b417f869c11f2de034eb919820a825f35d12ce99f63a43971947ce73679eb9ba
Master sites 1
  • PYPI

Commit history 1

DateCommitCreditsLog message
916caa0395 Po-Chuan Hsieh devel/py-simpleeval: Update to 1.0.8
Changes: https://github.com/danthedeckie/simpleeval/releases