This commit is contained in:
olari
2021-05-19 21:28:09 +03:00
parent ca7ce0e37c
commit bdaeb1fb95
4 changed files with 1260 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
**/*.csv
.ipynb_checkpoints/

1051
Untitled.ipynb Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -119,7 +119,8 @@ total_words = 0
word_frequency = Counter()
total_csv = [['day', 'entries', 'words']]
daily_csv = [['day', 'entries', 'words', 'calories', 'protein']]
daily_csv = [['day', 'entries', 'words', 'calories', 'carbs', 'fat', 'protein',
'sugar']]
entry_csv = [['timestamp', 'words']]
words_csv = [['word', 'count']]
@@ -137,6 +138,9 @@ for fpath in sorted((Path.home() / 'workspace' / 'journal').glob('*.md')):
daily_words = 0
daily_calories = 0.0
daily_protein = 0.0
daily_carbs = 0.0
daily_fat = 0.0
daily_sugar = 0.0
for (timestamp, content) in sorted(entries, key=lambda x: x[0]):
timestamp = int(datetime.strptime(timestamp, '%Y-%m-%d %H:%M:%S').timestamp())
@@ -183,6 +187,9 @@ for fpath in sorted((Path.home() / 'workspace' / 'journal').glob('*.md')):
daily_calories += food.get('Energy', 0.0)
daily_protein += food.get('Protein', 0.0)
daily_fat += food.get('Fat', 0.0)
daily_carbs += food.get('Carbs', 0.0)
daily_sugar += food.get('Sugar', 0.0)
words = ''.join(
c if c in string.ascii_letters+"'" else ' '
@@ -196,8 +203,19 @@ for fpath in sorted((Path.home() / 'workspace' / 'journal').glob('*.md')):
entry_csv.append([timestamp, entry_words])
daily_csv.append([day, daily_entries, daily_words, daily_calories,
daily_protein])
daily_macros = daily_protein + daily_fat + daily_carbs
daily_csv.append([
day,
daily_entries,
daily_words,
round(daily_calories, 2),
round(100 * (daily_carbs / daily_macros) if daily_carbs else 0, 2),
round(100 * (daily_fat / daily_macros) if daily_fat else 0, 2),
round(100 * (daily_protein / daily_macros) if daily_protein else 0, 2),
round(daily_protein, 2),
round(daily_sugar, 2)
])
total_entries += daily_entries
total_words += daily_words

187
foods
View File

@@ -1,4 +1,72 @@
CheesePizza
Energy 210kcal
Fat 5.3g
SaturatedFat 2.4g
Carbs 30.6g
Sugar 3.9g
Protein 8.9g
Salt 0.9g
ChiliBeans
Energy 85kcal
Carbs 12g
Sugar 2.5g
Fiber 5.8g
Protein 6.0g
Salt 0.65g
ProteinPowder
Energy 369kcal
Fat 5.4g
SaturatedFat 3.4g
Carbs 7.2g
Sugar 6.8g
Protein 72.0g
Salt 0.3g
KasviGrillimakkara
Energy 234kcal
Fat 15.2g
SaturatedFat 5.9g
Carbs 12.1g
Fiber 4.5g
Protein 10.0g
Salt 1.55g
Remoulade
Energy 486kcal
Fat 50.3g
SaturatedFat 4.0g
Carbs 7.0g
Sugar 5.2g
Protein 0.8g
Salt 1.04
ItaliamoGlassate
Energy 537kcal
Fat 32g
SaturatedFat 19g
Carbs 54g
Sugar 25g
Protein 7.3g
Salt 1g
LeipaJuusto
Energy 276kcal
Fat 22g
SaturatedFat 14g
Carbs 3.5g
Sugar 2.8g
Protein 16g
Pomegranate
Energy 83kcal
Carbs 19g
Fiber 4g
Sugar 14g
Protein 1.7g
RainbowNoodles
Energy 451kcal
Fat 18g
@@ -36,6 +104,13 @@ SaturatedFat 2.3g
Protein 3.2g
Salt 0.1g
SkimMilk
Energy 46kcal
Fat 1.5g
SaturatedFat 1.0g
Protein 3.4g
Salt 0.1g
BellPepper
Energy 31kcal
Protein 1g
@@ -196,6 +271,14 @@ Sugar 2.5g
Fiber 4g
Protein 13g
TricolorePasta
Energy 351kcal
Fat 1.4g
SaturatedFat 0.3g
Carbs 72g
Sugar 3.9g
Protein 11g
SaskiaPeach
Energy 16kcal
Sugar 4g
@@ -323,6 +406,14 @@ Sugar 19.9g
Protein 3.2g
Salt 0.12g
Strawberry
Energy 33kcal
Carbs 8g
Fiber 2g
Sugar 4.9g
Protein 0.7g
Fat 0.3g
Cocoa
Energy 373kcal
Fat 2.9g
@@ -394,6 +485,75 @@ Sugar 6g
Fiber 0.4g
Protein 0.6g
Pringles
Energy 536kcal
Fat 32g
SaturatedFat 3g
Carbs 56g
Sugar 2.4g
Fiber 2.9g
Protein 4.6g
Salt 1.4g
GelatiPremium
Energy 339kcal
Fat 21.3g
SaturatedFat 13.1g
Carbs 30.7g
Sugar 28.5g
Protein 5.4g
Salt 0.08g
Hummus
Energy 278kcal
Fat 23.8g
SaturatedFat 2.7g
Carbs 7.7g
Sugar 0.2g
Protein 6.8g
Salt 0.92g
PureOrangeJuice
Energy 45kcal
Fat 0.2g
Carbs 9.4g
Sugar 9.4g
Protein 0.08g
Cucumber
Energy 15kcal
Carbs 3.6g
Sugar 1.7g
Fiber 0.5g
Protein 0.7g
Falafel
Energy 219kcal
Fat 8.5g
SaturatedFat 0.7g
Carbs 19.9g
Sugar 4.1g
Fiber 9.9g
Protein 10.7g
Salt 1.4g
SunflowerSeeds
Energy 616kcal
Fat 53.9g
SaturatedFat 4.5g
Carbs 5.1g
Sugar 3.4g
Protein 21.4g
Salt 0.05
HalloumiCheese
Energy 319kcal
Fat 25g
SaturatedFat 16g
Carbs 1.5g
Protein 22.0g
Salt 2.7g
---
Omlette
@@ -483,3 +643,30 @@ Oatmeal 150g
Margarine 14g
Honey 25g
TOTAL 700g
BakedPotatoes
Potato 1440g
Oil 40g
SeedAndOilSalad
Salad 120g
Cucumber 120g
CherryTomatoes 120g
Oil 15g
SunflowerSeeds 20g
FriedFalafel
Falafel 400g
Oil 30g
PastaSalad
TricolorePasta 500g
Salad 300g
Oil 20g
SaladDressing 65g
TOTAL 1675g
ProteinShake
SkimMilk 400g
ProteinPowder 60g