Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Bodo Schönfeld niftycode

🏠
Working from home
View GitHub Profile
@niftycode
niftycode / download_zip_file.py
Created May 12, 2021
Download and unzip a ZIP file using Python
View download_zip_file.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Download and unzip a ZIP file
Version: 1.0
Python 3.7+
Date created: May 12th, 2021
Date modified: -
@niftycode
niftycode / FetchAndParseJSON.java
Last active Apr 16, 2021
Example how to fetch and parse JSON data in Java 11+
View FetchAndParseJSON.java
package de.niftycode;
import org.json.JSONArray;
import org.json.JSONObject;
import java.net.URI;
import java.net.http.HttpClient; // < New in Java 11, can also handle HTTP/2 requests!
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
@niftycode
niftycode / kiel-harbour-passengers.py
Created Feb 1, 2021
Use pandas and matplotlib to show the passenger numbers in the port of Kiel
View kiel-harbour-passengers.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Passengers - Kiel Harbour (1988-2019)
The data is provided by the City of Kiel, Germany
https://www.kiel.de/opendata/kiel_transport_verkehr_hafen_passagiere_insgesamt.csv
Version: 1.0
Python 3.8+
@niftycode
niftycode / csv_to_excel.py
Created Jun 4, 2020
Read a CSV file and save the data as Excel file
View csv_to_excel.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Cargo Handling (Port of Kiel, Germany)
For more information see: https://opendata.schleswig-holstein.de/dataset/guterumschlag-im-kieler-hafen
Version: 1.0
Python 3.7+
Date created: 03.06.2020
@niftycode
niftycode / kiel_bankruptcies.py
Created Jan 5, 2020
The bankruptcies in Kiel, Germany
View kiel_bankruptcies.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Unternehmensinsolvenzen in Kiel
The data is provided by the Open Data Portal Schleswig-Holstein, Germany
https://opendata.schleswig-holstein.de/dataset/unternehmensinsolvenzen-in-kiel
Version: 1.0
Python 3.8
@niftycode
niftycode / uk_general_election_2019.py
Last active Dec 29, 2019
UK General Election 2019 Bar Chart
View uk_general_election_2019.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
UK General Election 2019
Version: 1.1
Python 3.8
Date created: 28.12.2019
"""
@niftycode
niftycode / json_to_excel.py
Last active Dec 29, 2019
Read JSON data from a given URL and save the data as Excel file.
View json_to_excel.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Fetch JSON data and create an Excel file
Version: 1.1
Python 3.8
Date created: 14.12.2019
"""
@niftycode
niftycode / read_access_db.py
Created Feb 26, 2019
Read an Access Database using Python with the pyodbc module.
View read_access_db.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Read an Access Database using pyodbc
Version: 1.0
Python 3.7
Date created: 24.02.2019
"""
@niftycode
niftycode / koalition.py
Last active Dec 5, 2019
This is an example how to search for strings in a text file using Python 3
View koalition.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Program: koalition.py
Author: Bodo Schönfeld
Email: python@bodo-schoenfeld.de
Version: 1.2
Python 3.8
@niftycode
niftycode / traffic_accidents_kiel.py
Last active Oct 19, 2017
Use Kiel's OpenData to visualize traffic accidents with Python and Pandas
View traffic_accidents_kiel.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Traffic Accidents in Kiel, Germany
Python 3.6
last edited: 19/10/2017
The data is provided by the City of Kiel, Germany
https://www.kiel.de/