# Libraries, Frameworks and SDKs

> Code you reuse so you do not have to write it. How a library and a framework differ, what an SDK holds, and what each one costs you.

**Course:** [Code Editors and Package Managers](https://learn.benibix.com/learn/development-tools)  
**Time:** 11 min

**After this lesson you can:**

- Tell a library from a framework
- Say what an SDK is for
- Count the cost of a new dependency

## Library or framework: who calls whom

A library is code someone else wrote for one job, like reading dates. You call it when you want. A framework is a ready-made base for a whole app, like Django, first out in 2005. It calls your code when it needs it. The one line to remember: you call a library, and a framework calls you.

With a library, your code stays in charge. Python's random library picks a random item when you ask it to, and does nothing until then. You can use one function from it and ignore the rest.

A framework sets the shape of the app. It decides where each kind of code goes and when it runs. You fill in the gaps it leaves, such as what a page shows. Django and React are well-known frameworks. You trade some freedom for a lot of work done for you.

An SDK, short for software development kit, is a box of tools for building on one service or device. It holds libraries, sample code and guides. A payment company hands out an SDK so an app can take payments in a few lines. A phone maker hands one out so people can build apps for its phones.

Each library, framework or SDK you add is a dependency. That means outside code your project needs to work. Each one can need others in turn, so adding one can pull in dozens. A project keeps a list of them, with the version of each.

A dependency saves you work today and costs you a little forever. It is more code to download, to update and to trust. If it breaks, or someone finds a hole in it, every project that uses it is at risk.

The common mistake is adding a big package for a tiny job. Before you add one, ask three things. Could you write it in ten lines? Is someone still looking after it? How many other projects use it?

```python
import random
print(random.choice(["red", "blue", "green"]))
```
Your code loads the random library and calls it once. The library does nothing until you ask.

![Two panels. Library: a box called your code, marked in charge, calls a small box called random, which does one small job and sends an answer back. A note says you decide when to use it. Framework: a large box called Django, the shape of the app, holds two gaps filled by your page and your form, with arrows from the framework down into each. A note says it decides when to run your code.](https://learn.benibix.com/diagrams/dev-library-framework.svg)

### Example: Emma skips a package

Emma needs to pad a number with zeros, like 7 into 007. A package for it would add 1 more dependency to her shop's 140.

She finds the language already has it built in, as one short function. She uses that, and her list stays at 140.

**Words in this lesson:** [Software Library](https://learn.benibix.com/term/development/library), [Software Framework](https://learn.benibix.com/term/development/framework), [Software Development Kit (SDK)](https://learn.benibix.com/term/development/sdk), [Dependency](https://learn.benibix.com/term/development/dependency)

> **The one thing to remember.** You call a library when you want it. A framework calls your code when it wants it.

**Question:** How is a library not the same as a framework?

**Answer:** You call a library, and a framework calls your code. With a library your code is in charge and calls it when needed. A framework sets the shape of the app and decides when to run the parts you write.

---

Source: https://learn.benibix.com/learn/development-tools/libraries-frameworks-and-sdks
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
