Skip to content

Instantly share code, notes, and snippets.

View ThibTrip's full-sized avatar

Thibault Bétrémieux ThibTrip

View GitHub Profile
@ThibTrip
ThibTrip / generate_subtitles_with_whisper.ipynb
Created May 11, 2024 21:38
generate_subtitles_with_whisper.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ThibTrip
ThibTrip / faster_whisper_helpers.py
Created May 11, 2024 21:28
Dependency for gist notebook `generate_subtitles_with_whisper.ipynb` (see my gists)
"""
Helpers for interacting more easily with `faster_whisper` especially when it comes
to generating subtitles.
Notes
-----
The code is quite strict / opionated (e.g. additional parameters cannot be passed for the transcription
than the ones I manually defined) as it was not meant to be shared initially and I did
not take time to "generalize" it more.
"""
@ThibTrip
ThibTrip / pangres_and_df_to_sql.ipynb
Last active February 7, 2021 15:38
Issue about using pangres.upsert and df.to_sql(if_exists='replace') in the same script
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
Module containing a function to preserve leading zeroes (and other symbols such as "+", spaces and
parentheses in phone numbers and zip codes) when reading data with pandas.
WARNING: Use this caution, I most likely haven't covered all cases in the tests I wrote.
"""
import inspect
import io
import pandas as pd
import re
@ThibTrip
ThibTrip / indices_in_pandas.ipynb
Last active August 18, 2021 16:49
This document shows very basic functionalities of indices in pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ThibTrip
ThibTrip / pandas_dataframe_postgres_benchmark.ipynb
Created August 23, 2020 13:21
Benchmark of inserting a pandas DataFrame into a new PostgreSQL table with different methods
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ThibTrip
ThibTrip / pervasive.py
Last active March 5, 2020 09:32
Pervasive SQL in Python 3.7 (tested 2020-05-03)
"""
Tested with Pop OS (an Ubuntu clone)
# **INSTALLATION**:
## Install Python dependencies
* pip install jaydebeapi # latest version was '1.1.1' at the time of writing the gist
* pip install JPype1==0.6.3 # IMPORTANT! (latest: 0.7.2 did not work)
## Get the Persavive SQL driver