Fetch and deploy external resources (CSS, JS, Fonts) for web services
Project description
Sorry, this file is outdated – will be updated soon. Don’t read on. Thank you.
Installation
Install this package (as editable or from the repository) into your virtual environment.
Install invoke, create a tasks.py file in the root directory of your project and insert these lines:
from external_resources.tasks import ( get_resources, check_resource, deploy_resources, )
Create a file external_resources.yaml containing information about the external resources that you will be needing. An example is supplied with this package.
Create (or edit) the file invoke.yaml (in the same directory as tasks.py); it should specify the path of your external_resources.yaml registry and a list of resource names and optional version specifiers (like in a requirements file).
Example:
external_resources: required: - bootstrap5 - bootstrap5_js - htmx ~= 1.7 - lineawesome13 ~= 1.3 config_file: external_resources.yaml dir_name: static_external
The path to the config_file can either be an absolute path or relative to the directory of invoke.yaml.
The dir_name option should point to a directory where the external resources will be installed (on your local host); depending on the kind of the resource they will go into subdirectories css, js, or fonts.
The invoke command
inv get-resources
will try to download the resources specified as required into the dir_name target directory.
If the integrity check code for a resource is not known, the command
inv check-resource NAME
will calculate and display this code which then can be pasted into the registry to make sure the correct file was retrieved on a later download.
With
inv deploy-resources
the resources from the local dir_name directory (and its subdirectories) will be rsync’ed to the target host specified by the target option in invoke.yaml.
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 external_resources-0.2.0.tar.gz
.
File metadata
- Download URL: external_resources-0.2.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 152d7bc04b44970b79d0e188dde4ba3d12b0d5095162f8df0959a6961715f061 |
|
MD5 | b300ad35bf49bc337bebbb20516c58b9 |
|
BLAKE2b-256 | 98bf7ac2300d33ac442ae5fd45ebc554608fbb85a5bbf6364fa7b9769b780a0f |
File details
Details for the file external_resources-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: external_resources-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f0707c7ea6b466939a7d3b62e6777087e0255e6c6d3688e9852010fb60e0a6a |
|
MD5 | 561a8edcb2d3aaf1c8d3d5e974234326 |
|
BLAKE2b-256 | 75b42e12b947582dc9f4013c7c47b0cfbd0e00484ad4b0a392192b40a7fa406b |