Metadata-Version: 2.4
Name: tsndep
Version: 1.0.2
Summary: TSNDep - Dependency Manager for TSN MQL5 Ecosystem. Manages dependencies recursively with hooks support
Project-URL: Repository, https://forge.mql5.io/nique_372/TSNDep
Project-URL: Documentation, https://forge.mql5.io/nique_372/TSNDep/wiki
Project-URL: Issues, https://forge.mql5.io/nique_372/TSNDep/issues
Author-email: TradeSystemsNique <tradesystemsnique@gmail.com>
License: Copyright (c) 2026 Niquel & Leo NL-NC License  
        
        This repository is governed by the Niquel & Leo NL-NC License (No LLM - No Commercial).  
        Full terms and conditions are available at:  
        https://forge.mql5.io/nique_372/TSNReposIndex/src/branch/main/Licenses/LICENSE-NL-NC.md
        
        By accessing, cloning, forking, or otherwise using this repository, you agree to be bound by the terms of this license.
        If you do not accept this repository's license, DO NOT use any code fragments from this repository for any purpose.
License-File: LICENSE
Keywords: dependencies,metatrader,mql5,package-manager,trading
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.10
Requires-Dist: click>=8.3.3
Description-Content-Type: text/markdown

<p align="center">
  <strong>TSN Dependency Manager</strong>
</p>

<p align="center">
  A powerful CLI tool for managing TSN MQL5 Projects dependencies with recursive processing, hooks support, and automatic dependency resolution.
</p>

<p align="center">
  <img src="https://img.shields.io/badge/Language-Python-3776ab?style=flat-square"/>
  <img src="https://img.shields.io/badge/CLI-Click-36c5f0?style=flat-square"/>
  <img src="https://img.shields.io/badge/Platform-Cross--Platform-0D1B2A?style=flat-square"/>
  <img src="https://img.shields.io/badge/Author-TradeSystemsNique-C9D6DF?style=flat-square"/>
  <a href="./LICENSE">
    <img src="https://img.shields.io/badge/License-Nique%26Leo%20NL--NC-red.svg"/>
  </a>
</p>

---

## Main Features

### Dependency Management
- **Declarative Configuration**: Define dependencies in a simple JSON format
- **Recursive Processing**: Automatically resolve nested dependencies
- **Duplicate Prevention**: Skip already-processed repositories
- **Smart Updates**: Clone new repos or pull existing ones

### Hooks System
- **Pre/Post Hooks**: Execute custom commands before and after operations
- **Conditional Execution**: Run hooks only on success
- **Timeout Control**: Prevent hanging commands with configurable timeouts
- **Error Handling**: Skip failures or fail on errors

### Advanced Queries
- **Dependency Tree**: Visualize project structure with depth control
- **Export Analysis**: Export flattened dependency list with metadata
- **Repository Validation**: Check that all dependencies are properly cloned

### Multi-Language Support
- **Language Detection**: Identify required programming languages
- **Version Tracking**: Record language versions per dependency
- **Structured Metadata**: Store comments and branch information

---

## Repository Structure

```
TSNDep/
├── tsndep/             # Source code (CLI, commands, utilities)
│   ├── Comands/        # Command modules (install, add, remove, update, list, check, export, init)
│   ├── Ops/            # Utilities (Git operations, hooks, JSON handling)
│   └── Variables/      # Env varialbes for hooks (class)
```

---

## Installation

### From PyPI (Recommended)
```bash
pip install tsndep
```

Then use globally:
```bash
tsndep --help
```

### From Repository
```bash
git clone https://forge.mql5.io/nique_372/TSNDep
cd TSNDep
pip install -e .
```

### Contact me 
Contact me on MQL5 (user: nique_372) to be added as a collaborator with your MQL5 nickname (read-only access), which will make the repository automatically appear in your Shared Projects folder

---

## Quick Start

### 1. Initialize Your Project
```bash
cd your-project
tsndep init
```

This creates a `dependencies.json` template with:
- Empty repos array
- MetaTrader 5 build requirement
- Hook configuration (pre/post install/update)

### 2. Configure Dependencies

Edit `dependencies.json` and add your first dependency:

```json
{
  "repos": [
    {
      "name": "my-core-lib",
      "url": "https://github.com/yourorg/my-core-lib.git",
      "rama": "main",
      "comment": "Core library for trading systems"
    }
  ],
  "hooks": {
    "post_install": []
  }
}
```

### 3. Clone & Install All Dependencies

```bash
# Install from repository URL
tsndep install https://github.com/yourorg/my-project.git main

# Or with custom path
tsndep install https://github.com/yourorg/my-project.git main --path_install custom\\path
```

This will:
- Clone the main repository
- Read its `dependencies.json`
- Recursively clone all nested dependencies
- Execute any pre/post hooks

### 4. Verify Everything is Installed

```bash
tsndep check
```

Shows status of each dependency:
- `[OK]`: Repository cloned and ready
- `[FAIL]`: Repository missing or not cloned

### 5. Visualize the Dependency Tree

```bash
# Show all dependencies (default depth: 10)
tsndep list

# Show only 3 levels deep
tsndep list --depth 3
```

Output:
```
MyProject/
├── my-core-lib/
│   ├── logger-lib/
│   └── config-lib/
└── data-processor/
    ├── pandas-wrapper/
    └── ml-models/
```

---

## Common Commands

### Add a New Dependency
```bash
tsndep add https://github.com/org/repo.git main \
  --name my-new-lib \
  --comment "Trading calculations library"
```

### Remove a Dependency
```bash
tsndep remove my-new-lib
```

### Update all repositories (from dependencies.json)
```bash
tsndep update
```

Pulls latest changes from all repositories.

### Export Flat Dependency List
```bash
tsndep export --output all-deps.json
```

Creates a flattened list with all dependencies (useful for CI/CD).

---

## Requirements

### Python
- pip (Python package manager)
- see: [requirements.txt](requirements.txt)

### Check Your Setup
```bash
python --version          # Should be 3.10+
git --version             # Should be installed
pip list | grep click     # Should show click installed
```

---

## Documentation

- **[Commands Reference](https://forge.mql5.io/nique_372/TSNDep/wiki/Commands.md):** Detailed description of each command
- **[dependencies.json Format](https://forge.mql5.io/nique_372/TSNDep/wiki/DependenciesF.md):** Full dependencies.json specification
- **[Hooks Guide](https://forge.mql5.io/nique_372/TSNDep/wiki/Hooks.md):** Hook system and examples

---

## License

**[Read Full License](./LICENSE)**

By downloading or using this repository, you accept the license terms.

---

## Contact and Support

- **Platform:** [MQL5 Community](https://www.mql5.com)
- **Profile:** https://www.mql5.com/es/users/nique_372
- **Issues:** For bug reports or questions

---

## Disclaimer

- TSNDep is a dependency management tool, not trading software
- Always test in development before production deployment
- Ensure you have permissions for all repositories
- Git operations may have security implications. review URLs carefully
- The authors assume no liability for system failures or data loss

---

<p align="center">Copyright © 2026 TradeSystemsNique</p>