Skip to main content

Execution abstraction layer for high-level system scripts.

Project description

Xal is a contextual execution framework for Python. “xal” is the acronym of “eXecution Abstraction Layer”.


This project is experimental. Current goal is to implement a proof-of-concept that can be shown to, discussed with or tried by users of tools like subprocess, Fabric, zc.buildout, Salt…

Xal helps you create scripts to perform actions on a system, like managing non-Python resources, independantly from the execution context.

The main motivation of this library is about sharing system scripts:

  • scripts are written with session as argument, they use an high-level abstract API;
  • sessions are registries, they encapsulate API implementation: local Python shell, Fabric, Salt…


Let’s create a xal-compatible function. It takes the execution context as input argument:

>>> def home_directory_exists(session):
...     """Return True if home directory of session's user exists."""
...     return session.dir.exists(session.dir.home)

Then create an execution session. The LocalSession used here is a pre-configured registry:

>>> from xal.session.local import LocalSession
>>> session = LocalSession()

Finally run the function in the session:

>>> home_directory_exists(session)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (17.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page