Skip to main content

This package converts dataframe to csv,Html,Xml

Project description

Dataframe to CSV,HTML and XML converter

forthebadge made-with-python

Description

This is a package that converts your dataframe to csv,xml and html.This package has three funtions to

  • Convert dataframe to csv
  • Convert dataframe to xml
  • Convert dataframe to html

Usage

  • Run Following command to install.
 pip install dataframeXconverter

Example of How to use.

Make sure the dataframe you are passing is not an empty one.

import dataframeXconverter

# to convert dataframe to csv
df_to_csv(dataframe, "filename.csv")

# to convert dataframe to xml
df_to_csv(dataframe, "filename.xml")

# to convert dataframe to html
df_to_csv(dataframe, "filename.html")

Error and Exception Handling

I have included some error and exception handling in the code,if you want then you can log them. Im just throwing(raise) it ,you have to catch it in your script.

# in csv function

    if not isinstance(dataframe, pd.DataFrame):
       raise AttributeError('dataframe arg in df_to_csv() is not a dataframe')
   if not isinstance(filename, str) or not filename.endswith('.csv'):
       raise NameError('Please Provide Valid CSV File Name')

# in xml funtion

   if not isinstance(dataframe, pd.DataFrame):
       raise AttributeError('dataframe arg in df_to_xml() is not a dataframe')
   if not isinstance(filename, str) or not filename.endswith('.xml'):
       raise NameError('Please Provide Valid XML File Name')

# in html function

   if not isinstance(dataframe, pd.DataFrame):
       raise AttributeError('dataframe arg in df_to_html() is not a dataframe')
   if not isinstance(filename, str) or not filename.endswith('.html'):
       raise NameError('Please Provide Valid HTML File Name')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

dataframeXconverter-0.0.2-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page