diff --git a/README.md b/README.md index 936da8fb3073c9e94662ff278d7218103fc0700e..12bf69ce85099a0219fa27269fe6c7fda188e86e 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,32 @@ Run the command below python3 -m unittest tests/test_schemas.py ``` -# Quick Links +## Quick Links 1. [Generated Swagger Docs (recommended to look at this)](https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/-/blob/dev/project/soar/swagger.json) 2. [Schema Fields Definitions](https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/-/tree/dev/formats) 3. [JSON Schema Examples](https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/-/tree/dev/examples) -4. Ongoing Project: [SoAR README.md](https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/-/blob/dev/project/soar/SOAR_README.md) \ No newline at end of file +4. Ongoing Project: [SoAR README.md](https://git.noc.ac.uk/communications-backbone-system/backbone-message-format/-/blob/dev/project/soar/SOAR_README.md) + +## Installing + +You can install the message formats as a package with pip + +```requirements.txt +backbone-message-format @ git+https://git.noc.ac.uk/communications-backbone-system/backbone-message-format.git@v0.1.0#egg=backbone-message-format +``` + +### Importing the formats + +```python +import backbone_formats +``` + +### Importing the compiled schema + +```python +import importlib.resources +import soar_schema +import json +with importlib.resources.open_text(soar_schema, "swagger.json") as file: + schema = json.load(file) +``` \ No newline at end of file