github-heatmap 1.1.5__tar.gz → 1.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/PKG-INFO +1 -1
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/README.md +1 -3
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/cli.py +5 -7
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/drawer.py +0 -2
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/notion_loader.py +34 -6
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap.egg-info/PKG-INFO +2 -2
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/setup.py +1 -1
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/LICENSE +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/__init__.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/__main__.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/circluar_drawer.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/config.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/err.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/html_parser/__init__.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/html_parser/github_parser.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/html_parser/gitlab_parser.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/html_parser/jike_parse.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/html_parser/kindle_parser.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/__init__.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/apple_health_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/base_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/bbdc_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/bilibili_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/chatgpt_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/cichang_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/config.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/covid_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/dota2_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/duolingo_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/forest_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/from_github_issue_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/garmin_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/github_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/gitlab_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/gpx_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/jike_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/json_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/kindle_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/leetcode_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/multiple_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/neodb_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/nrc_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/ns_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/openlanguage_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/shanbay_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/strava_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/summary_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/todoist_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/wakatime_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/weread_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/youtube_loader.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/poster.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/skyline/__init__.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/skyline/config.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/skyline/font/__init__.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/skyline/skyline.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/structures.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/utils.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap.egg-info/SOURCES.txt +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap.egg-info/dependency_links.txt +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap.egg-info/entry_points.txt +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap.egg-info/requires.txt +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap.egg-info/top_level.txt +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/pyproject.toml +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/setup.cfg +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/tests/__init__.py +0 -0
- {github_heatmap-1.1.5 → github_heatmap-1.1.7}/tests/test_poster_utils.py +0 -0
|
@@ -738,6 +738,4 @@ python3 -m github_heatmap neodb --neodb_token <token> --mark_type <complete, wis
|
|
|
738
738
|
|
|
739
739
|
谢谢就够了
|
|
740
740
|
|
|
741
|
-
Just enjoy it
|
|
742
|
-
|
|
743
|
-
python3 -m github_heatmap notion --notion_token "secret_xvMkQzLkCRtZL478L8MhvLdIDOxicjjSUm9U9voAwbb" --database_id "cf6359306f94456da01908af73191a61" --date_prop_name "时间" --value_prop_name "金币" --unit "金币" --year 2024 --me "哈哈哈" --without-type-name --with-animation --background-color=#FFFFFF --track-color=#f44336 --special-color1=#ffd966 --special-color2=#549F57 --dom-color=#EBEDF0 --text-color=#000000
|
|
741
|
+
Just enjoy it
|
|
@@ -99,11 +99,11 @@ def run():
|
|
|
99
99
|
|
|
100
100
|
if args.type not in ["multiple", "summary"]:
|
|
101
101
|
tracks, years = loader.get_all_track_data()
|
|
102
|
-
years = reduce_year_list(years, tracks)
|
|
103
|
-
if not years: # check to handle empty year lists
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
# years = reduce_year_list(years, tracks)
|
|
103
|
+
# if not years: # check to handle empty year lists
|
|
104
|
+
# raise ValueError(
|
|
105
|
+
# "No data available for the specified years or type. Please check your user name!"
|
|
106
|
+
# )
|
|
107
107
|
if args.unit:
|
|
108
108
|
p.units = args.unit
|
|
109
109
|
else:
|
|
@@ -142,8 +142,6 @@ def run():
|
|
|
142
142
|
+ poster_length
|
|
143
143
|
* (YEAR_FONT_SIZE + MONTH_FONT_SIZE+DOM_BOX_PADING*3 + (DOM_BOX_PADING + DOM_BOX_TUPLE[0]) * 7)
|
|
144
144
|
)
|
|
145
|
-
print(f"高度 = {p.height}")
|
|
146
|
-
print(f"宽度 = {p.width}")
|
|
147
145
|
if not os.path.exists(OUT_FOLDER):
|
|
148
146
|
os.mkdir(OUT_FOLDER)
|
|
149
147
|
# support different issues, maybe better way
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from datetime import datetime, timedelta
|
|
1
2
|
import time
|
|
2
3
|
from collections import defaultdict
|
|
3
4
|
|
|
@@ -14,11 +15,12 @@ class NotionLoader(BaseLoader):
|
|
|
14
15
|
|
|
15
16
|
def __init__(self, from_year, to_year, _type, **kwargs):
|
|
16
17
|
super().__init__(from_year, to_year, _type)
|
|
17
|
-
self.number_by_date_dict =
|
|
18
|
+
self.number_by_date_dict = self.generate_date_dict(from_year, to_year)
|
|
18
19
|
self.notion_token = kwargs.get("notion_token", "")
|
|
19
20
|
self.database_id = kwargs.get("database_id", "")
|
|
20
21
|
self.date_prop_name = kwargs.get("date_prop_name", "")
|
|
21
22
|
self.value_prop_name = kwargs.get("value_prop_name", "")
|
|
23
|
+
|
|
22
24
|
@classmethod
|
|
23
25
|
def add_loader_arguments(cls, parser, optional):
|
|
24
26
|
parser.add_argument(
|
|
@@ -51,7 +53,21 @@ class NotionLoader(BaseLoader):
|
|
|
51
53
|
)
|
|
52
54
|
|
|
53
55
|
def get_api_data(self, start_cursor="", page_size=100, data_list=[]):
|
|
54
|
-
payload = {
|
|
56
|
+
payload = {
|
|
57
|
+
"page_size": page_size,
|
|
58
|
+
"filter": {
|
|
59
|
+
"and": [
|
|
60
|
+
{
|
|
61
|
+
"property": self.date_prop_name,
|
|
62
|
+
"date": {"on_or_after": f"{self.from_year}-01-01"},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"property": self.date_prop_name,
|
|
66
|
+
"date": {"on_or_before": f"{self.to_year}-12-31"},
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
}
|
|
55
71
|
if start_cursor:
|
|
56
72
|
payload.update({"start_cursor": start_cursor})
|
|
57
73
|
|
|
@@ -85,20 +101,32 @@ class NotionLoader(BaseLoader):
|
|
|
85
101
|
start_cursor=next_cursor, page_size=page_size, data_list=data_list
|
|
86
102
|
)
|
|
87
103
|
|
|
104
|
+
def generate_date_dict(self, start_year, end_year):
|
|
105
|
+
start_date = datetime(start_year, 1, 1)
|
|
106
|
+
end_date = datetime(end_year, 12, 31)
|
|
107
|
+
|
|
108
|
+
# 使用字典推导式生成日期字典
|
|
109
|
+
return {
|
|
110
|
+
(start_date + timedelta(days=i)).strftime("%Y-%m-%d"): 0
|
|
111
|
+
for i in range((end_date - start_date).days + 1)
|
|
112
|
+
}
|
|
113
|
+
|
|
88
114
|
def make_track_dict(self):
|
|
89
115
|
data_list = self.get_api_data()
|
|
90
|
-
# print(data_list)
|
|
91
116
|
for result in data_list:
|
|
92
117
|
date = result["properties"][self.date_prop_name]["date"]
|
|
93
118
|
value = result["properties"][self.value_prop_name]
|
|
94
119
|
if date and value:
|
|
95
120
|
dt = date.get("start")
|
|
96
121
|
type = value.get("type")
|
|
97
|
-
if
|
|
122
|
+
if type == "formula" and value.get(type).get("type") == "number":
|
|
123
|
+
value = int(value.get(type).get("number"))
|
|
124
|
+
elif type == "rollup" and value.get(type).get("type") == "number":
|
|
98
125
|
value = int(value.get(type).get("number"))
|
|
99
|
-
|
|
100
126
|
date_str = pendulum.parse(dt).to_date_string()
|
|
101
|
-
self.number_by_date_dict[date_str] =
|
|
127
|
+
self.number_by_date_dict[date_str] = (
|
|
128
|
+
self.number_by_date_dict.get(date_str, 0) + value
|
|
129
|
+
)
|
|
102
130
|
for _, v in self.number_by_date_dict.items():
|
|
103
131
|
self.number_list.append(v)
|
|
104
132
|
|
|
@@ -6,7 +6,7 @@ setup(
|
|
|
6
6
|
author_email="linkang.ma@gmail.com",
|
|
7
7
|
url="https://github.com/malinkang/GitHubPoster",
|
|
8
8
|
license="MIT",
|
|
9
|
-
version="1.1.
|
|
9
|
+
version="1.1.7",
|
|
10
10
|
description="Make everything a GitHub svg poster and Skyline!",
|
|
11
11
|
packages=find_packages(),
|
|
12
12
|
include_package_data=True,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_heatmap-1.1.5 → github_heatmap-1.1.7}/github_heatmap/loader/from_github_issue_loader.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|