0
0

More than 3 years have passed since last update.

カレンダーでルーティン管理

Last updated at Posted at 2020-08-26

週ごとのルーティン管理。
Googleカレンダーや手書き、エクセルでも良いと思うのですが、
試行錯誤中は何かと変化もあると思うのでpythonで作ってみました。

日毎に分かれているので毎日チェックマークをつけて達成/非達成を確認する事が出来ます。

筋トレのメニュー管理や食事、英語学習などの管理をしています。

出力したcsvをフォーマット作ってあるエクセルに「値だけ貼り付け」して印刷して使っています。

シンプルがベストって感じです。

#!/usr/bin/env python
# coding: utf-8

# In[1]:


import pandas as pd
# import datetime as dt
# from datetime import datetime as dtdt
import calendar


# In[2]:


c = calendar.Calendar(firstweekday=0)


# In[3]:


cld = c.monthdayscalendar(2020, 8)


# In[4]:


routine = []
# routine.append(["","","","","","","",]) # 曜日ごとのルーティンを記載
routine.append(["a","b","c","d","e","f","",])

# routine.append(["" for _ in range(7)]) # 毎日同じルーティンを記載
# routine.append(["routine" for _ in range(7)]) # 毎日同じルーティンを記載

# In[5]:

week=["月","火","水","木","金","土","日"]


# In[6]:


df = pd.DataFrame(week).T
for i in range(len(cld)):
    df_cld = pd.DataFrame(cld[i]).T
    df_cld = pd.concat([df_cld,df_routine]).reset_index(drop = 1)
    [df_cld.drop(columns=i,inplace=True) for i in range(len(df_cld.T)) if df_cld.T[0][i] is 0] # 先月/来月を削除
    df = pd.concat([df,df_cld]).reset_index(drop = True)
df.to_csv('sc.csv')


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0