-
-
Notifications
You must be signed in to change notification settings - Fork 2
API Stability Policy
Version: 1.0 Effective: 2025-01-03 Applies to: simple-resume ≥ 0.1.0
This document defines the stability guarantees for the simple-resume public API. It follows semantic versioning principles and is inspired by established libraries like pandas and Azure SDK.
The symbols listed in simple_resume.__all__ are stable and follow semantic versioning:
import simple_resume
# All exports in __all__ are stable
stable_exports = simple_resume.__all__
# 32 stable exports as of v0.1.7Guarantees:
- ✅ Backward compatibility within major versions
- ✅ Deprecation warnings before removal (2 minor versions minimum)
- ✅ Documented migration paths for breaking changes
- ✅ Type hints for IDE autocomplete
Example Stable APIs:
simple_resume.Resumesimple_resume.generate_pdfsimple_resume.ResumeSession- All exceptions (
ValidationError,GenerationError, etc.)
Modules under simple_resume.core.* and simple_resume.shell.* are internal and may change without notice:
# ⚠️ Not guaranteed to be stable
from simple_resume.core.resume import Resume # Works but may break
from simple_resume.shell.generate import generate_pdf # May change signaturesWhy Internal?
- Core modules contain implementation details
- Shell modules adapt to external dependencies
- We reserve the right to refactor for performance/maintainability
Use Internal APIs When:
- You need advanced customization
- You're extending the library
- You're willing to track upstream changes
Previously stable APIs scheduled for removal:
# Deprecated in v0.1.7, removal in v0.3.0
from simple_resume import old_function # Raises DeprecationWarningDeprecation Process:
- Mark as deprecated with
DeprecationWarning - Document alternative approach
- Maintain for 2 minor versions minimum
- Remove in next major version
We follow Semantic Versioning 2.0.0:
- MAJOR (0.x.0): Breaking changes to public API
- MINOR (x.1.x): New features, backward compatible
- PATCH (x.x.1): Bug fixes, backward compatible
| Your Version | simple-resume 0.1.x | simple-resume 0.2.x | simple-resume 1.0.x |
|---|---|---|---|
| 0.1.0 | ✅ Compatible | ❌ Breaks | |
| 0.1.7 | ✅ Current | ❌ Breaks | |
| 0.2.0 | ❌ Breaks | ✅ Compatible | |
| 1.0.0 | ❌ Breaks | ❌ Breaks | ✅ Compatible |
All 29 symbols in simple_resume.__all__:
# Core models (data only)
"Resume", "ResumeConfig", "RenderPlan", "ValidationResult" # 4 exports
# Exceptions
"SimpleResumeError", "ValidationError", "ConfigurationError",
"TemplateError", "GenerationError", "PaletteError",
"FileSystemError", "SessionError" # 8 exports
# Results & sessions
"GenerationResult", "GenerationMetadata", "BatchGenerationResult",
"ResumeSession", "SessionConfig", "create_session" # 6 exports
# Generation primitives
"GenerationConfig" # 1 export
"generate_pdf", "generate_html", "generate_all", "generate_resume" # 4 exports
# Shell layer I/O functions
"to_pdf", "to_html", "resume_generate" # 3 exports
# Convenience helpers
"generate", "preview" # 2 exportsimport simple_resume
# Check if a symbol is part of the stable API
def is_stable_api(symbol: str) -> bool:
return symbol in simple_resume.__all__
print(is_stable_api("Resume")) # True
print(is_stable_api("generate_pdf")) # True
print(is_stable_api("core")) # False (internal module)A breaking change is any modification that could break existing user code:
- ❌ Removing a stable export
- ❌ Renaming a stable export
- ❌ Changing a function signature (required parameters)
- ❌ Changing a return type incompatibly
- ❌ Removing a method from a stable class
- ✅ Adding new exports
- ✅ Adding optional parameters with defaults
- ✅ Adding new methods to classes
- ✅ Extending return types (covariance)
- ✅ Performance improvements
- ✅ Bug fixes that preserve behavior
- Announce: Document in changelog 2 minor versions ahead
-
Deprecate: Add
DeprecationWarningto old API - Migrate: Provide migration guide and new API
- Remove: Remove in next major version
# Example deprecation (v0.1.7)
import warnings
def old_generate(resume, format):
warnings.warn(
"old_generate is deprecated and will be removed in v0.3.0. "
"Use 'generate' instead.",
DeprecationWarning,
stacklevel=2
)
return generate(resume, format)While simple_resume.core.* and simple_resume.shell.* are internal, some extension points are designed for customization:
- Templates: Custom Jinja2 templates (documented in Usage Guide)
- Palettes: Custom color palettes (documented in Color Schemes)
-
Importers: Custom data importers (via
simple_resume.core.importers) -
Strategies: PDF generation strategies (via
PdfGenerationStrategyprotocol)
# ✅ Good: Use stable APIs when extending
from simple_resume import Resume
from simple_resume.core.protocols import PdfGenerationStrategy
class CustomPdfStrategy(PdfGenerationStrategy):
def generate(self, render_plan, output_path, ...):
# Custom implementation
pass
# ⚠️ Avoid: Depending on internal implementation details
from simple_resume.shell.render.latex import _internal_function # May breakWe use automated checks to enforce API stability:
-
API Surface Scanner: Ensures
__all__is up-to-date - Type Hint Validation: Ensures public APIs have type hints
- Deprecation Scanner: Ensures deprecated APIs emit warnings
- Documentation Sync: Ensures API reference matches code
If you encounter a breaking change not documented in the changelog:
- Check the API Reference for correct usage
- Review the Migration Guide for migration steps
- Open an issue with details
We are considering promoting these to stable status:
-
simple_resume.core.colors- Color utilities (WCAG calculations) -
simple_resume.core.importers- Data importers -
simple_resume.core.protocols- Extension protocols
APIs marked as experimental may change in any release:
-
simple_resume.shell.generate.core- Advanced generation options -
simple_resume.shell.strategies- Custom generation strategies
Experimental APIs are not in __all__ and should be used with caution.
| Library | Stability Policy | Public API | Internal |
|---|---|---|---|
| simple-resume |
__all__ only |
✅ Stable | |
| pandas | pandas.api.* |
✅ Stable | |
| requests | Top-level only | ✅ Stable | |
| Azure SDK | Documented guidelines | ✅ Stable |
Our policy aligns with established Python libraries while being simpler for our scope.
- API Reference - Complete API documentation
- ADR-003: API Surface Design - Design decisions
- Migration Guide - Version migration instructions
- Contributing - Contribution guidelines
- ✅ Added API Stability Policy
- ✅ Created API Reference documentation
- ✅ Fixed version mismatch between
__init__.pyandpyproject.toml
- ✅ Established
__all__exports as stable public API - ✅ Added lazy-loading for performance
- ✅ Initial public API definition
- ✅ FCIS architecture implementation