Skip to main content

PyAutoPlot is an open-source Python library designed to make dataset analysis much easier by generating helpful detailed plots using matplotlib based on your dataset.

Project description

PyAutoPlot

Python Version Code Size Downloads License Compliance PyPI Version

PyAutoPlot is an open-source Python library designed to make dataset analysis much easier by generating helpful detailed plots using matplotlib. It automatically generates appropriate plots based on the dataset you feed it.

Changes in version 1.1.0:

  1. New Visualizations: Added Correlation Heatmaps and Violin Plots.
  2. Data Cleanup: New cleanup() method allows filling or dropping missing values with multiple strategies.
  3. Advanced Reporting:
    • export_json(): Saves all stats and metadata to JSON.
    • export_report(): Generates professional HTML (self-contained) or PDF reports.
  4. Improved Intelligence: Automatically detects and parses date strings into datetime objects.
  5. Optimizations: Better memory management and resource warnings for large datasets.

[!TIP] For more information and Python package API references, view PyAutoPlot's documentation: https://infinitode-docs.gitbook.io/documentation/package-documentation/pyautoplot-package-documentation.

Changes in version 1.0.2:

Bug Fixes and Robustness:

  • Corrected calculation of missing values in _generate_analysis.
  • Added error handling for statistical functions (skewness, kurtosis, autocorrelation) to prevent crashes with empty or zero-variance data, returning NaN instead.
  • Added warnings for columns not classified by _detect_column_types.
  • Included input validation in the plot() method to check for valid column names and required arguments, raising ValueErrors for invalid input.

Performance Enhancements:

  • Modified auto_plot() to display and close plot figures section by section (or individually for looped plots like pie/line charts). This significantly reduces memory consumption when generating many plots.
  • Added a warning in the auto_plot() docstring regarding potential performance issues of pairwise scatter plots with many numeric columns.

Code Cleanup:

  • Refined static method definitions (_calculate_skewness, _calculate_kurtosis, etc.) by removing unnecessary self arguments and ensuring calls are updated.

Testing:

  • Replaced the existing test.py with a new script that:
    • Creates a test_output directory for plot outputs.
    • Uses energy_consumption_dataset.csv (with a dummy fallback).
    • Demonstrates AutoPlot initialization.
    • Runs auto_plot() with default and custom configurations.
    • Runs manual plot() for scatter, distribution, boxplot, and bar types.
    • Shows usage of the customize() method.
    • Includes a test with a small, inline dataset.
    • Saves all generated plots for visual inspection.

Changes in version 1.0.1:

  • Added package dependencies to PyAutoPlot: matplotlib>=3.0.0, pandas>=1.0.0, and numpy>=1.18.0.

Changes in version 1.0.0:

  • AutoPlot class, along with auto_plot and plot functions. auto_plot automatically generates suitable plots based on values in your dataset.

[!IMPORTANT] The AutoPlot object needs to be initialized with a CSV dataset before any plots can be generated using either plot or auto_plot.

Installation

You can install PyAutoPlot using pip:

pip install pyautoplot

Supported Python Versions

PyAutoPlot supports the following Python versions:

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9
  • Python 3.10
  • Python 3.11/Later (Preferred)

Please ensure that you have one of these Python versions installed before using PyAutoPlot. PyAutoPlot may not work as expected on lower versions of Python than the supported.

Features

  • Automatic Plotting: PyAutoPlot automatically generates appropriate plots based on values present in your dataset. Currently, PyAutoPlot supports the following types of data: numeric, categorical, and time-series.
  • Customization: Due to matplotlib's high customizability, you can create and use custom themes for PyAutoPlot, just pass in your theme as a dictionary of RCParams (See plot.rcParams.keys() for a list of valid parameters) or choose from our predefined themes. You can also pass in additional parameters to the function that matplotlib can recognize (e.g. color='#5d17eb').

Usage

AutoPlot

from pyautoplot import AutoPlot

# Initialize with a CSV file
plotter = AutoPlot("path/to/dataset.csv")

# Automatically analyze and plot
plotter.auto_plot(output_file='test', theme="dark", color='orange', excludes=['detailed_analysis'])

[!NOTE] PyAutoPlot may not work well with certain datasets. If you find any issues please open an issue.

Customization

from pyautoplot import AutoPlot

# Define your custom theme
custom_theme = {
    "axes.facecolor": "#ffffff",
    "axes.edgecolor": "#000000",
    "axes.labelcolor": "#000000",
    "figure.facecolor": "#ffffff",
    "grid.color": "#dddddd",
    "text.color": "#000000",
    "xtick.color": "#000000",
    "ytick.color": "#000000",
    "legend.frameon": True,
}

# Initialize with a CSV file
plotter = AutoPlot("path/to/dataset.csv")

# Automatically analyze and plot using the custom theme
plotter.auto_plot(output_file='test', theme=custom_theme, color='orange', excludes=['detailed_analysis'])

Contributing

Contributions are welcome! If you encounter any issues, have suggestions, or want to contribute to PyAutoPlot, please open an issue or submit a pull request on GitHub.

License

PyAutoPlot is released under the terms of the MIT License (Modified). Please see the LICENSE file for the full text.

Modified License Clause

The modified license clause grants users the permission to make derivative works based on the PyAutoPlot software. However, it requires any substantial changes to the software to be clearly distinguished from the original work and distributed under a different 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 Distribution

pyautoplot-1.1.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

pyautoplot-1.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file pyautoplot-1.1.0.tar.gz.

File metadata

  • Download URL: pyautoplot-1.1.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyautoplot-1.1.0.tar.gz
Algorithm Hash digest
SHA256 81d9f56d0a2a9958805e8211337e3cf1255a69b2a00eb5340d00ac9cc0aac9d7
MD5 d8d44a35960a59e94aa8a49c0b730a3a
BLAKE2b-256 607d2f49fe4b3b20fb6e88a8617f41c1f9e4d0ee6748180a533b6acf77fb789b

See more details on using hashes here.

File details

Details for the file pyautoplot-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyautoplot-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyautoplot-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f11549ce9580f652bccdf08c0a9d589643f0358e11d0b4cc792b1e3904d53b0b
MD5 af3908e9345c5889b48d73ed0f44f29b
BLAKE2b-256 dcd9d5bd2395c13dcfacf896365ba97b4bfb659af7edf0926dec698ac686b535

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