Skip to main content

A Django app to import tabular data from Google Sheets

Project description

django-gsheets-import

PyPI Documentation Status GitHub

The django-gsheets-import package is a Django application to facilitate data import from Google Sheets within Django's admin framework. It extends the great django-import-export package, which already provides import and export capabilities for all local file formats supported by tablib. Exporting data from Django's admin to Google Sheets is currently not supported but planned for a future release.

Below, we briefly outline how to install and use the package. A more detailed documentation about django-gsheets-import is available here.

Installation and configuration

The package and its dependencies can be installed from PyPI via pip install -U django-gsheets-import. To use the package in your Django project, just add import_export and gsheets_import to the list of installed apps in your settings.py, i.e.

## in settings.py
INSTALLED_APPS = [
    ...,
    'import_export',
    'gsheets_import',
    ...
]

In order for django-gsheets-import to work properly, it needs to be associated with an underlying Google Cloud Project (GCP). How to properly set up an appropriate GCP using the Google Cloud Console is described in more detail in the corresponding section of our documentation. At this point, let us just note that all of the services needed are available in Google Cloud's Free Tier, so that there is no need to set up a billing account. Assuming that a suitable GCP already exists, go to the Google Cloud Console and navigate to APIs & Services > Credentials. From there, copy an API key, as well as the desired OAuth Client ID and add them to your settings.py. The required project number can be found under IAM & Admin > Settings and must also be added to settings.py, i.e.

## in settings.py
GSHEETS_IMPORT_API_KEY = '<Your API developers key>'
GSHEETS_IMPORT_CLIENT_ID = '<Your OAuth Client ID>'
GSHEETS_IMPORT_APP_ID = '<Your project number>'

The package is now ready to be used with your Django project.

Features and usage

The django-gsheets-import package presented here strongly relies on the functionality provided by the django-import-export package. It extends that package by the option to allow the user to import data from their Google Sheets via the Django admin. The usage of django-gsheets-import is very similar to that of django-import-export, which is nicely documented here. It might also be instructive to have a look at the example Django project that ships with django-gsheets-import (see the documentation for more details).

In short, integrating the Google Sheets import feature offered by django-gsheets-import into your Django project's admin site is a two-step process:

  • Define a resource which determines how the fields of a given model translate to their import (and export) representations.
  • Define the admin interface of the considered model as a subclass of ImportGoogleModelAdmin or any of the other classes provided by the package's admin submodule, namely ImportGoogleMixin, ImportGoogleExportModelAdmin, and ImportGoogleExportMixin.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-gsheets-import-0.0.4.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_gsheets_import-0.0.4-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file django-gsheets-import-0.0.4.tar.gz.

File metadata

  • Download URL: django-gsheets-import-0.0.4.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for django-gsheets-import-0.0.4.tar.gz
Algorithm Hash digest
SHA256 418e5e9e472b869198e9b79136122c27ba6c477bac6e732c0500e41f6197d356
MD5 a79fd919023321ea2769726177dd2c69
BLAKE2b-256 c98f37355613e33e487e899a11d99d75c57e5951b57100ecf8ab7a047d53de67

See more details on using hashes here.

File details

Details for the file django_gsheets_import-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: django_gsheets_import-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for django_gsheets_import-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7ba1e5c1b0eee3e9ad93581a4c881bdc4c5292a676cd78a2e24ceccfbbbcfc54
MD5 ac4eb7e63ab425adf6b657b0f371dd2a
BLAKE2b-256 de3c1b83c2d8937e2ae712eba10df7feb737ff6e1da388b349df2bc5b2edb346

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page