---
title: Modular fastship
description: How to use fastship's various tools separately
order: 9
skip_showdoc: true
---
While `ship-new --nb` gets you started with everything you need to create a delightful Python package, **you can also use each of fastship's components listed below on their own**. You might find this useful if you're porting a large system over to fastship, documenting an existing code base, or if you'd like to customize the fastship workflow for your own project. Note that all of the commands below work without a `pyproject.toml` file unless otherwise noted.

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Document existing code: [`show_doc`](../api/showdoc.md#show_doc)

fastship allows you to document existing code, even code that is not written in fastship! [`fastship.showdoc.show_doc`](../api/showdoc.md#show_doc) allows you to render beautiful API documentation in notebooks and on Quarto sites.  For example, you can render API documentation for [`numpy.all`](https://numpy.org/doc/stable/reference/generated/numpy.all.html#numpy.all) like this:

```python
from fastship.showdoc import show_doc
from numpy import all
show_doc(all)
```

---

### all

> ```
>  all (a, axis=None, out=None, keepdims=<no value>, where=<no value>)
> ```

Test whether all array elements along a given axis evaluate to True.

|  | **Type** | **Default** | **Details** |
|--- |--- |--- |--- |
| a | array\_like |  | Input array or object that can be converted to an array. |
| axis | NoneType | None | Axis or axes along which a logical AND reduction is performed.\
The default (`axis=None`) is to perform a logical AND over all\
the dimensions of the input array. `axis` may be negative, in\
which case it counts from the last to the first axis.\
\
.. versionadded:: 1.7.0\
\
If this is a tuple of ints, a reduction is performed on multiple\
axes, instead of a single axis or all the axes as before. |
| out | NoneType | None | Alternate output array in which to place the result.\
It must have the same shape as the expected output and its\
type is preserved (e.g., if `dtype(out)` is float, the result\
will consist of 0.0's and 1.0's). See :ref:`ufuncs-output-type` for more\
details. |
| keepdims | \_NoValueType | \<no value\> | If this is set to True, the axes which are reduced are left\
in the result as dimensions with size one. With this option,\
the result will broadcast correctly against the input array.\
\
If the default value is passed, then `keepdims` will not be\
passed through to the `all` method of sub-classes of\
`ndarray`, however any non-default value will be.  If the\
sub-class' method does not implement `keepdims` any\
exceptions will be raised. |
| where | \_NoValueType | \<no value\> | Elements to include in checking for all `True` values.\
See `~numpy.ufunc.reduce` for details.\
\
.. versionadded:: 1.20.0 |
| **Returns** | **ndarray, bool** |  | **A new boolean or array is returned unless `out` is specified,\
in which case a reference to `out` is returned.** |

> [!NOTE]
> [`show_doc`](../api/showdoc.md#show_doc) automatically parses docstrings that are written in the numpy style.  For more information [read here](../api/showdoc.md#numpy-docstrings).

## Testing notebooks: `ship-test`

Testing notebooks can be very useful outside of fastship, especially if you are documenting an existing code base and want to incorporate tests for your docs. The `ship-test` CLI utility allows you to accomplish this:

You can test an individual notebook with the terminal command:

```sh
ship-test notebook.ipynb
```

...or a folder of notebooks:

```sh
ship-test tests/
```

## Export code to modules: [`nb_export`](../api/export.md#nb_export)

You can export a notebook to a module with the Python function:

```python
nb_export('notebook.ipynb', 'pkg')
```

...provided the notebook specifies a `default_exp` directive at the top, and `export` directives above each cell to be exported. We recommend including this in a code cell at the bottom of your notebook for convenience.

## Jupyter-git integration

Jupyter and Git don't normally play well together, especially for notebook diffs and merge conflicts. Configure `fastship`'s Git diff and merge drivers (`ship-diff-driver` and `ship-merge`) in your Git config and `.gitattributes`, and optionally enable Jupyter pre-save cleaning — see [Git-Friendly Jupyter](git_friendly_jupyter.md) for the exact setup.

You can also call any of the underlying commands directly:

- `ship-clean`
- `ship-diff`
- `ship-diff-driver`
- `ship-merge`
- `ship-fix`

To configure your own hooks, Check out the [pre-commit hooks tutorial](pre_commit.md).

## Python packaging

[`fastship.release`](../api/release.md) provides utilities for PyPI publishing (`uv`), tag-driven CI releases (Rust, Zig, npm), and GitHub releases. See the [`fastship.release`](../api/release.md) docs for details.
