Metadata-Version: 2.1
Name: port-ocean
Version: 0.1.0.dev7
Summary: Port Ocean is a CLI tool for managing your Port projects.
Author: Daniel Sinai
Author-email: daniel@getport.io
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: cli
Requires-Dist: click (>=8.1.3,<9.0.0) ; extra == "cli"
Requires-Dist: confluent-kafka (>=2.1.1,<3.0.0)
Requires-Dist: cookiecutter (>=2.1.1,<3.0.0) ; extra == "cli"
Requires-Dist: fastapi (>=0.96.0,<0.97.0)
Requires-Dist: httpx (>=0.24.1,<0.25.0)
Requires-Dist: loguru (>=0.7.0,<0.8.0)
Requires-Dist: pydantic (>=1.10.8,<2.0.0)
Requires-Dist: pyjq (>=2.6.0,<3.0.0)
Requires-Dist: pyyaml (>=6.0,<7.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: rich (>=13.4.1,<14.0.0) ; extra == "cli"
Requires-Dist: six (>=1.16.0,<2.0.0)
Requires-Dist: toml (>=0.10.2,<0.11.0) ; extra == "cli"
Requires-Dist: urllib3 (>=1.26.16,<2.0.0)
Requires-Dist: uvicorn (>=0.22.0,<0.23.0)
Requires-Dist: werkzeug (>=2.3.4,<3.0.0)
Description-Content-Type: text/markdown

# Ocean <img src="./assets/OceanSymbol.svg" alt="Ocean" width="100" height="100" align="right">

[![Lint](https://github.com/port-labs/port-ocean/actions/workflows/lint.yml/badge.svg)](https://github.com/port-labs/port-ocean/actions/workflows/lint.yml)

Ocean is a solution created by Port to tackle the difficulties encountered when merging different third-party systems with our developer portal product. This framework offers a uniform method for executing integrations, streamlining the process and enabling platform engineers to prioritize the essential features of the third-party system.



## Prerequisites

- Python 3.11



## Installation
```
pip install port-ocean[cli]
```

Or

```sh
poetry add port-ocean[cli]
```

[]()

## Run Integration

1. source the integration venv 

   ```sh
   . .venv/bin/activate
   ```

2. Run

   ```sh
   ocean sail ./path/to/integration
   ```

   

## Local Development (Framework)
1. Clone the repository

2. Install dependencies:

   ```sh
   make install
   ```

   Or (For installing integrations dependencies as well)

   ```sh
   make install/all
   ```

3. source the integration venv

   ```sh
   . .venv/bin/activate
   ```

   


## Local Development (Integration)
1. Clone the repository

2. For new integration run

   ```sh
   make new
   ```

   and follow the instructions

3. Install dependencies

4. ```sh
   cd DESIRED_INTEGRATION_FOLDER && make install
   ```

5. source the integration venv

   ```sh
   . .venv/bin/activate
   ```

6. Run the integration

   ```sh
   make run
   ```

   Or

   ```sh
   ocean sail
   ```

   

# Export Architecture

![image](./assets/ExportArchitecture.svg)

## Real-Time updates Architecture
![image](./assets/RealTimeUpdatesArchitecture.svg)

## Folder Structure
The Integration Framework follows a specific folder structure within the mono repository. This structure ensures proper organization and easy identification of integration modules. The suggested folder structure is as follows:

```
port-ocean/
├── port_ocean (framework)/
│ ├── ocean.py
│ ├── core/
| └── ...
└── integrations/
│  ├───integration_name/
│  ├──── main.py
│  ├──── pyproject.toml
│  └──── Dockerfile
├── ...
└── ...
```

- The `framework` folder contains the core logic for managing the integration lifecycle.
- Each integration is represented by a separate folder inside the `integrations` directory.
- Inside each integration folder, you'll find a `main.py` file that implements the core functionality of the integration for the specific third-party system.
- The `pyproject.toml` file inside each integration folder lists the required dependencies for that integration.

## Integration Lifecycle

![image](./assets/LifecycleOfIntegration.svg)

## Configuration
The Integration Framework utilizes a `config.yaml` file for its configuration. This file defines both the framework configuration and the integration configuration within it. Each integration is identified by its type and unique identifier, which are utilized during initialization to appropriately update Port.

Example `config.yaml`:
```yaml
# This is an example configuration file for the integration service.
# Please copy this file to config.yaml file in the integration folder and edit it to your needs.

port:
  clientId: PORT_CLIENT_ID # Can be loaded via environment variable: PORT_CLIENT_ID
  clientSecret: PORT_CLIENT_SECRET # Can be loaded via environment variable: PORT_CLIENT_SECRET
  baseUrl: https://api.getport.io/v1
# The trigger channel to use for the integration service.
triggerChannel:
  type: KAFKA / WEBHOOK
integration:
  # The name of the integration.
  identifier: "my_integration"
  # The type of the integration.
  type: "PagerDuty"
  config:
    my_git_token: "random"
    some_other_integration_config: "Very important information"
```

## Contributing
We welcome contributions to the Integration Framework project. If you have any suggestions, bug reports, or would like to contribute new features, please follow our guidelines outlined in the `CONTRIBUTING.md` file.

## License
The Integration Framework is open-source software licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). See the `LICENSE` file for more details.

## Contact
For any questions or inquiries, please reach out to our team at support@getport.io
