| Name | port-oneclick-mw JSON |
| Version |
0.1.1
JSON |
| download |
| home_page | None |
| Summary | A Python middleware service for managing Port.io guides (blueprints, actions, mappings, widgets) |
| upload_time | 2025-10-09 13:51:09 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.8 |
| license | MIT |
| keywords |
port
port.io
middleware
blueprints
automation
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Port OneClick Middleware
A Python middleware service for managing Port.io resources including blueprints, actions, mappings, and widgets.
## Installation
### From PyPI (Recommended)
```bash
pip install port-oneclick-mw
```
### From Source
```bash
git clone https://github.com/yourusername/port-oneclick-mw.git
cd port-oneclick-mw
pip install -e .
```
## Quick Start
### 1. Create Your Configuration
After installation, you need to provide two things:
#### a. Environment Variables (`.env` file)
Create a `.env` file in your project directory with your Port.io credentials:
```env
PORT_CLIENT_ID=your_client_id_here
PORT_CLIENT_SECRET=your_client_secret_here
# Optional: Custom directory paths (defaults shown)
BLUEPRINTS_DIR=setup/blueprints
ACTIONS_DIR=setup/actions
MAPPINGS_DIR=setup/mappings
WIDGETS_DIR=setup/widgets
# Optional: Specify what to process (all, blueprints, actions, mappings, widgets)
ACTION=all
```
#### b. Setup Directory Structure
Create a `setup/` directory with your Port.io resource definitions:
```
setup/
├── blueprints/ # Blueprint JSON files
├── actions/ # Action JSON files
├── mappings/ # Mapping JSON files
└── widgets/ # Widget/Dashboard JSON files
```
**Example structure:**
```
my-project/
├── .env
├── setup/
│ ├── blueprints/
│ │ ├── service.json
│ │ └── deployment.json
│ ├── actions/
│ │ └── deploy-service.json
│ ├── mappings/
│ │ └── github-mapping.json
│ └── widgets/
│ └── services-dashboard.json
```
### 2. Use Example Templates
The package includes example files to help you get started. Check the `examples/` directory:
```bash
# Copy examples to your setup directory
cp -r examples/blueprints setup/blueprints
cp -r examples/actions setup/actions
cp -r examples/widgets setup/widgets
```
Or view them in the package installation:
```bash
python -c "import site; print(site.getsitepackages())"
# Then navigate to port-oneclick-mw/examples/
```
### 3. Run the Middleware
```bash
# Run from command line
port-oneclick
# Or run the Python module directly
python main.py
```
## Configuration Options
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `PORT_CLIENT_ID` | Your Port.io client ID | **Required** |
| `PORT_CLIENT_SECRET` | Your Port.io client secret | **Required** |
| `BLUEPRINTS_DIR` | Path to blueprints directory | `setup/blueprints` |
| `ACTIONS_DIR` | Path to actions directory | `setup/actions` |
| `MAPPINGS_DIR` | Path to mappings directory | `setup/mappings` |
| `WIDGETS_DIR` | Path to widgets directory | `setup/widgets` |
| `ACTION` | What to process: `all`, `blueprints`, `actions`, `mappings`, or `widgets` | `all` |
### Directory Structure
Each directory should contain JSON files defining your Port.io resources:
- **blueprints/**: Blueprint definitions
- **actions/**: Self-service action definitions
- **mappings/**: Integration mapping configurations
- **widgets/**: Dashboard widget definitions
## JSON File Format
### Blueprint Example (`setup/blueprints/service.json`)
```json
{
"identifier": "service",
"title": "Service",
"icon": "Microservice",
"schema": {
"properties": {
"name": {
"type": "string",
"title": "Service Name"
},
"status": {
"type": "string",
"enum": ["active", "inactive"],
"title": "Status"
}
},
"required": ["name"]
}
}
```
### Action Example (`setup/actions/deploy.json`)
```json
{
"identifier": "deploy_service",
"title": "Deploy Service",
"icon": "Deployment",
"trigger": {
"type": "self-service",
"operation": "DAY-2",
"userInputs": {
"properties": {
"environment": {
"type": "string",
"title": "Environment",
"enum": ["development", "staging", "production"]
}
}
},
"blueprintIdentifier": "service"
}
}
```
See the `examples/` directory for more complete examples.
## Features
- ✅ **Blueprint Management**: Create and update Port.io blueprints
- ✅ **Action Management**: Configure self-service actions
- ✅ **Mapping Management**: Set up integration mappings
- ✅ **Widget Management**: Create dashboard widgets
- ✅ **Merge Strategy**: Safely updates existing resources without overwriting
- ✅ **Confirmation Prompts**: Review changes before applying
- ✅ **Detailed Logging**: Clear feedback on all operations
## Development
### For Package Development
```bash
# Clone the repository
git clone https://github.com/yourusername/port-oneclick-mw.git
cd port-oneclick-mw
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black .
```
## Important Notes
⚠️ **Security**: Never commit your `.env` file or Port.io credentials to version control!
⚠️ **Setup Directory**: The `setup/` directory is specific to your organization and should NOT be included in the PyPI package. Keep it in your private repository.
## Getting Port.io Credentials
1. Log in to your Port.io account
2. Navigate to Settings → Credentials
3. Create a new client ID and secret
4. Copy these values to your `.env` file
## Support & Documentation
- **Examples**: See the `examples/` directory in the package
- **Configuration Guide**: See `CONFIG.md` for detailed configuration options
- **Issues**: Report issues on GitHub
## License
MIT License - see LICENSE file for details
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Raw data
{
"_id": null,
"home_page": null,
"name": "port-oneclick-mw",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "port, port.io, middleware, blueprints, automation",
"author": null,
"author_email": "Erioluwa Asiru <your.email@example.com>",
"download_url": "https://files.pythonhosted.org/packages/42/10/43968a174f7c607f5aceac20628ed44ab68887c7a7946331b2101a27213b/port_oneclick_mw-0.1.1.tar.gz",
"platform": null,
"description": "# Port OneClick Middleware\n\nA Python middleware service for managing Port.io resources including blueprints, actions, mappings, and widgets.\n\n## Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install port-oneclick-mw\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/yourusername/port-oneclick-mw.git\ncd port-oneclick-mw\npip install -e .\n```\n\n## Quick Start\n\n### 1. Create Your Configuration\n\nAfter installation, you need to provide two things:\n\n#### a. Environment Variables (`.env` file)\n\nCreate a `.env` file in your project directory with your Port.io credentials:\n\n```env\nPORT_CLIENT_ID=your_client_id_here\nPORT_CLIENT_SECRET=your_client_secret_here\n\n# Optional: Custom directory paths (defaults shown)\nBLUEPRINTS_DIR=setup/blueprints\nACTIONS_DIR=setup/actions\nMAPPINGS_DIR=setup/mappings\nWIDGETS_DIR=setup/widgets\n\n# Optional: Specify what to process (all, blueprints, actions, mappings, widgets)\nACTION=all\n```\n\n#### b. Setup Directory Structure\n\nCreate a `setup/` directory with your Port.io resource definitions:\n\n```\nsetup/\n\u251c\u2500\u2500 blueprints/ # Blueprint JSON files\n\u251c\u2500\u2500 actions/ # Action JSON files\n\u251c\u2500\u2500 mappings/ # Mapping JSON files\n\u2514\u2500\u2500 widgets/ # Widget/Dashboard JSON files\n```\n\n**Example structure:**\n```\nmy-project/\n\u251c\u2500\u2500 .env\n\u251c\u2500\u2500 setup/\n\u2502 \u251c\u2500\u2500 blueprints/\n\u2502 \u2502 \u251c\u2500\u2500 service.json\n\u2502 \u2502 \u2514\u2500\u2500 deployment.json\n\u2502 \u251c\u2500\u2500 actions/\n\u2502 \u2502 \u2514\u2500\u2500 deploy-service.json\n\u2502 \u251c\u2500\u2500 mappings/\n\u2502 \u2502 \u2514\u2500\u2500 github-mapping.json\n\u2502 \u2514\u2500\u2500 widgets/\n\u2502 \u2514\u2500\u2500 services-dashboard.json\n```\n\n### 2. Use Example Templates\n\nThe package includes example files to help you get started. Check the `examples/` directory:\n\n```bash\n# Copy examples to your setup directory\ncp -r examples/blueprints setup/blueprints\ncp -r examples/actions setup/actions\ncp -r examples/widgets setup/widgets\n```\n\nOr view them in the package installation:\n```bash\npython -c \"import site; print(site.getsitepackages())\"\n# Then navigate to port-oneclick-mw/examples/\n```\n\n### 3. Run the Middleware\n\n```bash\n# Run from command line\nport-oneclick\n\n# Or run the Python module directly\npython main.py\n```\n\n## Configuration Options\n\n### Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `PORT_CLIENT_ID` | Your Port.io client ID | **Required** |\n| `PORT_CLIENT_SECRET` | Your Port.io client secret | **Required** |\n| `BLUEPRINTS_DIR` | Path to blueprints directory | `setup/blueprints` |\n| `ACTIONS_DIR` | Path to actions directory | `setup/actions` |\n| `MAPPINGS_DIR` | Path to mappings directory | `setup/mappings` |\n| `WIDGETS_DIR` | Path to widgets directory | `setup/widgets` |\n| `ACTION` | What to process: `all`, `blueprints`, `actions`, `mappings`, or `widgets` | `all` |\n\n### Directory Structure\n\nEach directory should contain JSON files defining your Port.io resources:\n\n- **blueprints/**: Blueprint definitions\n- **actions/**: Self-service action definitions\n- **mappings/**: Integration mapping configurations\n- **widgets/**: Dashboard widget definitions\n\n## JSON File Format\n\n### Blueprint Example (`setup/blueprints/service.json`)\n\n```json\n{\n \"identifier\": \"service\",\n \"title\": \"Service\",\n \"icon\": \"Microservice\",\n \"schema\": {\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Service Name\"\n },\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\"active\", \"inactive\"],\n \"title\": \"Status\"\n }\n },\n \"required\": [\"name\"]\n }\n}\n```\n\n### Action Example (`setup/actions/deploy.json`)\n\n```json\n{\n \"identifier\": \"deploy_service\",\n \"title\": \"Deploy Service\",\n \"icon\": \"Deployment\",\n \"trigger\": {\n \"type\": \"self-service\",\n \"operation\": \"DAY-2\",\n \"userInputs\": {\n \"properties\": {\n \"environment\": {\n \"type\": \"string\",\n \"title\": \"Environment\",\n \"enum\": [\"development\", \"staging\", \"production\"]\n }\n }\n },\n \"blueprintIdentifier\": \"service\"\n }\n}\n```\n\nSee the `examples/` directory for more complete examples.\n\n## Features\n\n- \u2705 **Blueprint Management**: Create and update Port.io blueprints\n- \u2705 **Action Management**: Configure self-service actions\n- \u2705 **Mapping Management**: Set up integration mappings\n- \u2705 **Widget Management**: Create dashboard widgets\n- \u2705 **Merge Strategy**: Safely updates existing resources without overwriting\n- \u2705 **Confirmation Prompts**: Review changes before applying\n- \u2705 **Detailed Logging**: Clear feedback on all operations\n\n## Development\n\n### For Package Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/port-oneclick-mw.git\ncd port-oneclick-mw\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate # On Windows: venv\\Scripts\\activate\n\n# Install in editable mode with dev dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Format code\nblack .\n```\n\n## Important Notes\n\n\u26a0\ufe0f **Security**: Never commit your `.env` file or Port.io credentials to version control!\n\n\u26a0\ufe0f **Setup Directory**: The `setup/` directory is specific to your organization and should NOT be included in the PyPI package. Keep it in your private repository.\n\n## Getting Port.io Credentials\n\n1. Log in to your Port.io account\n2. Navigate to Settings \u2192 Credentials\n3. Create a new client ID and secret\n4. Copy these values to your `.env` file\n\n## Support & Documentation\n\n- **Examples**: See the `examples/` directory in the package\n- **Configuration Guide**: See `CONFIG.md` for detailed configuration options\n- **Issues**: Report issues on GitHub\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python middleware service for managing Port.io guides (blueprints, actions, mappings, widgets)",
"version": "0.1.1",
"project_urls": {
"Documentation": "https://github.com/yourusername/port-oneclick-mw/blob/main/README.md",
"Homepage": "https://github.com/yourusername/port-oneclick-mw",
"Issues": "https://github.com/yourusername/port-oneclick-mw/issues",
"Repository": "https://github.com/yourusername/port-oneclick-mw"
},
"split_keywords": [
"port",
" port.io",
" middleware",
" blueprints",
" automation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "308f65e17f20ad8e93d6f7c27b29fbd35bbbd3dffbd833ad99b5cdce98de2db7",
"md5": "9158ba0ac07bb5ac298355eb21fd7744",
"sha256": "1bedcfa83fded0e6e6a9a393ff11122478e5a6689b9d144883d7dca85b5d6438"
},
"downloads": -1,
"filename": "port_oneclick_mw-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9158ba0ac07bb5ac298355eb21fd7744",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 27692,
"upload_time": "2025-10-09T13:51:07",
"upload_time_iso_8601": "2025-10-09T13:51:07.779264Z",
"url": "https://files.pythonhosted.org/packages/30/8f/65e17f20ad8e93d6f7c27b29fbd35bbbd3dffbd833ad99b5cdce98de2db7/port_oneclick_mw-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "421043968a174f7c607f5aceac20628ed44ab68887c7a7946331b2101a27213b",
"md5": "9de5cf2e90f935c70e0fa220c4e4761e",
"sha256": "c0863c83422d843073051277c2a2cb35dd97967f4be5406cffc31ce5ae54e59f"
},
"downloads": -1,
"filename": "port_oneclick_mw-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "9de5cf2e90f935c70e0fa220c4e4761e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 27683,
"upload_time": "2025-10-09T13:51:09",
"upload_time_iso_8601": "2025-10-09T13:51:09.715522Z",
"url": "https://files.pythonhosted.org/packages/42/10/43968a174f7c607f5aceac20628ed44ab68887c7a7946331b2101a27213b/port_oneclick_mw-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-09 13:51:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "port-oneclick-mw",
"github_not_found": true,
"lcname": "port-oneclick-mw"
}