Coder Social home page Coder Social logo

Porting to pandas df about pyairtable HOT 5 CLOSED

gtalarico avatar gtalarico commented on May 23, 2024
Porting to pandas df

from pyairtable.

Comments (5)

vlebert avatar vlebert commented on May 23, 2024 2

Just a few tries if it can help. For reading :

from airtable import Airtable
import pandas as pd
airtable = Airtable( base key, table_name, api_key = 'XXXX')
record_list = airtable.get_all()
df = pd.DataFrame([record['fields'] for record in record_list])

Or with index as record ID

df = pd.DataFrame([record['fields'] for record in record_list], index = [record['id'] for record in record_list])

For writing a row from DataFrame :

record=df.iloc[i].to_dict()
airtable.batch_insert([record])

Of course handling missing data, links between table may be more complicated

from pyairtable.

JasonCrowe avatar JasonCrowe commented on May 23, 2024

I would be interested in functionality that would let me push a pandas dataframe to airtable. Especially if it handles the filetype conversions. :D

from pyairtable.

gtalarico avatar gtalarico commented on May 23, 2024

Do you already have something like that working outside the library?
Curious how much code is required to add the feature.

from pyairtable.

getmykhan avatar getmykhan commented on May 23, 2024

Nope. Thinking of something along the lines of a strict JSON to bulk insert to airtables. Not sure if that is the most efficient way to do it though!

from pyairtable.

gtalarico avatar gtalarico commented on May 23, 2024

we could add a snippet to doc on how to do this but won't add any pandas functionality to the lib

from pyairtable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.