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:
- Removes duplicate bi-directional relationships
- Uses numeric IDs for tables and fields instead of repeating strings
- 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 tablefind-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 tableslist-tables: List all tables in the datasetstats: Show statistics about the loaded relationshipsoptimize: 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
Metadata
Release files for d365-relations-cli 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| d365_relations_cli-0.1.4.tar.gz | 217.4 kB | Without provenance | Details for d365_relations_cli-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| d365_relations_cli-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for d365_relations_cli-0.1.4-py3-none-any.whl |
Total release size: 437.1 kB
Release files / d365_relations_cli-0.1.4.tar.gz
| Download URL | d365_relations_cli-0.1.4.tar.gz |
|---|---|
| Size | 217.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
238dea2bad34be377c8b32d00a3e8393844f71651b1cbea9679daa3ace185f65
|
|
BLAKE2b-256 checksum How to use checksums |
cd7e8196a14b29dbc615a2a71186f64f06673d0716434376deafcf2a585d6b0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.14
|
Release files / d365_relations_cli-0.1.4-py3-none-any.whl
| Download URL | d365_relations_cli-0.1.4-py3-none-any.whl |
|---|---|
| Size | 219.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
154d8e5c053dd8ac4e666b1be58b4b8da3a4cbd69b5bbf6aefeabc2983eee941
|
|
BLAKE2b-256 checksum How to use checksums |
b4d298cc2d4a45224bb2618c4c117a27527b9409b2a6a1ff14a77b7252e2f70b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.14
|
Security for d365-relations-cli 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.