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

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

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

Uploaded Python 3

File details

Details for the file dataframeXconverter-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dataframeXconverter-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.4

File hashes

Hashes for dataframeXconverter-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc796c72a6c12d744f4192b899a6c0a1a52f9bd8e86b80b2425178a178bedd8
MD5 026c86484d95aa459d4cfb4535ef7423
BLAKE2b-256 f6dd4aa4d4f056cb0656751c5dedf96a6b48e122992283dc23150ad4421aa17d

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