# How to contribute to Libraries?

**URL:** <https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140>\
**Category:** Libraries\
**Created:** [October 2, 2019, 10:51am UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140 "2019-10-02T10:51:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doom](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Doom](https://librepcb.discourse.group/u/Doom)\
**Post date:** [October 2, 2019, 10:51am UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/1 "2019-10-02T10:51:08Z")

</div>

Hi,

I plan to use LibrePCB to create my next board.  
I need some extra components from existing libraries.  
I know I can do my own local library. But how can I contribute to existing libraries ?

For example, I need some Atmel devices and a Microchip/Atmel library already exists.  
How can I add my own components to this library and allow everyone to use my work and save time ?

Doom.

---

<div class="post-metadata">

**Author:** ![Doom](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Doom](https://librepcb.discourse.group/u/Doom)\
**Post date:** [October 2, 2019, 10:57am UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/2 "2019-10-02T10:57:31Z")

</div>

Just find this in the contributing page of GitHub LibrePCB project :

`

> **Part Libraries** : Fork an existing part library from [LibrePCB Libraries · GitHub](https://github.com/LibrePCB-Libraries/) and add or improve parts. If you want to create a new library, open a discussion [here](https://librepcb.discourse.group/c/libraries).

`

---

<div class="post-metadata">

**Author:** ![dbrgn](https://yyz2.discourse-cdn.com/free1/user_avatar/librepcb.discourse.group/dbrgn/32/25_2.png) [@dbrgn](https://librepcb.discourse.group/u/dbrgn)\
**Post date:** [October 2, 2019, 8:31pm UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/3 "2019-10-02T20:31:56Z")

</div>

Thanks for bringing this up. We definitely need a library contribution guide.

I’ll start with a quick overview. This workflow currently assumes that you are familiar with [git](https://git-scm.com/), [GitHub](https://github.com/) and the command line.

1. Fork the appropriate repository on GitHub: [https://github.com/librepcb-libraries](https://github.com/librepcb-libraries)
2. Make sure that the library is not already downloaded as a remote library. If it is, open the library editor to see the storage path and delete that directory in `LibrePCB-Workspace/v0.1/libraries/remote/`.  
 ![screenshot](https://global.discourse-cdn.com/free1/uploads/librepcb1/original/1X/f58a14736fc746b90ae3d25082a12241b03d66e2.png)
3. Ensure that the directory `LibrePCB-Workspace/v0.1/libraries/local/` exists
4. Clone the forked library to your local library directory using git:

```auto
$ git clone git@github.com:your-username/LibrePCB_Base.lplib.git \
    LibrePCB-Workspace/v0.1/libraries/local/

```

5. In the local library directory, create a new branch:

```auto
$ git checkout -b your-new-feature

```

6. Edit the library using the library editor. Add new library elements according to the [library conventions](https://docs.librepcb.org/#libraryconventions). If you edit any existing library elements, make sure to increment the version number.
7. Commit the changes, push the branch to your GitHub fork
8. Create a pull request on GitHub against the original repository and wait for a review.

I hope this helps! Let us know if you have any questions, we’ll try to help you along.

---

<div class="post-metadata">

**Author:** ![Doom](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Doom](https://librepcb.discourse.group/u/Doom)\
**Post date:** [October 2, 2019, 8:37pm UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/4 "2019-10-02T20:37:26Z")

</div>

Thanks for this.  
I will try that and let you know.  
D.

---

<div class="post-metadata">

**Author:** ![Doom](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Doom](https://librepcb.discourse.group/u/Doom)\
**Post date:** [October 7, 2019, 3:33pm UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/5 "2019-10-07T15:33:13Z")

</div>

For ATmegaxx8PB devices (48/88/168/328), there’s 32-TQFP (-A) and 32-VQFN (-M) packages.

And in each one, there is 2 different operational ranges :

- Industrial (-40°C to +85°C) which is -AU or -MU extension (ATmega48PB-AU for example)
- Industrial (-40°C to +105°C) which is -AN or -MN extension (ATmega48PB-AN for example)

Should I do U and N variant for each one or just one per package (-AU for TQFP (or -A)) is ok ?

And after, there’s tape & reel with “R” !  
(but here it is just packaging of the devices)

D.

---

<div class="post-metadata">

**Author:** ![dbrgn](https://yyz2.discourse-cdn.com/free1/user_avatar/librepcb.discourse.group/dbrgn/32/25_2.png) [@dbrgn](https://librepcb.discourse.group/u/dbrgn)\
**Post date:** [October 7, 2019, 3:41pm UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/6 "2019-10-07T15:41:55Z")

</div>

I don’t think we need variants for the operational ranges. Just use an `x` instead of the operational range code and leave away the packaging info:

- `Atmega48PB-Ax`
- `Atmega48PB-Mx`

Similarly, if there are packages with different surface finish variants without any functional difference, just use an `x` for that (or leave away the letter if it’s optional).

Do you agree, @ubruhin?

---

<div class="post-metadata">

**Author:** ![ouabache](https://avatars.discourse-cdn.com/v4/letter/o/a4c791/32.png) [@ouabache](https://librepcb.discourse.group/u/ouabache)\
**Post date:** [October 8, 2019, 2:42am UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/7 "2019-10-08T02:42:47Z")

</div>

> [@dbrgn](#):
>
> We definitely need a library contribution guide.

I’m game. I started a document in LibrePCB/dev/Library\_manual and put in the steps that I use to fork and resync the github repos. I created a pull request so hopefully anyone can add to it as they see fit.

John Eaton

---

<div class="post-metadata">

**Author:** ![dbrgn](https://yyz2.discourse-cdn.com/free1/user_avatar/librepcb.discourse.group/dbrgn/32/25_2.png) [@dbrgn](https://librepcb.discourse.group/u/dbrgn)\
**Post date:** [October 25, 2019, 10:57pm UTC](https://librepcb.discourse.group/t/how-to-contribute-to-libraries/140/8 "2019-10-25T22:57:14Z")

</div>


