This package converts dataframe to csv,Html,Xml
Project description
Dataframe to CSV,HTML and XML converter
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
Release history Release notifications | RSS feed
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
Close
Hashes for dataframeXconverter-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dc796c72a6c12d744f4192b899a6c0a1a52f9bd8e86b80b2425178a178bedd8 |
|
MD5 | 026c86484d95aa459d4cfb4535ef7423 |
|
BLAKE2b-256 | f6dd4aa4d4f056cb0656751c5dedf96a6b48e122992283dc23150ad4421aa17d |