Skip to content

Instantly share code, notes, and snippets.

View Sven-Bo's full-sized avatar

Sven Sven-Bo

View GitHub Profile
import json
import requests # pip install requests
import streamlit as st # pip install streamlit
from streamlit_lottie import st_lottie # pip install streamlit-lottie
# GitHub: https://github.com/andfanilo/streamlit-lottie
# Lottie Files: https://lottiefiles.com/
def load_lottiefile(filepath: str):
@Sven-Bo
Sven-Bo / economic_calendar.py
Created April 5, 2023 19:06
This Python script downloads key economic indicators, such as GDP, Unemployment Rate, Consumer Price Index, and Federal Funds Rate, from the FRED (Federal Reserve Economic Data) database using the pandas-datareader library. The data is then exported to an Excel file named 'economic_calendar.xlsx'. The user can customize the date range and econom…
import pandas_datareader as pdr # pip install pandas-datareader
import pandas as pd
start = "2020-01-01"
end = "2020-07-31"
# List of FRED codes for economic indicators
economic_indicators = {
"GDP": "GDP",
"Unemployment Rate": "UNRATE",
@Sven-Bo
Sven-Bo / custom_contract_generator.py
Created April 24, 2023 17:45
Custom Contract Generator - An enhanced version of the original script, allowing users to generate and save vendor contracts in a specified folder using PySimpleGUI and docxtpl
# Author: Sven Bosau
# YouTube: https://youtube.com/@codingisfun
# This script is a modified version of the original code from the following video:
# https://github.com/Sven-Bo/word-entry-form/blob/master/2.Step%20-%20Create%20GUI/Vendor_Contract_Example/vendor-contract-gui.py
# The modification allows the user to save generated documents in a specified folder.
import datetime
from pathlib import Path
import PySimpleGUI as sg
@Sven-Bo
Sven-Bo / excel_data_entry.py
Created May 2, 2023 04:52
This Python script creates a data entry form using PySimpleGUI, allowing users to input, submit, clear, and delete data in an Excel file.
"""
This script is based on the original code from the YouTube tutorial:
- https://youtu.be/svcv8uub0D0
The initial code can be found on GitHub at:
- https://github.com/Sven-Bo/data-entry-form-pysimplegui
Modifications made to the original code:
- Added a "Delete Last Row" button to remove the last row from the Excel file.
@Sven-Bo
Sven-Bo / pysimplegui_excel_entry.py
Last active May 24, 2023 06:28
This code is a modification of the initial code from the video tutorial titled "How to Create an Excel Data Entry Form in 10 Minutes Using Python (No VBA) | Easy & Simple" by Sven Bosau. It adds a scrollbar to the main window layout using PySimpleGUI, allowing for easy navigation when filling out the form. The modified code provides an improved …
"""
This code is a modification of the initial code from the video tutorial:
"How to Create an Excel Data Entry Form in 10 Minutes Using Python (No VBA) | Easy & Simple"
Video link: https://youtu.be/svcv8uub0D0
Modifications:
- Added a scrollbar to the main window layout using sg.Column and sg.VerticalScroll.
"""
from pathlib import Path
@Sven-Bo
Sven-Bo / pysimplegui_excel_entry_with_timestamp.py
Created May 29, 2023 09:20
This code is a modification of the initial code from the video tutorial titled "How to Create an Excel Data Entry Form in 10 Minutes Using Python (No VBA) | Easy & Simple" by Sven Bosau. It adds a timestamp next to the entry
"""
This code is a modification of the initial code from the video tutorial:
"How to Create an Excel Data Entry Form in 10 Minutes Using Python (No VBA) | Easy & Simple"
Video link: https://youtu.be/svcv8uub0D0
Modifications:
- Added a timestamp next to the entry in the Excel file
"""
from pathlib import Path
import PySimpleGUI as sg
@Sven-Bo
Sven-Bo / find_replace_excel_values.py
Created July 1, 2023 06:41
Case-Insensitive Text Replacement in Excel Files using openpyxl
"""
Title: Case-Insensitive Text Replacement in Excel Files
Author: Sven Bosau
Website: https://pythonandvba.com
YouTube Channel: https://Youtube.com/@codingisfun
This script leverages the openpyxl library to perform case-insensitive replacement of text in Excel files (.xlsx, .xls).
It traverses each cell in each worksheet of an Excel file, compares the lowercase content of the cell to the keys
of a predefined dictionary, and if a match is found, replaces the cell's content with the corresponding value.
@Sven-Bo
Sven-Bo / append_df_to_excel_table.py
Created July 20, 2023 22:19
Python script to append DataFrame data to an Excel table using xlwings
# This code was provided by Sven Bosau
# Website: https://pythonandvba.com
# YouTube: https://youtube.com/@codingisfun
import xlwings as xw
import pandas as pd
# Constants
WORKBOOK_PATH = 'workbook.xlsx'
SHEET_NAME = 'Sheet1'
@Sven-Bo
Sven-Bo / data_entry_form_autofit_column.py
Created June 19, 2024 06:33
Modification of the initial code from the video tutorial "Simple Data Entry Form with PySimpleGUI and Pandas" (https://youtu.be/svcv8uub0D0). The enhancement allows the Excel columns to autofit their widths based on the content using the openpyxl library.
from pathlib import Path
import PySimpleGUI as sg
import pandas as pd
from openpyxl import load_workbook
# Add some color to the window
sg.theme('DarkTeal9')
current_dir = Path(__file__).parent if '__file__' in locals() else Path.cwd()
EXCEL_FILE = current_dir / 'Data_Entry.xlsx'
@Sven-Bo
Sven-Bo / BBC-Radio-HLS.m3u
Created June 23, 2024 07:37 — forked from bpsib/BBC-Radio-HLS.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one/bbc_radio_one.isml/bbc_radio_one-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_dance/bbc_radio_one_dance.isml/bbc_radio_one_dance-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Relax
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_relax/bbc_radio_one_relax.isml/bbc_radio_one_relax-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 2