Skip to main content

AI Trello Extract

AI Trello Extract Banner

License: MIT Python Version PyPI Version Build Status

Table of Contents

Introduction

AI Trello Extract is a Python-based tool that leverages the py-trello library and python-dotenv to interact seamlessly with the Trello API. It facilitates the authentication process via OAuth and enables users to retrieve detailed information from Trello boards, lists, and cards. This project exemplifies secure API credential management and organized data retrieval for further processing.

Value Proposition

Managing and extracting data from Trello boards can be cumbersome, especially when dealing with multiple boards and extensive card details. AI Trello Extract streamlines this process by providing a secure and efficient way to authenticate with the Trello API, fetch comprehensive board data, and output it in accessible formats like Markdown and JSON. This enables developers and project managers to integrate Trello data into their workflows, documentation, and analytics effortlessly.

Key Features

  • OAuth Authentication: Securely authenticate with the Trello API using OAuth.
  • Comprehensive Data Retrieval: Fetch details of all accessible Trello boards, including lists and cards.
  • Secure Credential Management: Utilize environment variables to manage API credentials securely.
  • Flexible Output Formats: Export Trello data to Markdown files and JSON for versatile use cases.
  • Automated Testing: Ensure reliability with comprehensive unit and end-to-end tests.
  • Continuous Integration: Maintain code quality with GitHub Actions workflows.

Technology Stack

Installation

Install AI Trello Extract via PyPI:

pip install ai-trello-extract

For more details, visit the PyPI project page.

Setup

1. Register for Trello API Access

  1. Sign Up for a Trello Account:

    • If you don't have a Trello account, sign up at Trello.
  2. Get API Key and Token:

    • Navigate to the Trello Developer Portal.
    • Copy your API Key.
    • Click on the "Token" link to generate a Token. This token will be used for authentication in your API requests.

2. Clone the Repository

git clone https://github.com/DEV3L/ai-trello-extract
cd ai-trello-extract

3. Configure Environment Variables

Copy the default environment configuration and update it with your Trello API credentials:

cp env.default .env

Environment Variables

The following environment variables can be configured in the .env file:

  • TRELLO_API_KEY: Your Trello API key.
  • TRELLO_API_TOKEN: Your Trello API token.
  • TRELLO_BOARD_NAME: The name of the Trello board you wish to extract data from.
  • OUTPUT_DIRECTORY: The directory where output files will be saved (default is bin).

4. Setup a Virtual Environment and Install Dependencies

Ensure you have Hatch installed. If not, install it using brew:

brew install hatch

Create and activate the virtual environment:

hatch env create
hatch shell

Usage

Run the run_end_to_end.py script to authenticate with Trello, fetch board details, and export data:

python run_end_to_end.py

What the Script Does:

  1. Authentication: Uses credentials from the .env file to authenticate with the Trello API.
  2. Data Retrieval:
    • Fetches and prints details of all accessible Trello boards.
    • Retrieves and prints lists and cards from the specified Trello board.
  3. Data Export:
    • Writes board data to a Markdown file.
    • Organizes and writes board data into a structured directory with separate files for each list and card.

Available Scripts

Defined in pyproject.toml under [tool.hatch.envs.default.scripts]:

  • End-to-End Tests:

    hatch run e2e
    
  • Unit Tests:

    hatch run test
    
  • Publish Package to PyPI:

    hatch run publish
    

Testing

The project includes comprehensive tests to ensure reliability and correctness.

Running Tests

End-to-End Tests

Execute end-to-end tests to verify the complete workflow:

hatch run e2e

Unit Tests

Run unit tests to validate individual components:

hatch run test

Code Coverage

To monitor code coverage within your editor (e.g., VSCode), use Coverage Gutters:

Command + Shift + P => Coverage Gutters: Watch

Project Structure

ai-trello-extract/
├── ai_trello_extract/
│   ├── clients/
│   │   └── trello_client.py
│   ├── dataclasses/
│   │   ├── categorized_list.py
│   │   └── trello_card.py
│   ├── env_variables.py
│   ├── formatters/
│   │   ├── escape_markdown.py
│   │   └── generate_markdown.py
│   ├── orchestrators/
│   │   ├── orchestration_service.py
│   │   └── orchestration_service_test.py
│   ├── services/
│   │   ├── trello_service.py
│   │   └── trello_service_test.py
│   ├── tests/
│   │   ├── conftest.py
│   │   ├── env_variables_test.py
│   │   └── trello_client_test.py
│   ├── functions.py
│   ├── run_end_to_end.py
│   └── generate_markdown_test.py
├── .env.default
├── LICENSE
├── pyproject.toml
├── continuous-integration.yml
└── README.md

Critical Files and Directories

  • ai_trello_extract/: Main package containing modules for clients, dataclasses, formatters, orchestrators, and services.
  • tests/: Contains unit and integration tests.
  • pyproject.toml: Configuration file for project metadata, dependencies, and tools.
  • continuous-integration.yml: GitHub Actions workflow for continuous integration.
  • run_end_to_end.py: Script to execute the full data extraction and export process.
  • .env.default: Template for environment variables configuration.

Contributing

We welcome contributions! To contribute:

  1. Fork the Repository: Click the "Fork" button at the top-right corner of the repository page.
  2. Create a New Branch: Use git checkout -b feature/YourFeatureName to create a new branch.
  3. Make Your Changes: Implement your feature or bug fix.
  4. Ensure All Tests Pass: Run hatch run test to verify.
  5. Submit a Pull Request: Provide a detailed description of your changes.

Code of Conduct

We expect all contributors to adhere to our Code of Conduct:

  • Be Respectful: Treat everyone with respect and kindness.
  • Be Constructive: Provide constructive feedback and be open to receiving it.
  • Avoid Discrimination: Do not use discriminatory or offensive language.
  • Report Unacceptable Behavior: Notify project maintainers of any violations.

By participating in this project, you agree to abide by these guidelines.

License

This project is licensed under the MIT License.

Acknowledgments

  • Trello: For providing an excellent API and platform for project management.
  • Loguru: For the elegant logging library.
  • Hatch: For the efficient project management tool.
  • OpenAI: For providing the AI assistant that helped in creating this README.

Additional Resources


Note: If you have any questions or need further assistance, feel free to open an issue or reach out to the maintainers.

Metadata

Release files for ai-trello-extract 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-trello-extract 0.0.9
File Size Uploaded
ai_trello_extract-0.0.9.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-trello-extract 0.0.9
File Interpreter ABI Platform
ai_trello_extract-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 36.0 kB

Release files / ai_trello_extract-0.0.9.tar.gz

Download URL ai_trello_extract-0.0.9.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ccca941f8ea2164f036f0a600e3a12c09b121e83251ad95d0e56e7c4d085fd6f
BLAKE2b-256 checksum
How to use checksums
b7fe255beb9a4d2a23a2968766f92988fa993d8c200789aed42b0ef738c138dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / ai_trello_extract-0.0.9-py3-none-any.whl

Download URL ai_trello_extract-0.0.9-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
115fc09cd5ec10ec10e6d00feafb41d6b740beb1be5c76b08351c06d50179d1f
BLAKE2b-256 checksum
How to use checksums
a6843759e8475d14a6169a94275358ffdeb0f4031e51b42db0a2783172b2b154
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page