
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
DRY config and template system, easily extensible with Python.
This README is auto-generated, see project wiki for details.
Print given config (with optional path in config) as shell snippet.
Interactive REPL.
Process the given template to stdout using config from stdin.
class ConfigCtrl(Forkable)
High level scope API.
@property
def r()
Get config object for reading, i.e. missing scopes will error.
@property
def w()
Get config object for writing, i.e. missing scopes will be created.
def loadappconfig(mainfunction,
moduleresource,
encoding='ascii',
settingsoptional=False)
Using app name as prefix load config from the given resource, apply user settings, and return config object for app. Context module for loading resource and the app name are deduced from mainfunction
, or these can be provided as a tuple. Set settingsoptional
to suppress the usual error if ~/.settings.arid does not exist.
def load(pathorstream)
Execute config from the given path or stream.
def execute(text)
Execute given config text.
def __iter__()
Yield keys and values.
def processtemplate(frompathorstream, topathorstream)
Evaluate expression from path/stream and write result to path/stream.
class RConfig(Parabject)
def __iter__()
Yield values only. Iterate over -self
for keys and values.
def colon(prefix, suffix, scope)
Ignore rest of logical line.
@prime
def source(prefix, suffix, scope)
Include path or resource at prefix.
@prime
def sourceifexists(prefix, suffix, scope)
Like .
but allow the resource to be absent.
@prime
def equals(prefix, suffix, scope)
Assign expression to path.
@prime
def colonequals(prefix, suffix, scope)
Evaluate expression and assign result to path.
@prime
def plusequals(prefix, suffix, scope)
Assign expression to prefix plus an opaque key, i.e. add to list.
@prime
def commaequals(prefix, suffix, scope)
Split expression on whitespace and make a list out of the parts.
def screenstr(scope, resolvable)
GNU Screen string literal.
def scstr(scope, resolvable)
SuperCollider string literal.
def hclstr(scope, resolvable)
HashiCorp configuration language string literal.
def groovystr(scope, resolvable)
Groovy string literal.
def pystr(scope, resolvable)
Python literal.
def shstr(scope, resolvable)
Shell string literal.
def jsonquote(scope, resolvable)
JSON literal, also suitable for YAML.
def xmlattr(scope, resolvable)
XML attribute literal (including quotes).
def xmltext(scope, resolvable)
XML content, suggest assigning this to & with xmlattr assigned to " as is convention.
def tomlquote(scope, resolvable)
TOML string literal.
def urlquote(scope, resolvable)
Percent-encode all reserved characters.
def map_(scope, objsresolvable, *args)
If given 1 arg, evaluate it against every scope in objsresolvable
and return that list.
If given 2 args, the first is a variable name to which each scope is temporarily assigned.
If given 3 args, the first two are variable names for scope key and scope respectively.
def join(scope, partsresolvable, sepresolvable=None)
Concatenate the given list, using optional separator. Frequently used with map
.
def str_(scope, resolvable)
Coerce to string.
def list_(scope, *resolvables)
Create a list.
def try_(scope, *resolvables)
Attempt to evaluate each resolvable, returning the first that succeeds.
def hereslash(scope, *resolvables)
Join the given path components with the directory of the current resource.
def readfile(scope, resolvable)
Include the content of the given path.
def processtemplate(scope, resolvable)
Evaluate the content of the given path as an expression.
def pyref(scope, moduleresolvable, qualnameresolvable)
Python object in given module with given qualified name. Module may be relative to current resource, in which case assignment with :=
is normally necessary. Typically used to import functions.
def pyres(scope, packageresolvable, nameresolvable, encoding=Text('ascii'))
Python resource for inclusion with .
directive.
def gpg(scope, resolvable)
Use gpg to decrypt the given base64-encoded blob.
class Resolvable(Struct)
def resolve(scope)
Evaluate this expression against the given scope.
def wrap(value)
Attempt to wrap the given value in a model object of the most specific type.
class Scope(Resolvable)
def resolved(*path)
Follow the given path to get an expression, evaluate it (resolving any paths it requires, recursively), and return the resulting model object.
class Slash(Text, Function)
As text, the platform slash. As function, join args using that slash, starting with the last absolute path (or using all args if all relative).
FAQs
DRY config and template system, easily extensible with Python
We found that aridity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.