Package
Data Package commands help you work with Data Packages - collections of data files along with their metadata. These commands allow you to create, validate, explore, and publish data packages across various platforms.
Available Commands
Section titled “Available Commands”dpkit package copy
Section titled “dpkit package copy”Copy a local or remote Data Package to a local folder, a ZIP archive or a database.
dpkit package copy <descriptor-path> --to-path <target>Options:
--to-path(required): Target destination for the copy--with-remote: Include remote resources in the copy-d, --debug: Enable debug mode
Examples:
# Copy package to local directorydpkit package copy datapackage.json --to-path ./output
# Copy package to ZIP archivedpkit package copy datapackage.json --to-path package.zip
# Copy remote package including remote resourcesdpkit package copy https://example.com/datapackage.json --to-path ./local --with-remotedpkit package infer
Section titled “dpkit package infer”Infer a data package from local or remote file paths. This command analyzes data files and automatically generates metadata including schema information.
dpkit package infer <file-paths...>Table Dialect Options:
--delimiter: Field delimiter character--header: Whether files have headers--header-rows: Number of header rows--header-join: Join character for multi-row headers--comment-rows: Number of comment rows to skip--comment-char: Comment character--quote-char: Quote character for fields--double-quote: Whether quotes are doubled for escaping--escape-char: Escape character--null-sequence: Sequence representing null values--skip-initial-space: Skip initial whitespace--property: JSON property path for nested data--item-type: Type of items in arrays--item-keys: Keys for object items--sheet-number: Excel sheet number--sheet-name: Excel sheet name--table: Database table name--sample-bytes: Bytes to sample for inference
Table Schema Options:
--field-names: Override field names--field-types: Override field types--missing-values: Values to treat as missing--string-format: String format specification--decimal-char: Decimal separator character--group-char: Thousands separator character--bare-number: Allow bare numbers--true-values: Values to treat as true--false-values: Values to treat as false--datetime-format: DateTime format string--date-format: Date format string--time-format: Time format string--array-type: Type of array elements--list-delimiter: List item delimiter--list-item-type: Type of list items--geopoint-format: Geopoint format specification--geojson-format: GeoJSON format specification--sample-rows: Rows to sample for inference--confidence: Confidence threshold for type inference--comma-decimal: Use comma as decimal separator--month-first: Parse dates with month first--keep-strings: Keep string types when possible
Examples:
# Infer package from CSV filesdpkit package infer data1.csv data2.csv
# Infer with custom delimiterdpkit package infer data.csv --delimiter ";"
# Infer from remote filesdpkit package infer https://example.com/data.csvdpkit package explore
Section titled “dpkit package explore”Explore a Data Package descriptor to view its structure and metadata in an interactive format.
dpkit package explore <descriptor-path>Options:
-j, --json: Output as JSON-d, --debug: Enable debug mode
Examples:
# Explore local packagedpkit package explore datapackage.json
# Explore remote packagedpkit package explore https://example.com/datapackage.json
# Export structure as JSONdpkit package explore datapackage.json --jsondpkit package validate
Section titled “dpkit package validate”Validate a data package from a local or remote path against the Data Package specification.
dpkit package validate <descriptor-path>Options:
--json: Output validation results as JSON-d, --debug: Enable debug mode-q, --quit: Exit immediately after validation (don’t prompt for error filtering)-a, --all: Skip selection prompts when all can be selected
Examples:
# Validate local packagedpkit package validate datapackage.json
# Validate remote packagedpkit package validate https://example.com/datapackage.json
# Get validation results as JSONdpkit package validate datapackage.json --jsondpkit package script
Section titled “dpkit package script”Open an interactive scripting session with a loaded Data Package. This provides a REPL environment where you can programmatically interact with the package data.
dpkit package script <descriptor-path>Available Variables:
dpkit: The dpkit library objectdataPackage: The loaded data package object
Examples:
# Start scripting sessiondpkit package script datapackage.json
# In the REPL session:dpkit> dataPackage.resources.lengthdpkit> dataPackage.resources[0].schema.fieldsdpkit package publish
Section titled “dpkit package publish”Publish data packages to various platforms. This is a parent command with platform-specific subcommands.
dpkit package publish ckan
Section titled “dpkit package publish ckan”Publish a data package to a CKAN instance.
dpkit package publish ckan <descriptor-path>CKAN Options:
--to-ckan-api-key: CKAN API key for authentication--to-ckan-url: CKAN instance URL--to-ckan-owner-org: Organization to publish under--to-ckan-dataset-name: Name for the dataset
Examples:
# Publish to CKANdpkit package publish ckan datapackage.json \ --to-ckan-url https://demo.ckan.org \ --to-ckan-api-key your-api-key \ --to-ckan-owner-org your-orgdpkit package publish github
Section titled “dpkit package publish github”Publish a data package to GitHub as releases or repository files.
dpkit package publish github <descriptor-path>dpkit package publish zenodo
Section titled “dpkit package publish zenodo”Publish a data package to Zenodo for academic archiving.
dpkit package publish zenodo <descriptor-path>Common Workflows
Section titled “Common Workflows”Creating a New Package
Section titled “Creating a New Package”-
Infer from data files:
Terminal window dpkit package infer *.csv --json > datapackage.json -
Validate the generated package:
Terminal window dpkit package validate datapackage.json -
Explore the package structure:
Terminal window dpkit package explore datapackage.json
Working with Remote Packages
Section titled “Working with Remote Packages”# Explore remote packagedpkit package explore https://example.com/datapackage.json
# Copy remote package locallydpkit package copy https://example.com/datapackage.json --to-path ./local-copy
# Validate remote packagedpkit package validate https://example.com/datapackage.jsonPublishing Workflow
Section titled “Publishing Workflow”# Validate before publishingdpkit package validate datapackage.json
# Publish to CKANdpkit package publish ckan datapackage.json \ --to-ckan-url https://your-ckan-instance.org \ --to-ckan-api-key $CKAN_API_KEYOutput Formats
Section titled “Output Formats”Most commands support multiple output formats:
- Interactive Display: Default rich terminal interface
- JSON: Use
--jsonflag for machine-readable output - Debug Mode: Use
--debugfor detailed operation logs