Giter VIP home page Giter VIP logo

kipart's Introduction

KiPart

Generate multi-unit schematic symbols for KiCad from a CSV, text, or Excel file.

Features

  • Generates schematic part libraries for KiCad from CSV/text/Excel files.
  • Converts lists of pins in a file into a multi-unit schematic part symbol.
  • Converts multiple files stored in .zip archives.
  • Each row of the file lists the number, name, type, style, unit and side of a pin.
  • Pins on a unit with the same name (e.g., GND) can be placed at the same location so they can all be tied to the same net with a single connection.
  • Also includes kilib2csv for converting schematic part libraries into CSV files suitable for input to KiPart.

Example Use Case

From a user:

I had a very complex library for a microprocessor that I needed to refactor— I needed to reorder hundreds of pins in a sane human-usable format. I thought I was going to have do it by hand in KiCAD's graphical symbol editor. I tried that, got very frustrated with all the clicking and dragging.

So I then:

  • searched and found this tool,
  • used kilib2csv to export my KiCAD lib to CSV,
  • imported the CSV in a spreadsheet program
  • edited the spreadsheet (mainly sorting the pins by function using the spreadsheet's sort() function),
  • exported the spreadsheet back to CSV,
  • used kipart to export back to KiCAD.

Boom! Usable part in minutes.

kipart's People

Contributors

adamfeuer avatar cnieves1 avatar dependabot[bot] avatar descampsa avatar dnschneid avatar dvdfreitag avatar geospark avatar hyozd avatar johnthagen avatar martoni avatar mpkuti avatar q3k avatar randrej avatar xesscorp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kipart's Issues

Please elaborate KiPart documentation to explain how to run as a script

I am familiar with python as a scripting language, but I do not understand the part about "running KiPart as a script" in the Usage part of the documentation. After installing using "pip install kipart", I don't know how to proceed. Where do i write "kipart -v" to test the software? Do I run it from a python command promt, from a windows cmd promt, etc? Neither works.

Thank you very much.

DCM Feature

There is a file called library.dcm that hold some extra informations about the symbol.
It would be nice to have it embedded in Kipart.

Follows the content of the file considering my_symbol.

EESchema-DOCLIB  Version 2.0
#
$CMP my_symbol
D description1 description2 description3
K keyword1 keyword2 keyword3
F filename_documentation
$ENDCMP
#
#End Doc Library

What do you think?

Fails under python2.7

The last commit included a python 3.0 only feature, the extended destructuring *_ in common.py:79.

Footprint and datasheet fields seem to be required in kicad 5

It seems that with Kicad 5, that the F2 and F3 fields are required (i.e. footprint and datasheet). I couldn't find any official documentation to back this up other than kicad won't load the symbol library created with kipart unless those fields are in the file. There is documentation I found here:
https://forum.kicad.info/t/lib-format-description/3226
that seems to indicate that F2 and F3 were required back in 2016, but perhaps not enforced?

Read spice files

Is your feature request related to a problem? Please describe.

I have a large library of spice models, and I'm looking for a good tool to do schematic entry and simulation.
It seems eeschema is one of the more mature options out there, but it would be a lot of work to manually make symbols for this library.

Describe the solution you'd like

I'd like to be able to auto-generate KiCad symbols for the spice models, that have all the right attributes set to use them in simulation.

In LTSpice it is possible to right-click a spice model and auto-generate a symbol from it, it would be great to have this functionality in KiCad.

Describe alternatives you've considered

It would also be possible to write a separate script to generate a csv file from the spice file and then run your tool.
This allows easy editing of the symbol, but adds an extra program and extra step.

Maybe it would be possible to use https://gitlab.com/kicad/libraries/kicad-library-utils/-/tree/master/schlib/autogen instead.

Additional context

The library I'm trying to work with is https://github.com/google/skywater-pdk

I'd be happy to try and implement this feature, but always good to check what author of the project thinks before jumping in.

update for kicad version 6

First of thank you for this piece of software! creating symbols has never been easier;

Is your feature request related to a problem? Please describe.
with Kicad version 6 the transition to S-Expressions has finished (now symbols/libraries are shaved as S expressions). This is not really an issue (or at least for me) for the normal functionality of kipart because importing an older symbol (.lib) still works as expected.
However if you want to use kilib2csv to convert a symbol back to a csv file, conversion doesn't fail but the resulting csv is empty.

Describe the solution you'd like
Ideally kipart (kilb2csv) should be updated to also handle the newer format.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add an option to change unit sorting order.

Currently, units are sorted in this way:
A, AA, AB, AC, B, C

It would be nice to add an option to control the unit sorting order:

  1. Do not sort (units should appear in the same order as in the CSV file)
  2. Sort like in KiCad (A, B, C, AA, AB, AC)
  3. Preserve current sorting order (A, AA, AB, AC, B, C)

Currently, the workaround to achieve KiCad-like sorting order is to rename double-letter names to something like:
A, B, C, ZA, ZB, ZC


Forked from issue #66

* at start of pin number not generating "gap" pin

The usage documentation states that putting a * at the start of a pin number will create a non-exxistent "gap" pin for visual grouping, when using -s row, but this doesn't appear to be the case.

When I run kipart -r generic -s row -o printer_parts.lib --overwrite kipart_parts.csv with KiPart 0.1.14 using the following CSV:

X95840WV20I-2.7
Pin,Type,Style,Side,Name
14,input,,left,A0
15,input,,left,A1
4,input,,left,A2
*5,io,clock,left,SCL
6,io,,left,SDA
17,input,,left,~WP
*16,pwr,,left,VCC
7,pwr,,left,GND
2,passive,,right,RL3
3,output,,right,RW3
1,passive,,right,RH3
*9,passive,,right,RL2
8,output,,right,RW2
10,passive,,right,RH2
*12,passive,,right,RL1
11,output,,right,RW1
13,passive,,right,RH1
*19,passive,,right,RL0
20,output,,right,RW0
18,passive,,right,RH0

I get the following part:
screenshot 2016-02-16 13 42 47

It would be nice to have an example of generating the "gap" pins in https://kipart.readthedocs.org/en/latest/usage.html in case this isn't the proper format that should be generating "gap" pins.

Error creating symbol

version: KiPart 0.1.21
I created the attached CSV and when I run the command line below I get this console output:

kipart --sort row --bundle --overwrite --output mcu.lib ATMEL_ATSAMA5D27.csv

Traceback (most recent call last): File "/usr/local/bin/kipart", line 9, in <module> load_entry_point('kipart==0.1.21', 'console_scripts', 'kipart')() File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.21-py2.7.egg/kipart/__main__.py", line 144, in main append_to_lib = call_kipart(part_data_file) File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.21-py2.7.egg/kipart/__main__.py", line 127, in call_kipart debug_level=args.debug) File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.21-py2.7.egg/kipart/kipart.py", line 571, in kipart fuzzy_match=fuzzy_match) File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.21-py2.7.egg/kipart/kipart.py", line 487, in draw_symbol draw_pins(lib_file, unit_num, sorted_side_pins, transform[side], KeyError: ''

and the attached .lib
symbol.zip

Pin-Order, chip-like and connector-like

Is it possible, that the pins on the right side are ordered from top to bottom?

In this case I changed the side from left to right for all pins. Here I could have reversed the sort direction:
2017-04-18_001

But in this case I got not what I wanted:

What KiPart generated:
2017-04-18_002

And what I wanted:
2017-04-18_003

Feature Request: Connector output format (maybe more)

Great tool, but an excellent feature would be to add a connector output format for Eg DIP headers similar to that implemented on the rohrbacher web tool - see attached pic.

I'm breadboarding an STM32 project from the LQFP144 package on an adapter board and this would be SUPER useful for labeling the pins on the breakout connectors.
ie create 4 36 pin connectors in the "CONN1" style in the picture
capture

Maybe I can have a crack at it over the weekend

default output directory should be working directory

I've installed kipart to system directories using pip. When I run kipart without an output path, I get this error.

Traceback (most recent call last):
  File "/usr/local/bin/kipart", line 9, in <module>
    load_entry_point('kipart==0.1.28', 'console_scripts', 'kipart')()
  File "/usr/local/lib/python2.7/dist-packages/kipart/__main__.py", line 144, in main
    append_to_lib = call_kipart(part_data_file)
  File "/usr/local/lib/python2.7/dist-packages/kipart/__main__.py", line 127, in call_kipart
    debug_level=args.debug)
  File "/usr/local/lib/python2.7/dist-packages/kipart/kipart.py", line 660, in kipart
    with open(lib_filename, lib_filemode) as lib_file:
IOError: [Errno 13] Permission denied: '/usr/local/bin/kipart.lib'

I think it happens because of this line of code. Path of kipart executable, is used for default directory. I would like to change this to the current working directory if you agree.

ImportError: No module named builtins

When running KiPart 0.1.10 using Python 2.7.6 or 2.7.10 the following error is given:
Traceback (most recent call last):
File "/usr/local/bin/kipart", line 7, in
from kipart.main import main
File "/usr/local/lib/python2.7/dist-packages/kipart/main.py", line 31, in
from .kipart import *
File "/usr/local/lib/python2.7/dist-packages/kipart/kipart.py", line 27, in
from builtins import str
ImportError: No module named builtins

Extra fields

Allow extra fields and values to be specified in the CSV file passed to KiPart.

Empty rows are not handled correctly

Hi,
I see emtpy rows are not handled correctly.

If I run the command:

kipart -r generic -s row --box_line_width 20 test.csv -o test.lib --overwrite

on the attached file:

test.csv

Then it fails with:

Traceback (most recent call last):
  File "C:\Users\Carlos\AppData\Local\Programs\Python\Python38\Scripts\kipart-script.py", line 11, in <module>
    load_entry_point('kipart==1.0.0', 'console_scripts', 'kipart')()
  File "c:\users\carlos\appdata\local\programs\python\python38\lib\site-packages\kipart-1.0.0-py3.8.egg\kipart\kipart.py", line 1105, in main
    call_kipart(
  File "c:\users\carlos\appdata\local\programs\python\python38\lib\site-packages\kipart-1.0.0-py3.8.egg\kipart\kipart.py", line 883, in call_kipart
    return kipart(
  File "c:\users\carlos\appdata\local\programs\python\python38\lib\site-packages\kipart-1.0.0-py3.8.egg\kipart\kipart.py", line 837, in kipart
    parts_lib[part_num] = draw_symbol(
  File "c:\users\carlos\appdata\local\programs\python\python38\lib\site-packages\kipart-1.0.0-py3.8.egg\kipart\kipart.py", line 630, in draw_symbol
    balance_bboxes(bbox)
  File "c:\users\carlos\appdata\local\programs\python\python38\lib\site-packages\kipart-1.0.0-py3.8.egg\kipart\kipart.py", line 351, in balance_bboxes
    bal_bbox = find_bbox_bbox(bboxes["top"], bboxes["bottom"])
KeyError: 'top'

Flag for changing the generated files to follow the look of the KiCAD library

Is your feature request related to a problem? Please describe.
Not a problem, but inconsistency.
The generated ports using KiPart has a line width of ~0.3 and no fill, while the KiCAD packaged library sets the width to 0 and fills the port with the background color.

Describe the solution you'd like
A flag for telling KiPart that the generated symbols should follow the KiCAD standard.

Not a big thing, but would be nice :)
Thanks for a great tool!

Kipart cannot import STM32CubeMX pinouts anymore?

Hi,

It seems that some update has been made to the pinout format, when running on the attached generated CSV the following error is given:

$ kipart -r stm32cube kipart.csv                                                                                                                                                                                             

Traceback (most recent call last):
  File "/usr/bin/kipart", line 11, in <module>
    load_entry_point('kipart==0.1.36', 'console_scripts', 'kipart')()
  File "/usr/lib/python3.8/site-packages/kipart/kipart.py", line 1033, in main
    call_kipart(part_data_file, input_file, file_ext)
  File "/usr/lib/python3.8/site-packages/kipart/kipart.py", line 965, in call_kipart
    return kipart(
  File "/usr/lib/python3.8/site-packages/kipart/kipart.py", line 805, in kipart
    ) in part_reader(part_data_file, part_data_file_name, part_data_file_type):
TypeError: stm32cube_reader() takes from 1 to 2 positional arguments but 3 were given

Tested with kipart 0.1.36 on Arch with Python 3.8.1, pinout CSV generated with STM32CubeMX 5.5.0

STM32CubeMX generated pinout CSV file:

"Position","Name","Type","Signal","Label","AF0","AF1","AF2","AF3","AF4","AF5","AF6","AF7","AF8","AF9","AF10","AF11","AF12","AF13","AF14","AF15"
"1","VBAT","Power","","","","","","","","","","","","","","","","","",""
"2","PC13","I/O","","","","","","","","","","","","","","","","","","EVENTOUT"
"3","PC14-OSC32_IN (PC14)","I/O","RCC_OSC32_IN","","","","","","","","","","","","","","","","","EVENTOUT"
"4","PC15-OSC32_OUT (PC15)","I/O","","","","","","","","","","","","","","","","","","EVENTOUT"
"5","PH0-OSC_IN (PH0)","I/O","","","","","","","","","","","","","","","","","","EVENTOUT"
"6","PH1-OSC_OUT (PH1)","I/O","","","","","","","","","","","","","","","","","","EVENTOUT"
"7","NRST","Reset","","","","","","","","","","","","","","","","","",""
"8","VSSA/VREF-","Power","","","","","","","","","","","","","","","","","",""
"9","VDDA/VREF+","Power","","","","","","","","","","","","","","","","","",""
"10","PA0","I/O","ADC1_IN5","","","TIM2_CH1","","","","","","USART2_CTS","","","","","COMP1_OUT","","TIM2_ETR","EVENTOUT"
"11","PA1","I/O","USART2_DE","","","TIM2_CH2","","","I2C1_SMBA","SPI1_SCK","","USART2_DE/USART2_RTS","","","","","","","TIM15_CH1N","EVENTOUT"
"12","PA2","I/O","USART2_TX","","","TIM2_CH3","","","","","","USART2_TX","LPUART1_TX","","QUADSPI_BK1_NCS","","","","TIM15_CH1","EVENTOUT"
"13","PA3","I/O","USART2_RX","","","TIM2_CH4","","","","","","USART2_RX","LPUART1_RX","","QUADSPI_CLK","","","","TIM15_CH2","EVENTOUT"
"14","PA4","I/O","SPI1_NSS","","","","","","","SPI1_NSS","","USART2_CK","","","","","","","LPTIM2_OUT","EVENTOUT"
"15","PA5","I/O","SPI1_SCK","","","TIM2_CH1","TIM2_ETR","","","SPI1_SCK","","","","","","","","","LPTIM2_ETR","EVENTOUT"
"16","PA6","I/O","SPI1_MISO","","","TIM1_BKIN","","","","SPI1_MISO","COMP1_OUT","USART3_CTS","LPUART1_CTS","","QUADSPI_BK1_IO3","","","","TIM16_CH1","EVENTOUT"
"17","PA7","I/O","SPI1_MOSI","","","TIM1_CH1N","","","I2C3_SCL","SPI1_MOSI","","","","","QUADSPI_BK1_IO2","","","","","EVENTOUT"
"18","PB0","I/O","","","SYS_TRACED0","TIM1_CH2N","","","","SPI1_NSS","","USART3_CK","","","QUADSPI_BK1_IO1","","COMP1_OUT","","","EVENTOUT"
"19","PB1","I/O","","","SYS_TRACED1","TIM1_CH3N","","","","","","USART3_DE/USART3_RTS","LPUART1_DE/LPUART1_RTS","","QUADSPI_BK1_IO0","","","","LPTIM2_IN1","EVENTOUT"
"20","PB2","I/O","","","RTC_OUT_ALARM/RTC_OUT_CALIB","LPTIM1_OUT","","","I2C3_SMBA","","","","","","","","","","","EVENTOUT"
"21","PB10","I/O","","","","TIM2_CH3","","","I2C2_SCL","SPI2_SCK","","USART3_TX","LPUART1_RX","TSC_SYNC","QUADSPI_CLK","","COMP1_OUT","","","EVENTOUT"
"22","PB11","I/O","","","","TIM2_CH4","","","I2C2_SDA","","","USART3_RX","LPUART1_TX","","QUADSPI_BK1_NCS","","","","","EVENTOUT"
"23","VSS","Power","","","","","","","","","","","","","","","","","",""
"24","VDD","Power","","","","","","","","","","","","","","","","","",""
"25","PB12","I/O","SPI2_NSS","","","TIM1_BKIN","","","I2C2_SMBA","SPI2_NSS","","USART3_CK","LPUART1_DE/LPUART1_RTS","TSC_G1_IO1","","","","","TIM15_BKIN","EVENTOUT"
"26","PB13","I/O","SPI2_SCK","","","TIM1_CH1N","","","I2C2_SCL","SPI2_SCK","","USART3_CTS","LPUART1_CTS","TSC_G1_IO2","","","","","TIM15_CH1N","EVENTOUT"
"27","PB14","I/O","SPI2_MISO","","","TIM1_CH2N","","","I2C2_SDA","SPI2_MISO","","USART3_DE/USART3_RTS","","TSC_G1_IO3","","","","","TIM15_CH1","EVENTOUT"
"28","PB15","I/O","SPI2_MOSI","","RTC_REFIN","TIM1_CH3N","","","","SPI2_MOSI","","","","TSC_G1_IO4","","","","","TIM15_CH2","EVENTOUT"
"29","PA8","I/O","TIM1_CH1","","RCC_MCO","TIM1_CH1","","","","","","USART1_CK","","","","","","","LPTIM2_OUT","EVENTOUT"
"30","PA9","I/O","TIM1_CH2","","","TIM1_CH2","","","I2C1_SCL","","","USART1_TX","","","","","","","TIM15_BKIN","EVENTOUT"
"31","PA10","I/O","TIM1_CH3","","","TIM1_CH3","","","I2C1_SDA","","","USART1_RX","","","CRS_SYNC","","","","","EVENTOUT"
"32","PA11","I/O","","","","TIM1_CH4","TIM1_BKIN2","","","SPI1_MISO","COMP1_OUT","USART1_CTS","","","USB_DM","","TIM1_BKIN2_COMP1","","","EVENTOUT"
"33","PA12","I/O","USART1_DE","","","TIM1_ETR","","","","SPI1_MOSI","","USART1_DE/USART1_RTS","","","USB_DP","","","","","EVENTOUT"
"34","PA13 (JTMS/SWDIO)","I/O","SYS_JTMS-SWDIO","","SYS_JTMS-SWDIO","IR_OUT","","","","","","","","","USB_NOE","","","","","EVENTOUT"
"35","VSS","Power","","","","","","","","","","","","","","","","","",""
"36","VDDUSB","Power","","","","","","","","","","","","","","","","","",""
"37","PA14 (JTCK/SWCLK)","I/O","SYS_JTCK-SWCLK","","SYS_JTCK-SWCLK","LPTIM1_OUT","","","I2C1_SMBA","","","","","","","","","","","EVENTOUT"
"38","PA15 (JTDI)","I/O","","","SYS_JTDI","TIM2_CH1","TIM2_ETR","USART2_RX","","SPI1_NSS","","USART3_DE/USART3_RTS","","","","","","","","EVENTOUT"
"39","PB3 (JTDO/TRACESWO)","I/O","SYS_JTDO-SWO","","SYS_JTDO-SWO","TIM2_CH2","","","","SPI1_SCK","","USART1_DE/USART1_RTS","","","","","","","","EVENTOUT"
"40","PB4 (NJTRST)","I/O","","","SYS_JTRST","","","","I2C3_SDA","SPI1_MISO","","USART1_CTS","","TSC_G2_IO1","","","","","","EVENTOUT"
"41","PB5","I/O","","","SYS_TRACED2","LPTIM1_IN1","","","I2C1_SMBA","SPI1_MOSI","","USART1_CK","","TSC_G2_IO2","","","","","TIM16_BKIN","EVENTOUT"
"42","PB6","I/O","USART1_TX","","SYS_TRACED3","LPTIM1_ETR","","","I2C1_SCL","","","USART1_TX","","TSC_G2_IO3","","","","","TIM16_CH1N","EVENTOUT"
"43","PB7","I/O","USART1_RX","","SYS_TRACECLK","LPTIM1_IN2","","","I2C1_SDA","","","USART1_RX","","TSC_G2_IO4","","","","","","EVENTOUT"
"44","PH3-BOOT0 (BOOT0)","I/O","","","","","","","","","","","","","","","","","","EVENTOUT"
"45","PB8","I/O","","","","","","","I2C1_SCL","","","","","","","","","","TIM16_CH1","EVENTOUT"
"46","PB9","I/O","","","","IR_OUT","","","I2C1_SDA","SPI2_NSS","","","","","","","","","","EVENTOUT"
"47","VSS","Power","","","","","","","","","","","","","","","","","",""
"48","VDD","Power","","","","","","","","","","","","","","","","","",""

Error when loading part generated by kipart

Hi,

I tried to generate a single part with kipart and when I add it to the libraries list I get the following error:
"Library 'lt1512' component load error error <error 'pin only had 6 parameters of the required 11 or 12' in DRAW command X> occurred at line 15 ."

Here is the csv I created: https://dl.dropboxusercontent.com/u/9135021/lt1512.csv
Here is the lib that was created: https://dl.dropboxusercontent.com/u/9135021/lt1512.lib

The command I used was kipart lt1512.csv -o lt1512.lib

Running this on fedora 22 with the latest revision of kicad (bzr 6089).

[KiPart BUG] Wrong unit sorting order (A, AA, AB, AC, B, ...)

Describe the bug
I have a pin table with units specified.

The problem is that units doesn't match KiCad names:

KiCad unit name CSV unit name
A A
B AA
C AB
D AC
E B
... ...

Expected behavior
I expect the KiCad unit names to match the unit names provided in the CSV table:

KiCad unit name CSV unit name
A A
B B
... ...
AA AA
AB AB
AC AC
... ...

Desktop (please complete the following information):

  • OS: Windows 10
  • Python version: 3.9.12
  • KiPart version: 1.0.0

[KiPart BUG]: Bundle doesn't work as expected when stacking power and passive pins as per KLC S4.3

Kicad library rule:

https://klc.kicad.org/symbol/s4/s4.3/

Specifies that invisible pins when stacking should be have passive pin type.

However, KiPart only bundles pins when those pins are power type.

Changing:

def is_pwr(pin, fuzzy_match):
    """Return true if this is a power input pin."""
    return (
        find_closest_match(name=pin.type, name_dict=PIN_TYPES, fuzzy_match=fuzzy_match)
        == "W"
    )

to

def is_pwr(pin, fuzzy_match):
    """Return true if this is a power input pin."""
    return (
        (find_closest_match(name=pin.type, name_dict=PIN_TYPES, fuzzy_match=fuzzy_match)
        == "W") or 
        (find_closest_match(name=pin.type, name_dict=PIN_TYPES, fuzzy_match=fuzzy_match)
        == "P")
    )

does the trick.

Pin Ordering Question

Hello,

I'm using the following test.csv file to create a symbol:

TestIC,,,,,,
,,,,,,
Pin,Unit,Name,Type,Side,Style,Hidden
A1,,FUNC1_IN,in,left,,
A2,,FUNC1_IN,in,left,,
B1,,FUNC1_OUT,out,right,,
B2,,FUNC1_OUT,out,right,,
C1,,FUNC2_IN,in,left,,
C2,,FUNC2_IN,in,left,,
D1,,FUNC2_OUT,out,right,,
D2,,FUNC2_OUT,out,right,,
E1,,FUNC3_IN,in,left,,
E2,,FUNC3_IN,in,left,,
F1,,FUNC3_OUT,out,right,,
F2,,FUNC3_OUT,out,right,,

Then I run kipart with default options:

kipart test.csv

The pin order on the left side is as expected (FUNC1, FUNC2, FUNC3) but on the right side it is reversed (FUNC3, FUNC2, FUNC1 from top to bottom)

How can I keep the pins on the left and right sides aligned (e.g. FUNC1 pins above FUNC2 pins on both sides)? Am I missing something in the documentation?

KiPart is AWESOME!

Describe the bug
Not a bug. KiPart is AWESOME!

Additional context

I had a very complex library for a microprocessor that I needed to refactor— to reorder hundreds of pins in a sane human-usable format. I thought I was going to have do it by hand in the graphical symbol editor. I tried that, got very frustrated with all the clicking and dragging, searched and found this tool, used kilib2csv to export my KiCAD lib to CSV, edited the CSV in a spreadsheet program, exported back to CSV, used kipart to export back to KiCAD. Boom! Usable part in minutes.

This tool is awesome.

Thank you.

multiple parts in a single csv file doesn't work

From the instructions in usage manual I've created this CSV file;

CONN_03X02

Pin, Unit, Name
1, 1, P1
2, 1, P2
3, 1, P3
4, 2, P4
5, 2, P5
6, 2, P6

CONN_03X03

Pin, Unit, Name
1, 1, P1
2, 1, P2
3, 1, P3
4, 2, P4
5, 2, P5
6, 2, P6
7, 3, P7
8, 3, P8
9, 3, P9

But I got this error:

Traceback (most recent call last):
  File "/usr/local/bin/kipart", line 9, in <module>
    load_entry_point('kipart==0.1.16', 'console_scripts', 'kipart')()
  File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.16-py2.7.egg/kipart/__main__.py", line 127, in main
    append_to_lib = call_kipart(part_data_file)
  File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.16-py2.7.egg/kipart/__main__.py", line 112, in call_kipart
    debug_level=args.debug)
  File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.16-py2.7.egg/kipart/kipart.py", line 544, in kipart
    for part_num, pin_data in part_reader(part_data_file):
  File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.16-py2.7.egg/kipart/generic_reader.py", line 88, in generic_reader
    setattr(pin, a, fix_pin_data(row[c], part_num))
  File "/usr/local/lib/python2.7/dist-packages/kipart-0.1.16-py2.7.egg/kipart/common.py", line 118, in fix_pin_data
    fixed_pin_data = pin_data.strip()  # Remove leading/trailing spaces.
AttributeError: 'NoneType' object has no attribute 'strip'

After some investigations I've noticed that blank line separating the parts is ignored because csv.DictReader used here simply skips empty lines. This stackoverflow question has some info on the matter.

As a workaround I've used a line containing a single comma commas to separate parts. Ex:

...
5, 2, ~
6, 2, ~
,,
CONN_03X03

Pin, Unit, Name
1, 1, ~
2, 1, ~

...

Edit: added missing name column, which didn't effect the result

stm32cube reader failing in 1.43

Hi, it seems there has been a regression/new format for stm32cube, when running now one gets the following error:

Traceback (most recent call last):
  File "/usr/bin/kipart", line 33, in <module>
    sys.exit(load_entry_point('kipart==0.1.43', 'console_scripts', 'kipart')())
  File "/usr/lib/python3.8/site-packages/kipart/kipart.py", line 1050, in main
    call_kipart(part_data_file, input_file, file_ext)
  File "/usr/lib/python3.8/site-packages/kipart/kipart.py", line 979, in call_kipart
    return kipart(
  File "/usr/lib/python3.8/site-packages/kipart/kipart.py", line 799, in kipart
    for (
  File "/usr/lib/python3.8/site-packages/kipart/stm32cube_reader.py", line 146, in stm32cube_reader
    ports = group_pins(pins)
  File "/usr/lib/python3.8/site-packages/kipart/stm32cube_reader.py", line 108, in group_pins
    ports[port] = sorted(ports[port], key=lambda p: parse_portpin(p[1])[1])
  File "/usr/lib/python3.8/site-packages/kipart/stm32cube_reader.py", line 108, in <lambda>
    ports[port] = sorted(ports[port], key=lambda p: parse_portpin(p[1])[1])
TypeError: 'NoneType' object is not subscriptable

With the following CSV:

"Position","Name","Type","Signal","Label"
"A1","PE3","I/O","",""
"A2","PE2","Output","GPIO_Output","T_VCC_EN"
"A3","PE1","I/O","",""
"A4","PE0","Output","GPIO_Output","LED3"
"A5","PB8","Output","GPIO_Output","LED2"
"A6","PB5","I/O","SPI1_MOSI",""
"A7","PG14","Output","GPIO_Output","GNDDet"
"A8","PG13","Output","GPIO_Output","RESET"
"A9","PB4","I/O","SPI1_MISO",""
"A10","PB3","I/O","SPI1_SCK",""
"A11","PD7","I/O","",""
"A12","PC12","I/O","",""
"A13","PA15","I/O","",""
"A14","PA14","I/O","SYS_JTCK-SWCLK",""
"A15","PA13","I/O","SYS_JTMS-SWDIO",""
"B1","PE4","I/O","",""
"B2","PE5","I/O","",""
"B3","PE6","I/O","",""
"B4","PB9","I/O","",""
"B5","PB7","I/O","USART1_RX",""
"B6","PB6","I/O","USART1_TX",""
"B7","PG15","I/O","",""
"B8","PG12","I/O","",""
"B9","PG11","I/O","",""
"B10","PG10","I/O","",""
"B11","PD6","I/O","USART2_RX",""
"B12","PD0","I/O","",""
"B13","PC11","I/O","",""
"B14","PC10","Output","GPIO_Output","LED1"
"B15","PA12","I/O","USB_OTG_FS_DP",""
"C1","VBAT","Power","",""
"C2","PI7","I/O","",""
"C3","PI6","I/O","",""
"C4","PI5","I/O","",""
"C5","VDD","Power","",""
"C6","PDR_ON","Reset","",""
"C7","VDD","Power","",""
"C8","VDDSDMMC","Power","",""
"C9","VDD","Power","",""
"C10","PG9","I/O","",""
"C11","PD5","I/O","USART2_TX",""
"C12","PD1","I/O","",""
"C13","PI3","I/O","SPI2_MOSI",""
"C14","PI2","I/O","SPI2_MISO",""
"C15","PA11","I/O","USB_OTG_FS_DM",""
"D1","PC13","I/O","",""
"D2","PI8","I/O","",""
"D3","PI9","I/O","",""
"D4","PI4","I/O","",""
"D5","VSS","Power","",""
"D6","BOOT0","Boot","",""
"D7","VSS","Power","",""
"D8","VSS","Power","",""
"D9","VSS","Power","",""
"D10","PD4","I/O","",""
"D11","PD3","I/O","",""
"D12","PD2","I/O","",""
"D13","PH15","I/O","",""
"D14","PI1","I/O","SPI2_SCK",""
"D15","PA10","I/O","",""
"E1","PC14-OSC32_IN","I/O","",""
"E2","PF0","I/O","",""
"E3","PI10","I/O","",""
"E4","PI11","I/O","",""
"E12","PH13","I/O","",""
"E13","PH14","I/O","",""
"E14","PI0","I/O","",""
"E15","PA9","I/O","USB_OTG_FS_VBUS",""
"F1","PC15-OSC32_OUT","I/O","",""
"F2","VSS","Power","",""
"F3","VDD","Power","",""
"F4","PH2","I/O","",""
"F6","VSS","Power","",""
"F7","VSS","Power","",""
"F8","VSS","Power","",""
"F9","VSS","Power","",""
"F10","VSS","Power","",""
"F12","VSS","Power","",""
"F13","VCAP_2","Power","",""
"F14","PC9","I/O","",""
"F15","PA8","I/O","",""
"G1","PH0-OSC_IN","I/O","RCC_OSC_IN",""
"G2","VSS","Power","",""
"G3","VDD","Power","",""
"G4","PH3","I/O","",""
"G6","VSS","Power","",""
"G7","VSS","Power","",""
"G8","VSS","Power","",""
"G9","VSS","Power","",""
"G10","VSS","Power","",""
"G12","VSS","Power","",""
"G13","VDD","Power","",""
"G14","PC8","I/O","",""
"G15","PC7","I/O","",""
"H1","PH1-OSC_OUT","I/O","RCC_OSC_OUT",""
"H2","PF2","I/O","",""
"H3","PF1","I/O","",""
"H4","PH4","I/O","",""
"H6","VSS","Power","",""
"H7","VSS","Power","",""
"H8","VSS","Power","",""
"H9","VSS","Power","",""
"H10","VSS","Power","",""
"H12","VSS","Power","",""
"H13","VDDUSB","Power","",""
"H14","PG8","I/O","",""
"H15","PC6","I/O","",""
"J1","NRST","Reset","",""
"J2","PF3","I/O","",""
"J3","PF4","I/O","",""
"J4","PH5","I/O","",""
"J6","VSS","Power","",""
"J7","VSS","Power","",""
"J8","VSS","Power","",""
"J9","VSS","Power","",""
"J10","VSS","Power","",""
"J12","VDD","Power","",""
"J13","VDD","Power","",""
"J14","V12PHYHS","Power","",""
"J15","REXTPHYHS","MonoIO","USB_OTG_HS_REXTPHYHS",""
"K1","PF7","I/O","",""
"K2","PF6","I/O","",""
"K3","PF5","I/O","",""
"K4","VDD","Power","",""
"K6","VSS","Power","",""
"K7","VSS","Power","",""
"K8","VSS","Power","",""
"K9","VSS","Power","",""
"K10","VSS","Power","",""
"K12","PH12","I/O","",""
"K13","PG5","I/O","",""
"K14","PG4","I/O","",""
"K15","PG3","I/O","",""
"L1","PF10","I/O","",""
"L2","PF9","I/O","",""
"L3","PF8","I/O","",""
"L4","BYPASS_REG","Reset","",""
"L12","PH11","I/O","",""
"L13","PH10","I/O","",""
"L14","PD15","I/O","",""
"L15","PG2","I/O","",""
"M1","VSSA","Power","",""
"M2","PC0","I/O","",""
"M3","PC1","I/O","",""
"M4","PC2","I/O","",""
"M5","PC3","I/O","",""
"M6","PB2","I/O","",""
"M7","PG1","I/O","",""
"M8","VSS","Power","",""
"M9","VSS","Power","",""
"M10","VCAP_1","Power","",""
"M11","PH6","I/O","",""
"M12","PH8","I/O","",""
"M13","PH9","I/O","",""
"M14","PD14","I/O","",""
"M15","PD13","I/O","",""
"N1","VREF-","Power","",""
"N2","PA1","I/O","",""
"N3","PA0-WKUP","I/O","",""
"N4","PA4","I/O","",""
"N5","PC4","I/O","",""
"N6","PF13","I/O","",""
"N7","PG0","I/O","",""
"N8","VDD","Power","",""
"N9","VDD","Power","",""
"N10","VDD","Power","",""
"N11","PE13","I/O","",""
"N12","PH7","I/O","",""
"N13","PD12","I/O","",""
"N14","PD11","I/O","",""
"N15","PD10","Output","GPIO_Output","GPIO2"
"P1","VREF+","Power","",""
"P2","PA2","I/O","",""
"P3","PA6","I/O","",""
"P4","PA5","I/O","",""
"P5","PC5","I/O","",""
"P6","PF12","I/O","",""
"P7","PF15","I/O","",""
"P8","PE8","I/O","",""
"P9","PE9","I/O","",""
"P10","PE11","I/O","",""
"P11","PE14","I/O","",""
"P12","PB12","I/O","",""
"P13","PB13","I/O","USB_OTG_HS_VBUS",""
"P14","PD9","I/O","",""
"P15","PD8","Output","GPIO_Output","GPIO1"
"R1","VDDA","Power","",""
"R2","PA3","I/O","ADC1_IN3",""
"R3","PA7","I/O","",""
"R4","PB1","I/O","",""
"R5","PB0","I/O","",""
"R6","PF11","I/O","",""
"R7","PF14","I/O","",""
"R8","PE7","I/O","",""
"R9","PE10","I/O","",""
"R10","PE12","I/O","",""
"R11","PE15","I/O","",""
"R12","PB10","Output","GPIO_Output","USB_SEL"
"R13","PB11","I/O","",""
"R14","PB14","I/O","USB_OTG_HS_DM",""
"R15","PB15","I/O","USB_OTG_HS_DP",""

[KiPart BUG]

Failed to load on Mac with Python 3.10.5, seems there is a coding issue with pin_data.strip() function

Heres the what im getting on my console
Warning: Replaced whitespace with '' in pin ' DM4_N/ DB14_N' of part 135.
Warning: Replaced whitespace with '
' in pin '183 io' of part 135.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/bin/kipart", line 33, in
sys.exit(load_entry_point('kipart==1.1.0', 'console_scripts', 'kipart')())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kipart/kipart.py", line 1211, in main
call_kipart(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kipart/kipart.py", line 967, in call_kipart
return kipart(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kipart/kipart.py", line 897, in kipart
for (
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kipart/generic_reader.py", line 108, in generic_reader
setattr(pin, a, fix_pin_data(row_dict[c], part_num))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kipart/common.py", line 149, in fix_pin_data
fixed_pin_data = pin_data.strip() # Remove leading/trailing spaces.
AttributeError: 'NoneType' object has no attribute 'strip'

Error when running kipart

I tried running kpart using the example csv file provided in the test directory.
I get the following error everytime I run it:

kipart example1.csv -o example1.lib
usage: kipart [-h] [-v]
[-r [{generic,xilinxultra,xilinx7,xilinx6s,xilinx6v,psoc5lp,stm32cube,lattice,gowin}]]
[-s [{row,num,name}]] [--reverse]
[--side [{left,right,top,bottom}]] [-o [file.lib]] [-f] [-b]
[-a] [-w] [-d [LEVEL]]
file.[csv|txt|xlsx|zip] [file.[csv|txt|xlsx|zip] ...]
kipart: error: argument -r/--reader: invalid lower value: 'generic'

The version of kipart is 0.1.36

Hope I can get some feedback on this!

NC pins not bundled despite -b parameter

I am defining a new footprint for a molex connector where several pins are either GND or NC.

The multiple GND pins are properly bundled with the -b option.

The multiple NC pins remain unbundled in the resulting KiCad component.

Test-Connector
Pin,Name,Type,Side
1,GND,pwr,right
2,GND,pwr,right
3,DAC.1_out,out,right
4,DAC.2_out,out,right
5,DAC.1_10%,out,right
6,DAC.2_10%,out,right
7,NC,nc,right
8,NC,nc,right
9,NC,nc,right
10,NC,nc,right

Wishlist: Non-boxy parts

I haven't looked at the deep parts of the code, but I was wondering if it would be possible to define "templates" for non-boxy symbols like transistors (with an arbitrary number of units and joined pins) or operational amplifiers (again with an arbitrary number of units and pinout)

When creating a part from STM32Cube, create a single unit

Feature request: Create a schematic symbol with all pins in a single unit.

Solution from XessCorp/Author:

  1. Find the directory where kipart is installed.
  2. Go to the kipart subdirectory.
  3. Copy the stm32cube_reader.py file to my_stm32cube_reader.py
  4. Edit the my_stm32cube_reader.py file as follows:
  5. Line 113: Change the name of the stm32cube_reader(...) function to my_stm32cube_reader(...).
  6. Line 161: Change the assignment to pin.unit = "1"
    Now you can call kipart using the option "-r my_stm32cube" and all the pins should be assigned to a single unit.

Solution was just tested and works perfectly!

kipart: error: argument -r/--reader: invalid lower value: 'generic'

Hi,
I got an error when I launch kipart.
kipart: error: argument -r/--reader: invalid lower value: 'generic'
command line :
kipart example.csv
System : Ubuntu 18.04 LTS and Centos 7
Python install "out of the box"
openxyl installed on Centos.

I have trid to find it out by myself, but newbie on python, I did not find kipart script, only a kind of wrapper (?) in my /home/.local/bin, so any help or suggestion is welcome.

example.csv.txt

Issue with multiple units symbol

I cannot create multiple units symbol, when the manufacture's number or symbol's description field is populated.

I am using KiPart 0.1.42

CSV file i used with KiPart:
sample_csv.zip

Content of working and non-working lib file:

non-working

nonworking_symbol

working

working_symbol

Pin spacing parameter

It seems there is no way of setting pin spacing parameter other than modifying it in the source file ( kipart.py )

How to use this?

How do you actually use this tool?
Please add some info to the Wiki or README.
Cheers!

Tool crashes for unknown reason

System: windows 10, latest github version.

Error report:
"E:\Programming\HD6309_computer\documentation>kipart iCE40PinoutHX1K_kiparts2.csv --overwrite
Traceback (most recent call last):
File "C:\Python35\Scripts\kipart-script.py", line 11, in
load_entry_point('kipart==0.1.24', 'console_scripts', 'kipart')()
File "c:\python35\lib\site-packages\kipart-0.1.24-py3.5.egg\kipart_main_.py", line 144, in main
append_to_lib = call_kipart(part_data_file)
File "c:\python35\lib\site-packages\kipart-0.1.24-py3.5.egg\kipart_main_.py", line 127, in call_kipart
debug_level=args.debug)
File "c:\python35\lib\site-packages\kipart-0.1.24-py3.5.egg\kipart\kipart.py", line 679, in kipart
fuzzy_match=fuzzy_match)
File "c:\python35\lib\site-packages\kipart-0.1.24-py3.5.egg\kipart\kipart.py", line 507, in draw_symbol
balance_bboxes(bbox)
File "c:\python35\lib\site-packages\kipart-0.1.24-py3.5.egg\kipart\kipart.py", line 281, in balance_bboxes
lr_bbox = find_bbox_bbox(bboxes['left'], bboxes['right'])
KeyError: 'left'"

CSV file:
iCE40PinoutHX1K_kiparts2.zip

Bundling no connect pins leaves them connected

The bundling behaviour (-b) is very useful for power and ground pins, but joins no connect pins which is not the correct behaviour. Is there any workaround for this?

Attached is an example component csv, resultant library, and a simple schematic showing the problem. Run the KiCad Electrical Rules Checker to demonstrate that pins 7 and 8 are erroneously connected.

The library was generated using kipart example.csv -b -o example.lib

example.zip

I'm running KiCad 4.0.7 on Arch linux, with KiPart installed from the AUR.

Append/Overwrite Flags Issue [KiPart BUG]

Describe the bug
-a (append) and -w (overwrite) flags not behaving as documented. Want to be able to overwrite existing parts on an existing library.

Documentation says
-a, --append, --add Add parts to an existing part library. Overwrite existing parts only if used in conjunction with -w

To Reproduce
Create test.lib containing 2 symbols
kipart -o test.lib -a symbol1.csv symbol2.csv (Writing test.lib 2)

Update only symbol1 in test.lib
kipart -o test.lib -a -w symbol1.csv (Writing test.lib 1)

Expected behavior
In above scenario, I'd expect second step to update test.lib with the updated symbol1 and the unchanged symbol2 however only symbol1 gets written.

Workaround
As I maintain all my kipart generated files in a single library, I work around this by putting all symbol.csv files onto the command line every time, instead of doing additions/modifications in an incremental manner.

Versions

  • OS Win10
  • Python version 3.9.14
  • KiPart version 1.4.0

Additional context
Love the tool !!

error: pin has 10 parameters of the required 11 or 12 in DRAW command X

I have a CSV that I converted to a .lib with kipart lm80-p0598-1_c_apq8064e_datasheet2.csv -s num -o snapdragon.lib, which gives no errors or warnings, but when imporing to KiCAD, I get the following error:
Library 'file' component load error error <error: pin has 10 parameters of the required 11 or 12 in DRAW command X> occured at line 1095

I am running KiPart 0.1.28 on MacOS Sierra 10.12.3.

file.lib.zip

lm80-p0598-1_c_apq8064e_datasheet2.csv.zip

Symbol layout bug when more pins right than left

If more pins are on the right side than on the left, the top edge of the symbol outline will be at the same height as the last pin. The usual spacing from the top most pin to the outline is therefor not present and the labeling overlaps. See attached picture.
EDIT: Only true if no pins at all on the left side.

kipart symbol layout bug

kilib2csv.py parsing error in parsing eeschema headers

On line 99 of kilib2csv.py you are parsing the lib file header and extracting a version string. That is correct as far as it goes. Unfortunately, kicad correctly parses libraries that have more than the version on the header line. I have an existing 88-pin library that has on that first line not only the eeschema version but also a date time stamp. 'Date: ' followed by a * followed by a newline char. kicad correctly parses this without error. kilib2csv throws uncaught exceptions when encountering this date stamp.

I tried this first with the date field intact and this caused the exceptions, not good in any case. Then I removed the datetime stamp and kilib2csv worked without any problem on this lib.

Error when loading generated library with manufacturers part number specified

Hi, first of all thanks for the great work :) This tool helped me a lot! I guess i found a bug, or i'm too stupid to use the tool correctly ^^.
I noticed when specifing a manufacturers part number in the first row of the csv file, kipart will generate the "F 4" field in the header of the symbol. Unfortunately it does this with a whitespace between the F and the 4, which leads to error when i try to load the library. When i delete the whitespace between the two characters manually, the library loads just fine. I have attached the cvs file and the generated lib file, so that you can see for yourself.

i used the following command on Windows 10:
kipart JM1.csv -r generic -o ../libraries/JM1_FPGA_Con_faulty.lib

Kicad Version: 4.0.7

Thanks again for your work!

ManufacturersBug.zip

Lattice reader get stuck indefinently

Hi, I have found that after exporting a pin description from Lattice Diamond, kipart never completes.
I have attached the pin CSV below for debugging.

Command being run: kipart -r lattice lattice_test.csv

Desktop (please complete the following information):

  • OS Arch Linux
  • Python 3.8
  • KiPart version 0.1.44

lattice_test.csv:

#Pin Layout Report file generated by Lattice Diamond Version 3.11.3
#Generated at Sun Nov  8 17:53:07 2020
#DESIGN = test
#DEVICE = LFE5U-85F
#PACKAGE = CABGA381
#SPEEDGRADE = 8
Pin_Number,Pad_Name,Function,IO_Bank_Number,Signal_Name,Direction
A4,PL11A,ULC_GPLL0T_IN,7,,
A5,PL11B,ULC_GPLL0C_IN,7,,
B5,PL11C,ULC_GPLL0T_MFGOUT2,7,,
C5,PL11D,ULC_GPLL0C_MFGOUT2,7,,
C4,PL14A,ULC_GPLL0T_MFGOUT1,7,,
A3,PL14C,,7,,
B4,PL14B,ULC_GPLL0C_MFGOUT1,7,,
B3,PL14D,,7,,
E4,PL17A,,7,,
C3,PL17C,,7,,
D5,PL17B,,7,,
D3,PL17D,,7,,
F4,PL20A,,7,,
E5,PL20C,,7,,
E3,PL20B,,7,,
F5,PL20D,,7,,
A2,PL35A,,7,,
B2,PL35C,VREF1_7,7,,
B1,PL35B,,7,,
C2,PL35D,,7,,
C1,PL38A,,7,,
D2,PL38C,,7,,
D1,PL38B,,7,,
E1,PL38D,,7,,
H4,PL41A,GR_PCLK7_1,7,,
H5,PL41C,GR_PCLK7_0,7,,
G5,PL41B,,7,,
H3,PL41D,,7,,
G3,PL44A,PCLKT7_1,7,,
F2,PL44C,PCLKT7_0,7,,
F3,PL44B,PCLKC7_1,7,,
E2,PL44D,PCLKC7_0,7,,
G2,PL47A,PCLKT6_1,6,,
H2,PL47C,PCLKT6_0,6,,
F1,PL47B,PCLKC6_1,6,,
G1,PL47D,PCLKC6_0,6,,
J4,PL50A,GR_PCLK6_0,6,,
J3,PL50C,GR_PCLK6_1,6,,
J5,PL50B,,6,,
K3,PL50D,,6,,
K2,PL53A,,6,,
H1,PL53C,,6,,
J1,PL53B,,6,,
K1,PL53D,,6,,
K4,PL56A,,6,,
L4,PL56C,,6,,
K5,PL56B,VREF1_6,6,,
L5,PL56D,,6,,
M5,PL77A,,6,,
M4,PL83A,,6,,
N4,PL83C,D15/IO15,6,,
N5,PL83B,,6,,
P5,PL83D,D14/IO14,6,,
N3,PL86A,D13/IO13,6,,
L3,PL86C,D11/IO11,6,,
M3,PL86B,D12/IO12,6,,
L2,PL86D,D10/IO10,6,,
N2,PL89A,LLC_GPLL0T_MFGOUT2,6,,
L1,PL89C,D9/IO9,6,,
M1,PL89B,LLC_GPLL0C_MFGOUT2,6,,
N1,PL89D,D8/IO8,6,,
P1,PL92A,LLC_GPLL0T_MFGOUT1,6,,
P2,PL92B,LLC_GPLL0C_MFGOUT1,6,,
P3,PL92C,LLC_GPLL0T_IN,6,,
P4,PL92D,LLC_GPLL0C_IN,6,,
R1,PB4A,D7/IO7,8,,
U1,PB6A,D5/MISO2/IO5,8,,
T1,PB4B,D6/IO6,8,,
V1,PB6B,D4/MOSI2/IO4,8,,
W1,PB9A,D3/IO3,8,,
V2,PB11A,D1/MISO/IO1,8,,
Y2,PB9B,D2/IO2,8,,
W2,PB11B,D0/MOSI/IO0,8,,
T2,PB13A,SN/CSN/SCAN_SHFT_EN,8,,
R2,PB15A,HOLDN/DI/BUSY/CSSPIN/CEN,8,,
U2,PB13B,CS1N,8,,
R3,PB15B,DOUT/CSON/ATB_FORCE,8,,
T3,PB18A,WRITEN/ATB_SENSE,8,,
V3,INITN,,8,,
U3,CCLK,MCLK/SCK,8,,
W3,PROGRAMN,,8,,
Y3,DONE,,8,,
T4,CFG_1,,8,,
R4,CFG_2,,8,,
U4,CFG_0,,8,,
V4,TDO,,,,
T5,TCK,TEST_CLK,,,
R5,TDI,,,,
U5,TMS,,,,
W4,RESERVED,,,,
T7,GND,,,,
W5,RESERVED,,,,
Y5,GND,,,,
T8,GND,,,,
Y6,GND,,,,
Y7,GND,,,,
T9,GND,,,,
Y8,GND,,,,
W8,RESERVED,,,,
T10,GND,,,,
W9,RESERVED,,,,
W10,RESERVED,,,,
W11,RESERVED,,,,
Y11,GND,,,,
Y12,GND,,,,
W13,RESERVED,,,,
T11,GND,,,,
W14,RESERVED,,,,
Y14,GND,,,,
T12,GND,,,,
Y15,GND,,,,
Y16,GND,,,,
T13,GND,,,,
Y17,GND,,,,
W17,RESERVED,,,,
T14,GND,,,,
W18,RESERVED,,,,
Y19,GND,,,,
W20,GND,,,,
T17,PR92D,LRC_GPLL0C_IN/S7_OUT,3,,
U16,PR92C,LRC_GPLL0T_IN,3,,
U17,PR92B,LRC_GPLL0C_MFGOUT1,3,,
U18,PR92A,LRC_GPLL0T_MFGOUT1,3,,
T18,PR89D,LRC_GPLL0C_MFGOUT2,3,,
R18,PR89B,,3,,
U19,PR89C,LRC_GPLL0T_MFGOUT2,3,,
T19,PR89A,,3,,
U20,PR86D,,3,,
R20,PR86B,S7_IN,3,,
T20,PR86C,,3,,
P20,PR86A,S6_OUT,3,,
P18,PR83D,,3,,
N20,PR83B,S6_IN,3,,
P19,PR83C,,3,,
N19,PR83A,S5_OUT,3,,
T16,PR77A,,3,,
R17,PR56D,,3,,
P16,PR56B,VREF1_3,3,,
R16,PR56C,S5_IN,3,,
N17,PR56A,S4_OUT,3,,
P17,PR53D,,3,,
M17,PR53B,,3,,
N18,PR53C,,3,,
N16,PR53A,,3,,
M18,PR50D,,3,,
L17,PR50B,,3,,
L18,PR50C,GR_PCLK3_1,3,,
L16,PR50A,GR_PCLK3_0,3,,
M19,PR47D,PCLKC3_0,3,,
M20,PR47B,PCLKC3_1,3,,
L19,PR47C,PCLKT3_0/S4_IN,3,,
L20,PR47A,PCLKT3_1/S3_OUT,3,,
K20,PR44D,PCLKC2_0,2,,
K19,PR44B,PCLKC2_1,2,,
J20,PR44C,PCLKT2_0/S3_IN,2,,
J19,PR44A,PCLKT2_1/S2_OUT,2,,
K18,PR41D,,2,,
H20,PR41B,,2,,
J18,PR41C,GR_PCLK2_0,2,,
G19,PR41A,GR_PCLK2_1,2,,
G20,PR38D,,2,,
F19,PR38B,,2,,
F20,PR38C,,2,,
E20,PR38A,,2,,
E19,PR35D,,2,,
D19,PR35B,S2_IN,2,,
D20,PR35C,VREF1_2,2,,
C20,PR35A,S1_OUT,2,,
K17,PR29B,,2,,
K16,PR29A,,2,,
J16,PR20D,,2,,
H17,PR20B,,2,,
J17,PR20C,,2,,
H18,PR20A,,2,,
H16,PR17D,,2,,
G18,PR17B,URC_GPLL0C_MFGOUT1,2,,
G16,PR17C,,2,,
F17,PR17A,URC_GPLL0T_MFGOUT1,2,,
F18,PR14D,,2,,
E17,PR14B,S1_IN,2,,
E18,PR14C,,2,,
D18,PR14A,S0_OUT,2,,
F16,PR11D,URC_GPLL0C_MFGOUT2,2,,
E16,PR11C,URC_GPLL0T_MFGOUT2,2,,
D17,PR11B,URC_GPLL0C_IN/S0_IN,2,,
C18,PR11A,URC_GPLL0T_IN,2,,
B20,PT121B,URC_GPLL1C_IN,1,,
B19,PT119B,,1,,
A19,PT121A,URC_GPLL1T_IN,1,,
A18,PT119A,,1,,
B18,PT116B,,1,,
C17,PT114B,,1,,
A17,PT116A,,1,,
B17,PT114A,,1,,
D16,PT112B,,1,,
B16,PT110B,,1,,
C16,PT112A,,1,,
A16,PT110A,,1,,
E15,PT107B,,1,,
C15,PT105B,,1,,
D15,PT107A,,1,,
B15,PT105A,,1,,
A15,PT103A,,1,,
E14,PT85B,,1,,
C14,PT83B,,1,,
D14,PT85A,,1,,
A14,PT83A,,1,,
E13,PT80B,,1,,
C13,PT78B,,1,,
D13,PT80A,,1,,
B13,PT78A,,1,,
A13,PT76B,,1,,
E12,PT74B,GR_PCLK1_1,1,,
A12,PT76A,,1,,
D12,PT74A,GR_PCLK1_0,1,,
C12,PT71B,,1,,
E11,PT69B,,1,,
B12,PT71A,PCLKT1_0,1,,
D11,PT69A,PCLKT1_1,1,,
C11,PT65B,,0,,
A11,PT63B,,0,,
B11,PT65A,PCLKT0_0,0,,
A10,PT63A,PCLKT0_1,0,,
B10,PT60B,GR_PCLK0_0,0,,
C10,PT58B,,0,,
A9,PT60A,GR_PCLK0_1,0,,
B9,PT58A,,0,,
E10,PT56B,,0,,
D10,PT56A,,0,,
C9,PT54A,,0,,
E9,PT20B,,0,,
A8,PT18B,,0,,
D9,PT20A,,0,,
A7,PT18A,,0,,
B8,PT15B,,0,,
D8,PT13B,,0,,
C8,PT15A,,0,,
E8,PT13A,,0,,
C7,PT11B,,0,,
D7,PT9B,,0,,
C6,PT11A,,0,,
E7,PT9A,,0,,
D6,PT6B,,0,,
B6,PT4B,ULC_GPLL1C_IN,0,,
E6,PT6A,,0,,
A6,PT4A,ULC_GPLL1T_IN,0,,
C19,GND,,,,Gnd
H19,GND,,,,Gnd
R19,GND,,,,Gnd
G17,GND,,,,Gnd
M16,GND,,,,Gnd
G15,GND,,,,Gnd
K15,GND,,,,Gnd
N15,GND,,,,Gnd
B14,GND,,,,Gnd
F14,GND,,,,Gnd
G14,GND,,,,Gnd
J14,GND,,,,Gnd
K14,GND,,,,Gnd
M14,GND,,,,Gnd
N14,GND,,,,Gnd
P14,GND,,,,Gnd
F13,GND,,,,Gnd
G13,GND,,,,Gnd
P13,GND,,,,Gnd
G12,GND,,,,Gnd
J12,GND,,,,Gnd
K12,GND,,,,Gnd
L12,GND,,,,Gnd
M12,GND,,,,Gnd
P12,GND,,,,Gnd
G11,GND,,,,Gnd
J11,GND,,,,Gnd
K11,GND,,,,Gnd
L11,GND,,,,Gnd
M11,GND,,,,Gnd
P11,GND,,,,Gnd
G10,GND,,,,Gnd
J10,GND,,,,Gnd
K10,GND,,,,Gnd
L10,GND,,,,Gnd
M10,GND,,,,Gnd
G9,GND,,,,Gnd
J9,GND,,,,Gnd
K9,GND,,,,Gnd
L9,GND,,,,Gnd
M9,GND,,,,Gnd
F8,GND,,,,Gnd
G8,GND,,,,Gnd
P8,GND,,,,Gnd
B7,GND,,,,Gnd
F7,GND,,,,Gnd
G7,GND,,,,Gnd
J7,GND,,,,Gnd
K7,GND,,,,Gnd
M7,GND,,,,Gnd
N7,GND,,,,Gnd
P7,GND,,,,Gnd
G6,GND,,,,Gnd
K6,GND,,,,Gnd
N6,GND,,,,Gnd
D4,GND,,,,Gnd
G4,GND,,,,Gnd
J2,GND,,,,Gnd
M2,GND,,,,Gnd
H13,VCC,,,,Power
J13,VCC,,,,Power
K13,VCC,,,,Power
L13,VCC,,,,Power
M13,VCC,,,,Power
N13,VCC,,,,Power
H12,VCC,,,,Power
N12,VCC,,,,Power
H11,VCC,,,,Power
N11,VCC,,,,Power
H10,VCC,,,,Power
N10,VCC,,,,Power
H9,VCC,,,,Power
N9,VCC,,,,Power
H8,VCC,,,,Power
J8,VCC,,,,Power
K8,VCC,,,,Power
L8,VCC,,,,Power
M8,VCC,,,,Power
N8,VCC,,,,Power
F15,VCCAUX,,,,
P15,VCCAUX,,,,
F6,VCCAUX,,,,
P6,VCCAUX,,,,
F10,VCCIO0,,0,,
F9,VCCIO0,,0,,
F12,VCCIO1,,1,,
F11,VCCIO1,,1,,
H15,VCCIO2,,2,,
J15,VCCIO2,,2,,
H14,VCCIO2,,2,,
L15,VCCIO3,,3,,
M15,VCCIO3,,3,,
L14,VCCIO3,,3,,
V20,GND,,,,
V19,GND,,,,
W19,GND,,,,
V16,GND,,,,
W16,GND,,,,
V15,GND,,,,
W15,GND,,,,
U14,GND,,,,
V14,GND,,,,
U13,GND,,,,
V13,GND,,,,
U12,GND,,,,
V12,GND,,,,
W12,GND,,,,
U11,GND,,,,
U10,GND,,,,
U9,GND,,,,
V9,GND,,,,
U8,GND,,,,
V8,GND,,,,
U7,GND,,,,
V7,GND,,,,
W7,GND,,,,
V6,GND,,,,
W6,GND,,,,
V5,GND,,,,
T6,VCCA0,,,,
U6,VCCA0,,,,
T15,VCCA1,,,,
U15,VCCA1,,,,
V11,VCCAUXA0,,,,
V10,VCCAUXA0,,,,
V18,VCCAUXA1,,,,
V17,VCCAUXA1,,,,
P10,VCCIO8,,8,,
P9,VCCIO8,,8,,
L7,VCCIO6,,6,,
L6,VCCIO6,,6,,
M6,VCCIO6,,6,,
H7,VCCIO7,,7,,
H6,VCCIO7,,7,,
J6,VCCIO7,,7,,

kipart is currently failing to build zipped files for ecp5

with the lattice dir of https://github.com/xesscorp/KiCad-Schematic-Symbol-Libraries
cd lattice
make

kipart ECP5_pinouts.zip -r lattice -b -s name -o Lattice_ECP5_FPGA.lib -w
Traceback (most recent call last):
  File "/home/matt/.local/bin/kipart", line 8, in <module>
    sys.exit(main())
  File "/home/matt/.local/lib/python3.6/site-packages/kipart/kipart.py", line 1037, in main
    part_data_file, zipped_file.filename, zip_file_ext
  File "/home/matt/.local/lib/python3.6/site-packages/kipart/kipart.py", line 991, in call_kipart
    debug_level=args.debug,
  File "/home/matt/.local/lib/python3.6/site-packages/kipart/kipart.py", line 807, in kipart
    ) in part_reader(part_data_file, part_data_file_name, part_data_file_type):
  File "/home/matt/.local/lib/python3.6/site-packages/kipart/lattice_reader.py", line 60, in lattice_reader
    pos = csv_file.tell()
io.UnsupportedOperation: underlying stream is not seekable
makefile:14: recipe for target 'Lattice_ECP5_FPGA.lib' failed
make: *** [Lattice_ECP5_FPGA.lib] Error 1

This is with KiPart 0.1.43 and I have tried python2 and python3.

_csv.Error: new-line character seen in unquoted field

getting
_csv.Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?
osx 10.11, Office (Excel) for Mac 2011., Python 2.7; attempted saving as Mac, Windows, MS-DOS format as many variously have suggested. Hand-built the file in text editor - there are, of course newlines (\n)... get same error.

Here is file:
`Atlas EZO

Pin,Unit,Type,Name,Side
1,1,gnd,GND,top
2,1,out,TX,top
3,1,in,RX,top
4,1,pwr,VCC,bottom
5,1,in,P+,bottom
6,1,in,P-,bottom

`

JSON?

Have you also considered supporting JSON in addition to CSV?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.