A CLI tool for Dataplex Semantic Model operations
Project description
dataplex-sm-cli
A powerful and extensible CLI tool for managing Dataplex Semantic Models. This CLI can be installed in any Python project via pip.
Features
- 🚀 Easy installation via pip
- 🎯 Semantic model management (create, delete, list)
- ⚙️ Configuration management
- 🔧 Extensible command structure
- 📝 Well-documented commands with examples
Installation
From Source (Development)
# Clone the repository
git clone https://github.com/Sachin-Rungta/dataplex-sm-cli.git
cd dataplex-sm-cli
# Install in development mode
pip install -e .
From PyPI (Once Published)
pip install dataplex-sm-cli
In Any Project
Once installed, you can use the CLI from any directory:
pip install dataplex-sm-cli
dataplex-sm --help
Usage
Get Help
dataplex-sm --help
dataplex-sm --version
Model Commands
Create a semantic model
dataplex-sm model create --name my-model --description "My model" --project my-project
List all models
dataplex-sm model list --project my-project
Delete a model
dataplex-sm model delete --name my-model --project my-project
Configuration Commands
Set a configuration value
dataplex-sm config set --key project-id --value my-project
Get configuration
dataplex-sm config get --key project-id
dataplex-sm config get # Get all values
Development
Setup Development Environment
# Install with dev dependencies
pip install -e ".[dev]"
Run Tests
pytest tests/
pytest tests/ --cov=dataplex_sm_cli # With coverage
Code Quality
# Format code
black dataplex_sm_cli/ tests/
# Lint
flake8 dataplex_sm_cli/ tests/
# Type checking
mypy dataplex_sm_cli/
Project Structure
dataplex-sm-cli/
├── dataplex_sm_cli/
│ ├── __init__.py # Package initialization
│ └── cli.py # Main CLI implementation
├── tests/
│ ├── __init__.py
│ └── test_cli.py # CLI tests
├── pyproject.toml # Modern Python project config
├── setup.py # Setup script for pip
├── README.md # This file
└── .gitignore # Git ignore rules
Adding New Commands
To add new commands to the CLI, edit dataplex_sm_cli/cli.py:
@main.command()
@click.option("--option", help="Option help text")
def my_command(option):
"""Command help text."""
click.echo(f"Executing my-command with option: {option}")
Then add tests in tests/test_cli.py:
def test_my_command(runner):
result = runner.invoke(main, ["my-command", "--option", "value"])
assert result.exit_code == 0
assert "expected output" in result.output
Publishing to PyPI
# Build the package
pip install build
python -m build
# Upload to PyPI (requires credentials)
pip install twine
twine upload dist/*
Requirements
- Python 3.8+
- click >= 8.0.0
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataplex_sm_cli-0.1.0.tar.gz.
File metadata
- Download URL: dataplex_sm_cli-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57dd99d92efd3f61d0194d39d614f2256e191c044a04e65e41fa521c8386747e
|
|
| MD5 |
64253ca939812a2bdcf2802a0c264c54
|
|
| BLAKE2b-256 |
f60a4871548c14d7c7c372ff288ca3cf6df4e282370df3f23db3e1b03a586c0e
|
File details
Details for the file dataplex_sm_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dataplex_sm_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7efb356f209d72506100ff38690ce218764c0dc0ac146fdd303e7a37f4b2f5f6
|
|
| MD5 |
f1af6f0a419d453f215f1d5148436604
|
|
| BLAKE2b-256 |
1372b937a003fe3267ce9c0c77c4bd941d947f2d21ee03e82cb1c83f5b4e34e8
|