8000 release 0.7.3 by chfw · Pull Request #291 · pyexcel/pyexcel · GitHub
[go: up one dir, main page]

Skip to content

release 0.7.3 #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Apr 12, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support pathlib in cookbook, #263
  • Loading branch information
chfw committed Apr 12, 2025
commit e2d4b5a453f7e80bbd32f1f11717260853bbfc4d
11 changes: 8 additions & 3 deletions pyexcel/cookbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from pyexcel.book import Book
from pyexcel.core import save_as, get_book, get_sheet
from pyexcel._compact import OrderedDict
from pyexcel._compact import OrderedDict, get_string_file_name
from pyexcel.constants import MESSAGE_WARNING

DEFAULT_OUT_FILE = "pyexcel_merged.csv"
Expand All @@ -32,9 +32,10 @@ def update_columns(in_file_name, column_dicts, out_file_name=None):


"""
in_file_name = get_string_file_name(in_file_name)
default_out_file = OUT_FILE_FORMATTER % in_file_name
if out_file_name:
default_out_file = out_file_name
default_out_file = get_string_file_name(out_file_name)
if os.path.exists(default_out_file):
raise NotImplementedError(MESSAGE_WARNING)
sheet = get_sheet(file_name=in_file_name, name_columns_by_row=0)
Expand All @@ -54,9 +55,10 @@ def update_rows(in_file_name, row_dicts, out_file_name=None):
:param dict row_dicts: dictionaries of rows
:param str out_file_name: save the sheet as
"""
in_file_name = get_string_file_name(in_file_name)
default_out_file = OUT_FILE_FORMATTER % in_file_name
if out_file_name:
default_out_file = out_file_name
default_out_file = get_string_file_name(out_file_name)
if os.path.exists(default_out_file):
raise NotImplementedError(MESSAGE_WARNING)
sheet = get_sheet(file_name=in_file_name, name_rows_by_column=0)
Expand All @@ -71,6 +73,7 @@ def merge_files(file_array, out_file_name=DEFAULT_OUT_FILE):
"""merge many files horizontally column after column
:param str out_file_name: save the sheet as
"""
out_file_name = get_string_file_name(out_file_name)
if os.path.exists(out_file_name):
raise NotImplementedError(MESSAGE_WARNING)
content = []
Expand All @@ -90,6 +93,7 @@ def merge_two_files(file1, file2, out_file_name=DEFAULT_OUT_FILE):
:param str file2: an accessible file name
:param str out_file_name: save the sheet as
"""
out_file_name = get_string_file_name(out_file_name)
if os.path.exists(out_file_name):
raise NotImplementedError(MESSAGE_WARNING)
files = [file1, file2]
Expand All @@ -102,6 +106,7 @@ def merge_readers(reader_array, out_file_name=DEFAULT_OUT_FILE):
With FilterableReader and SeriesReader, you can do custom filtering
:param str out_file_name: save the sheet as
"""
out_file_name = get_string_file_name(out_file_name)
if os.path.exists(out_file_name):
raise NotImplementedError(MESSAGE_WARNING)
content = OrderedDict()
Expand Down
0