Skip to main content

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.

Release files for pre-script 0.1.2

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

Source distribution (sdist)

Source distribution for pre-script 0.1.2
File Size Uploaded
pre_script-0.1.2.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pre-script 0.1.2
File Interpreter ABI Platform
pre_script-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size:5.5 kB

Release files / pre_script-0.1.2.tar.gz

Download URL pre_script-0.1.2.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
30c57a5369e3c06103e82da1d18472a6e46d36c199221aa73c031730ab560f42
BLAKE2b-256 checksum
How to use checksums
7bcbdfa9fb2211ea25dd2a77dad8eda77818095d0f4502a559dbe8d724939c0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Linux/6.2.16-2-MANJARO

Release files / pre_script-0.1.2-py3-none-any.whl

Download URL pre_script-0.1.2-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96f28b57533592d3d8d31f7081e0d366457a3ba8ef90dab17ce32d2fbee62ea2
BLAKE2b-256 checksum
How to use checksums
9dd7fca4523ccad4bc1f1a4660175f38733b5a373a66c4185eb9c855ff1609ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Linux/6.2.16-2-MANJARO

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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