Skip to main content

Export data to xlsx

Project description

Exdata

PyPI - Version Tests codecov

Exdata is a Python package for exporting data to Excel (xlsx) files with a focus on flexibility, customization, and ease of use. It provides a rich set of features for creating complex Excel documents with precise control over layout and formatting. Built on top of xlsxwriter, it leverages its robust Excel file generation capabilities while providing a more intuitive and flexible interface for complex document structures.

Features

  • Flexible Data Structure: Create complex layouts using nested rows and columns
  • Rich Text Formatting: Support for formatted text with different styles within a single cell
  • Customizable Layout: Control cell sizes, positions, and expansion behavior
  • Memory Efficient: Support for both in-memory and file-based operations

Installation

pip install exdata

Quick Start

Demo

from exdata import XlsxExporter, Sheet, Row, Cell, Column

formats = {
    'default': {
        'border': 1,
        'align': 'vcenter',
    },
    'header': {
        'border': 1,
        'align': 'center',
        'valign': 'vcenter',
        'bg_color': '#98D0FF',
        'bold': True,
    },
}
sheet = Sheet(
    name='Example',
    data=[
        Row(
            data=[
                Column([
                    Cell('User'),
                    Row([
                        Cell('First name'),
                        Cell('Last name'),
                    ]),
                ]),
                Cell('Age'),
                Column([
                    Cell('Contact Details'),
                    Row([
                        Cell('Email'),
                        Cell('Phone'),
                    ]),
                ]),
            ],
            format='header',
        ),
        Row(data=[
            Cell('John'),
            Cell('Doe'),
            Cell(30),
            Cell('john.doe@example.com'),
            Cell('+1 234-567-8901'),
        ]),
        Row(data=[
            Cell('Jane'),
            Cell('Smith'),
            Cell(28),
            Cell('jane.smith@example.com'),
            Cell('+1 234-567-8902'),
        ]),
        Row(data=[
            Cell('Bob'),
            Cell('Johnson'),
            Cell(35),
            Cell('bob.johnson@example.com'),
            Cell('+1 234-567-8903'),
        ]),
    ],
    format='default',
)


exporter = XlsxExporter(sheets=[sheet], formats=formats)

with open('data_grid_example.xlsx', 'wb') as f:
    f.write(exporter.export().read())

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

exdata-0.1.1.tar.gz (213.7 kB view details)

Uploaded Source

Built Distribution

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

exdata-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file exdata-0.1.1.tar.gz.

File metadata

  • Download URL: exdata-0.1.1.tar.gz
  • Upload date:
  • Size: 213.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for exdata-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a29c352d7506e1309536a3dadd2d850b9643d84134a2f7ce2912195ee88070b5
MD5 054796154712eb14e926725a410ab6a6
BLAKE2b-256 fe92d4e6a3aa07bb907e81dc6ab73d4643a49f37dc8b5fc550c09eb6bdac49b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for exdata-0.1.1.tar.gz:

Publisher: release.yml on kindlycat/exdata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file exdata-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: exdata-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for exdata-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce96a17c66c0dafd3fc452c731b7fcdd9fe30a956354850037a7cc5ff7291382
MD5 1c1d61e2a963a9e41ce371e8109f7b8b
BLAKE2b-256 ecb2cb3b8875355433146abbcfcfd03fe7f55f8ef6c283fae5aec2a0162fa9fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for exdata-0.1.1-py3-none-any.whl:

Publisher: release.yml on kindlycat/exdata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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