Skip to content
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

Consider offering a reader/writer object based on a given dataframe #46

Open
robin900 opened this issue Mar 23, 2022 · 0 comments
Open

Comments

@robin900
Copy link
Owner

A writer object would mainly serve to automate the arguments passed to get_as_dataframe but also a little bit for set_with_dataframe:

from gspread_dataframe import make_reader_writer
ws = some_worksheet
df = some_dataframe
df2 = some_dataframe_with_same_columns
reader_writer = make_reader_writer(example=df, resize=True, include_index=True)
reader_writer.write(ws, df2)
df3 = reader_writer.read(ws)
print(reader_writer.get_as_dataframe_call_repr(numpy_alias='np'))
>>> "get_as_dataframe(worksheet, header=0, indexcol=0, dtype={'col1': object, 'col2': np.int64, 'col3': np.datetime64})"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant