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”.

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…

Example

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)
True

Ressources

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

xal-0.1.zip (17.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page