diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..f6380cc Binary files /dev/null and b/.DS_Store differ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index ef5fb65..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: README Build - -on: - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - type: choice - options: - - info - - warning - - debug - tags: - description: 'Test scenario tags' - required: false - type: boolean - environment: - description: 'Environment to run tests against' - type: environment - required: true - schedule: - - cron: '0 */3 * * *' # runs every 3hours - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: checkout repo content - uses: actions/checkout@v2 # checkout the repository content to github runner - - - name: setup python - uses: actions/setup-python@v2 - with: - python-version: '3.10.4' # install the python version needed - - - name: install python packages - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: execute py script - run: python main.py - - - name: commit files - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add -A - git commit -m "Automated publish" -a - - - name: push changes - uses: ad-m/github-push-action@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: main diff --git a/.gitignore b/.gitignore index 4094836..5935305 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,4 @@ .idea/**/* venv/* -venv/**/* - -__pycache__/* -__pycache__/**/* \ No newline at end of file +venv/**/* \ No newline at end of file diff --git a/README.md b/README.md index fa50baf..d6afe58 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,72 @@ +
+

Hello there ! Hi

+

+ I'm Lucàs, a passionate developer from + France Image Icon + Rodez, France. +

+
+
+

I code with

+ DataGrip + FileZilla + GitHub + Handlebars.js + IntelliJIdea + JetBrains + Jinja + Json + Markdown + PhpStorm + PyCharm + Symfony + Git + Pug + HTML5 + Figma + GitLab + Composer + diagrams.net + Linux + JavaScript + GNU Bash + Android + Android Studio + Bulma + MariaDB + Java + SQLite + Visual Studio Code + CSS3 + MySQL + Windows + Python + C + PostgreSQL + PHP + Insomnia + Bootstrap + Angular +
-# Hello there ! Wave hand +
+

Where to find me

+ + GitHub + + + LinkedIn + + + FreeCodeCamp + +
-I'm Lucàs, a passionate developer from France Image Icon **Rodez, France**. -
Currently, the weather is: **30.6°C** :thermometer:, **Sunny** :sunny: +
-### I code with -![DataGrip](https://img.shields.io/static/v1?label=&message=DataGrip&color=%23df2020&logo=datagrip&logoColor=white) -![FileZilla](https://img.shields.io/static/v1?label=&message=FileZilla&color=%23df2020&logo=filezilla&logoColor=white) -![GitHub](https://img.shields.io/static/v1?label=&message=GitHub&color=%23df2020&logo=github&logoColor=white) -![Handlebars.js](https://img.shields.io/static/v1?label=&message=Handlebars.js&color=%23df2020&logo=handlebarsdotjs&logoColor=white) -![IntelliJIdea](https://img.shields.io/static/v1?label=&message=IntelliJ+IDEA&color=%23df2020&logo=intellijidea&logoColor=white) -![JetBrains](https://img.shields.io/static/v1?label=&message=JetBrains&color=%23df2020&logo=jetbrains&logoColor=white) -![Jinja](https://img.shields.io/static/v1?label=&message=Jinja&color=%23df2020&logo=jinja&logoColor=white) -![Json](https://img.shields.io/static/v1?label=&message=JSON&color=%23df2020&logo=json&logoColor=white) -![Markdown](https://img.shields.io/static/v1?label=&message=Markdown&color=%23df2020&logo=markdown&logoColor=white) -![PhpStorm](https://img.shields.io/static/v1?label=&message=PhpStorm&color=%23df2020&logo=phpstorm&logoColor=white) -![PyCharm](https://img.shields.io/static/v1?label=&message=PyCharm&color=%23df2020&logo=pycharm&logoColor=white) -![Symfony](https://img.shields.io/static/v1?label=&message=Symfony&color=%23df2020&logo=symfony&logoColor=white) -![Git](https://img.shields.io/static/v1?label=&message=Git&color=%23df3e20&logo=git&logoColor=white) -![Pug](https://img.shields.io/static/v1?label=&message=Pug&color=%23df4420&logo=pug&logoColor=white) -![HTML5](https://img.shields.io/static/v1?label=&message=HTML5&color=%23df4920&logo=html5&logoColor=white) -![Figma](https://img.shields.io/static/v1?label=&message=Figma&color=%23df4b20&logo=figma&logoColor=white) -![GitLab](https://img.shields.io/static/v1?label=&message=GitLab&color=%23df5f20&logo=gitlab&logoColor=white) -![Composer](https://img.shields.io/static/v1?label=&message=Composer&color=%23df7220&logo=composer&logoColor=white) -![diagrams.net](https://img.shields.io/static/v1?label=&message=diagrams.net&color=%23df8a20&logo=diagramsdotnet&logoColor=white) -![Linux](https://img.shields.io/static/v1?label=&message=Linux&color=%23dfaf20&logo=linux&logoColor=white) -![JavaScript](https://img.shields.io/static/v1?label=&message=JavaScript&color=%23dfca20&logo=javascript&logoColor=white) -![GNU Bash](https://img.shields.io/static/v1?label=&message=GNU+Bash&color=%235bdf20&logo=gnubash&logoColor=white) -![Android](https://img.shields.io/static/v1?label=&message=Android&color=%2320df75&logo=android&logoColor=white) -![Android Studio](https://img.shields.io/static/v1?label=&message=Android+Studio&color=%2320df75&logo=androidstudio&logoColor=white) -![Bulma](https://img.shields.io/static/v1?label=&message=Bulma&color=%2320dfc3&logo=bulma&logoColor=white) -![MariaDB](https://img.shields.io/static/v1?label=&message=MariaDB&color=%2320b3df&logo=mariadb&logoColor=white) -![Java](https://img.shields.io/static/v1?label=&message=Java&color=%2320b2df&logo=java&logoColor=white) -![SQLite](https://img.shields.io/static/v1?label=&message=SQLite&color=%2320a2df&logo=sqlite&logoColor=white) -![Visual Studio Code](https://img.shields.io/static/v1?label=&message=Visual+Studio+Code&color=%232092df&logo=visualstudiocode&logoColor=white) -![CSS3](https://img.shields.io/static/v1?label=&message=CSS3&color=%23208edf&logo=css3&logoColor=white) -![MySQL](https://img.shields.io/static/v1?label=&message=MySQL&color=%23208ddf&logo=mysql&logoColor=white) -![Windows](https://img.shields.io/static/v1?label=&message=Windows&color=%23208bdf&logo=windows&logoColor=white) -![Python](https://img.shields.io/static/v1?label=&message=Python&color=%232088df&logo=python&logoColor=white) -![C](https://img.shields.io/static/v1?label=&message=C&color=%23207adf&logo=c&logoColor=white) -![PostgreSQL](https://img.shields.io/static/v1?label=&message=PostgreSQL&color=%232050df&logo=postgresql&logoColor=white) -![PHP](https://img.shields.io/static/v1?label=&message=PHP&color=%23202cdf&logo=php&logoColor=white) -![Insomnia](https://img.shields.io/static/v1?label=&message=Insomnia&color=%236020df&logo=insomnia&logoColor=white) -![Bootstrap](https://img.shields.io/static/v1?label=&message=Bootstrap&color=%236d20df&logo=bootstrap&logoColor=white) -![Angular](https://img.shields.io/static/v1?label=&message=Angular&color=%23df204a&logo=angular&logoColor=white) - - -### Where to find me -[![GitHub](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/LucasVbr) -[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/lucasvbr) -[![FreeCodeCamp](https://img.shields.io/badge/freecodecamp-27273D?style=for-the-badge&logo=freecodecamp&logoColor=white)](https://www.freecodecamp.org/LucasVbr) - ---- - -
- -This **README** is generated **every 3 hours**.
-Last refresh: **Monday 08 August 22, 20:10** (Europe/Paris)
-![Profile Views](https://komarev.com/ghpvc/?username=lucasvbr&label=Profile%20views&color=0e75b6&style=flat) -![FreeCodeCamp Points](https://img.shields.io/freecodecamp/points/lucasvbr?label=FreeCodeCamp%20points) -![README Build](https://github.com/LucasVbr/LucasVbr/actions/workflows/main.yml/badge.svg?branch=main) -![Made with love](https://img.shields.io/badge/-made%20with%20%E2%9D%A4%EF%B8%8F-red) - - -*inspired by [Thomas Guibert](https://github.com/thmsgbrt)* - -
\ No newline at end of file +
+ Profile Views + FreeCodeCamp Points + Made with love +
\ No newline at end of file diff --git a/Utils.py b/Utils.py deleted file mode 100644 index c2b04db..0000000 --- a/Utils.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- - -import os.path -from flask import Flask, render_template -from src.Badge import Badge, getBadgeColor -from meteofrance_api import MeteoFranceClient -from src.FileUtils import setFileData, getJsonData -from src.meteoEmoji import EMOJIS - -""" -05/06/2022 -""" - -__file__ = 'Utils.py' -__author__ = 'Lucas Vbr' -__version__ = '0.1' - - -def getDataSubfiles(files: list): - contents = {} - for file in files: - baseName = os.path.basename(file) - fileName = os.path.splitext(baseName)[0] - contents[fileName] = getJsonData(file) - return contents - - -def convertToolBadges(listToolName: list) -> list[dict[str, str]]: - tools = [Badge(toolName) for toolName in listToolName] - tools.sort(key=getBadgeColor) # Sort by color - return [{"src": badge.url, "alt": badge.name} for badge in tools] - - -def getWeather(city: str) -> dict: - meteoClient = MeteoFranceClient() - place = meteoClient.search_places(city)[0] - weather = meteoClient.get_forecast_for_place(place, language="en") \ - .current_forecast - - return { - "temperature": weather.get('T').get('value'), - "description": weather.get("weather").get("desc"), - "icon": EMOJIS.get(weather.get("weather").get("icon")) - } - - -def buildFile(templateFile: str, outputFile: str, data: dict) -> None: - app = Flask('my app') - with app.app_context(): - rendered = render_template(templateFile, data=data) - - setFileData(outputFile, rendered) diff --git a/config.json b/config.json deleted file mode 100644 index 56b1479..0000000 --- a/config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "info": { - "name": "Lucàs", - "city": "Rodez", - "timezone": "Europe/Paris", - "hi_img": { - "src": "./img/Hi.gif", - "alt": "Wave hand", - "size": "50" - }, - "france_img": { - "src": "https://camo.githubusercontent.com/810c0059ec880d3bf22c12f8ecd24d39ae1c9ee5d294cd397e6f414738d9cdd8/68747470733a2f2f63646e2d69636f6e732d706e672e666c617469636f6e2e636f6d2f3531322f3139372f3139373536302e706e67", - "alt": "France Image Icon", - "size": "12" - } - }, - "template_file": "index.md.jinja", - "output_file": "README.md", - "data_files": [ - "data/tools.json", - "data/links.json", - "data/footer_badges.json" - ] -} \ No newline at end of file diff --git a/data/footer_badges.json b/data/footer_badges.json deleted file mode 100644 index 5a1bf93..0000000 --- a/data/footer_badges.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "alt": "Profile Views", - "src": "https://komarev.com/ghpvc/?username=lucasvbr&label=Profile%20views&color=0e75b6&style=flat" - }, - { - "alt": "FreeCodeCamp Points", - "src": "https://img.shields.io/freecodecamp/points/lucasvbr?label=FreeCodeCamp%20points" - }, - { - "alt": "README Build", - "src": "https://github.com/LucasVbr/LucasVbr/actions/workflows/main.yml/badge.svg?branch=main" - }, - { - "alt": "Made with love", - "src": "https://img.shields.io/badge/-made%20with%20%E2%9D%A4%EF%B8%8F-red" - } -] diff --git a/data/links.json b/data/links.json deleted file mode 100644 index 26fa774..0000000 --- a/data/links.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "src": "https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white", - "alt": "GitHub", - "href": "https://github.com/LucasVbr" - }, - { - "src": "https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white", - "alt": "LinkedIn", - "href": "https://www.linkedin.com/in/lucasvbr" - }, - { - "src": "https://img.shields.io/badge/freecodecamp-27273D?style=for-the-badge&logo=freecodecamp&logoColor=white", - "alt": "FreeCodeCamp", - "href": "https://www.freecodecamp.org/LucasVbr" - } -] \ No newline at end of file diff --git a/data/tools.json b/data/tools.json deleted file mode 100644 index 903ebeb..0000000 --- a/data/tools.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - "Android", - "Android Studio", - "Angular", - "Bootstrap", - "Bulma", - "C", - "CSS3", - "Composer", - "DataGrip", - "Figma", - "FileZilla", - "GNU Bash", - "Git", - "GitHub", - "GitLab", - "HTML5", - "Handlebars.js", - "Insomnia", - "IntelliJIdea", - "Java", - "JavaScript", - "JetBrains", - "Jinja", - "Json", - "Linux", - "MariaDB", - "Markdown", - "MySQL", - "PHP", - "PhpStorm", - "PostgreSQL", - "Pug", - "PyCharm", - "Python", - "SQLite", - "Symfony", - "Visual Studio Code", - "Windows", - "diagrams.net" -] \ No newline at end of file diff --git a/main.py b/main.py deleted file mode 100644 index dbb3d8d..0000000 --- a/main.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -__author__ = "LucasVbr" -__version__ = "3.0.3" - -from Utils import * -from src.FileUtils import getJsonData, setJsonData -from datetime import datetime -import pytz - -CONFIG_FILE = "config.json" - -if __name__ == "__main__": - configData = getJsonData(CONFIG_FILE) - - data = getDataSubfiles(configData.get("data_files")) - - toolList = data.get("tools") - toolList = list(dict.fromkeys(toolList)) # Remove duplicates - - data["info"] = configData.get("info") - data["tools"] = convertToolBadges(toolList) - data["weather"] = getWeather(data.get("info").get('city')) - data['today'] = datetime \ - .today() \ - .astimezone(pytz.timezone(data['info'].get('timezone'))) \ - .strftime("%A %d %B %y, %H:%M") - - buildFile( - configData.get("template_file"), - configData.get("output_file"), - data - ) - - # Rewrite Tools (in order) - toolList.sort() - setJsonData("data/tools.json", toolList) diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 4719b38..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -flask~=2.1.2 -colour~=0.1.5 -simpleicons~=6.23.0 -meteofrance-api~=1.0.2 -pytz~=2021.3 \ No newline at end of file diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 362d97f..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -__pycache__/* -__pycache__/**/* \ No newline at end of file diff --git a/src/Badge.py b/src/Badge.py deleted file mode 100644 index d106cf5..0000000 --- a/src/Badge.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- - -from simpleicons.all import icons -from urllib.parse import urlencode -from colour import Color - -""" -04/06/2022 -""" - -__file__ = 'Badge.py' -__author__ = 'Lucas Vbr' -__version__ = '0.1' - - -class Badge: - def __init__(self, badgeName: str): - self.name = badgeName - self.url = "" - self.color = 0 - - self.buildUrl() - - def get_color(self): - return self.color - - def buildUrl(self): - BASE_URL = "https://img.shields.io/static/v1" - LOGO_COLOR = "white" - - icon = icons.get(self.name) - - color_hue = Color(f'#{icon.hex}').get_hue() - color_hsl = (color_hue, 0.75, 0.5) - color = Color() - color.set_hsl(color_hsl) - - try: - params = { - "label": "", - "message": icon.title, - "color": color, - "logo": icon.slug, - "logoColor": LOGO_COLOR - } - urlParams = urlencode(params) - self.url = f"{BASE_URL}?{urlParams}" - self.color = color_hue - except Exception: - pass # Let default values - - -def getBadgeColor(badge: Badge) -> float: - return badge.color diff --git a/src/FileUtils.py b/src/FileUtils.py deleted file mode 100644 index 235b670..0000000 --- a/src/FileUtils.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -04/06/2022 -""" - -import json - -__file__ = 'FileUtils.py' -__author__ = 'Lucas Vbr' -__version__ = '0.1' - -DEFAULT_FILE_ENCODING = "utf8" - - -def getJsonData(filePath: str) -> str: - """ - Take data from JSON File - :param filePath: Path of the file to read - :return: The content of the JSON file - """ - with open(filePath, encoding=DEFAULT_FILE_ENCODING) as file: - data = json.load(file) - return data - - -def setJsonData(filePath: str, content) -> None: - setFileData(filePath, json.dumps(content, indent=2)) - - -def setFileData(filePath: str, content: str) -> None: - """ - Create a new File or replace it content if already exist - :param filePath: Path of the file to fill - :param content: Content to place in the file - :return: None - """ - with open(filePath, "w", encoding=DEFAULT_FILE_ENCODING) as file: - file.write(content) diff --git a/src/meteoEmoji.py b/src/meteoEmoji.py deleted file mode 100644 index 322e641..0000000 --- a/src/meteoEmoji.py +++ /dev/null @@ -1,69 +0,0 @@ -EMOJIS = { - "p1j": ":sunny:", - "p1n": ":full_moon:", - "p2j": ":partly_sunny:", - "p2n": ":cloud:", - "p3j": ":cloud:", - "p3n": ":cloud:", - "p4j": ":fog:", - "p4n": ":fog:", - "p5j": ":fog:", - "p5n": ":fog:", - "p6j": ":fog:", - "p6n": ":fog:", - "p7j": ":fog:", - "p7n": ":fog:", - "p8j": ":fog:", - "p8n": ":fog:", - "p9j": ":cloud_with_rain:", - "p9n": ":cloud_with_rain:", - "p10j": ":cloud_with_rain:", - "p10n": ":cloud_with_rain:", - "p11j": ":cloud_with_rain:", - "p11n": ":cloud_with_rain:", - "p12j": ":cloud_with_rain:", - "p12n": ":cloud_with_rain:", - "p13j": ":cloud_with_rain:", - "p13n": ":cloud_with_rain:", - "p14j": ":cloud_with_rain:", - "p14n": ":cloud_with_rain:", - "p15j": ":cloud_with_rain:", - "p15n": ":cloud_with_rain:", - "p16j": ":cloud_with_lightning:", - "p16n": ":cloud_with_lightning:", - "p17j": ":cloud_with_snow:", - "p17n": ":cloud_with_snow:", - "p18j": ":cloud_with_snow:", - "p18n": ":cloud_with_snow:", - "p19j": ":cloud_with_snow:", - "p19n": ":cloud_with_snow:", - "p20j": ":cloud_with_snow:", - "p20n": ":cloud_with_snow:", - "p21j": ":cloud_with_snow:", - "p21n": ":cloud_with_snow:", - "p22j": ":cloud_with_snow:", - "p22n": ":cloud_with_snow:", - "p23j": ":cloud_with_snow:", - "p23n": ":cloud_with_snow:", - "p24j": ":cloud_with_lightning:", - "p24n": ":cloud_with_lightning:", - "p25j": ":cloud_with_lightning:", - "p25n": ":cloud_with_lightning:", - "p26j": ":cloud_with_lightning:", - "p26n": ":cloud_with_lightning:", - "p27j": ":cloud_with_lightning:", - "p27n": ":cloud_with_lightning:", - "p28j": ":cloud_with_lightning:", - "p28n": ":cloud_with_lightning:", - "p29j": ":cloud_with_lightning:", - "p29n": ":cloud_with_lightning:", - "p30j": ":cloud_with_lightning:", - "p30n": ":cloud_with_lightning:", - "p31j": ":star:", - "p31n": ":star:", - "p32j": ":tornado:", - "p32n": ":tornado:", - "p33j": ":tornado:", - "p33n": ":tornado:", - -} diff --git a/templates/index.md.jinja b/templates/index.md.jinja deleted file mode 100644 index 19d04a6..0000000 --- a/templates/index.md.jinja +++ /dev/null @@ -1,29 +0,0 @@ -{% from 'macro/image.md.jinja' import image, imageWithSize, imageWithLink %} - -# Hello there ! {{ imageWithSize(data.info.hi_img) }} - -I'm {{ data.info.name }}, a passionate developer from {{ imageWithSize(data.info.france_img) }} **{{ data.info.city }}, France**. -
Currently, the weather is: **{{ data.weather.temperature }}°C** :thermometer:, **{{ data.weather.description }}** {% if data.weather.icon != "None" %}{{ data.weather.icon }}{% endif %} - -### I code with -{% for img in data.tools -%} - {{ image(img) }} -{% endfor %} - -### Where to find me -{% for img in data.links -%} - {{ imageWithLink(img) }} -{% endfor %} ---- - -
- -This **README** is generated **every 3 hours**.
-Last refresh: **{{ data.today }}** ({{ data.info.timezone }})
-{% for img in data.footer_badges -%} - {{ image(img) }} -{% endfor %} - -*inspired by [Thomas Guibert](https://github.com/thmsgbrt)* - -
diff --git a/templates/macro/image.md.jinja b/templates/macro/image.md.jinja deleted file mode 100644 index 9b4350b..0000000 --- a/templates/macro/image.md.jinja +++ /dev/null @@ -1,11 +0,0 @@ -{% macro image(image) -%} - ![{{ image.alt }}]({{ image.src }}) -{%- endmacro %} - -{% macro imageWithLink(image) -%} - [![{{ image.alt }}]({{ image.src }})]({{ image.href }}) -{%- endmacro %} - -{% macro imageWithSize(image) -%} - {{ image.alt }} -{%- endmacro %}