.lib format description?

Hi folks,

I’m interested in making schematic symbols from a Python script (currently interested in Atmel ARM chips), and am wondering if there’s a description of the lib format, outside of the Eeschema source code? If not, I’m happy to make one as I figure it out, but would prefer not to reinvent the wheel if such a description exists. Thanks! -Ian-

I did a similar Python script called KiPart. You can look at how that handles libraries.

1 Like

Thanks Dave!

I’ve made some progress this weekend on a script that’s much like yours, but tailored to generating Atmel SAM symbols, and have started up a document to describe the lib format. I’ll attach it to this thread as soon as I’m not a new forum member anymore. -Ian-

1 Like

You can link the script i.e. in github also if you are a new member

Thanks for the suggestion Maurice - the script is at https://github.com/ianrrees/kicad-library-utils/tree/20160608-add-samd but it’s not done enough to really use yet.

Will just post the .lib format documentation however is appropriate when I know where it should end up.

For library formats, I found http://www.compuphase.com/electronics/LibraryFileFormats.pdf very useful.

It would be nice if there was a common repo for file formats, the “official” docs appear to be based on personal notes and very incomplete.

The official docs repo welcomes such a new document :slight_smile:
Since Eeschema will change soon, starting with Pcbnew would be more effective though.

1 Like

How soon is “soon”? :slight_smile:

1 Like

Soon is… one year maybe?

1 Like

So a good reason to post what we have now

1 Like

Sorry for the delay! I took a stab tonight at building the docs repo, but hit some snags with dependencies.

Here’s where I got up to with the .lib documentation:
Eeschema lib format description.md (4.4 KB)


A good start, several TODOs

I think I can fill a few things…

  • Component name (start with ‘~’ to make hidden)
  • Prefix name (start with ‘~’ to make hidden)

I think it is ‘#’ to make hidden. ‘~’ toggles overbar, but a single ‘~’ is used as a placeholder for empty string.

(I don’t yet understand what the NN in the vertical justification means)

The two letters are Italic (‘I’ or ‘N’) and Bold (‘B’ or ‘N’)

Ti - date and time?

I don’t think I have ever seen that in a lib or dcm file?

Thanks Bob, somehow I just managed to read through the doc you linked to earlier - not sure if my Internet connection just wasn’t working or if I overlooked it earlier. Very good doc at any rate!

I think the notes about the tildes (~) that you mentioned and the Ti both came from reading the source code, though could be mistaken.

@davidsrsb - The TODOs are things that weren’t required to accomplish my immediate goal (making a set of symbols for some Atmel SAM parts). So I agree 100% that the doc is not complete, but it does contain enough to make a script for generating parts for instance. I guess if the plan is to change the format anyways, it’s probably not worth putting effort in to making a full format description just for the sake of completeness?

Not for some time and I am sure that there will be an issue or two with peoples private libs converting to the new format, especially with script generated parts or converted from a third party pcb package.
If nothing else writing a document like this makes everyone think a bit deeper about what they just assumed.

1 Like

Has this made it to the official docs yet? I’m not finding it.