-
Notifications
You must be signed in to change notification settings - Fork 41
Description
name: Good First Issue
about: A beginner-friendly task perfect for first-time contributors
title: '[GOOD FIRST ISSUE] Add public API exports to link_predictor init.py'
labels: 'good first issue, documentation, python'
assignees: ''
Welcome! 👋
This is a beginner-friendly issue perfect for first-time contributors to the Intugle project. We've designed this task to help you get familiar with our codebase while making a meaningful contribution.
Task Description
The link_predictor module's __init__.py file is currently empty, which means users can't easily import the main classes. We need to add proper exports to make the module's public API clear and accessible.
Why This Matters
When a Python module's __init__.py is empty, users must write verbose imports like:
from intugle.link_predictor.predictor import LinkPredictor
from intugle.link_predictor.models import PredictedLink, LinkPredictionResultBy exposing the public API in __init__.py, we enable cleaner imports:
from intugle.link_predictor import LinkPredictor, PredictedLink, LinkPredictionResultThis improves developer experience and makes the module more Pythonic.
What You'll Learn
- Python module structure and
__init__.pypurpose - Public API design principles
- How to make code more user-friendly
- Contributing to an open-source project
Step-by-Step Guide
Prerequisites
- Python 3.10+ installed
- Git basics (clone, commit, push, pull request)
- Read our CONTRIBUTING.md guide
Setup Instructions
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/data-tools.git cd data-tools -
Create a virtual environment
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies
pip install -e ".[dev]" -
Create a new branch
git checkout -b fix/issue-8-link-predictor-init
Implementation Steps
-
Open the target file
- Navigate to
src/intugle/link_predictor/__init__.py - Currently, this file is empty (just blank lines)
- Navigate to
-
Review the module contents
- Look at
src/intugle/link_predictor/predictor.pyto see what classes should be exported - Look at
src/intugle/link_predictor/models.pyto see what models should be exported
- Look at
-
Add the exports
Add the following content to__init__.py:""" Link Predictor Module This module provides functionality for predicting relationships between datasets based on column profiling, data type analysis, and LLM-based inference. """ from intugle.link_predictor.models import ( LinkPredictionResult, PredictedLink, ) from intugle.link_predictor.predictor import ( LinkPredictor, LinkPredictionSaver, NoLinksFoundError, ) __all__ = [ "LinkPredictor", "LinkPredictionSaver", "PredictedLink", "LinkPredictionResult", "NoLinksFoundError", ]
-
Verify the imports work
Test that users can now import cleanly:# Create a test file: test_imports.py from intugle.link_predictor import LinkPredictor, PredictedLink print("✅ Imports working correctly!")
Files to Modify
- File:
src/intugle/link_predictor/__init__.py- Change: Add public API exports
- Line(s): Currently empty (lines 1-3)
Testing Your Changes
# Run existing tests to ensure nothing broke
pytest tests/
# Test the imports manually
python -c "from intugle.link_predictor import LinkPredictor; print('✅ Success')"Submitting Your Work
-
Commit your changes
git add src/intugle/link_predictor/__init__.py git commit -m "Add public API exports to link_predictor module - Export LinkPredictor, LinkPredictionSaver, and NoLinksFoundError from predictor - Export PredictedLink and LinkPredictionResult from models - Add module docstring - Define __all__ for explicit public API Fixes #8"
-
Push to your fork
git push origin fix/issue-8-link-predictor-init
-
Create a Pull Request
- Go to the original repository
- Click "Pull Requests" → "New Pull Request"
- Select your branch
- Fill out the PR template
Example Code
Before
# Verbose imports required
from intugle.link_predictor.predictor import LinkPredictor
from intugle.link_predictor.models import PredictedLinkAfter
# Clean, simple imports
from intugle.link_predictor import LinkPredictor, PredictedLinkExpected Outcome
After this change:
- Users can import main classes directly from the module
- The module has a clear public API defined in
__all__ - IDE autocomplete works better
- The module follows Python best practices
Definition of Done
- Code changes implemented in
__init__.py - Module docstring added
-
__all__list defined - Manual import test passes
- Existing tests still pass
- Code follows project style guidelines (PEP 8)
- Pull request submitted with proper reference to this issue
Resources
Need Help?
Don't hesitate to ask questions! We're here to help you succeed.
- Comment below with your questions
- Join our Discord for real-time support
- Tag maintainers: @raphael-intugle for guidance
Skills You'll Use
- Python basics (imports, modules)
- Git and GitHub (fork, commit, PR)
- Code documentation
- Following coding standards
Estimated Time
This task should take approximately: 15-30 minutes
Thank you for contributing to Intugle!
Tips for Success:
- Read through the existing code in
predictor.pyandmodels.pyfirst - Test your changes locally before submitting
- Make sure your commit message is clear and descriptive
- Have fun! 🎉