Skip to content

Commit

Permalink
Merge 0b6b7cb into 22a35a1
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Jul 18, 2020
2 parents 22a35a1 + 0b6b7cb commit eaa4a58
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion KiBOM_CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(this file is auto-generated with default options the first time the script is executed).
For usage help:
python -m kibom -h
python KiBOM_CLI.py -h
"""

import sys
Expand Down
54 changes: 24 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,46 @@ BoM options are user-configurable in a per-project configuration file.

## Installation

KiBom can be installed through the PIP package manager:
KiBoM can be installed via multiple methods:

```pip install kibom```

*Note: Take note of which python executable you use when installing kibom - this is the same executable you must use when running the KiBom script from KiCAD (more details below under "Usage")*
**A. Download**

## Usage

The KiBoM script can be run directly from KiCad or from the command line, e.g.
Download the KiBoM [package from github](https://github.com/SchrodingersGat/KiBoM/archive/master.zip) and extract the .zip archive to a location on your computer.

`python -m kibom "%I" "%O.csv"`
**B. Git Clone**

**Note: Selecting python executable**
Use git to clone the source code to your computer:

The python executable you choose (i.e. the *python* part of the command above) **must** be the same as the one you used to install kibom (using pip).
`git clone https://github.com/SchrodingersGat/kibom`

By default KiCad uses the version of python packaged with the KiCad application (i.e. kicad/bin/python).
**C. PIP**

**Example: Install kibom under python3 on windows**
KiBom can also be installed through the PIP package manager:

You have installed kibom using Python3: `pip3 install kibom`
```pip install kibom```

To launch the script correctly from the KiCad BOM window, use the command:
*Note: Take note of which python executable you use when installing kibom - this is the same executable you must use when running the KiBom script from KiCAD (more details below under "Usage")*

`python3.exe -m kibom "%I" "%O.csv"`
Installing under PIP is recommended for advanced users only, as the exact location of the installed module must be known to properly run the script from within KiCad.

If you are running a different python version, select that accordingly.
## Usage

For command help, run the script with the *-h* flag e.g.
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 -m kibom -h`
`python KiBOM_CLI.py -h`

~~~~
usage: python -m kibom [-h] [-n NUMBER] [-v] [-r VARIANT] [-d SUBDIRECTORY]
[--cfg CFG] [-s SEPARATOR] [--version]
usage: KiBOM_CLI.py [-h] [-n NUMBER] [-v] [-r VARIANT] [--cfg CFG]
[-s SEPARATOR]
netlist output
KiBOM Bill of Materials generator script
positional arguments:
netlist xml netlist file. Use "%I" when running from within
KiCad
output BoM output file name. Use "%O" when running from
within KiCad to use the default output name (csv
output BoM output file name. Use "%O" when running from
within KiCad to use the default output name (csv
file). For e.g. HTML output, use "%O.html"
optional arguments:
Expand All @@ -66,21 +62,19 @@ optional arguments:
Number of boards to build (default = 1)
-v, --verbose Enable verbose output
-r VARIANT, --variant VARIANT
Board variant(s), used to determine which components
are output to the BoM. To specify multiple variants,
with a BOM file exported for each variant, separate
variants with the ';' (semicolon) character.
Board variant(s), used to determine which components are
output to the BoM
-d SUBDIRECTORY, --subdirectory SUBDIRECTORY
Subdirectory within which to store the generated BoM
files.
Subdirectory (relative to output file) within which the
BoM(s) should be written.
--cfg CFG BoM config file (script will try to use 'bom.ini' if
not specified here)
-s SEPARATOR, --separator SEPARATOR
CSV Separator (default ',')
--version show program's version number and exit
~~~~
~~~~

**netlist** The netlist must be provided to the script. When running from KiCad use "%I"

**output** This is the path to the BoM output. When running from KiCad, usage "%O" for the default option
Expand Down
Binary file modified example/html_ex.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eaa4a58

Please sign in to comment.