Skip to main content

Yggdrasil

Concept

The yggdrasil library is meant to facilitate the distribution of scripts into production through the definition of apps. Conceptually, each app is defined as:

  • Name: Characterises the app to be installed / uninstalled
  • Source code: Source code of the project that must be accessed
  • Entry points: Entry points of the project
  • Virtual environment: environment to run the app within

Through its API, yggdrasil gives your means to seamlessly switch between several virtual environments while having an easy way to call your home-made scripts from the command line.

Getting started

Before using the tool to create apps, yggdrasil needs an initial set up. First, install the package (either from PyPI or from Github):

pip install ud-yggdrasil
pip install git+https://www.github.com/um-ed/ud-yggdrasil.git

Then, create the base folder structure to install yggdrasil into:

yggdrasil seed

If a path is set up as environment variable (YGGDRASIL_ROOT), the folders structure will be created there. If not, it will be created under the user's Documents folder. To make each app easily callable from the command line, it's also recommended to add the Yggdrasil\Scripts full path to the Path environment variable.

That's it, you're ready to create your first application!

Applications requirements

The definition of apps is done through the settings.yaml file (under Yggdrasil\settings). The library gives the possibility to either install apps that are only stored locally (local apps hereafter) or hosted online in a git repository (web apps hereafter). The settings file is automatically created when running seed, already prefilled with dummy examples for local & web setups. If in doubt / altered locally, it can also be found under this repository (yggdrasil\data\template_settings.yaml). To be able to create an application, the core project will also need to define:

  • A requirements.txt file with the project's dependencies, located at the source of the package / project directory
  • For web-based apps, the project will need to define entry points in the setup.py file

Yggdrasil commands

Yggdrasil can be called either from shell or from python. From shell:

yggdrasil seed # Creates a seed for yggdrasil
yggdrasil create app_name # Installs an app for the given name
yggdrasil remove app_name # Uninstalls an app for the given name
yggdrasil show app_name # Show information related to the app name provided

(Further parametrisation available, details with -h)

From python:

import yggdrasil as ygg
ygg.seed() # Creates a seed for yggdrasil
ygg.create("app_name") # Installs an app for the given name
ygg.remove("app_name") # Uninstalls an app for the given name
ygg.show("app_name") # Show information related to the app name provided

After an application is installed through yggdrasil (and provided the yggdrasil scripts' path was added to the Path environment variable), you will be able to call the project's entry points directly from the command line:

app_name

Any feedback welcome!

Release files for ud-yggdrasil 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ud-yggdrasil 2.0.0
File Size Uploaded
ud-yggdrasil-2.0.0.tar.gz 10.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ud-yggdrasil 2.0.0
File Interpreter ABI Platform
ud_yggdrasil-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.3 kB

Release files / ud-yggdrasil-2.0.0.tar.gz

Download URL ud-yggdrasil-2.0.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
669912cab9b219b22d70ee2c9a99432f8c0b18034e541454c38f790230486086
BLAKE2b-256 checksum
How to use checksums
4735a880f8729e2fb5adcc2f91134102e622292074429ce782b73072c5602e07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.11.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.7

Release files / ud_yggdrasil-2.0.0-py3-none-any.whl

Download URL ud_yggdrasil-2.0.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d0b117ee0a9e67dee59322a10ce9cf500dcd72ed5050ff0fe822a8012a66f04
BLAKE2b-256 checksum
How to use checksums
93679d542789ed3a517815c6c30042eb8a9806d5bebdeaca0918b80215e40043
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.11.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.7

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page