# Outside hosts and Python packages

Declare what your module may reach on the internet and which Python packages it uses, and how the module check reviews both.

A module that talks to the outside world, like a payroll service or a shipping API, sends the workspace's data somewhere. A module that uses a library runs someone else's code. Both are fine, as long as everybody can see exactly what's involved. So your module **declares** every outside host it calls and every Python package it uses, and the module check holds it to that.

## Declaring outside hosts

List every host your module's server code calls, by name:

```json
// For developers: module.json
"egress": ["api.paychex.com", "id.trimble.com"]
```

- **Every host.** If the code calls it, it's on the list.
- **Describe the service behind it,** too: who it is, the API version, how it signs in, which settings hold the credentials, and a simple health check. That's what lets the workspace see what's connected and lets the platform test the connection.
- **Keys go in secret settings,** never in the code. See [Module settings](article:549e2ab5-49bd-48b8-8c86-d54d51ba8914).
- **Say what's sent.** Your module's description should tell people what data goes to each service.

A Workspace Admin sees the list before installing, on your module's **Permissions & terms** tab in the Marketplace.

> **Microsoft 365 and other integrations are different.** The platform makes those calls for you, so don't list their hosts. See [Integrations: Microsoft 365 and more](article:aa49f9c8-2692-4669-92d0-a3b6a5b88675).

## Python packages and pinned versions

List the packages your module needs, each **pinned to an exact version**:

```json
// For developers: module.json
"runtime": {"requirements": ["openpyxl==3.1.5", "reportlab==5.0.0"]}
```

They're installed in the workspace's module home when it starts. All of a workspace's modules share that home, so:

- **Pin the same version other modules use.** Two modules asking for different versions of one package can stop the workspace's modules from starting.
- **Prefer what's already there.** Every workspace has these ready, so they install in no time:

| For | Package |
|---|---|
| PDF to images, PDF text | pymupdf, pypdfium2, pdfminer.six |
| Reading and merging PDFs | pypdf |
| Writing PDF reports | reportlab |
| Images and thumbnails | pillow |
| Spreadsheets | openpyxl |
| CAD drawings (DXF) | ezdxf |
| Image processing | opencv (headless), numpy, scipy |
| QR codes | qrcode |

The Module Builder can tell you the exact versions to pin.

## How the module check reviews both

Every build goes through the same check, whether it comes from the Module Builder, Claude or the CLI.

| What it finds | Result |
|---|---|
| A call to a host that isn't declared | **Must fix**: the build is blocked |
| A package with no version, or a version range | **Must fix** (no version) or a warning (range) |
| A pinned version with a known security hole | Blocks a Marketplace listing; pin a fixed version |
| A package from a git link or private index | Blocks a Marketplace listing |
| A package that isn't widely known | A note asking you to say why you need it |
| A host with no service description | A warning for now, needed for the Marketplace later |

See [Publish a module: the module check](article:cfb41dcb-edee-4f32-979c-d0f041eff1f8).

## Ask the Module Builder

> *"Connect to the Paychex API to pull last week's hours. Declare its host, keep the client secret in a secret setting, and add a health check."*

## Good to know

- **Outside calls don't run in the Module Builder's test copy.** Its outbound network is locked to the platform, and secrets are blanked there. Test outside connections in the live workspace.
- **Outbound calls and packages are included.** The outside service may bill the workspace itself.
- **No installers or compiled files.** Ship source and pinned packages, not binaries.
- **Need a paid platform service, like maps?** That's declared separately and approved by a Workspace Admin. See [What a module costs to run](article:dd966d79-6c2d-43c0-8d6e-3dff5886192d).
- More on reaching outside: [Connect to outside systems: Microsoft 365, the Bridge and APIs](article:6e787951-0ed5-4c90-b32d-2d0c1998a66f).


Source: https://datavisions.ai/docs/creators/platform-services/outside-hosts-and-python-packages
