KiCad new footprint libraries (.pretty) packet. - Page 1
Forum section: electronics / general

author: firewalker
author_rank: Super Contributor
timestamp: January 28, 2014, 05:20:57 pm
content: Is there a packet with all the new libraries? Why the had to create a separate git repo for every pcb familly?Alexander.

author: metRo_
author_rank: Regular Contributor
timestamp: February 08, 2014, 12:07:51 pm
content: Isn't that what you want?https://github.com/KiCad/kicad-library

author: firewalker
author_rank: Super Contributor
timestamp: February 08, 2014, 12:11:21 pm
content: No. Have a look at the README.md file.Quote

author: codeboy2k
author_rank: Super Contributor
timestamp: February 09, 2014, 03:51:22 am
content: Quote from: firewalker on February 08, 2014, 12:11:21 pmIt's really annoying too.. while I am using the libraries I have to wait for it to scan github and download somethingI've decided today that I am going to clone the repo and have a local clone that I link to in my libraryYou just need to change the environment variable KIGITHUB (one more peeve... why can't I specify this library location from inside the program... it ONLY comes from the environment, outside.. so to change the location I have to restart Kicad)

author: firewalker
author_rank: Super Contributor
timestamp: February 09, 2014, 08:34:21 am
content: Change KIGITHUB to point to what?Alexander.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 09, 2014, 01:19:12 pm
content: Quote from: firewalker on February 09, 2014, 08:34:21 amActually, it's not that simple.. I thought it would beHowever, what I have done tonight is write a python scriptclone-kicad-repo.pythat will pull the needed repositories from github, using the file (on linux)/usr/local/share/kicad/template/fp-lib-table.for-githubUsing the contents of that file it will 'git clone' every single repository that is in that file into the subdirectory/usr/local/share/kicad/github-repoFinally, it will copy/usr/local/share/kicad/template/fp-lib-table.for-prettyto your home directory asfp-lib-table. This is where kicad looks (why not in the .kicad subdir ?? dumbasses! )As the last step to getting a local copy of the GitHub repositories, you need to set the environment variable KISYSMOD before running KiCad. This tells kicad to get the library from your local system.Code:KISYSMOD=/usr/local/share/kicad/github-repoYou can change these paths at the top of the script.The second script I wrote is calledupdate-kicad-repo.py. This script can be used after you already have the many repositories locally and want to update your local copy with a git pull. There are 71 repositories, you don't want to do it manually.Code:Air_Coils_SML_NEOSID.pretty : Already up-to-date.Capacitors.pretty : Already up-to-date.Capacitors_Elko_ThroughHole.pretty : Already up-to-date.Capacitors_SMD.pretty : Already up-to-date.Connect.pretty : Already up-to-date.Connectors_Serial_MOLEX.pretty : Already up-to-date.Converters_DCDC_ACDC.pretty : Already up-to-date.Crystals.pretty : Already up-to-date.Crystals_Oscillators_SMD.pretty : Already up-to-date.Diodes_SMD.pretty : Already up-to-date.Diodes_ThroughHole.pretty : Already up-to-date.Discret.pretty : Already up-to-date.Display.pretty : Already up-to-date.The scripts are not polished but they work, and you can use them. I share them here for anyone else that wants to maintain a local copy of the GitHub repository.One last word. This only clones the .pretty repositories for pcbnew, and does not clone the schematic repo athttps://github.com/KiCad/kicad-libraryposted as Linux only so far. I am going to test on Windows, and I will update this post for Windows after I install Windows, kicad and git into a fresh VirtualBoxCheers!

author: firewalker
author_rank: Super Contributor
timestamp: February 09, 2014, 03:29:07 pm
content: Thanks m8!I believe all this GIT thing is for KiCad to pull everything it needs it self. Always the latest versions.Alexander.

author: RJSC
author_rank: Regular Contributor
timestamp: February 09, 2014, 04:03:07 pm
content: Does this mean the new versions of KiCAD as default cannot be used offline because the libraries are stored on github with no local cache?

author: firewalker
author_rank: Super Contributor
timestamp: February 09, 2014, 04:37:53 pm
content: As I can understand the libraries will be cached on demand.No one seems (at the time) to know how exactly to insert the github addresses to the FP_TABLE.Alexander.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 09, 2014, 04:48:21 pm
content: Quote from: firewalker on February 09, 2014, 04:37:53 pmYes, they are cached, but I didn't see the cache was maintained between invocations. It seemed like it was a per-session thing, and it was always reloading them from github.This method doesn't fly with me, as I have a slow line and I was seeing two or three second delays whenever I wanted to look at a part. And the kicad library sucks, you can't see what a part looks like until you load it, so that meant clicking and downloading many parts that would be thrown away the next time I started kicad.What do you mean no one knows how to insert the git hub addresses ?You can edit the system global file/usr/local/share/kicad/template/fp-lib-tableor your local version in your home directory.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 09, 2014, 04:55:18 pm
content: Quote from: firewalker on February 09, 2014, 03:29:07 pmYes, I think that was the intention. But it's stupid silly to make it this way, with no "switch" or "button" on the UI to bring them all locally and check for changes at startup. A simple 'git clone' and 'git pull' occasionally would have sufficed, as I wrote in the script.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 09, 2014, 04:57:07 pm
content: Quote from: RJSC on February 09, 2014, 04:03:07 pmYep, it does !for offline use, use my script while you are online, and make a local copy. Then use the update script occasionally to get changes, fixes, and new footprints/3d models

author: djsb
author_rank: Super Contributor
timestamp: February 09, 2014, 06:37:30 pm
content: All this work automatically on my linux Kicad installation which I compile using the kicad-install.sh script. I still havent figured out how to set things up on Windows despite reading the pcbnew "Help" file. This system is WAY to complicated and difficult to understand. I've documented what I've tried herehttps://www.eevblog.com/forum/open-source-kicad-geda/kicad-library-table-generator/msg384583/#msg384583any clues as to what I'm doing wrong?Thanks,David.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 09, 2014, 08:25:27 pm
content: If you want to use the git hub repo directly on Windows (instead of downloading it locally as I described) then you should copy the fp-table.for-github to a file called fp-table into your Windows home directory, which I think might be the Documents or My Documents folder.Once you have this file in the correct home directory, it should show up in the programI don't run it on windows so I don't know, I'll give it a try and let you know

author: djsb
author_rank: Super Contributor
timestamp: February 09, 2014, 09:08:00 pm
content: Yes, just figured it out. I just changed the file fp-lib-table.for-github to fp-lib-table and it all shows up OK. I'll try downloading a local copy later on so I can get any updates.At least I've got some footprint available. Just got to figure out the schematic libraries next.David.

author: wzy006
author_rank: Newbie
timestamp: November 12, 2014, 06:41:02 pm
content: I made a quick and dirty change of the code for windows. Thanks Codeboy2k. I removed the git path search, so please check if your git was installed in the same places as I set in the scripts. I also replace os.spawn with subprocess, because when I used os.spawnev, python crashed every time.Finally, I removed the last step, which will copy fp-lib-table. Please manually do it. For windows, KiCad read fp-lib-table from x:\Users\*user_name*\AppData\Roaming\kicad, please manaully copy fp-lib-table.for-pretty as fp-lib-table, so KiCad will use $KIGITHUB instaed of $KISYSMOD.in RunKiCad.bat add the following line to set path of KISYSMODSET KISYSMOD=C:\kicad-winbuilder-3.4\kicad\share\github-repoclone-kicad-repo.pyCode:#!/usr/bin/pythonimport re, os, sys, subprocessimport shutil# change templatedir if you need to# templatedir = '/usr/local/share/kicad/template'templatedir = r'C:\kicad-winbuilder-3.4\kicad\share\template'# set localdir to the location where you want to# store your local copy of the GitHub repository#localdir = '/usr/local/share/kicad/github-repo'localdir = r'C:\kicad-winbuilder-3.4\kicad\share\github-repo'github_table = 'fp-lib-table'sys_table = 'fp-lib-table.for-pretty'default_table = 'fp-lib-table'env = {}env.update(os.environ)sep = ';' if (re.compile('^').match(sys.platform)) else ':'KIGITHUB = 'https://github.com/KiCad'found = Nonepaths = env['PATH'].split(sep)for path in paths:fpath = os.path.join(path,'git')if (os.path.isfile(fpath) and os.access(fpath, os.X_OK)):found = Truecmd = fpathbreakcmd = r'C:\Program Files (x86)\Git\bin'# if not found:# print "cannot find git executable"# exit(1)args = [r'C:\Program Files (x86)\Git\bin\git', 'clone', 'x']os.chdir(localdir)template = os.path.join(templatedir, github_table)for line in open(template,'rU'):mo = re.search(r'^.*\(\W*uri\W?([^)]*).*$',line)if mo:repo = mo.group(1).replace('${KIGITHUB}', KIGITHUB)args=repoprint localdirprint argssubprocess.call(args)print 'done x'print "you now have a local copy of the GitHub repository"print "in : ", localdirprint "updating KiCad ... "env['HOME']='C:\Users\xxx'frompath = os.path.join(templatedir,sys_table)topath = os.path.join(env['HOME'],default_table)print ".. copying: ", frompathprint "...... to: ", topathshutil.copyfile(frompath, topath)print ".. done"printprint "before running kicad, you will need to set"print "the following environment variable:"printprint "KISYSMOD=%s\n" % localdir

author: Teemo
author_rank: Regular Contributor
timestamp: December 30, 2014, 01:57:48 am
content: BRZ4022 version is already very useable.From here on it goes according to:Murphy's Law #15 - "If you tinker with anything long enough, it will break."

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: February 01, 2015, 10:43:32 am
content: Quote from: Teemo on December 30, 2014, 01:57:48 amAgree with that! Classic case of feature bloat I think. Forcing users to fiddle with configs and write scripts just so they can create a usable installation is ridiculous. Kicad has turned into a bit of play tool for developers, people who don't mind coding and building their own unique installation, but is a nightmare for people who want to use it out of the box, or are people without programming skills.All they really had to do was fix some bugs and clean up the interface.

author: Bassman59
author_rank: Super Contributor
timestamp: February 03, 2015, 07:29:16 pm
content: Quote from: donotdespisethesnake on February 01, 2015, 10:43:32 amExcept that they've been working very hard to make it easy to install on all of the major platforms. I've been using it successfully on OS X and it works quite well. They're at BZR 5403 now.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: February 08, 2015, 08:09:27 am
content: Quote from: Bassman59 on February 03, 2015, 07:29:16 pmI've been using it for years, IME it used to be very to install (unzip and run), now it is a PITA. It requires post-install config, which is then specific to each installation. If a user doesn't know what an "fp-lib-table" is, he is quickly forced to find out. Also makes it very difficult to share projects with other machines or people.There are backward compatibility issues, so opening old projects can mess up. People even writing their own scripts to handle config issues, having to manually edit project files. They also have a policy of not providing stable releases, and everyone ends up using slightly different version with different bugs. People installing using their own patched source versions is frankly insane way to distribute software.None of that says "easy to install" to me. I grant kicad team have been working very hard, but if it was on making installation easier they failed.The kicker is there is nothing in the new version that is particularly worth having, apart from a few bug fixes (offset by lots of new bugs).YMMV!

author: nickoe
author_rank: Contributor
timestamp: May 02, 2015, 11:39:51 am
content: FYI you can download a zip of all the pretty libs from Jenkins.Currently you can download on:http://ci.kicad-pcb.org/job/any-kicad-pretty-lib-nightlies/lastSuccessfulBuild/artifact/*zip*/archive.zipThe job name might change in the future.But also be aware that recently the footprint library wizards has been improved, such that it is easy to fetch the libs from within pcbnew.

author: timofonic
author_rank: Frequent Contributor
timestamp: May 03, 2015, 03:00:18 pm
content: Quote from: nickoe on May 02, 2015, 11:39:51 amDo the libs fetched from within pcbnew are for schematic symbols too?

author: nickoe
author_rank: Contributor
timestamp: May 03, 2015, 03:04:55 pm
content: Quote from: Circuiteromalaguito on May 03, 2015, 03:00:18 pmNo, they are only for the pcbnew. The schematic libraies are in one single repo together with the 3D models. But that is off topic here.