# Quickstart

Save this as `example.toml`:

```toml
[project]
name = "my-app"
version = "1.0.0"
# Search terms for the package index
keywords = ["python", "toml"]
```

Read the file with [`load`](<https://dimbleby.github.io/tomledit/api/index.md#tomledit.load> "load"), edit the document like a dictionary, and write it back with [`dump`](<https://dimbleby.github.io/tomledit/api/index.md#tomledit.dump> "dump"):

```python
from pathlib import Path

from tomledit import dump, load

path = Path("example.toml")
with path.open("rb") as f:
    doc = load(f)

project = doc["project"]

project["version"] = "2.0.0"
project["keywords"].append("important-keyword")

with path.open("wb") as f:
    dump(doc, f)
```

```toml
[project]
name = "my-app"
version = "2.0.0"
# Search terms for the package index
keywords = ["python", "toml", "important-keyword"]
```

Use [`loads`](<https://dimbleby.github.io/tomledit/api/index.md#tomledit.loads> "loads") and [`dumps`](<https://dimbleby.github.io/tomledit/api/index.md#tomledit.dumps> "dumps") when working with strings instead of files.
