Skip to main content

Django Excel Tools

https://badge.fury.io/py/django-excel-tools.svg https://travis-ci.org/NorakGithub/django-excel-tools.svg?branch=master

Common function when working with excel.

Requirements

Installations

Install django-excel-tools

pip install django-excel-tools

Usage

Class declaration

from django_excel_tools import serializers


class OrderExcelSerializer(serializers.ExcelSerializers):
    REGION_CHOICES = ('Central', 'North', 'East', 'West', 'South')
    product_name = serializers.CharField(max_length=100, verbose_name='Product Name')
    quantity = serializers.IntegerField(verbose_name='Quantity', blank=True, default=0)
    price = serializers.IntegerField(verbose_name='Price')
    region = serializers.CharField(max_length=10, verbose_name='Region', choices=REGION_CHOICES)
    transaction_date = serializers.DateField(date_format='%Y-%m-%d', date_format_verbose='YYYY-MM-DD',
                                             verbose_name='Transaction Date')

    class Meta:
        start_index = 1
        fields = ('product_name', 'quantity', 'price', 'region', 'transaction_date')

Class initialization

from openpyxl import load_workbook


def import_order():
    workbook = load_workbook(file)  # Create workbook from file. Used openpyxl
    worksheet = workbook.worksheets[0]
    serializer = OrderExcelSerializer(worksheet=worksheet, **kwargs)

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2017-08-22)

  • First release on PyPI.

Metadata

Release files for django-excel-tools 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-excel-tools 0.0.6
File Size Uploaded Provenance Actions
django_excel_tools-0.0.6.tar.gz 16.1 kB Without provenance Details for django_excel_tools-0.0.6.tar.gz

Release files / django_excel_tools-0.0.6.tar.gz

Download URL django_excel_tools-0.0.6.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd7107060b06fb5783413d4aa5f021ebafc03ebae78d42bac0b56bed6409c486
BLAKE2b-256 checksum
How to use checksums
5ff04b76e94acaadebc11161f6c60f0ffc744eb11b299737a3fead6ff0c97078
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-excel-tools 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page