pandas-plots 0.0.3__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas-plots
3
- Version: 0.0.3
3
+ Version: 0.3.1
4
4
  Summary: A collection of helper for pandas n plots
5
5
  Author-email: smeisegeier <dsexterDSDo@googlemail.com>
6
6
  License: Copyright 2024 smeisegeier
@@ -11,10 +11,18 @@ License: Copyright 2024 smeisegeier
11
11
 
12
12
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
13
 
14
- Project-URL: Homepage, https://github.com/smeisegeier/pandas-plots
14
+ Project-URL: homepage, https://github.com/smeisegeier/pandas-plots
15
+ Project-URL: repository, https://github.com/smeisegeier/pandas-plots
15
16
  Keywords: tables,pivot,plotly
16
17
  Classifier: License :: OSI Approved :: MIT License
17
18
  Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Development Status :: 5 - Production/Stable
21
+ Classifier: Development Status :: 3 - Alpha
22
+ Classifier: Environment :: Console
23
+ Classifier: Intended Audience :: Science/Research
24
+ Classifier: Operating System :: OS Independent
25
+ Classifier: Topic :: Scientific/Engineering
18
26
  Requires-Python: >=3.10
19
27
  Description-Content-Type: text/markdown
20
28
  License-File: LICENSE
@@ -22,15 +30,13 @@ Requires-Dist: pandas>=2.0.0
22
30
  Requires-Dist: plotly
23
31
  Requires-Dist: matplotlib
24
32
  Requires-Dist: seaborn
33
+ Requires-Dist: sqlalchemy<2.0.0
25
34
 
26
35
  # pandas-plots
27
36
 
28
- <!-- [![GitHub release](https://img.shields.io/github/release/Naereen/StrapDown.js.svg)](https://GitHub.com/Naereen/StrapDown.js/releases/) -->
29
- <!-- [![GitHub latest commit](https://badgen.net/github/last-commit/Naereen/Strapdown.js)](https://GitHub.com/Naereen/StrapDown.js/commit/) -->
37
+ ![PyPI - Version](https://img.shields.io/pypi/v/pandas-plots) ![GitHub last commit](https://img.shields.io/github/last-commit/smeisegeier/pandas-plots?logo=github) ![GitHub License](https://img.shields.io/github/license/smeisegeier/pandas-plots?logo=github) ![py3.10](https://img.shields.io/badge/python-3.10-blue.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0icHlZZWxsb3ciIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZlNSIgb2Zmc2V0PSIwLjYiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2RhMSIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJweUJsdWUiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPHBhdGggZD0iTTI3LDE2YzAtNyw5LTE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Jyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPHBhdGggZD0iTTI3LDE2YzAtNyw5LTEzLDI0LTEzYzE1LDAsMjMsNiwyMywxM2wwLDIyYzAsNy01LDEyLTExLDEybC0yNCwwYy04LDAtMTQsNi0xNCwxNWwwLDEwbC05LDBjLTgsMC0xMy05LTEzLTI0YzAtMTQsNS0yMywxMy0yM2wzNSwwbDAtM2wtMjQsMGwwLTlsMCwweiBNODgsNTB2MSIgZmlsbD0idXJsKCNweUJsdWUpIi8+CiAgPHBhdGggZD0iTTc0LDg3YzAsNy04LDEzLTIzLDEzYy0xNSwwLTI0LTYtMjQtMTNsMC0yMmMwLTcsNi0xMiwxMi0xMmwyNCwwYzgsMCwxNC03LDE0LTE1bDAtMTBsOSwwYzcsMCwxMyw5LDEzLDIzYzAsMTUtNiwyNC0xMywyNGwtMzUsMGwwLDNsMjMsMGwwLDlsMCwweiBNMTQwLDUwdjEiIGZpbGw9InVybCgjcHlZZWxsb3cpIi8+CgogIDxjaXJjbGUgcj0iNCIgY3g9IjY0IiBjeT0iODgiIGZpbGw9IiNGRkYiLz4KICA8Y2lyY2xlIHI9IjQiIGN4PSIzNyIgY3k9IjE1IiBmaWxsPSIjRkZGIi8+Cjwvc3ZnPgo=)
32
-
33
- ## quickstart
39
+ ## usage
34
40
 
35
41
  install / update package
36
42
 
@@ -44,7 +50,7 @@ include in python
44
50
  from pandas_plots import tbl, viz
45
51
  ```
46
52
 
47
- example
53
+ ## example
48
54
 
49
55
  ```python
50
56
  # load sample dataset from seaborn
@@ -53,7 +59,8 @@ df = sb.load_dataset('taxis')
53
59
 
54
60
  viz.plot_box(df['fare'], height=400, violin=True)
55
61
  ```
56
- ![plot_box](img/2024-02-13-00-40-27.png)
62
+
63
+ ![plot_box](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-13-00-40-27.png?raw=true)
57
64
 
58
65
  ## why use pandas-plots
59
66
 
@@ -72,4 +79,7 @@ It is subdivided into:
72
79
  - `plot_stacked_bars()` shortcut to stacked bars 😄
73
80
  - `plot_quadrants()` quickly show a 2x2 heatmap
74
81
 
82
+ - `sql` is added as convienient wrapper for fetching data from sql databases
83
+ - `connect_sql` get data from `['mssql', 'sqlite','postgres']`
84
+
75
85
  ## dependencies
@@ -0,0 +1,51 @@
1
+ # pandas-plots
2
+
3
+ ![PyPI - Version](https://img.shields.io/pypi/v/pandas-plots) ![GitHub last commit](https://img.shields.io/github/last-commit/smeisegeier/pandas-plots?logo=github) ![GitHub License](https://img.shields.io/github/license/smeisegeier/pandas-plots?logo=github) ![py3.10](https://img.shields.io/badge/python-3.10-blue.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0icHlZZWxsb3ciIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZlNSIgb2Zmc2V0PSIwLjYiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2RhMSIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJweUJsdWUiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPHBhdGggZD0iTTI3LDE2YzAtNyw5LTEzLDI0LTEzYzE1LDAsMjMsNiwyMywxM2wwLDIyYzAsNy01LDEyLTExLDEybC0yNCwwYy04LDAtMTQsNi0xNCwxNWwwLDEwbC05LDBjLTgsMC0xMy05LTEzLTI0YzAtMTQsNS0yMywxMy0yM2wzNSwwbDAtM2wtMjQsMGwwLTlsMCwweiBNODgsNTB2MSIgZmlsbD0idXJsKCNweUJsdWUpIi8+CiAgPHBhdGggZD0iTTc0LDg3YzAsNy04LDEzLTIzLDEzYy0xNSwwLTI0LTYtMjQtMTNsMC0yMmMwLTcsNi0xMiwxMi0xMmwyNCwwYzgsMCwxNC03LDE0LTE1bDAtMTBsOSwwYzcsMCwxMyw5LDEzLDIzYzAsMTUtNiwyNC0xMywyNGwtMzUsMGwwLDNsMjMsMGwwLDlsMCwweiBNMTQwLDUwdjEiIGZpbGw9InVybCgjcHlZZWxsb3cpIi8+CgogIDxjaXJjbGUgcj0iNCIgY3g9IjY0IiBjeT0iODgiIGZpbGw9IiNGRkYiLz4KICA8Y2lyY2xlIHI9IjQiIGN4PSIzNyIgY3k9IjE1IiBmaWxsPSIjRkZGIi8+Cjwvc3ZnPgo=)
4
+
5
+ ## usage
6
+
7
+ install / update package
8
+
9
+ ```bash
10
+ pip install pandas-plots -U
11
+ ```
12
+
13
+ include in python
14
+
15
+ ```python
16
+ from pandas_plots import tbl, viz
17
+ ```
18
+
19
+ ## example
20
+
21
+ ```python
22
+ # load sample dataset from seaborn
23
+ import seaborn as sb
24
+ df = sb.load_dataset('taxis')
25
+
26
+ viz.plot_box(df['fare'], height=400, violin=True)
27
+ ```
28
+
29
+ ![plot_box](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-13-00-40-27.png?raw=true)
30
+
31
+ ## why use pandas-plots
32
+
33
+ `pandas-plots` is a package to help you examine and visualize data that are organized in a pandas DataFrame. It provides a high level api to pandas / plotly with some selected functions.
34
+
35
+ It is subdivided into:
36
+
37
+ - `tbl` utilities for table descriptions
38
+ - `describe_df()` an alternative version of pandas `describe()` function
39
+ - `pivot_df()` gets a pivot table of a 3 column dataframe
40
+
41
+ - `viz` utilities for plotly visualizations
42
+ - `plot_box()` auto annotated boxplot w/ violin option
43
+ - `plot_boxes()` multiple boxplots _(annotation is experimental)_
44
+ - `plots_bars()` a standardized bar plot
45
+ - `plot_stacked_bars()` shortcut to stacked bars 😄
46
+ - `plot_quadrants()` quickly show a 2x2 heatmap
47
+
48
+ - `sql` is added as convienient wrapper for fetching data from sql databases
49
+ - `connect_sql` get data from `['mssql', 'sqlite','postgres']`
50
+
51
+ ## dependencies
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pandas-plots"
7
- version = "0.0.3"
7
+ version = "0.3.1"
8
8
  requires-python = ">=3.10"
9
9
  description = "A collection of helper for pandas n plots"
10
10
  readme = "README.md"
@@ -13,6 +13,13 @@ license = { file = "LICENSE" }
13
13
  classifiers = [
14
14
  "License :: OSI Approved :: MIT License",
15
15
  "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.10",
17
+ 'Development Status :: 5 - Production/Stable',
18
+ 'Development Status :: 3 - Alpha',
19
+ 'Environment :: Console',
20
+ 'Intended Audience :: Science/Research',
21
+ 'Operating System :: OS Independent',
22
+ 'Topic :: Scientific/Engineering'
16
23
  ]
17
24
  keywords = ["tables", "pivot", "plotly"]
18
25
  dependencies = [
@@ -20,13 +27,15 @@ dependencies = [
20
27
  "plotly",
21
28
  "matplotlib",
22
29
  "seaborn",
30
+ "sqlalchemy < 2.0.0",
23
31
  ]
24
32
 
25
33
  # [project.optional-dependencies]
26
34
  # dev = ["black", "bumpver", "isort", "pip-tools", "pytest"]
27
35
 
28
36
  [project.urls]
29
- Homepage = "https://github.com/smeisegeier/pandas-plots"
37
+ homepage = "https://github.com/smeisegeier/pandas-plots"
38
+ repository = "https://github.com/smeisegeier/pandas-plots"
30
39
 
31
40
  # [project.scripts]
32
41
  # realpython = "reader.__main__:main"
@@ -0,0 +1,75 @@
1
+ from typing import Literal
2
+
3
+ from sqlalchemy import create_engine, text
4
+ from sqlalchemy_utils import create_database, database_exists
5
+
6
+
7
+ def connect_sql(
8
+ db: str,
9
+ host: str = '',
10
+ user: str = '',
11
+ pw: str = '',
12
+ dbms: Literal['mssql', 'sqlite','postgres'] = 'mssql',
13
+ ensure_db_exists: bool = False,
14
+ ) -> object:
15
+ """
16
+ Connects to any SQL database based on the given parameters.
17
+
18
+ Args:
19
+ db (str): The name of the database / sqlite-file.
20
+ host (str, optional): The host name or IP address of the database server. Defaults to an empty string.
21
+ user (str, optional): The username for authentication. Defaults to an empty string.
22
+ pw (str, optional): The password for authentication. Defaults to an empty string.
23
+ dbms (Literal['mssql', 'sqlite','postgres'], optional): The type of database management system. Defaults to 'mssql'.
24
+ ensure_db_exists (bool, optional): Specifies whether to create the database if it does not exist. Defaults to False.
25
+
26
+ Returns:
27
+ Connection: The connection object for the established database connection.
28
+
29
+ Remarks:
30
+ - postgres
31
+ - psycopg2-binary must be installed
32
+ - example:
33
+ con = my_connect_to_any_sql(
34
+ host='<instance>.postgres.database.azure.com',
35
+ db='eteste',
36
+ user='<user>n@<instance>',
37
+ pw='<password>',
38
+ dbms='postgres',
39
+ ensure_db_exists=False
40
+ )
41
+ - mssql
42
+ - sqlalchemy nust be <v2 to write -> sql
43
+
44
+ """
45
+
46
+ if dbms == 'mssql':
47
+ url = f'mssql://{user}:{pw}@{host}/{db}?driver=ODBC Driver 17 for SQL Server'
48
+ elif dbms == 'sqlite':
49
+ url = f'sqlite:///{db}'
50
+ elif dbms == 'postgres':
51
+ url = f'postgresql+psycopg2://{user}:{pw}@{host}/{db}'
52
+ else:
53
+ print("dbms not supported")
54
+ return None
55
+
56
+ engine = create_engine(
57
+ url, # * leave positional argument unnamed, since it was relabeled between versions..
58
+ connect_args={'connect_timeout': 10},
59
+ )
60
+
61
+ # * ensure db exists
62
+ if ensure_db_exists:
63
+ if not database_exists(engine.url):
64
+ create_database(engine.url)
65
+ print(f'db {db} created')
66
+ else:
67
+ print(f'db {db} exists')
68
+
69
+ # * now connect
70
+ try:
71
+ con=engine.connect()
72
+ except Exception as e:
73
+ print(e)
74
+
75
+ return con
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas-plots
3
- Version: 0.0.3
3
+ Version: 0.3.1
4
4
  Summary: A collection of helper for pandas n plots
5
5
  Author-email: smeisegeier <dsexterDSDo@googlemail.com>
6
6
  License: Copyright 2024 smeisegeier
@@ -11,10 +11,18 @@ License: Copyright 2024 smeisegeier
11
11
 
12
12
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
13
 
14
- Project-URL: Homepage, https://github.com/smeisegeier/pandas-plots
14
+ Project-URL: homepage, https://github.com/smeisegeier/pandas-plots
15
+ Project-URL: repository, https://github.com/smeisegeier/pandas-plots
15
16
  Keywords: tables,pivot,plotly
16
17
  Classifier: License :: OSI Approved :: MIT License
17
18
  Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Development Status :: 5 - Production/Stable
21
+ Classifier: Development Status :: 3 - Alpha
22
+ Classifier: Environment :: Console
23
+ Classifier: Intended Audience :: Science/Research
24
+ Classifier: Operating System :: OS Independent
25
+ Classifier: Topic :: Scientific/Engineering
18
26
  Requires-Python: >=3.10
19
27
  Description-Content-Type: text/markdown
20
28
  License-File: LICENSE
@@ -22,15 +30,13 @@ Requires-Dist: pandas>=2.0.0
22
30
  Requires-Dist: plotly
23
31
  Requires-Dist: matplotlib
24
32
  Requires-Dist: seaborn
33
+ Requires-Dist: sqlalchemy<2.0.0
25
34
 
26
35
  # pandas-plots
27
36
 
28
- <!-- [![GitHub release](https://img.shields.io/github/release/Naereen/StrapDown.js.svg)](https://GitHub.com/Naereen/StrapDown.js/releases/) -->
29
- <!-- [![GitHub latest commit](https://badgen.net/github/last-commit/Naereen/Strapdown.js)](https://GitHub.com/Naereen/StrapDown.js/commit/) -->
37
+ ![PyPI - Version](https://img.shields.io/pypi/v/pandas-plots) ![GitHub last commit](https://img.shields.io/github/last-commit/smeisegeier/pandas-plots?logo=github) ![GitHub License](https://img.shields.io/github/license/smeisegeier/pandas-plots?logo=github) ![py3.10](https://img.shields.io/badge/python-3.10-blue.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0icHlZZWxsb3ciIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZlNSIgb2Zmc2V0PSIwLjYiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2RhMSIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJweUJsdWUiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZG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IGlkPSJweUJsdWUiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPHBhdGggZD0iTTI3LDE2YzAtNyw5LTEzLDI0LTEzYzE1LDAsMjMsNiwyMywxM2wwLDIyYzAsNy01LDEyLTExLDEybC0yNCwwYy04LDAtMTQsNi0xNCwxNWwwLDEwbC05LDBjLTgsMC0xMy05LTEzLTI0YzAtMTQsNS0yMywxMy0yM2wzNSwwbDAtM2wtMjQsMGwwLTlsMCwweiBNODgsNTB2MSIgZmlsbD0idXJsKCNweUJsdWUpIi8+CiAgPHBhdGggZD0iTTc0LDg3YzAsNy04LDEzLTIzLDEzYy0xNSwwLTI0LTYtMjQtMTNsMC0yMmMwLTcsNi0xMiwxMi0xMmwyNCwwYzgsMCwxNC03LDE0LTE1bDAtMTBsOSwwYzcsMCwxMyw5LDEzLDIzYzAsMTUtNiwyNC0xMywyNGwtMzUsMGwwLDNsMjMsMGwwLDlsMCwweiBNMTQwLDUwdjEiIGZpbGw9InVybCgjcHlZZWxsb3cpIi8+CgogIDxjaXJjbGUgcj0iNCIgY3g9IjY0IiBjeT0iODgiIGZpbGw9IiNGRkYiLz4KICA8Y2lyY2xlIHI9IjQiIGN4PSIzNyIgY3k9IjE1IiBmaWxsPSIjRkZGIi8+Cjwvc3ZnPgo=)
32
-
33
- ## quickstart
39
+ ## usage
34
40
 
35
41
  install / update package
36
42
 
@@ -44,7 +50,7 @@ include in python
44
50
  from pandas_plots import tbl, viz
45
51
  ```
46
52
 
47
- example
53
+ ## example
48
54
 
49
55
  ```python
50
56
  # load sample dataset from seaborn
@@ -53,7 +59,8 @@ df = sb.load_dataset('taxis')
53
59
 
54
60
  viz.plot_box(df['fare'], height=400, violin=True)
55
61
  ```
56
- ![plot_box](img/2024-02-13-00-40-27.png)
62
+
63
+ ![plot_box](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-13-00-40-27.png?raw=true)
57
64
 
58
65
  ## why use pandas-plots
59
66
 
@@ -72,4 +79,7 @@ It is subdivided into:
72
79
  - `plot_stacked_bars()` shortcut to stacked bars 😄
73
80
  - `plot_quadrants()` quickly show a 2x2 heatmap
74
81
 
82
+ - `sql` is added as convienient wrapper for fetching data from sql databases
83
+ - `connect_sql` get data from `['mssql', 'sqlite','postgres']`
84
+
75
85
  ## dependencies
@@ -3,6 +3,7 @@ MANIFEST.in
3
3
  README.md
4
4
  pyproject.toml
5
5
  src/pandas_plots/__init__.py
6
+ src/pandas_plots/sql.py
6
7
  src/pandas_plots/tbl.py
7
8
  src/pandas_plots/viz.py
8
9
  src/pandas_plots.egg-info/PKG-INFO
@@ -2,3 +2,4 @@ pandas>=2.0.0
2
2
  plotly
3
3
  matplotlib
4
4
  seaborn
5
+ sqlalchemy<2.0.0
@@ -1,50 +0,0 @@
1
- # pandas-plots
2
-
3
- <!-- [![GitHub release](https://img.shields.io/github/release/Naereen/StrapDown.js.svg)](https://GitHub.com/Naereen/StrapDown.js/releases/) -->
4
- <!-- [![GitHub latest commit](https://badgen.net/github/last-commit/Naereen/Strapdown.js)](https://GitHub.com/Naereen/StrapDown.js/commit/) -->
5
-
6
- ![py3.10](https://img.shields.io/badge/python-3.10-blue.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0icHlZZWxsb3ciIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZlNSIgb2Zmc2V0PSIwLjYiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2RhMSIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJweUJsdWUiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPHBhdGggZD0iTTI3LDE2YzAtNyw5LTEzLDI0LTEzYzE1LDAsMjMsNiwyMywxM2wwLDIyYzAsNy01LDEyLTExLDEybC0yNCwwYy04LDAtMTQsNi0xNCwxNWwwLDEwbC05LDBjLTgsMC0xMy05LTEzLTI0YzAtMTQsNS0yMywxMy0yM2wzNSwwbDAtM2wtMjQsMGwwLTlsMCwweiBNODgsNTB2MSIgZmlsbD0idXJsKCNweUJsdWUpIi8+CiAgPHBhdGggZD0iTTc0LDg3YzAsNy04LDEzLTIzLDEzYy0xNSwwLTI0LTYtMjQtMTNsMC0yMmMwLTcsNi0xMiwxMi0xMmwyNCwwYzgsMCwxNC03LDE0LTE1bDAtMTBsOSwwYzcsMCwxMyw5LDEzLDIzYzAsMTUtNiwyNC0xMywyNGwtMzUsMGwwLDNsMjMsMGwwLDlsMCwweiBNMTQwLDUwdjEiIGZpbGw9InVybCgjcHlZZWxsb3cpIi8+CgogIDxjaXJjbGUgcj0iNCIgY3g9IjY0IiBjeT0iODgiIGZpbGw9IiNGRkYiLz4KICA8Y2lyY2xlIHI9IjQiIGN4PSIzNyIgY3k9IjE1IiBmaWxsPSIjRkZGIi8+Cjwvc3ZnPgo=)
7
-
8
- ## quickstart
9
-
10
- install / update package
11
-
12
- ```bash
13
- pip install pandas-plots -U
14
- ```
15
-
16
- include in python
17
-
18
- ```python
19
- from pandas_plots import tbl, viz
20
- ```
21
-
22
- example
23
-
24
- ```python
25
- # load sample dataset from seaborn
26
- import seaborn as sb
27
- df = sb.load_dataset('taxis')
28
-
29
- viz.plot_box(df['fare'], height=400, violin=True)
30
- ```
31
- ![plot_box](img/2024-02-13-00-40-27.png)
32
-
33
- ## why use pandas-plots
34
-
35
- `pandas-plots` is a package to help you examine and visualize data that are organized in a pandas DataFrame. It provides a high level api to pandas / plotly with some selected functions.
36
-
37
- It is subdivided into:
38
-
39
- - `tbl` utilities for table descriptions
40
- - `describe_df()` an alternative version of pandas `describe()` function
41
- - `pivot_df()` gets a pivot table of a 3 column dataframe
42
-
43
- - `viz` utilities for plotly visualizations
44
- - `plot_box()` auto annotated boxplot w/ violin option
45
- - `plot_boxes()` multiple boxplots _(annotation is experimental)_
46
- - `plots_bars()` a standardized bar plot
47
- - `plot_stacked_bars()` shortcut to stacked bars 😄
48
- - `plot_quadrants()` quickly show a 2x2 heatmap
49
-
50
- ## dependencies
File without changes
File without changes
File without changes