This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import pytesseract | |
from pdf2image import convert_from_path | |
# Convert the PDF to a list of images | |
images = convert_from_path('path_to_pdf.pdf') | |
# Process each image with Tesseract | |
for i, img in enumerate(images): | |
text = pytesseract.image_to_string(img, lang='eng') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.10 | |
WORKDIR /app | |
COPY . /app | |
RUN pip install uv | |
RUN uv pip install --system --no-cache-dir -r requirements.txt | |
CMD python -u main.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(jsonlite) | |
library(brio) | |
# where is the archive directory | |
dir_path <- "~/Downloads/twitter-archive/data" | |
# file in /data with the tweets | |
filename <- "tweets.js" | |
# get full file path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(jsonlite) | |
library(lubridate) | |
# specify local path to the downloaded JSON files | |
path <- "~/Downloads/Spotify Extended Streaming History/" | |
# get a list of all JSON files in the directory | |
json_files <- list.files(path, pattern = "*.json", full.names = TRUE) | |
# initialize an empty list to store the data |