Update Code Structure authored by Steinar Hjellvik's avatar Steinar Hjellvik
...@@ -3,10 +3,18 @@ ...@@ -3,10 +3,18 @@
The OSDU CLI uses the [Python Click](https://click.palletsprojects.com/en/8.0.x/) package to simplify the development experience. Code is located under the _src/osducli_ folder as follows: The OSDU CLI uses the [Python Click](https://click.palletsprojects.com/en/8.0.x/) package to simplify the development experience. Code is located under the _src/osducli_ folder as follows:
```text ```text
├── auth <- Authentication functions
| ├── aws_token_credential.py <- AWS auth
| ├── credentials.py <- Credentials functions
| ├── msal_interactive.py <- Azure MSAL interactive auth
| ├── msal_non_interactive.py <- Azure MSAL non-interactive auth
| └── token_credential.py <- Azure refresh token auth
├── commands <- CLI Commands grouped by folder ├── commands <- CLI Commands grouped by folder
| ├── config/ <- Configuration commands | ├── config/ <- Configuration commands
| ├── crs/ <- Coordinate Reference System (CRS) service commands
| ├── dataload/ <- Data loading commands | ├── dataload/ <- Data loading commands
| ├── entitlements/ <- Entitlements commands | ├── entitlements/ <- Entitlements commands
| ├── file/ <- File commands
| ├── legal/ <- Legal commands | ├── legal/ <- Legal commands
| ├── list/ <- List information | ├── list/ <- List information
| ├── schema/ <- Schema commands | ├── schema/ <- Schema commands
...@@ -15,11 +23,14 @@ The OSDU CLI uses the [Python Click](https://click.palletsprojects.com/en/8.0.x/ ...@@ -15,11 +23,14 @@ The OSDU CLI uses the [Python Click](https://click.palletsprojects.com/en/8.0.x/
| ├── storage/ <- Storage commands | ├── storage/ <- Storage commands
| ├── unit/ <- Unit commands | ├── unit/ <- Unit commands
| ├── version/ <- Version command | ├── version/ <- Version command
| ├── wellbore-ddms/ <- Wellbore ddms commands
| └── workflow/ <- Workflow commands | └── workflow/ <- Workflow commands
├── util <- Utility / helper functions ├── util <- Utility / helper functions
| ├── exceptions.py <- CLI specific exceptions | ├── exceptions.py <- CLI specific exceptions
| ├── file.py <- File helper functions | ├── file.py <- File helper functions
| └── prompt.py <- Prompting for information | ├── prompt.py <- Prompting for information
| ├── pypi.py <- Get latest version from pypi
| └── service_info.py <- Service information
├── __init__.py <- Contains the CLI version number ├── __init__.py <- Contains the CLI version number
├── __main__.py <- Main entry point and command loading ├── __main__.py <- Main entry point and command loading
├── click_cli.py <- Click helpers including state and command decorators ├── click_cli.py <- Click helpers including state and command decorators
...@@ -42,7 +53,7 @@ __click_command_ functions (commands) should be decorated with the following: ...@@ -42,7 +53,7 @@ __click_command_ functions (commands) should be decorated with the following:
## Calling OSDU API's ## Calling OSDU API's
The cliclient.py module contains the _CliOsduClient _class that simplifies interacting with the OSDU backend. _CliOsduClient _currently uses the separate osdu-sdk package which contains backend code seperated out from the original CLI. Future updates might align with a future OSDU standard SDK. Using the _CliOsduClient_ you can make HTTP REST calls direclty agains the API's. Certain API's e.g. Search have wrapper classes that simplify the API usage. The cliclient.py module contains the _CliOsduClient _class that simplifies interacting with the OSDU backend. _CliOsduClient _currently uses the separate osdu_api package which is the OSDU forum maintained Python SDK. Using the _CliOsduClient_ you can make HTTP REST calls directly against the OSDU API's. Certain API's e.g. Search have wrapper classes that simplify the API usage.
## Testing ## Testing
... ...
......