Apps handler for in-house python scripts
Project description
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ud-yggdrasil-2.0.0.tar.gz
.
File metadata
- Download URL: ud-yggdrasil-2.0.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 669912cab9b219b22d70ee2c9a99432f8c0b18034e541454c38f790230486086 |
|
MD5 | d7ce8ab4811093c5cb034d8bef433e74 |
|
BLAKE2b-256 | 4735a880f8729e2fb5adcc2f91134102e622292074429ce782b73072c5602e07 |
File details
Details for the file ud_yggdrasil-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: ud_yggdrasil-2.0.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d0b117ee0a9e67dee59322a10ce9cf500dcd72ed5050ff0fe822a8012a66f04 |
|
MD5 | a75a1c2a002b3926df68be8045cc72b7 |
|
BLAKE2b-256 | 93679d542789ed3a517815c6c30042eb8a9806d5bebdeaca0918b80215e40043 |