Skip to content

Commit

Permalink
Merge pull request #93 from SchrodingersGat/pipify
Browse files Browse the repository at this point in the history
Pipify
  • Loading branch information
SchrodingersGat authored Mar 22, 2020
2 parents 1b3bad5 + 8a38b16 commit f0f933b
Show file tree
Hide file tree
Showing 27 changed files with 425 additions and 281 deletions.
4 changes: 1 addition & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
[run]
source =
KiBOM_CLI.py
./bomlib
source = ./kibom
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ venv.bak/
.coverage
htmlcov/

# PIP build
build/
dist/
kibom.egg-info/

.python-version
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,27 @@ language: python

python:
- 2.7
- 3.6
- 3.7

install:
- pip install -r test/requirements.txt
- pip install wheel

addons:
apt:
update: true

before_install:
- sudo apt-get install python3-pip python3-coverage python3-xlsxwriter
- pip install coverage
- pip install xlsxwriter

script:
# Check Python code for style-guide
- flake8 .
# Run the coverage tests
- bash ./run-tests.sh
# Ensure the module can actually build
- python setup.py bdist_wheel --universal

after_success:
- coveralls
212 changes: 0 additions & 212 deletions KiBOM_CLI.py

This file was deleted.

45 changes: 31 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,42 @@ KiBoM intelligently groups components based on multiple factors, and can generat

BoM options are user-configurable in a per-project configuration file.

## Installation

KiBom can be installed through the PIP package manager:

```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")*

## 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.
The *KiBOM_CLI* script can be run directly from KiCad or from the command line, e.g.

`python -m kibom "%I" "%O.csv"`

**Note: Selecting python executable**

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).

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

**Example: Install kibom under python3 on windows**

`python KiBOM_CLI.py -h`
You have installed kibom using Python3: `pip3 install kibom`

To launch the script correctly from the KiCad BOM window, use the command:

`python3.exe -m kibom "%I" "%O.csv"`

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

For command help, run the script with the *-h* flag e.g.

`python -m kibom -h`

~~~~
usage: KiBOM_CLI.py [-h] [-n NUMBER] [-v] [-r VARIANT] [-d SUBDIRECTORY]
usage: python -m kibom [-h] [-n NUMBER] [-v] [-r VARIANT] [-d SUBDIRECTORY]
[--cfg CFG] [-s SEPARATOR] [--version]
netlist output
Expand Down Expand Up @@ -364,17 +392,6 @@ C3 and C5 have the same value and footprint
**C4**
C4 has a different footprint to C3 and C5, and thus is grouped separately

A HTML BoM file is generated as follows:

![alt tag](example/bom.png?raw=True "BoM")

To add the BoM script, the Command Line options should be configured as follows:
* path-to-python-script (KiBOM_CLI.py)
* netlist-file "%I"
* output_path "%O_bom.html" (replace file extension for different output file formats)

Hit the "Generate" button, and the output window should show that the BoM generation was successful.

### HTML Output
The output HTML file is generated as follows:

Expand Down
Empty file removed __init__.py
Empty file.
Empty file removed bomlib/__init__.py
Empty file.
Binary file removed example/bom.png
Binary file not shown.
Binary file modified example/html_ex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions kibom/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
Loading

0 comments on commit f0f933b

Please sign in to comment.