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
import glob | |
import os | |
import pathlib | |
import ntpath | |
import shutil | |
if __name__ == '__main__': | |
def get_image_files(_dir): | |
tif = glob.glob(f'{_dir}/**/*.tif', recursive=True) | |
jpg = glob.glob(f'{_dir}/**/*.jpg', recursive=True) |
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
import sys | |
from email.mime.text import MIMEText | |
from smtplib import SMTP_SSL, SMTPException | |
import logging | |
def admin_email(recipients, subject, content): | |
smtp_server = '' | |
sender = '' |
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
import os | |
folder = '' | |
x = True | |
while x: | |
renameables = [] | |
for root, dirs, _ in os.walk(folder): | |
for d in dirs: |
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
gdal_translate.exe -co COMPRESS=JPEG -co TILED=YES -co PHOTOMETRIC=RGB mosaic.tif mosaic_compressed.tif | |
gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHTOTMETRIC_OVERVIEW RGB --config INTERLEAVE_OVERVIEW PIXEL -r average mosaic.tif 2 4 8 16 |
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
import glob | |
from PyPDF2 import PdfFileMerger | |
import os | |
from datetime import datetime | |
now = datetime.now().isoformat().replace(':', '').replace('-', '').replace('.', '') | |
def get_pdf_files(dir_): | |
files = sorted(glob.glob(f'{dir_}\\*.pdf')) |