Skip to main content

Package to write data from database to excel files

Project description

EaseExcel

EaseExcel is a Python package designed to facilitate the transfer of data from databases to Excel. It seamlessly integrates with SQLAlchemy, supporting connections to various database types.

Installation

If you encounter any errors during installation, you may need to install the following packages before trying again:

pip install SQLAlchemy XlsxWriter

Usage

# Import statments
from sqlalchemy import create_engine
from sqlalchemy import text
import asyncio

from EaseExcel.src.Excel.ease_excel import EaseExcel
# Example 1
async def main():
    """
    In this example providing sql alchmey engine and sql query as argument

    These are required argument
    
    """
    engine = create_engine('postgresql+psycopg2://username:password@host:port/database')
   
    query = "select * from posts"

    await EaseExcel(
        sqlalchemy_engine=engine,
        SQL_query=query).build()

asyncio.run(main())
# Example 2
async def main():
    """
    In this example providing sql alchmey engine, sql query and filename as argument

    file_name: it is optional argument if filename is not provided file will we created with
    default name.
    
    """
    engine = create_engine('postgresql+psycopg2://username:password@host:port/database')
   
    query = "select * from posts"

    await EaseExcel(
        sqlalchemy_engine=engine,
        SQL_query=query,
        file_name='Posts').build()

asyncio.run(main())
# Example 3
async def main():
    """
    In this example providing sql alchmey engine, sql query and filename as argument

    file_name: it is optional argument if filename is not provided file will we created with
    default name.

    file_path: it is also a optional argument if this is not provided file will be create in current directory.
    
    """
    engine = create_engine('postgresql+psycopg2://username:password@host:port/database')
   
    query = "select * from posts"

    await EaseExcel(
        sqlalchemy_engine=engine,
        SQL_query=query,
        file_name='Posts'.
        file_path='<path>').build()

asyncio.run(main())

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

EaseExcel-1.0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

EaseExcel-1.0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file EaseExcel-1.0.2.tar.gz.

File metadata

  • Download URL: EaseExcel-1.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for EaseExcel-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7d45d26d05c148b44b7022350529764cf96bbef42696aaff51ee5f20ceceafd9
MD5 92b1380f6ecd7b3889d689cae9f304c5
BLAKE2b-256 c1b6f49448b08db72c0712b1817020aa6acf6c2db1d37bb8a0b8612997b1042d

See more details on using hashes here.

File details

Details for the file EaseExcel-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: EaseExcel-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for EaseExcel-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d85a887e68de5d3b41b1e875ac298e1677139696cbcd36bf001be096bd3f127
MD5 5e26905a642f7f0ef9d1940d1fc9d674
BLAKE2b-256 fc594bc23cddf98924f1cc4e6ddf139e254bb273d72abf661fd31aebdffab93e

See more details on using hashes here.

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