0.1.5 • Published 3 years ago

latona-datacatalog v0.1.5

Weekly downloads
-
License
Apache 2.0
Repository
github
Last release
3 years ago

Latona - Data Catalog

Latona addon for generating model-based human-readable data catalog pages (md, html, Confluence Cloud)

Disclaimer

This is NOT a fully-fledged data catalog implementation like Apache Atlas. This is just an addon to Latona code generator. This addon renders a set of pages to simplify digesting metadata in a user-friendly way. Nothing more than that.

We used this tool on a number occasions, usually when it is too early to start thinking about heavy data cataloging tools, but presenting some collected metadata is beneficial.

Usage

Quick start

  1. Install Latona - see latona documentation
  2. Scaffold model and project - see latona documentation
  3. Add latona-datacatalog addon to package.json:
npm i latona-datacatalog
  1. Add latona-datacatalog to your latona project. To use the default configuration add this snippet to the addons array:
{
  "moduleName": "latona-datacatalog",
  "options": {
    "renderFormat": "md"
  }
}
  1. Add tables to your model. See our test model for examples. Data catalog expects tables array to be at the root of the model.

  2. Add extra collections for other catalogs. Default configuration will look for collections.businessProcesses for business process catalog, and for collections.applications for applications catalog. Nothing bad will happen if these are missing - respective catalogs will be empty in this case.

  3. Add relationship types to your model. They should land in collections.relationships by default. Each relationship type should be structured as follows (titles are used to group relationship links at the catalog item's page):

{
  "id": "string",
  "title_forward": "string",
  "title_backward": "string"
}
  1. Add relationship records. The default place for them is at collections.relationshipTypes. typeId should be one of defined at the previous steps, source is the source (upstream) object's slug, target is the target (downstream) object's slug. Typical relationship looks like this:
{
  "typeId": "fk",
  "source": "[orders].[dbo].[FactOrderItem]",
  "target": "[orders].[dbo].[DimClient]"
}
  1. Add custom markdown content to the ./content folder (use item's slug as a file name).

  2. Render as described in the Latona's guide.

Addon options

Please refer for more information to these source files:

OptionTypeRequiredDescription
pathsobjectyes
paths.outPathstringyesoutput path (default: ./output)
paths.customContentPathstringyespath to the folder with custom markdown files (use slug for names and custom markdown will be injected)
renderFormatenum "md", "html", "conf"yes
pageTreeFileNamestringyesfilename for the JSON file with the list of all generated pages
confobjectConfluence-specific configuration
conf.createNotesPagebooleantrue by default
conf.notesSlugSuffixstringyes (only if parent object is present)Slug suffix for "notes" pages - empty pages that may be editted directly at Confluence. Notes pages are injected into catalog pages via macro.
conf.notesTitleSuffixstringyes (only if parent object is present)Suffix for "notes" page titles.
conf.modelConfigobjectyes (only if parent object is present)
conf.modelConfig.spaceKeystringyes (only if parent object is present)Confluence space key
catalogsobjectyes (only if parent object is present)Catalogs configuration (there may be many)
catalogs.<catalogName>objectyesCatalog configuration object. Only latin letters.
catalogs.<catalogName>.collectionstringyespath to array of catalog items (from the model root)
catalogs.<catalogName>.titlestringyescatalog title
catalogs.<catalogName>.slugstringyescatalog slug (url-friendly string)
catalogs.<catalogName>.sectionByobjectsectioning configuration (at least first level should be described, only two levels are supported)
catalogs.<catalogName>.sectionBy.firstobjectyes (only if parent object is present)first level of grouping
catalogs.<catalogName>.sectionBy.first.properties[]arrayyes (only if parent object is present)properties to group by
catalogs.<catalogName>.sectionBy.first.properties[].namestringyesproperty name (for internal use only)
catalogs.<catalogName>.sectionBy.first.properties[].pathstringyesproperty path (relative to catalog item)
catalogs.<catalogName>.sectionBy.first.properties[].titlestringyesproperty title
catalogs.<catalogName>.sectionBy.first.properties[].showbooleanshow property
catalogs.<catalogName>.sectionBy.first.properties[].showInLinkTablebooleanshow property on the parent page if "inParentAs": "linkTable"
catalogs.<catalogName>.sectionBy.first.inParentAsenum "linkTable", "linkList", "section"yes (only if parent object is present)sets how to show sections on the parent page (catalog root page for the first level of grouping)
catalogs.<catalogName>.sectionBy.first.tableLinkPropertystringsets which property should be used for linking to the section details page
catalogs.<catalogName>.sectionBy.first.titleTemplatestringyes (only if parent object is present)section title template (variable expansion is supported)
catalogs.<catalogName>.sectionBy.first.slugTemplatestringyes (only if parent object is present)section slug template (variable expansion is supported)
catalogs.<catalogName>.sectionBy.secondobjectsee catalogs.&lt;catalogName&gt;.sectionBy.first
catalogs.<catalogName>.detailsobjectyessee catalogs.&lt;catalogName&gt;.sectionBy.first
catalogs.<catalogName>.detailsCollectionsobjectdescribes inner collections for the catalog's item (e.g.: if database table is a catalog item, then table fields is the inner collection)
catalogs.<catalogName>.detailsCollections.<name>objectyes (only if parent object is present)Collection configuration object. Only latin letters.
catalogs.<catalogName>.detailsCollections.<name>.collectionstringyes (only if parent object is present)path to array of collection items (relative to item)
catalogs.<catalogName>.detailsCollections.<name>.properties[]arrayyes (only if parent object is present)collection properties
catalogs.<catalogName>.detailsCollections.<name>.properties[].namestringyes (only if parent object is present)property name (for internal use only)
catalogs.<catalogName>.detailsCollections.<name>.properties[].pathstringyes (only if parent object is present)property path (relative to collection item)
catalogs.<catalogName>.detailsCollections.<name>.properties[].titlestringyes (only if parent object is present)property title
catalogs.<catalogName>.detailsCollections.<name>.headingstringyes (only if parent object is present)section's title
relationshipsCollectionstringyespath to array of relationships (relative to collections object within the latona model)
relationshipTypesCollectionstringyespath to array of relationship types (relative to collections object within the latona model)
dropDefaultCatalogsbooleanfalse by default, removes default catalogs configuration if true

Upload pages to Confluence Cloud

The latona-datacatalog package also includes dc2confcloud utility which enables automated upload of pages to your Confluence Cloud space.

  1. Install the package globally to use this tool:
npm i -g latona-datacatalog
  1. Create the configuration json:
{
  "confluence": {
    "baseUrl": "<your_account>.atlassian.net",
    "spaceKey": "<your_space_key>"
  },
  "contentFolder": "./path/to/generated/conf/output",
  "notesSuffix": " - Notes", // see addon options
  "pageTree": "___page_tree___.json", // see addon options
  // specify parent pages for each "root" catalog page
  "parents": [
    {
      "slug": ".datacatalog",
      "confPageId": 123456789 // you need to create this page manually
    },
    {
      "slug": ".datacatalog-notes",
      "confPageId": 123456789 // you need to create this page manually
    },
    {
      "slug": ".bpcatalog",
      "confPageId": 123456789 // you need to create this page manually
    },
    {
      "slug": ".bpcatalog-notes",
      "confPageId": 123456789 // you need to create this page manually
    },
    {
      "slug": ".appcatalog",
      "confPageId": 123456789 // you need to create this page manually
    },
    {
      "slug": ".appcatalog-notes",
      "confPageId": 123456789 // you need to create this page manually
    }
  ]
}
  1. Run the tool:
dc2confcloud -u <your_user_name> -t <your_access_token> -c <./path/to/dc2confcloud.json>

Usage details:

Usage: dc2confcloud [options]

Options:
  -u, --user <user>      Confluence user name (email)
  -t, --token <token>    Confluence access token
  -c, --config <config>  path to dc2confcloud's configuration json (default: "./dc2confcloud.json")
  -h, --help             display help for command

Contributing

Please read our Latona's contribution guidelines for details on our development approach, and the process for submitting pull requests to us. All contributors should comply with our Latona's Code of Conduct

License

Latona is copyright (c) 2019-present DataArt (www.dataart.com) and all contributors and licensed under the Apache License, Version 2.0. See the LICENSE file for more details.