mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-05-13 17:11:52 +00:00
init branch
This commit is contained in:
@@ -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
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
### Where to find me
|
||||
[](https://github.com/LucasVbr)
|
||||
[](https://www.linkedin.com/in/lucasvbr)
|
||||
[](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>
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
*inspired by [Thomas Guibert](https://github.com/thmsgbrt)*
|
||||
|
||||
</div>
|
||||
@@ -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
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
@@ -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
Binary file not shown.
|
Before Width: | Height: | Size: 281 KiB |
@@ -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)
|
||||
@@ -1,5 +0,0 @@
|
||||
flask~=2.1.2
|
||||
colour~=0.1.5
|
||||
simpleicons~=6.23.0
|
||||
meteofrance-api~=1.0.2
|
||||
pytz~=2021.3
|
||||
@@ -1,2 +0,0 @@
|
||||
__pycache__/*
|
||||
__pycache__/**/*
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -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:",
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -1,11 +0,0 @@
|
||||
{% macro image(image) -%}
|
||||

|
||||
{%- endmacro %}
|
||||
|
||||
{% macro imageWithLink(image) -%}
|
||||
[]({{ image.href }})
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro imageWithSize(image) -%}
|
||||
<img src="{{ image.src }}" alt="{{ image.alt }}" width="{{ image.size }}" height="{{ image.size }}"/>
|
||||
{%- endmacro %}
|
||||
Reference in New Issue
Block a user