Skip to content

Commit 2ac5644

Browse files
committed
feat: add export_name parameter
1 parent a716821 commit 2ac5644

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/python_notion_exporter/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(
4242
include_files: bool = False,
4343
recursive: bool = True,
4444
workers: int = multiprocessing.cpu_count(),
45+
export_name: str = None,
4546
):
4647
"""
4748
Initializes the NotionExporter class.
@@ -57,9 +58,14 @@ def __init__(
5758
include_files (bool, optional): If True, includes files in the export. Defaults to False.
5859
recursive (bool, optional): If True, exports will be recursive. Defaults to True.
5960
workers (int, optional): Number of worker threads for exporting. Defaults to the number of CPUs available.
61+
export_name (str, optional): Name of the export. Defaults to the current date and time.
6062
"""
6163

62-
self.export_name = f"export-{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}"
64+
self.export_name = (
65+
f"export-{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}"
66+
if not export_name
67+
else export_name
68+
)
6369
self.token_v2 = token_v2
6470
self.file_token = file_token
6571
self.include_files = include_files

0 commit comments

Comments
 (0)