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.0.tar.gz (212.5 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.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: exdata-0.1.0.tar.gz
  • Upload date:
  • Size: 212.5 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.0.tar.gz
Algorithm Hash digest
SHA256 93f5f9755eec9b401e8c95766c9489dc053a883dfc78873950bfe9ec308e2511
MD5 6996a37720baf62235c37bd0507c1ab4
BLAKE2b-256 38defeb4fdb0c9daffa221ac17f962ce23fed4de17ca5a9d1af2724b8363e686

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: exdata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6169d591425f922e288fe4af8040eef3d54d60b4bb26bbc51a41e8d99aad0bce
MD5 e7ec1bc36f2084c495544d43917ed504
BLAKE2b-256 f8d5e9d8084fedd6e46fea2fa45fbc7324cbd990260a528c6de2d41a1779c188

See more details on using hashes here.

Provenance

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