Skip to content

Refactor API and Transform Layers for Shared Configuration and Simplified Logic#15

Closed
ismailtsdln wants to merge 1 commit intoINTERPOL-Innovation-Centre:mainfrom
ismailtsdln:main
Closed

Refactor API and Transform Layers for Shared Configuration and Simplified Logic#15
ismailtsdln wants to merge 1 commit intoINTERPOL-Innovation-Centre:mainfrom
ismailtsdln:main

Conversation

@ismailtsdln
Copy link
Copy Markdown

API Layer Refactor

GraphSenseClient (Singleton Pattern)

  • Introduced a singleton class to manage API configuration and client instances.

  • Ensures configuration is loaded only once and shared across all transforms.

  • Eliminates redundant client initialization and improves consistency.

Improved Entity Creation

  • Completely rewrote the create_entity_with_details function to be more robust and maintainable.

  • Handles different query types consistently.

  • Replaced dictionary indexing with explicit object attributes for improved type safety and readability.

Configuration Factorization

  • Centralized currency-specific constants (e.g., Satoshi / Wei conversion factors) into a standard configuration dictionary.

  • Improved consistency and ease of maintenance for currency-related calculations.

Transform Layer Refactor

Centralized Extraction Logic

  • Moved common address and currency extraction logic into transforms/utils.py.

  • All transforms now rely on extract_address_and_currencies, which uniformly handles:

  • Cluster IDs

  • Explicit currency filters

  • Automatic currency detection

Simplified Transforms

  • Significantly simplified ToDetails.py, ToTags.py, and ToCluster.py.

  • Removed repetitive boilerplate related to property extraction and error handling.

  • Delegated shared logic and error display to utility functions, improving readability and maintainability.

@ismailtsdln ismailtsdln changed the title master Refactor API and Transform Layers for Shared Configuration and Simplified Logic Jan 16, 2026
@ismailtsdln ismailtsdln closed this by deleting the head repository Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant