Skip to main content

Get and explore relationships between Dynamics 365 tables

Project description

Dynamics 365 Table Relationship Finder

A tool for finding relationships between Dynamics 365 tables based on their field associations. This tool efficiently identifies direct and indirect relationships, enabling better understanding of data models.

Features

  • Find Direct Relationships: Quickly find all tables directly related to a specific table.
  • Find Relationship Paths: Discover paths between two tables through their relationships, with control over search depth.
  • Memory Efficient: Designed to handle large relationship datasets efficiently.
  • Command-line Interface: Easy-to-use CLI for quick access to relationship information.
  • Case-Insensitive Lookups: Table names can be specified in any case (uppercase, lowercase, mixed case).

Installation

pip install d365-relations-cli

Optimizing the Relationship File

You need to create an advanced optimized version of the tablefieldassociations.json file before using the tool. This significantly reduces file size and improves performance:

# Using the CLI
tr optimize -i tablefieldassociations.json -o tablefieldassociations_opt.json

The advanced optimization performs the following:

  1. Removes duplicate bi-directional relationships
  2. Uses numeric IDs for tables and fields instead of repeating strings
  3. Creates lookup dictionaries for table and field names

Command-line Usage

# Find all tables directly related to a specific table (case-insensitive)
tr find-related companyinfo

# Find direct relationships between two tables (with no intermediate tables)
tr find-relationship table1 TABLE2

# Find relationships with intermediate tables (specify max number of intermediate tables)
tr find-relationship table1 TABLE2 --levels 2

# Get detailed information about the direct relationship between two tables
tr get-relationship-details Table1 table2

# List all tables in the dataset
tr list-tables

# Show statistics about the loaded relationships
tr stats

# Specify a different optimized JSON file
tr -f custom_tablefieldassociations_opt.json find-related companyinfo

# Save results to a file
tr find-related companyinfo --output results.json

CLI Commands

  • find-related: Find all tables directly related to a specific table
  • find-relationship: Find paths between two tables (default is direct relationships only, use --levels to include intermediate tables)
  • get-relationship-details: Get detailed information about the direct relationship between two tables
  • list-tables: List all tables in the dataset
  • stats: Show statistics about the loaded relationships
  • optimize: Create an advanced optimized version of the relationships file

Run dynamics365-finder --help for more information about the available commands and options.

Python API Usage

from dynamics365_relationship_finder import AdvancedTableRelationshipFinder

# Initialize the finder with the path to your advanced optimized JSON file
finder = AdvancedTableRelationshipFinder('tablefieldassociations_opt.json')

# Find all tables directly related to a specific table (case-insensitive)
related_tables = finder.find_related('Customer')
print(related_tables)

# Find paths between two tables (with no intermediate tables by default)
paths = finder.find_relationship('Customer', 'SalesTable')
print(paths)

# Find paths with up to 2 intermediate tables
paths = finder.find_relationship('Customer', 'SalesTable', levels=2)
print(paths)

# Get detailed information about the direct relationship between two tables
details = finder.get_relationship_details('Customer', 'SalesTable')
print(details)

# List all tables in the dataset
tables = finder.get_table_list()
print(tables)

# Get statistics about the loaded relationships
stats = finder.get_stats()
print(stats)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

d365_relations_cli-0.1.2.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

d365_relations_cli-0.1.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file d365_relations_cli-0.1.2.tar.gz.

File metadata

  • Download URL: d365_relations_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for d365_relations_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cef2528e386897de65398111c40ff4574345e75207dcee26f96655f20852dc45
MD5 134ee92f1a941b32958b3a519fa70dec
BLAKE2b-256 d92c0865a2506912893bc7179f8e766170519e3fb3239908c457f6bb0817aff4

See more details on using hashes here.

File details

Details for the file d365_relations_cli-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for d365_relations_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 85ac22bcc72cba582034d1a543df164f250a25320f1e83055de01c2f4115d134
MD5 b8ad86aa901c8c69f5c4a2a7b6782196
BLAKE2b-256 f29435ab82a49f2eda6fa593830c6227ae70e330e9d4378347cbaa74e911fa6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page