Skip to main content

Standalone Package Generator

Project description

AdHoc Standalone Python Script Generator
########################################

The *AdHoc* compiler can be used as a program (see `Script Usage`_)
as well as a module (see :class:`adhoc.AdHoc`).

Since the *AdHoc* compiler itself is installed as a compiled *AdHoc*
script, it serves as its own usage example.

After installation of the *adhoc.py* script, the full source can be
obtained in directory ``__adhoc__``, by executing::

adhoc.py --explode

Purpose
=======

*AdHoc* provides python scripts with

- template facilities
- default file generation
- standalone module inclusion

*AdHoc* has been designed to provide an implode/explode cycle:

======== ======= ========= ======= =========
source_0 xsource_0
source_1 implode explode xsource_1
... ------> script.py ------> ...
source_n xsource_n
======== ======= ========= ======= =========

where ``xsource_i === source_i``. I.e., ``diff source_i xsource_i``
does not produce any output.

Quickstart
==========

module.py:

# -*- coding: utf-8 -*-
mvar = 'value'

script.py:

# -*- coding: utf-8 -*-
# @:adhoc_run_time:@
import module # @:adhoc:@
print('mvar: ' + module.mvar)

Compilation::

adhoc.py --compile script.py >/tmp/script-compiled.py

Execution outside source directory::

cd /tmp && python script-compiled.py

shows::

mvar: value

Decompilation::

cd /tmp && \
mkdir -p __adhoc__ && \
adhoc.py --decompile <script-compiled.py >__adhoc__/script.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AdHoc-0.3.2.tar.gz (118.8 kB view details)

Uploaded Source

File details

Details for the file AdHoc-0.3.2.tar.gz.

File metadata

  • Download URL: AdHoc-0.3.2.tar.gz
  • Upload date:
  • Size: 118.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for AdHoc-0.3.2.tar.gz
Algorithm Hash digest
SHA256 c200e740500ad2cb2dcb606da190c43f3cde25b44b24ff80f85f91bf9bda52cb
MD5 44b15db6d16e05b4687e277950b840f3
BLAKE2b-256 ca77ddf2d5be815160b9a3996ea59f64a8f6fe061d2b8c436aa4fae7a0f83f88

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page