Skip to main content

Create Excel files from CSVs using the GoodGrids API, based on an example Excel file template.

Project description

django-goodgrids

Django API for creating Excel files from CSV using the web-based GoodGrids API.

About GoodGrids

GoodGrids is a service for creating Excel files from CSV files programmatically. You upload an example Excel file to serve as a template. You can then use the GoodGrids API to create Excel files from CSV files based on this template. You can style cells, include formulas, and avoid all the issues that plague CSV files.

Using GoodGrids with class-based views

Let's assume your Django application already has a class-based view DownloadDataCSVView that returns a CSV file for your users to download. To create a view that let's your users download Excel files, use the following snippet:

from django_goodgrids.views import DownloadDataAsExcelView

class DownloadDataAsExcelView(GoodGridsExcelExportViewMixin, DownloadDataCSVView):
    goodgrids_api_url = 'https://goodgrids.com/create-excel-file/3a6c0d9ac7c74d'
    excel_file_name = 'data.xlsx'

Make sure to set goodgrids_api_url to your actual API URL.

You can then include this in your urls.py:

url(r'^download-data-as-excel-file/?$',
    views.DownloadDataAsExcelView.as_view(),
    name='download_data_as_excel_file'),

Using Goodgrids with function-based views

Let's assume your Django application already has a function-based view named download_data_as_csv_view that returns a CSV file for your users to download. To create a view that let's your users download Excel files, use the following snippet:

from django_goodgrids.views import create_goodgrids_excel_export_view

download_data_as_excel_view = create_goodgrids_excel_export_view(
    csv_export_view=download_data_as_csv_view,
    goodgrids_api_url='https://goodgrids.com/create-excel-file/3a6c0d9ac7c74d',
    excel_file_name='data.xlsx',
)

Make sure to set goodgrids_api_url to your actual API URL.

You can then include this in your urls.py:

url(r'^download-data-as-excel-file/?$',
    views.download_data_as_excel_view,
    name='download_data_as_excel_file'),

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-goodgrids-0.1.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

django_goodgrids-0.1.3-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-goodgrids-0.1.3.tar.gz.

File metadata

File hashes

Hashes for django-goodgrids-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6c80e33b3b9c3cdefe4df927620d800d6cd0e47e3329b7b51a4390ada1f1abff
MD5 2d75b541d7935dca712a5d80ab767155
BLAKE2b-256 4f03e0fe6ce2e96ebd0c48c3739242f36dc6e99908763a420ef643c344c27673

See more details on using hashes here.

File details

Details for the file django_goodgrids-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_goodgrids-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b0a22482e1503e64678d9a27897bb8cc04e5a43c779115cf2840cdc931374d31
MD5 08a40b4d4c7c9d1b9fdb6b93e15f3f23
BLAKE2b-256 a6663328eae35e6abfc93a34a202597514a7821ec50bd3ba0ccf8febe047c3bb

See more details on using hashes here.

Supported by

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