Freepcb2pretty.py syntax

I downloaded a copy of freepcb2pretty_MBA.zip but cannot figure out how to use freepcb2pretty.py

Can someone give me some pointers? The file I want to convert is named midcom.fpl

Thanks,

Ron

You might want to give a bit more detail here. A start would be a link to the thing you downloaded.

The link is: freepcb2pretty_MBA.zip from the forum subject Why are the Kicad Library conventions non-IPC compliant?

It is lacking any documentation for a python dummy like me.

Thanks,

Ron

The tool should give you a help screen when you run it with python freepcb2pretty.py -h As i do not have any freepcb footprints available i can not really be of any further help.
My guess would be that you run it as python freepcb2pretty.py output_dir input_file Replace output dir with the path to where you want your final files to be. example could be ./out/. The input file is the footprint you want to convert. (There are other options but i do not really know what you need)


The topic you reference should now be quite outdated. We adapted many of the suggestions made there for the official library. For example we now require outlines on the fab layer, a second reference on fab, …
A lot of the new footprints are now created using the IPC standard as a guide. (Addressing the issues raised in the exact response you linked to)
We have some ipc inspired footprint generators in our scripting repo https://github.com/pointhi/kicad-footprint-generator (The long term plan would be to include some of these generators as library wizards in kicad. I might look into that as soon as the library wizard is available again under linux.) Right now these scripts are not really beginner friendly.

Here is what I get:

C:\Users\Ron\Downloads>python freepcb2pretty.py -h
File “freepcb2pretty.py”, line 247
ss = Polyline.create_from_freepcb(file_in, opts)
^
TabError: inconsistent use of tabs and spaces in indentation

The ^ is under the )

I get the same error no mater what i do. Guess I will just continue to redraw my FreePCB footprints in KiCAD. I was just looking for a way to automate it and this looked like it should work.

Ron

I would guess you use python 3.x which is a bit more fuzzy about this. I can run the help command without problem using python 2.x
I would gather from that that the script has never been tested under python 3. This means it might screw up in other ways as well. So my suggestion is to run it using python 2. (Don’t ask me how this is done in windows. In linux i can just type python2 or python3 depending on what i need.)

I got a copy of python 2.x and the -h now works but the conversion does not. Here is the latest error.

C:\Users\Ron\Downloads>C:\Python27\python freepcb2pretty.py C:\Users\Ron\Downloads\out midcom.fpl
Loading FreePCB library…
Traceback (most recent call last):
File “freepcb2pretty.py”, line 861, in
main ()
File “freepcb2pretty.py”, line 816, in main
sublibrary = Library (ff, args)
File “freepcb2pretty.py”, line 158, in init
self.Modules.append (PCBmodule (file_in, opts))
File “freepcb2pretty.py”, line 215, in init
assert self.Source
AssertionError

The footprint file is not formed in a way that the script expects. Sadly i can not be of more help as i am neither the author of this script nor am i familiar with that file format. You could try to hunt town the original developers of that script and ask them for help.

Just out of curiosity, what are you trying to do with that script? (Why do you need to convert from freepcb to kicad) Maybe there is an alternative easier route available.

I have been doing freelance schematic and PCB layout work for many years. I started with the DOS version of ORCAD, then Windows ORCAD then Ivex until they went belly up. Next was FreePCB which is a very good program however is no longer being developed. I am now using KiCAD and for many board updates for customers I need to recreate footprints from my custom FreePCB libraries. Was just looking for a labor saving way. The name freepcb2pretty sounded like it held some promise of working. I have tried sending a PM to the person who originally posted the link to the download and never got an answer.

At this point let’s just call this topic closed.

Thanks,
Ron

Did you try the original script found in this github repo? https://github.com/cpavlina/kicad-pcblib

If that does not work you can try to contact the author via github.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.