Skip to content
/ graphs Public

A powerful tool to import and analyze Miro diagrams using NetworkX.

License

Notifications You must be signed in to change notification settings

wtznc/graphs

Repository files navigation

Graphs

License Python Version Build Status Docker

Overview

Graphs is a powerful tool that bridges the gap between Miro, a collaborative online whiteboarding platform, and NetworkX, a Python library for creating, manipulating, and studying complex networks. This project allows users to create diagrams in Miro, seamlessly import them into a Python environment for advanced mathematical analysis and visualization, and leverage AI to enhance task scheduling based on calendar synchronization.

Features

  • Miro Integration: Connect to your Miro boards, fetch diagrams, and retrieve detailed board data.
  • NetworkX Conversion: Automatically convert Miro diagrams into NetworkX graph structures for analysis.
  • Graph Analysis: Perform centrality calculations, community detection, and other network analyses.
  • Logging: Comprehensive logging to monitor application behavior and debug issues.
  • Continuous Integration: Automated testing and code quality checks with GitHub Actions.
  • Pre-commit Hooks: Enforce code quality standards using pre-commit hooks with black, flake8, and isort.

Table of Contents

Installation

Prerequisites

Clone the Repository

git clone https://github.com/wtznc/graphs.git
cd graphs

Set Up Virtual Environment

Create and activate a Python virtual environment:

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

Install Dependencies

Install the required Python packages:

pip install --upgrade pip
pip install -r requirements.txt

Configure Environment Variables

Create a .env file based on .env.example:

cp .env.example .env

Edit the .env file and add your Miro API credentials:

MIRO_CLIENT_ID=your_client_id
MIRO_CLIENT_SECRET=your_client_secret
MIRO_ACCESS_TOKEN=your_access_token
BOARD_ID=your_board_id

Important: Ensure that .env is listed in your .gitignore to prevent sensitive information from being committed to the repository.

Usage

Running the Application

Execute the main application script:

python src/main.py

Example Output

The application will fetch the specified Miro board, convert it into a NetworkX graph, perform analysis, and output the results:

{
    "nodes": [
        {"id": "1", "label": "Node 1"},
        {"id": "2", "label": "Node 2"}
    ],
    "edges": [
        {"source": "1", "target": "2"}
    ],
    "centrality": {
        "1": 0.5,
        "2": 0.5
    },
    "communities": [
        ["1", "2"]
    ]
}

Docker (Optional)

To containerize the application using Docker:

  1. Build the Docker Image:

    docker build -t graphs:latest .
  2. Run the Docker Container:

    docker run --env-file .env -v $(pwd)/logs:/app/logs graphs:latest

Project Structure

graphs/
├── src/
│   ├── analysis/
│   │   ├── __init__.py
│   │   └── graph_analysis.py
│   ├── miro/
│   │   ├── __init__.py
│   │   ├── api_client.py
│   │   ├── auth.py
│   │   └── parser.py
│   ├── networkx_converter/
│   │   ├── __init__.py
│   │   └── converter.py
│   ├── utils/
│   │   ├── __init__.py
│   │   ├── helpers.py
│   │   └── logger.py
│   ├── config.py
│   └── main.py
├── tests/
│   ├── __init__.py
│   ├── test_client.py
│   ├── test_parser.py
│   ├── test_converter.py
│   └── test_graph_analysis.py
├── .github/
│   └── workflows/
│       └── ci.yml
├── .pre-commit-config.yaml
├── .gitignore
├── README.md
├── LICENSE
├── requirements.txt
├── setup.py
├── Dockerfile
└── .env.example

Contributing

We welcome contributions from the community! To contribute, please follow these steps:

  1. Fork the Repository

  2. Clone Your Fork

    git clone https://github.com/yourusername/graphs.git
    cd graphs
  3. Create a New Branch

    git checkout -b feature/your-feature-name
  4. Make Your Changes

  5. Commit Your Changes

    git commit -m "Add feature: your feature description"
  6. Push to Your Fork

    git push origin feature/your-feature-name
  7. Create a Pull Request

Please refer to our Contributing Guidelines for more details.

Issues

We use GitHub Issues to track bugs, enhancements, and feature requests. Here are some of the main issues to get you started:

  1. [Feature] Implement Miro API Client (#1)
  2. [Feature] Implement Miro Board Parser (#2)
  3. [Feature] Implement NetworkX Converter (#3)
  4. [Feature] Implement Graph Analysis Functions (#4)
  5. [Feature] Implement Logging and Helper Functions (#5)
  6. [Feature] Implement Main Application Logic (#6)

Feel free to check out these issues and contribute to the project!

Support

If you encounter any issues or have questions, please feel free to open an issue on GitHub or contact me directly at your.email@example.com.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A powerful tool to import and analyze Miro diagrams using NetworkX.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published