Skip to main content

Trello Extract is a Python project that uses the py-trello library and python-dotenv to authenticate with the Trello API and fetch details from Trello boards, lists, and cards. This project demonstrates how to securely manage API credentials and interact with Trello's API to retrieve project data for further processing.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_trello_extract-0.0.8.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

ai_trello_extract-0.0.8-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_trello_extract-0.0.8.tar.gz.

File metadata

  • Download URL: ai_trello_extract-0.0.8.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ai_trello_extract-0.0.8.tar.gz
Algorithm Hash digest
SHA256 9cf5d71ca78863b788e71ca432736239fba0a11d8f12a77d2897d197a129927f
MD5 e00345809c47517016577a1ceaac45fc
BLAKE2b-256 d722e8b180c8a35a82359c7b01928d4a1f90556d4df563adfe1d316f1a6b87ca

See more details on using hashes here.

File details

Details for the file ai_trello_extract-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_trello_extract-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2159e04566080901f2916124323cced7418d51a86698c726e2f5b67bac4c56e6
MD5 d67c522717f05d21b1a54dbbbf7d08b3
BLAKE2b-256 5afe31bd0c12cf68e5c086b084db1122d7663e514f1457d943872374fa8073e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page