Skip to main content

Simple Excel and CSV file Generator

Project description

Simple Excel and CSV File Generator From Django Model.

Required Packages:

pip install pandas

Usage :

Django Models to Excel File:

from django_model_to_excel_csv import generate_excel_file

def func(request):
    queryset = User.objects.all().values()
    # queryset will be your model data
    # file_path : 'your absloute path' or it will store in your project Base Directory
    # file_name accepts string : 'string' 
    # sheet_name accepts string : 'string'
    # index and header : Boolean
    generate_excel = generate_excel_file.all_to_excel(queryset, file_path, file_name, sheet_name, index, header)

Django Models to CSV File:

from django_model_to_excel_csv import generate_csv_file

def func(request):
    queryset = User.objects.all().values()
    # queryset will be your model data
    # file_path : 'your absloute path' or it will store in your project Base Directory
    # file_name accepts string : 'string' 
    # sheet_name accepts string : 'string'
    # index and header : Boolean
    generate_excel = generate_excel_file.all_to_excel(queryset, file_path, file_name, sheet_name, index, header)

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_model_to_excel_csv-0.1.2.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

Supported by

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