Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK)) by mollari.NetBSD.org (Postfix) with ESMTPS id 5D714A65B8 for ; Tue, 25 Aug 2015 05:05:42 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id AD88314A144; Tue, 25 Aug 2015 05:05:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id F3ABE14A132 for ; Tue, 25 Aug 2015 05:05:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at NetBSD.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.NetBSD.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id wssXztugbkX3 for ; Tue, 25 Aug 2015 05:05:40 +0000 (UTC) Received: from cvs.netbsd.org (cvs.NetBSD.org [IPv6:2001:4f8:3:7:2e0:81ff:fe30:95bd]) by mail.netbsd.org (Postfix) with ESMTP id 4627114A12B for ; Tue, 25 Aug 2015 05:05:40 +0000 (UTC) Received: by cvs.netbsd.org (Postfix, from userid 500) id 0384A98; Tue, 25 Aug 2015 05:05:40 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Tue, 25 Aug 2015 05:05:39 +0000 From: "Richard PALO" Subject: CVS commit: pkgsrc/math To: pkgsrc-changes@NetBSD.org Reply-To: richard@netbsd.org X-Mailer: log_accum Message-Id: <20150825050540.0384A98@cvs.netbsd.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk Module Name: pkgsrc Committed By: richard Date: Tue Aug 25 05:05:39 UTC 2015 Modified Files: pkgsrc/math: Makefile Added Files: pkgsrc/math/py-simpleeval: DESCR Makefile PLIST distinfo Log Message: Add py-simpleeval A quick single-file MIT-Licenced 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 very simple, just a single file you can dump into a project, or import from pypi (pip or easy_install). 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 very easy to add whatever extra specific functionality you need (your own functions, variable/name lookup, etc). To generate a diff of this commit: cvs rdiff -u -r1.305 -r1.306 pkgsrc/math/Makefile cvs rdiff -u -r0 -r1.1 pkgsrc/math/py-simpleeval/DESCR \ pkgsrc/math/py-simpleeval/Makefile pkgsrc/math/py-simpleeval/PLIST \ pkgsrc/math/py-simpleeval/distinfo Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.