---
title: sync
description: Propagate small changes in the library back to notebooks
order: 4
---
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

The library is primarily developed in notebooks so any big changes should be made there. But sometimes, it's easier to fix small bugs or typos in the modules directly. `ship-sync` is the command that will propagate those changes back to the corresponding notebooks.

Note that you can't create new cells or reorder cells with that functionality, so your corrections should remain limited. Exported `.py` files must contain cell IDs (format `# %% path/nb.ipynb #cell_id`); if your exports don't have IDs, run `ship-export` to regenerate them.

[source](https://github.com/AnswerDotAI/fastship/blob/main/fastship/sync.py#L25)

### absolute\_import

```python
def absolute_import(
    name, fname, level
):
```

*Unwarps a relative import in `name` according to `fname`*

```python
test_eq(absolute_import('xyz', 'nbdev', 0), 'xyz')
test_eq(absolute_import('', 'nbdev', 1), 'nbdev')
test_eq(absolute_import(None, 'nbdev', 1), 'nbdev')
test_eq(absolute_import('core', 'nbdev', 1), 'nbdev.core')
test_eq(absolute_import('core', 'nbdev/vision', 2), 'nbdev.core')  # from ..core import *
test_eq(absolute_import('transform', 'nbdev/vision', 1), 'nbdev.vision.transform')  # from .transform import *
test_eq(absolute_import('notebook.core', 'nbdev/data', 2), 'nbdev.notebook.core')  # from ..notebook.core import *
```

[source](https://github.com/AnswerDotAI/fastship/blob/main/fastship/sync.py#L72)

### ship\_update

```python
def ship_update(
    fname:str=None, # A Python file or directory to sync back to its source notebook(s)
):
```

*Propagate changes in exported `.py` modules matching `fname` to the notebooks that created them*
