Skip to main content

Bibliothèque pour se faciliter le scripting !

Project description

Automathèque

Code de base pour automatheque.

Installation

mais il est peu probable que vous ayez besoin de l'installer, c'est avant tout une dépendance.

pip install automatheque

Dépendances

  • voir pyproject.toml

Install en mode dev

pip install -e .[dev,docs] ou monas install depuis la racine.

Usage : Utilitaire pour script

from automatheque.script import script  # alias court de script_automatheque

@script(__doc__, __version__)
def main(_script):
    print(_script.config)

if __name__ == '__main__':
    main()

L'API a été promue de automatheque.util.script vers automatheque.script (#41). L'ancien chemin reste importable (shim) mais émet un DeprecationWarning : migrez vers from automatheque.script import script.

Le décorateur câble automatiquement, si le script les déclare dans son usage : --dry-run (via _script.dry_run), la verbosité -v/-q (niveau de log), une sortie propre sur Ctrl-C (code 130), et la durée d'exécution.

Sous-commandes (via commandopt)

On déclare des fonctions-commandes avec @commande([...]) (alias de commandopt.commandopt) et on aiguille avec _script.execute_commande(). Les options internes d'automatheque (--config, --dry-run, -v/-q) sont exclues de la sélection, mais restent transmises à la commande.

"""Mon script

Usage:
  mon_script.py (--ajouter | --supprimer) [--config=<f>] [-v]
"""
from automatheque.script import script, commande

@commande(["--ajouter"])
def ajouter(arguments):
    ...

@commande(["--supprimer"])
def supprimer(arguments):
    ...

@script(__doc__, __version__)
def main(_script):
    return _script.execute_commande()

if __name__ == '__main__':
    main()

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

automatheque-0.13.0.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

automatheque-0.13.0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file automatheque-0.13.0.tar.gz.

File metadata

  • Download URL: automatheque-0.13.0.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for automatheque-0.13.0.tar.gz
Algorithm Hash digest
SHA256 27830ecbea07a9f335d760eb92e50c80dbf1d2b9071d47ae408091c67f69875b
MD5 488e397953a382426df4655dfb942065
BLAKE2b-256 81bfd48a56dbc0beffa2c8a276e1026716153482c37d598b33b7666c989312b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for automatheque-0.13.0.tar.gz:

Publisher: release.yml on jaegerbobomb/automatheque

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file automatheque-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: automatheque-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for automatheque-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45d0a924ce2a0081febf252ca0757030a98c7b34ef7636301746107becba945c
MD5 2e52be13c3b505e0930f77c81349f46a
BLAKE2b-256 2824c39dbc80a6fbbc5fca3cde8e06aa8c0c84fda65e766abbe02d908cb14f3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for automatheque-0.13.0-py3-none-any.whl:

Publisher: release.yml on jaegerbobomb/automatheque

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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