Skip to content

Need an option to disable type inference / force strings in get_all_records() #1579

@prashantsbd

Description

@prashantsbd

I have been trying to get the data in structured dictionary format with get_all_records() as get_all_values() used to return the list of values alone. But it's really disgusting to always get the zero's starting numbers as direct int conversion which I wasn't ready for.

I saw much appreciation to this auto type referencing/ conversion but maybe a parameter with default value as current state and facilitating custom data type needs too which for me is string

currently the DIY solution that is working for me is
using the gspread.utils.to_records(headers, values)
to map get_all_values things as dictionaries
but doing so either I had to keep the spreadsheet heading orphan or get values from 2nd line to end

        ......
        values = worksheet.get_all_values()
        headers = values[0]
        rows = values[1:]
        record = spread.utils.to_records(headers, rows)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions