Giter Site home page Giter Site logo

python-scripts's Introduction

Python Scripts

A collection of useful python utility scripts

1. Generate README.md

Generate a README.md file with summaries of READMEs in sub-directories

usage: generate_readme.py [-h] --rootdir REPODIR [--filename FILENAME]
                          [--subfilename SUBFILENAME] [--index] [--regenerate]

Generate a README.md file with summaries of READMEs in sub-directories

optional arguments:
  -h, --help            show this help message and exit
  --rootdir REPODIR, -d REPODIR
                        The root directory to generate the file in
  --filename FILENAME, -f FILENAME
                        Name of file to generate
  --subfilename SUBFILENAME, -s SUBFILENAME
                        Name of file in subdirectories to summarise
  --index, -i           Generate an index of all files in subdirectory
  --regenerate, -r      Regenerate an existing file

2. Ansible Playbook: Check Unmanaged Packages

This is a script to run an ansible playbook which runs all the relevant install tasks in --check mode, and reports a list of packages that have NOT been installed by the playbook, but have been manually installed on the system, for each play.

$ ansible-playbok site.yml -i inventory.yml --ask-sudo-pass --tags package-installs
...
UNMANAGED PACKAGE LIST ************************************************
localhost:
  - sqlite3
  - libsigc++-2.0-0v5
  - build-essential
  - jekyll
  - libxkbcommon-x11-0
192.168.1.3:
  - net-tools
  - packer

3. Create PDF

Simple script to create a pdf file by merging images or other pdf documents

usage: create_pdf.py [-h] --output OUTPUT [--filetypes {pdf,png,jpg,jpeg}]
                     [--directory DIRECTORY]
                     [file [file ...]]

Create a PDF file by merging existing pdf files and/or images

positional arguments:
  file

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output file name
  --filetypes {pdf,png,jpg,jpeg}, -t {pdf,png,jpg,jpeg}
  --directory DIRECTORY, -d DIRECTORY

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.