Skip to content

Commit

Permalink
add readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
xyluo25 committed Mar 3, 2024
1 parent e973cee commit 5e0a677
Show file tree
Hide file tree
Showing 9 changed files with 254 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .pypirc

This file was deleted.

18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3"
jobs:
post_create_environment:
- pip install -r requirements_dev.txt
- pip install sphinx

sphinx:
configuration: docs/source/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 7 additions & 0 deletions docs/source/acknowledgement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
===============
Acknowledgement
===============

sqlalchemy-teradata is a fork of sqlalchemy-vertica, which is a fork of sqlalchemy-redshift, which is a fork of sqlalchemy-snowflake. All of these projects have been invaluable in the development of sqlalchemy-teradata.

pandas: http://pandas.pydata.org/
16 changes: 16 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=============
API Reference
=============


exceltosqlserver.ExcelToDB
---------------------------

.. .. autoclass:: exceltomysql.exceltoDBtable
.. :members:
..
.. automodule:: exceltosqlserver.exceltosqlserver
:members: ExcelToDB
:undoc-members:
:show-inheritance:
79 changes: 79 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
from pathlib import Path

current_dir = Path(__file__).parent.absolute()
docs_dir = current_dir.parent.absolute()
home_dir = docs_dir.parent.absolute()
src_dir = home_dir / "exceltosqlserver"


# go up one level from /docs/ to the package root
sys.path.insert(0, str(home_dir))


autodoc_mock_imports = [
"sqlalchemy",
"pandas",
"pyodbc",
"socket",
"pyufunc"
]

# -- Project information -----------------------------------------------------
project = 'exceltosqlserver'
copyright = '2020-, Xiangyong Luo'
author = 'Xiangyong Luo'

# The full version, including alpha/beta/rc tags
release = '0.2.5'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom

# -- Docstring preprocessing for autodoc
# autodoc_typehints = "both"

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
language = "en"
# needs_sphinx = "6" # same value as pinned in /docs/requirements.txt
root_doc = "index"
source_suffix = {'.rst': 'restructuredtext'}

# # Napoleon settings
# napoleon_google_docstring = True
# napoleon_numpy_docstring = True
# napoleon_include_init_with_doc = True
# napoleon_include_private_with_doc = True
# napoleon_include_special_with_doc = True
# napoleon_use_admonition_for_examples = False
# napoleon_use_admonition_for_notes = False
# napoleon_use_admonition_for_references = False
# napoleon_use_ivar = True
# napoleon_use_param = True
# napoleon_use_rtype = True

# pygments_style = "vs"

# Add any paths that contain templates here, relative to this directory.
templates_path = []
html_static_path = []

# html_theme = "sphinx_rtd_theme"

# -- Options for EPUB output
epub_show_urls = 'footnote'
53 changes: 53 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
exceltosqlserver
====================================
| **Authors**: Xiangyong Luo
| **Email**: [email protected]

exceltosqlserver is a tool to convert excel files (.xls, .xlsx, .csv) to mysql database.

**If you use exceltosqlserver in your research, please cite: https://github.com/xyluo25/exceltosqlserver**


**Package dependencies**
------------------------

* [X] sqlalchemy
* [X] pandas
* [X] pyodbc
* [X] pyufunc


**Call for Contributions**
--------------------------

The exceltosqlserver project welcomes your expertise and enthusiasm!

Small improvements or fixes are always appreciated. If you are considering larger contributions to the source code, please contact us through email:

Xiangyong Luo : [email protected]


Writing code isn't the only way to contribute to exceltosqlserver. You can also:

* review pull requests
* help us stay on top of new and old issues
* develop tutorials, presentations, and other educational materials
* develop graphic design for our brand assets and promotional materials
* translate website content
* help with outreach and onboard new contributors
* write grant proposals and help with other fundraising efforts

For more information about the ways you can contribute to exceltosqlserver, visit [our GitHub](https://github.com/xyluo25/exceltosqlserver). If you' re unsure where to start or how your skills fit in, reach out! You can ask by opening a new issue or leaving a comment on a relevant issue that is already open on GitHub.

Contents
====================================

.. toctree::
:maxdepth: 2

installation
quick-start
api
acknowledgement

19 changes: 19 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Installation
============

You can install the latest release of exceltosqlserver at `PyPI`_ via `pip`_:

.. code-block:: python
pip install exceltosqlserver
By running the command above, the exceltosqlserver package along with required dependency packages
(`sqlalchemy`_, `pandas`_) will be installed to your computer (if they have not been installed yet).


.. _`PyPI`: https://pypi.org/project/exceltosqlserver
.. _`pip`: https://packaging.python.org/key_projects/#pip
.. _`sqlalchemy`: https://github.com/sqlalchemy/sqlalchemy
.. _`pandas`: https://github.com/pandas-dev/pandas
.. _`our repository`: https://github.com/xyluo25/exceltosqlserver

42 changes: 42 additions & 0 deletions docs/source/quick-start.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
===========
Quick Start
===========

In this section, some examples are provided to quickly show how to use exceltosqlserver.


Simple Example
==============

.. code-block:: python
from exceltosqlserver import ExcelToDB, hostname, local_ip
# Step 1, prepare your input parameters
yourFile = "test01.xls" # available for xlsx, xls,csv
yourUsrID = ""
yourPWD = ""
yourDBname= ""
rename_table = "" # Use your filename as table name to MySQL Server or user define their preferred table name. e.g. : "test"
# get your local host name
# this will return your local computer name for your MySQL server database
host_name = hostname
# get your local ip address
# this will return your local ip address (if your sql server can be accessed by DNS)
IP = local_ip
yourHostOrIP = "localhost" # you need to change your host if needed, dns: local ip address
# Step 2, save your data onto MySQL
ex = ExcelToDB(yourFile, yourHoseOrIP, yourUsrID, yourPWD, yourDBname, rename_table)
ex.save2db()
# output:
# Successfully load excel data...
# Secessfully connected to SQL Server...
# Secessfully saved 'yourtable' to SQL Server...

0 comments on commit 5e0a677

Please sign in to comment.