← Back to team overview

kicad-developers team mailing list archive

Re: The library tables wizard

 

On Wed, 2015-01-07 at 23:38 +0100, Miguel Ángel Ajo wrote:
Hi Jean Pierre, just an idea for your wizard work:
> 
> https://api.github.com/orgs/KiCad/repos
> 
> 
> You could save the need to work with the HTML viewer and pagination
> problems 
> using the above API endpoint, all the KiCad project repositories are
> listed into it
> in json format.

The GitHub API is pretty comprehensive, as I found when writing my web
footprint viewer [1]. Full GH API access would allow us to be rather
more flexible with what we can do, for example:

   * Only load footprints one at a time, rather than having to download 
     and unzip the whole repo (note that the transfer can still be    
     compressed!)
   * View and use footprint history (although this can't easily be done 
     in the case that a footprint has moved pretty repo, e.g. from 
     Sockets.pretty to Sockets_Samtec.pretty)
   * See changes made in all repos (currently quite hard to do, as you
     have dozens of separate repos to consider)
   * Contribute new footprints back to the GH repo in the form of a pull
     request, without leaving KiCad.

Similar use could be made of any Git repo locally too (but not the pull
request aspect). Additionally, any remote git repo could also be cloned
and used from within KiCad. This does not require the GH API, just a Git
library, of which there are many (or shell out, even, bleh!)

just querying the URL Miguel provided would only count as a single API
access, and would not need an API token, unless the user kept on
refreshing the list somehow! But you would still get a complete list of
repos.

However, the API limits are pretty low when you don't have an API token.
The web viewer uses a private clientId and secret and then the user gets
their own API token via OAuth. This does require that the user has a
Github account.

We wouldn't be able to distribute the client secret for a KiCad GitHub
interface (it could be stolen and used fraudulently for other purposes).
We could:

  * Make the user get their own access token (fairly easy via GitHub's
settings page
  * Have an OAuth server somewhere which can arbitrate this process
(user still needs to log into GitHub via Kicad to get the access token,
however.

This would also allow to dispense with the webviewer WX requirement,
which adds another step to the arduous KiCad build process.

[1] http://libree.org/tool/kicad_viewer





Follow ups

References