Util for executing a custom script before running any python application without modifying the last one
Project description
Pre Script
Util for executing a custom script before running any python application or script without modifying the last one.
You may treat it as application pre-start hook.
Use cases
- patching log configs for a legacy application (sometimes it's pretty hard)
- auto-executing
docker-compose.yml
before running the application - patching the application module (sometimes usefull for debugging)
- any case where you need to inject some temporary logic without modifying the application code base
Installation
$ pip install pre-script
Example
$ echo PRE_SCRIPT_ENABLED=1
$ echo 'print("hello from pre-script")' > .pre-script.py
$ echo 'print("hello from app")' > app.py
$ python app.py
$ hello from pre-script
$ hello from app
If required, the script name can be changed via PRE_SCRIPT_FILE
environment variable.
License
Distributed under the terms of the [MIT license][license], Pre Script is free and open source software.
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
pre_script-0.1.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for pre_script-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52311ee721866fefb24d4c896e13c36f94eab4f4ce975dab30455d744d59cd43 |
|
MD5 | c8ff7f12cef9045e60f34ac25eb4c546 |
|
BLAKE2b-256 | e3902f21c66fffc38e09fefd62b189fabbd63a3ef6a53ca27d238020d5858c5b |