diff --git a/KiBOM_CLI.py b/KiBOM_CLI.py index 25339580..04e4e5d1 100644 --- a/KiBOM_CLI.py +++ b/KiBOM_CLI.py @@ -11,6 +11,7 @@ import argparse here = os.path.abspath(os.path.dirname(sys.argv[0])) sys.path.append(here) +sys.path.append(os.path.join(here,"KiBOM")) from KiBOM.columns import ColumnList from KiBOM.netlist_reader import * diff --git a/README.md b/README.md index 828772cc..ea64ce89 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,23 @@ KiBoM intelligently groups components based on multiple factors, and can generat BoM options are user-configurable in a per-project configuration file. +## Usage + +The *KiBOM_CLI* script can be run directly from KiCad or from the command line. For command help, run the script with the *-h* flag e.g. + + python KiBOM_CLI.py -h + +![alt tag](example/help.png?raw=True "Command Line") + +**netlist** The netlist must be provided to the script. When running from KiCAD use "%I" +**--output / -o** If provided, this is the path to the BoM output. If not provided, the script will use the same name as the input file, with the suffix "_bom.csv" +**--cfg** If provided, this is the BOM config file that will be used. If not provided, options will be loaded from "bom.ini" +**--verbose / -v** Enable extra debugging information + +To run from KiCad, simply add the same command line in the *Bill of Materials* script window. e.g. to generate a HTML output: + +![alt tag](example/html_eg.png?raw=True "HTML Example") + ## Features ### Intelligent Component Grouping @@ -107,7 +124,7 @@ Hit the "Generate" button, and the output window should show that the BoM genera ### HTML Output The output HTML file is generated as follows: -![alt tag](example/html.png?raw=True "HTML") +![alt tag](example/html_eg.png?raw=True "HTML") Here the components are correctly grouped, with links to datasheets where appropriate, and fields color-coded. diff --git a/__init__.py b/__init__.py index 90b1d514..f234336b 100644 --- a/__init__.py +++ b/__init__.py @@ -1,3 +1,2 @@ - -import sys -sys.path.append(".") \ No newline at end of file +import KiBOM +from KiBOM import * \ No newline at end of file diff --git a/example/help.png b/example/help.png new file mode 100644 index 00000000..8dbb526f Binary files /dev/null and b/example/help.png differ diff --git a/example/html_eg.png b/example/html_eg.png new file mode 100644 index 00000000..15bd8e03 Binary files /dev/null and b/example/html_eg.png differ