Back to docs
Concepts

Dependency Packages

Dependency packages let you bundle Python dependencies into reusable archives that can be attached to one or more flow deployments.

Slug Identifiers

Every dependency package is assigned a unique slug: an 8-character uppercase alphanumeric identifier (e.g., A1B2C3D4). Slugs are generated automatically when a package is created and are immutable.

Slug Generation Rules

  • Format: 8 characters, uppercase letters (A–Z) and digits (0–9)
  • Character set: 36 possible characters per position (26 letters + 10 digits)
  • Uniqueness: Generated using cryptographically secure random selection (secrets.choice)
  • Immutability: Once assigned, a slug never changes for the lifetime of the package
  • Backfill: Legacy packages created before slug support are assigned a slug on first access

Finding Slugs in the UI

Slugs are displayed in two locations within the Dagy web interface:

  1. List view: The slug appears as a monospace badge next to the package name. Click the slug to copy it to your clipboard.
  2. Edit form: The slug appears in the "Package Details" card header next to the title.

Both locations provide a one-click copy-to-clipboard action with visual confirmation.

Attaching Dependencies to Deployments

During deployment, you can attach one or more dependency packages by referencing their slugs. The dependency archives will be included in the flow's runtime environment.

CLI Usage

Use the --dep-packages flag with dagy deploy:

# Single dependency package
dagy deploy artifact.zip \
  --deployment my-pipeline \
  --dep-packages A1B2C3D4

# Multiple dependency packages
dagy deploy artifact.zip \
  --deployment my-pipeline \
  --dep-packages A1B2C3D4 X9Y8Z7W6 M3N4P5Q6

Python SDK Usage

Pass dep_package_slugs to deploy_artifact() or upload_artifact_via_api():

from dagy.deploy import deploy_artifact

# Single dependency package
result = deploy_artifact(
    artifact_path="./dist/artifact.zip",
    deployment_name="my-pipeline",
    flow_name="daily_etl",
    flow_version="1",
    api_url="https://api.dagy.io",
    dep_package_slugs=["A1B2C3D4"],
)

# Multiple dependency packages
result = deploy_artifact(
    artifact_path="./dist/artifact.zip",
    deployment_name="my-pipeline",
    flow_name="daily_etl",
    flow_version="1",
    api_url="https://api.dagy.io",
    dep_package_slugs=["A1B2C3D4", "X9Y8Z7W6"],
)

API Usage

Include dep_package_slugs in the CompleteUploadRequest body when finalizing a deployment:

{
  "upload_id": "...",
  "artifact_key": "...",
  "parts": [...],
  "deployment_name": "my-pipeline",
  "flow_name": "daily_etl",
  "flow_version": "1",
  "dep_package_slugs": ["A1B2C3D4", "X9Y8Z7W6"]
}

Slug Lookup API

You can look up a dependency package by its slug:

GET /dep-packages/by-slug/{slug}

This returns the full DepPackageResponse including build status, package size, and S3 URI.

Workflow

  1. Create a dependency package in the UI with the required Python packages.
  2. Build the package. Dagy resolves, installs, and archives the dependencies.
  3. Copy the slug from the UI (e.g., A1B2C3D4).
  4. Deploy your flow with --dep-packages A1B2C3D4 to attach the dependency archive.

The slug provides a short, memorable reference that is easy to copy-paste into CLI commands and CI/CD scripts.

Quick Reference

FeatureSummary
Supported Python versions3.10, 3.11, 3.12, 3.13
Maximum dependencies per package200
Name normalization standardPEP 503 (lowercase, hyphens only, no extras)
Duplicate handling (frontend)Block or prompt on add; skip or conflict on bulk import
Duplicate handling (backend)Last-occurrence-wins deduplication on save
Conflict resolutionInline banner with per-conflict and bulk actions
Save & Build retry behaviorUpdates existing record; never creates duplicates
Version spec formats supportedPEP 508: ==, >=, <, !=, ~=, @URL, extras, markers

For detailed information on versioning, duplicate prevention, conflict resolution, and best practices, see the Dependency Packages Guide.