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.2.tar.gz (213.8 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.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for exdata-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6cbdabe3347e744ba3011fc26664c5d639c8e2e37941cdb690752d32e1dfcdd8
MD5 0cf6fb7ba712e709bce8085778ba8552
BLAKE2b-256 1af3837ed973dff08f42b5fa5618c73234495032d1d371abb26b87051cc7375e

See more details on using hashes here.

Provenance

The following attestation bundles were made for exdata-0.1.2.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.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for exdata-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fe4371bcd6faf7fe9ffca95342f00ca60a2e289ab5ac744b03f5d21d0c425612
MD5 3ec96b842c07257364b31bf11ef3c049
BLAKE2b-256 f3a01c7150ce4466ca29b56d4ac4bda8e6d570327ccda3b6d450d345cc2455c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for exdata-0.1.2-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