Giter Club home page Giter Club logo

attestation's Introduction

attestation

Automatically send your attestation letters.


Installation

To install, clone this repository:

git pull https://github.com/GuignardLab/attestation.git

and then run:

cd attestation
pip install -e .

Warning 1: You have to have install pdflatex as a command line

Warning 2: You have to use -e to be able to easily modify src/attestation/_template.py (see below). If you don't want to use -e you'll have to pip install . each time you change the template file

Usage

After installation you need to modify the first lines of the file src/attestation/_template.py. You will want to modify PI_name, role, address, and you might want to inform signature_path and logo_path as absolute paths.

Setting signature_path or logo_path to the empty string will ignore them.

Once you have modified these variables you can ran the script as follow:

send-attestation --name Name Surname

with Name and Surname being the ones of the student you want to send the attestation for.

By default, the email is sent to the two concerned HR people (Marlène & Jasmina). You can change that with the following command line:

send-attestation --name student_name student_surname --recipients [email protected] [email protected]

Few other parameters can be changed, running the following:

send-attestation --help

which will give you the following:

usage: send-attestation [-h] [-n NAME [NAME ...]] [-g {m,f}] [-t SMTP] [-p PORT] [-u USERNAME]
                        [-r RECIPIENTS [RECIPIENTS ...]] [-ld LAST_DAY] [-ns] [-k] [-pdf PDF_FILE]

Building and sending an "attestation de présence"

optional arguments:
  -h, --help            show this help message and exit
  -n NAME [NAME ...], --name NAME [NAME ...]
  -g {m,f}, --genre {m,f}
  -t SMTP, --smtp SMTP  smtp (default LIS)
  -p PORT, --port PORT  port for email (default 587)
  -u USERNAME, --username USERNAME
                        account for email (default leo.guignard)
  -r RECIPIENTS [RECIPIENTS ...], --recipients RECIPIENTS [RECIPIENTS ...]
                        email where to send the letter (default [email protected] & [email protected])
  -ld LAST_DAY, --last-day LAST_DAY
                        Last day of the stay
  -ns, --no-send        Add this flag to not send the email
  -k, --keep-pdf        Add this flag to keep the generated pdf
  -pdf PDF_FILE, --pdf-file PDF_FILE
                        Path and name of the generate pdf file if kept (ignore if the flag kept-pdf is not present)

should inform you about the possibilities.

The whole script can also be ran programatically the following way:

from attestation import send_attestation

send_attestation(
    name, # Name of the student as a string
    recipients, # List of email addresses
    genre, # Wheter you need "étudiant" or "étudiante"
    day, # Last day of the stay of the student if it is not the end of the month
    smtp_server, # Smtp server to send (optional, default LIS)
    smtp_port, # Smtp port to send (optional)
    smtp_username, # Username for the smtp server
    send, # Bool whether to send or not the email
    keep, # bool whether to keep or not the generated pdf
    pdf_file, # where to save the pdf if saved
)

Typing send_attestation? should also give you a bit more information.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, "attestation" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.


This library was generated using Cookiecutter and a custom made template based on @napari's cookiecutter-napari-plugin template.

attestation's People

Contributors

leoguignard avatar

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.