# Software Library

> Ready-made code for one kind of job. You load it and call it from your code.

**Field:** Software Development  
**Category:** Editors & Tools  
**Also known as:** Library, Code Library

## Think of it like

Think of it like a box of ready-made Lego parts. You grab a wheel instead of building one.

## Definition

A software library is a set of code that someone else wrote for you to reuse. It does one kind of job, like reading dates, drawing charts or talking to a website. You load it into your program and call its functions. Your code stays in charge and decides when to use it. Most programs lean on many libraries.

## Example

Emma needs to read a spreadsheet in Python. Instead of writing 500 lines, she loads a library and calls one function.

## Example code

```python
import random
print(random.choice(["red", "blue", "green"]))
```

The random library picks a colour. Nobody had to write the picking code.

## Why it matters

Libraries save months of work. They are also tested by thousands of other users.

## Common mistake

Adding a big library for one tiny job. Each one is more code to download, update and trust.

## Three principles

- **Reuse, not rewrite.** Someone already solved this problem.
- **You call it.** Your code decides when it runs.
- **One job.** Each library covers one kind of task.

## Related terms

- [Software Framework](https://learn.benibix.com/term/development/framework)
- [Dependency](https://learn.benibix.com/term/development/dependency)
- [Package Manager](https://learn.benibix.com/term/development/package-manager)
- [Function](https://learn.benibix.com/term/development/function)

## Told apart from

- [Library vs Framework](https://learn.benibix.com/compare/library-vs-framework): Your code calls a library when it wants help. A framework is the other way round: it runs the show and calls your code.
- [Software Package vs Library](https://learn.benibix.com/compare/software-package-vs-library): People think a package and a library are the same thing, and they are not. A library is the code itself, such as a set of date tools. A package is the box it ships in, with a name, a version number and a list of what it needs. Most packages hold a library, but some hold a tool you run instead.

## Taught in

- [Libraries, Frameworks and SDKs](https://learn.benibix.com/learn/development-tools/libraries-frameworks-and-sdks): Coding Tools, 7/13

---

Source: https://learn.benibix.com/term/development/library
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-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
