Package: airscraper
AirscraperA simple scraper to download csv from any airtable shared view programatically, think of it as a programatic way of downloading csv from airtable shared view.
Use it if:You want to download a shared view periodicallyYou don't mind the shared view to be accessed basically without authorizationRequirementsBecause its a simple scraper, basically only beautifulsoup is neededBeautifulSoup4PandasInstallationUsing pip (Recommended)pip install airscraperBuild From SourceInstall build dependencies:pipinstall--upgradepipsetuptoolswheel
pipinstalltqdm
pipinstall--user--upgradetwineBuild the Packagepython setup.py bdist_wheelInstall the built Packagepip install --upgrade dist/airscraper-0.1-py3-none-any.whlUse it without adding python in front of itairscraper [url]Direct Execution (Testing Purpose)Clone this projectInstall the requirementspip install -r requirements.txtrun the codepython airscraper/airscraper.py [url]UsageCreate ashared view linkand use that link to download the shared view into csv. All[url]mentioned in the examples are referring to the shared view link you get from this step.As CLI# Print Result to Terminalpythonairscraper/airscraper.py[url]# Pipe the result to csv filepythonairscraper/airscraper.py[url]>[filename].csvAs Python PackagefromairscraperimportAirScraperclient=AirScraper([url])data=client.get_table().text# print the resultprint(data)# save as filewithopen('data.csv','w')asf:f.write(data)# use it with pandasfromioimportStringIOimportpandasaspddf=pd.read_csv(StringIO(data),sep=',')df.head()Helpusage: airscraper [-h] [-l LOCALE] [-tz TIMEZONE] view_url

Download CSV from Airtable Shared View Link, You can pass the result to file using
'> name.csv'

positional arguments:
  view_url              url generated from sharing view using link in airtable

optional arguments:
  -h, --help            show this help message and exit
  -l LOCALE, --locale LOCALE
                        Your locale, default to 'en'
  -tz TIMEZONE, --timezone TIMEZONE
                        Your timezone, use URL encoded string, default to
                        'Asia/Jakarta'What's nextCurrently I'm thinking of several things in mind:✅ Making this installed packageAdds accessibility to use it in FaaS Platform (most use case I could thought of are related to this)✅ Create a proper package that can be imported (so I could use it in my ETL script)✅ Fill in LICENSE and setup.py, (to be honest I have no idea yet what to put into it)It turns out there are a lot of resourcesout thereif you know what to look for :)ContributingIf you have similar problem or have any idea to improve this package please let me know in the issues or just hit me up on twitter@BanditelolRPDevelopmentIf you're going to try to develop it yourself, here's my overall workflow1. Create a virtual environmentI usually usedvenvon python 3.8 to create a new virtualenvironmentpython-mvenvvenv# and activate the environmentsourcevenv/bin/activate2. Create a virtual environmentInstall necessary requirements and install the package for development using editablepipinstallwheelspytest-q
pipinstall-rrequirements.txt
pipinstall-e.3. Play around with the codeYou can browse the notebook for explanation on how it works and some example use case, and I really appreciate helps in documentation and testing. Have fun!