Authors Class

Thanks to the Pyton language and the simple project class Author it is possible to automatically generate a markdown table for the authors who contribute to the creation of the articles on the BalziBox site.

The project is executable through the educational application Thonny .

class Author:
    def __init__(self, alias, name, surname, location):
        self.alias = alias
        self.name = name
        self.surname = surname
        self.location = location

    def to_markdown(self):
        return f"| Info Author | Description | \n| ---: | --- |\n|Alias: | {self.alias} |\n| Name: | {self.name} |\n| Surname: | {self.surname} |\n| Location: | {self.location}"

authors = [
    Author("Fr.Sa.Ba", "Francesco Saverio", "Balzano", "[40.8470, 14.2650](https://www.openstreetmap.org/search?lat=40.8470&lon=14.2650#map=11/40.8468/14.2654)"),
]

list_authors = "\n".join(autore.to_markdown() for autore in authors)
print(list_authors)

Fr.Sa.Ba

Info AuthorDescription
Alias:Fr.Sa.Ba
Name:Francesco Saverio
Surname:Balzano
Location:40.8470, 14.2650