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.

Metadata

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 Provenance Actions
pre_script-0.1.2.tar.gz 2.5 kB Without provenance Details for pre_script-0.1.2.tar.gz

Built distribution (wheel)

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

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

Security for pre-script 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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