init branch

This commit is contained in:
Lucàs
2022-08-08 22:00:41 +02:00
parent 12d87d4744
commit 8e971b7d55
16 changed files with 0 additions and 467 deletions
Vendored
BIN
View File
Binary file not shown.
-69
View File
@@ -1,69 +0,0 @@
# Hello there ! <img src="./img/Hi.gif" alt="Wave hand" width="50" height="50"/>
I'm Lucàs, a passionate developer from <img src="https://camo.githubusercontent.com/810c0059ec880d3bf22c12f8ecd24d39ae1c9ee5d294cd397e6f414738d9cdd8/68747470733a2f2f63646e2d69636f6e732d706e672e666c617469636f6e2e636f6d2f3531322f3139372f3139373536302e706e67" alt="France Image Icon" width="12" height="12"/> **Rodez, France**.
<br>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)
---
<div align="center">
This **README** is generated **every 3 hours**.<br>
Last refresh: **Monday 08 August 22, 20:10** (Europe/Paris)<br>
![Profile Views](https://komarev.com/ghpvc/?username=lucasvbr&amp;label=Profile%20views&amp;color=0e75b6&amp;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)*
</div>
-52
View File
@@ -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)
-24
View File
@@ -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"
]
}
-18
View File
@@ -1,18 +0,0 @@
[
{
"alt": "Profile Views",
"src": "https://komarev.com/ghpvc/?username=lucasvbr&amp;label=Profile%20views&amp;color=0e75b6&amp;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"
}
]
-17
View File
@@ -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"
}
]
-41
View File
@@ -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"
]
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

-37
View File
@@ -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)
-5
View File
@@ -1,5 +0,0 @@
flask~=2.1.2
colour~=0.1.5
simpleicons~=6.23.0
meteofrance-api~=1.0.2
pytz~=2021.3
-2
View File
@@ -1,2 +0,0 @@
__pycache__/*
__pycache__/**/*
-54
View File
@@ -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
-39
View File
@@ -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)
-69
View File
@@ -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:",
}
-29
View File
@@ -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**.
<br>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 %}
---
<div align="center">
This **README** is generated **every 3 hours**.<br>
Last refresh: **{{ data.today }}** ({{ data.info.timezone }})<br>
{% for img in data.footer_badges -%}
{{ image(img) }}
{% endfor %}
*inspired by [Thomas Guibert](https://github.com/thmsgbrt)*
</div>
-11
View File
@@ -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) -%}
<img src="{{ image.src }}" alt="{{ image.alt }}" width="{{ image.size }}" height="{{ image.size }}"/>
{%- endmacro %}