analysistoolbox 2.2.85__tar.gz → 2.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.
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/PKG-INFO +1 -1
- analysistoolbox-2.3.1/analysistoolbox/file_management/ConvertWordToHTML.py +177 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/file_management/__init__.py +1 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/CreateCorrelatedSIPs.py +7 -3
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox.egg-info/PKG-INFO +1 -1
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox.egg-info/SOURCES.txt +1 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/setup.py +2 -1
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/LICENSE.md +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/README.md +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/calculus/FindDerivative.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/calculus/FindLimitOfFunction.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/calculus/FindMinimumSquareLoss.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/calculus/PlotFunction.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/calculus/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/ExtractTextFromPDF.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/FetchPDFFromURL.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/FetchUSShapefile.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/FetchWebsiteText.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/GetCompanyFilings.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/GetGoogleSearchResults.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/GetZipFile.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/AddDateNumberColumns.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/AddLeadingZeros.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/AddRowCountColumn.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/AddTPeriodColumn.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/AddTukeyOutlierColumn.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CleanTextColumns.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/ConductAnomalyDetection.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/ConductEntityMatching.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/ConvertOddsToProbability.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CountMissingDataByGroup.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CreateBinnedColumn.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CreateDataOverview.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CreateRandomSampleGroups.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CreateRareCategoryColumn.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CreateStratifiedRandomSampleGroups.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/GeocodeUSAddresses.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/ImputeMissingValuesUsingNearestNeighbors.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/VerifyGranularity.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/ConductManifoldLearning.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/ConductPrincipalComponentAnalysis.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/ConductPropensityScoreMatching.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/CreateAssociationRules.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/CreateGaussianMixtureClusters.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/CreateHierarchicalClusters.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/CreateKMeansClusters.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/GenerateEDAWithLIDA.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/file_management/ConvertWordDocsToPDF.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/file_management/CreateCopyOfPDF.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/file_management/CreateFileTree.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/file_management/ImportDataFromFolder.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/ChiSquareTestOfIndependence.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/ChiSquareTestOfIndependenceFromTable.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/ConductCoxProportionalHazardRegression.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/ConductLinearRegressionAnalysis.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/ConductLogisticRegressionAnalysis.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/ConductSurvivalAnalysis.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/OneSampleTTest.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/OneWayANOVA.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/TTestOfMeanFromStats.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/TTestOfProportionFromStats.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/TTestOfTwoMeansFromStats.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/TwoSampleTTestOfIndependence.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/TwoSampleTTestPaired.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/CalculateEigenvalues.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/ConvertMatrixToRowEchelonForm.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/ConvertSystemOfEquationsToMatrix.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/PlotVectors.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/SolveSystemOfEquations.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/VisualizeMatrixAsLinearTransformation.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/llm/SendPromptToAnthropic.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/llm/SendPromptToChatGPT.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/llm/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/CreateARIMAModel.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/CreateBoostedTreeModel.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/CreateDecisionTreeModel.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/CreateLinearRegressionModel.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/CreateLogisticRegressionModel.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/CreateNeuralNetwork_SingleOutcome.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/prescriptive_analytics/CreateContentBasedRecommender.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/prescriptive_analytics/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/probability/ProbabilityOfAtLeastOne.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/probability/ProbabilityOfHypothesisGivenData.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/probability/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/CreateMetalogDistribution.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/CreateMetalogDistributionFromPercentiles.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/CreateSIPDataframe.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/CreateSLURPDistribution.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateCountOfSuccesses.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateCountOutcome.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateCountUntilFirstSuccess.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateNormallyDistributedOutcome.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateTDistributedOutcome.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateTimeBetweenEvents.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateTimeUntilNEvents.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/a_vector.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/class_method.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/metalog.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/pdf_quantile_functions.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/support.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/statistics/CalculateConfidenceIntervalOfMean.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/statistics/CalculateConfidenceIntervalOfProportion.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/statistics/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/Plot100PercentStackedBarChart.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotBarChart.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotBoxWhiskerByGroup.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotBulletChart.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotCard.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotClusteredBarChart.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotContingencyHeatmap.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotCorrelationMatrix.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotDensityByGroup.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotDotPlot.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotHeatmap.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotOverlappingAreaChart.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotRiskTolerance.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotScatterplot.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotSingleVariableCountPlot.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotSingleVariableHistogram.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotTimeSeries.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/RenderTableOne.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/__init__.py +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox.egg-info/dependency_links.txt +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox.egg-info/requires.txt +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox.egg-info/top_level.txt +0 -0
- {analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: analysistoolbox
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: A collection tools in Python for data collection and processing, statistics, analytics, and intelligence analysis.
|
|
5
5
|
Home-page: https://github.com/KyleProtho/AnalysisToolBox/tree/master/analysistoolbox
|
|
6
6
|
Author: Kyle Protho
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Load packages
|
|
2
|
+
import os
|
|
3
|
+
import base64
|
|
4
|
+
|
|
5
|
+
# Declare function
|
|
6
|
+
def ConvertWordToHTML(docx_file_path, html_file_path=None):
|
|
7
|
+
"""
|
|
8
|
+
This function converts a Word document (.docx) to HTML format while preserving formatting,
|
|
9
|
+
including headings, tables, images, footnotes, and endnotes. All footnotes are converted to endnotes.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
docx_file_path (str): The path to the input .docx file.
|
|
13
|
+
html_file_path (str, optional): The path where the output .html file will be saved.
|
|
14
|
+
If None, saves to the same folder as the input file.
|
|
15
|
+
"""
|
|
16
|
+
# Lazy load uncommon packages
|
|
17
|
+
import mammoth
|
|
18
|
+
|
|
19
|
+
# Check if input file exists
|
|
20
|
+
if not os.path.exists(docx_file_path):
|
|
21
|
+
raise FileNotFoundError(f"Input file not found: {docx_file_path}")
|
|
22
|
+
|
|
23
|
+
# Check if input file is .docx
|
|
24
|
+
if not docx_file_path.lower().endswith('.docx'):
|
|
25
|
+
raise ValueError("Input file must be a .docx file")
|
|
26
|
+
|
|
27
|
+
# If html_file_path is None, use the same folder as the input file
|
|
28
|
+
if html_file_path is None:
|
|
29
|
+
input_dir = os.path.dirname(docx_file_path)
|
|
30
|
+
input_filename = os.path.splitext(os.path.basename(docx_file_path))[0]
|
|
31
|
+
html_file_path = os.path.join(input_dir, f"{input_filename}.html")
|
|
32
|
+
print(f"No output path specified. Using: {html_file_path}")
|
|
33
|
+
|
|
34
|
+
# Check if html_file_path is a directory instead of a file
|
|
35
|
+
if os.path.isdir(html_file_path):
|
|
36
|
+
# If it's a directory, create a filename based on the input file
|
|
37
|
+
input_filename = os.path.splitext(os.path.basename(docx_file_path))[0]
|
|
38
|
+
html_file_path = os.path.join(html_file_path, f"{input_filename}.html")
|
|
39
|
+
print(f"Directory provided instead of file path. Using: {html_file_path}")
|
|
40
|
+
|
|
41
|
+
# Check if html_file_path ends with a path separator (indicating it's meant to be a directory)
|
|
42
|
+
if html_file_path.endswith(('/', '\\')):
|
|
43
|
+
input_filename = os.path.splitext(os.path.basename(docx_file_path))[0]
|
|
44
|
+
html_file_path = os.path.join(html_file_path, f"{input_filename}.html")
|
|
45
|
+
print(f"Directory path provided. Using: {html_file_path}")
|
|
46
|
+
|
|
47
|
+
# Ensure the output file has .html extension
|
|
48
|
+
if not html_file_path.lower().endswith('.html'):
|
|
49
|
+
html_file_path += '.html'
|
|
50
|
+
print(f"Added .html extension. Using: {html_file_path}")
|
|
51
|
+
|
|
52
|
+
# Create output directory if it doesn't exist
|
|
53
|
+
output_dir = os.path.dirname(html_file_path)
|
|
54
|
+
if output_dir and not os.path.exists(output_dir):
|
|
55
|
+
try:
|
|
56
|
+
os.makedirs(output_dir)
|
|
57
|
+
except PermissionError:
|
|
58
|
+
raise PermissionError(f"Permission denied: Cannot create directory '{output_dir}'. "
|
|
59
|
+
f"Please check your permissions or choose a different output location.")
|
|
60
|
+
|
|
61
|
+
# Test write access to the output location
|
|
62
|
+
try:
|
|
63
|
+
test_file = html_file_path + '.tmp'
|
|
64
|
+
with open(test_file, 'w') as f:
|
|
65
|
+
f.write('test')
|
|
66
|
+
os.remove(test_file)
|
|
67
|
+
except PermissionError:
|
|
68
|
+
raise PermissionError(f"Permission denied: Cannot write to location '{html_file_path}'. "
|
|
69
|
+
f"Please check that:\n"
|
|
70
|
+
f"1. The file is not currently open in another application\n"
|
|
71
|
+
f"2. You have write permissions to this directory\n"
|
|
72
|
+
f"3. The path is not read-only\n"
|
|
73
|
+
f"4. OneDrive sync is not preventing file access")
|
|
74
|
+
except OSError as e:
|
|
75
|
+
raise ValueError(f"Invalid output path '{html_file_path}': {str(e)}")
|
|
76
|
+
|
|
77
|
+
# Define custom image converter to embed images as base64
|
|
78
|
+
def convert_image(image):
|
|
79
|
+
with image.open() as image_bytes:
|
|
80
|
+
encoded_src = base64.b64encode(image_bytes.read()).decode("ascii")
|
|
81
|
+
return {
|
|
82
|
+
"src": f"data:{image.content_type};base64,{encoded_src}"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
# Define style mapping to ensure footnotes are converted to endnotes
|
|
86
|
+
# and preserve other formatting
|
|
87
|
+
style_map = """
|
|
88
|
+
p[style-name='Footnote Text'] => p.endnote
|
|
89
|
+
p[style-name='Endnote Text'] => p.endnote
|
|
90
|
+
comment-reference => sup
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
# Open and convert the docx file
|
|
95
|
+
with open(docx_file_path, "rb") as docx_file:
|
|
96
|
+
result = mammoth.convert_to_html(
|
|
97
|
+
docx_file,
|
|
98
|
+
convert_image=mammoth.images.img_element(convert_image),
|
|
99
|
+
style_map=style_map
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
# Get the HTML content
|
|
103
|
+
html_content = result.value
|
|
104
|
+
|
|
105
|
+
# Add basic HTML structure and CSS for better formatting
|
|
106
|
+
full_html = f"""<!DOCTYPE html>
|
|
107
|
+
<html lang="en">
|
|
108
|
+
<head>
|
|
109
|
+
<meta charset="UTF-8">
|
|
110
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
111
|
+
<title>Converted Document</title>
|
|
112
|
+
<style>
|
|
113
|
+
body {{
|
|
114
|
+
font-family: 'Times New Roman', serif;
|
|
115
|
+
line-height: 1.6;
|
|
116
|
+
max-width: 800px;
|
|
117
|
+
margin: 0 auto;
|
|
118
|
+
padding: 20px;
|
|
119
|
+
}}
|
|
120
|
+
table {{
|
|
121
|
+
border-collapse: collapse;
|
|
122
|
+
width: 100%;
|
|
123
|
+
margin: 20px 0;
|
|
124
|
+
}}
|
|
125
|
+
table, th, td {{
|
|
126
|
+
border: 1px solid #ddd;
|
|
127
|
+
}}
|
|
128
|
+
th, td {{
|
|
129
|
+
padding: 8px;
|
|
130
|
+
text-align: left;
|
|
131
|
+
}}
|
|
132
|
+
th {{
|
|
133
|
+
background-color: #f2f2f2;
|
|
134
|
+
}}
|
|
135
|
+
.endnote {{
|
|
136
|
+
font-size: 0.9em;
|
|
137
|
+
margin-top: 2em;
|
|
138
|
+
border-top: 1px solid #ccc;
|
|
139
|
+
padding-top: 1em;
|
|
140
|
+
}}
|
|
141
|
+
img {{
|
|
142
|
+
max-width: 100%;
|
|
143
|
+
height: auto;
|
|
144
|
+
}}
|
|
145
|
+
</style>
|
|
146
|
+
</head>
|
|
147
|
+
<body>
|
|
148
|
+
{html_content}
|
|
149
|
+
</body>
|
|
150
|
+
</html>"""
|
|
151
|
+
|
|
152
|
+
# Write the HTML content to the output file
|
|
153
|
+
try:
|
|
154
|
+
with open(html_file_path, 'w', encoding='utf-8') as html_file:
|
|
155
|
+
html_file.write(full_html)
|
|
156
|
+
except PermissionError:
|
|
157
|
+
raise PermissionError(f"Permission denied: Cannot write to '{html_file_path}'. "
|
|
158
|
+
f"The file may be open in another application, or you may not have "
|
|
159
|
+
f"write permissions to this location. Please close any open files "
|
|
160
|
+
f"and check your permissions.")
|
|
161
|
+
except OSError as e:
|
|
162
|
+
if "Invalid argument" in str(e) or "cannot find the path" in str(e).lower():
|
|
163
|
+
raise ValueError(f"Invalid file path: '{html_file_path}'. "
|
|
164
|
+
f"Please ensure the path is valid and accessible.")
|
|
165
|
+
else:
|
|
166
|
+
raise OSError(f"Error writing file: {str(e)}")
|
|
167
|
+
|
|
168
|
+
# Print any warnings from mammoth
|
|
169
|
+
if result.messages:
|
|
170
|
+
print("Conversion warnings:")
|
|
171
|
+
for message in result.messages:
|
|
172
|
+
print(f" - {message}")
|
|
173
|
+
|
|
174
|
+
print(f"Successfully converted {docx_file_path} to {html_file_path}")
|
|
175
|
+
|
|
176
|
+
except Exception as e:
|
|
177
|
+
raise Exception(f"Error converting document: {str(e)}")
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/CreateCorrelatedSIPs.py
RENAMED
|
@@ -14,6 +14,8 @@ def CreateCorrelatedSIPs(mean_of_variable_1,
|
|
|
14
14
|
number_of_samples=10000,
|
|
15
15
|
variable_1_name='Variable 1',
|
|
16
16
|
variable_2_name='Variable 2',
|
|
17
|
+
# Printing arguments
|
|
18
|
+
print_simulation_result_summary=False,
|
|
17
19
|
# Scatterplot arguments
|
|
18
20
|
show_scatterplot=True,
|
|
19
21
|
dot_fill_color="#999999",
|
|
@@ -79,12 +81,14 @@ def CreateCorrelatedSIPs(mean_of_variable_1,
|
|
|
79
81
|
|
|
80
82
|
# Calculate the correlation between the two variables
|
|
81
83
|
simulated_correlation = dataframe[variable_1_name].corr(dataframe[variable_2_name])
|
|
82
|
-
|
|
84
|
+
if print_simulation_result_summary:
|
|
85
|
+
print("Correlation between the two variables in the simulated data: ", simulated_correlation)
|
|
83
86
|
|
|
84
87
|
# Show the summary statistics of the dataframe
|
|
85
88
|
simulation_summary = dataframe.describe()
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
if print_simulation_result_summary:
|
|
90
|
+
print("Summary statistics of the simulated data:")
|
|
91
|
+
print(simulation_summary)
|
|
88
92
|
|
|
89
93
|
# If scatterplot requested, generate plot
|
|
90
94
|
if show_scatterplot:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: analysistoolbox
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: A collection tools in Python for data collection and processing, statistics, analytics, and intelligence analysis.
|
|
5
5
|
Home-page: https://github.com/KyleProtho/AnalysisToolBox/tree/master/analysistoolbox
|
|
6
6
|
Author: Kyle Protho
|
|
@@ -49,6 +49,7 @@ analysistoolbox/descriptive_analytics/CreateKMeansClusters.py
|
|
|
49
49
|
analysistoolbox/descriptive_analytics/GenerateEDAWithLIDA.py
|
|
50
50
|
analysistoolbox/descriptive_analytics/__init__.py
|
|
51
51
|
analysistoolbox/file_management/ConvertWordDocsToPDF.py
|
|
52
|
+
analysistoolbox/file_management/ConvertWordToHTML.py
|
|
52
53
|
analysistoolbox/file_management/CreateCopyOfPDF.py
|
|
53
54
|
analysistoolbox/file_management/CreateFileTree.py
|
|
54
55
|
analysistoolbox/file_management/ImportDataFromFolder.py
|
|
@@ -12,7 +12,7 @@ setup(
|
|
|
12
12
|
long_description=long_description,
|
|
13
13
|
long_description_content_type='text/markdown',
|
|
14
14
|
url="https://github.com/KyleProtho/AnalysisToolBox/tree/master/analysistoolbox",
|
|
15
|
-
version='2.
|
|
15
|
+
version='2.3.1',
|
|
16
16
|
author='Kyle Protho',
|
|
17
17
|
author_email='kyletprotho@gmail.com',
|
|
18
18
|
license='MIT',
|
|
@@ -41,6 +41,7 @@ setup(
|
|
|
41
41
|
'langchain_core',
|
|
42
42
|
'lida',
|
|
43
43
|
'lifelines',
|
|
44
|
+
'mammoth',
|
|
44
45
|
'mapclassify',
|
|
45
46
|
'matplotlib<3.8',
|
|
46
47
|
'mlxtend',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/calculus/FindLimitOfFunction.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/calculus/FindMinimumSquareLoss.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/FetchPDFFromURL.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/FetchUSShapefile.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/FetchWebsiteText.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/GetZipFile.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_collection/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/AddLeadingZeros.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/AddTPeriodColumn.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/CleanTextColumns.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/data_processing/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/descriptive_analytics/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/file_management/CreateCopyOfPDF.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/file_management/CreateFileTree.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/OneWayANOVA.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/hypothesis_testing/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/linear_algebra/PlotVectors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/llm/SendPromptToAnthropic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/predictive_analytics/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/prescriptive_analytics/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/CreateSIPDataframe.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/SimulateCountOutcome.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/__init__.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/a_vector.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/metalog.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/simulations/pymetalog/support.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotBarChart.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotBulletChart.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotDotPlot.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotHeatmap.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotRiskTolerance.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotScatterplot.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/PlotTimeSeries.py
RENAMED
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox/visualizations/RenderTableOne.py
RENAMED
|
File without changes
|
|
File without changes
|
{analysistoolbox-2.2.85 → analysistoolbox-2.3.1}/analysistoolbox.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|