Skip to content

Instantly share code, notes, and snippets.

View samirsaci's full-sized avatar

Samir Saci samirsaci

View GitHub Profile
@samirsaci
samirsaci / label_information.csv
Created October 1, 2022 16:21
Graphic Automation
SKU SKU Code Arrow Zone Cell Loc Location log arrow cat special
1 6549541941942 8 067 49 1 067-49-1 Pieces Arrow Red Dress GOH
2 6388908160619 1 064 13 2 064-13-2 Carton Arrow Red Rev Tie RFID
3 6035901125615 5 062 12 9 062-12-9 Carton Arrow Red Rev Shoes Lady Label
4 6380994358294 3 058 79 5 058-79-5 Carton Arrow Green Rev Jewelry Danger
5 7056603542859 2 055 76 8 055-76-8 Pieces Arrow Green Jewelry Sprinkler
@samirsaci
samirsaci / stacked.py
Created September 23, 2022 19:58
Automate PPT
# Bar Plot: split per lines per orders
fig, ax = plt.subplots(figsize=(12, 6))
df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[0], color='tab:blue', legend= True, ax = ax)
df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[1], color='tab:red', legend= True, ax = ax)
df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[2], color='tab:orange', legend= True, ax = ax)
df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[3], color='darkblue', legend= True, ax = ax)
df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[4], color='brown', legend= True, ax = ax)
df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[5], color='grey', legend= True, ax = ax)
plt.xlabel('Week', fontsize = 14)
plt.ylabel('Number of Orders', fontsize = 14)
@samirsaci
samirsaci / final_slide.py
Created September 17, 2022 13:19
Automate PPT
# Add Analysis lines
total_orders, LIST_ANALYSIS = plot_split(df_lior)
# Create a slide
slide = prs.slides.add_slide(image_slide_layout)
shapes = slide.shapes
# Create Title
title_shape = shapes.title
title_shape.text = 'Order Profile'
# Add Image
@samirsaci
samirsaci / daily_orders.py
Created September 17, 2022 13:14
Automate PPT
'''Slides Analysis per Week'''
for WEEK in LIST_WEEKS:
# Create Plot
avg_ratio, max_ratio, busy_day, max_lines, total_lines = analysis_week(df_day, WEEK)
# Create a slide
slide = prs.slides.add_slide(image_slide_layout)
shapes = slide.shapes
# Create Title
@samirsaci
samirsaci / introduction.py
Created September 17, 2022 13:00
Automate PPT
# Create the presentation object
prs = Presentation()
# Layout Choice for the introduction slide
image_slide_layout = prs.slide_layouts[5]
page = 1
'''Slide Introduction'''
# Create the slide
title_slide_layout = prs.slide_layouts[0]
@samirsaci
samirsaci / records.csv
Last active October 3, 2023 11:11
Control Tower
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 30 columns, instead of 8. in line 2.
Order Time,Order Date,City,Store,#Shipment,Order Amount,Transmission OnTime,Transmission,Start PickPack,Pickpack,Loading,Expected Loading Date,Loading OnTime,Loading Date,Airport Arrival,Airport OnTime,Airport Arrival Date,Takeoff,Landing,Landing Date,Landing OnTime,Start Clearance,End Clearance,Leaving Airport,Store Arrival,Store Arrival Date,Delivery OnTime,Delivery Time,Extraction Time,Last Status
2021-05-02 17:00:00.000000,2021-05-02,CITY1,CITY1/ST8,2021-05-02/CITY1/ST8/1,9538,False,2021-05-03 17:00:00.000000,2021-05-04 07:00:00.000000,2021-05-04 15:08:01.811817,2021-05-04 19:00:00.000000,2021-05-04,True,2021-05-04,2021-05-04 22:28:26.955442,True,2021-05-04,2021-05-05 06:00:00.000000,2021-05-05 18:45:10.610100,2021-05-05,True,2021-05-06 09:00:00.000000,2021-05-06 11:14:17.533875,2021-05-06 12:07:20.920092,2021-05-06 17:01:17.840106,2021-05-06,False,2021-05-07 16:30:00.000000,2021-05-11 10:00:00,Delivery Time
2021-05-09 12:00:00.000000,2021-05-09,CITY2,CITY2/ST9,2021-05-09/CITY2/ST9/2,5735,True,2021-05-09
@samirsaci
samirsaci / gtts.py
Created September 11, 2022 08:13
Productivity
from gtts import gTTS
import pandas as pd
import xlrd
def do_TTS(hanzi):
tts = gTTS(text=hanzi, lang='zh-CN')
# Filename
filename = hanzi[0:10] + '.mp3'
# Save
tts.save(filename)
@samirsaci
samirsaci / pinyin.py
Last active September 11, 2022 08:01
Productivity
import pandas as pd
import jieba, itertools
def to_pinyin(sentence):
segments = jieba.cut(sentence)
output = " ".join(segments)
pinyined = pinyin(output)
combined = list(itertools.chain.from_iterable(pinyined))
return ''.join(combined)
# Import
@samirsaci
samirsaci / pdf.py
Created September 10, 2022 18:19
Productivity
import PyPDF2
# Open the report
pdfFileObj = open('example.pdf', 'rb')
# Launch pdf reader object
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
# number of pages in pdf
n_pages = pdfReader.numPages)
@samirsaci
samirsaci / read_email.py
Created September 10, 2022 18:14
Productivity
import win32com.client
import os
from datetime import datetime, timedelta
# Initiate the Outlook Session
outlook = win32com.client.Dispatch('outlook.application')
mapi = outlook.GetNamespace("MAPI")
# Select the folder 6 to get the emails
inbox = mapi.GetDefaultFolder(6)