All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Comprehensive code examples in docstrings for all public API classes and functions:
D3Session,D3AsyncSession,D3PluginClient,D3PythonScript,D3Function,DesignerPlugin,PluginException,PluginPayload, and all low-level functions inapi.py. scripts/generate_astro_docs.py: script for generating Astro-compatible API reference documentation.
- Improved
DesignerPluginclass docstring and expandeddefault_init(),from_json_file(), andservice_infodocstrings with full Args/Returns sections and examples. - Added explicit notes to
register_moduleandregister_all_modulesonD3SessionandD3AsyncSessionclarifying that eager registration is only needed in rare cases — sessions already auto-register lazily onexecute(). PluginPayload.is_module_payload()anddebug_string()now have docstrings.
- Lazy module registration:
D3Session.execute()andD3AsyncSession.execute()now automatically register a@d3functionmodule on first use, eliminating the need to declare all modules incontext_modulesupfront. registered_modulestracking on session instances prevents duplicate registration calls.- Jupyter notebook support:
@d3functionnow automatically replaces a previously registered function when the same name is re-registered in the same module, with a warning log. This enables iterative workflows in Jupyter notebooks where cells are re-executed. - Automatic import detection:
@d3functionnow automatically discovers file-level imports used by the decorated function and includes them in the registered module. In Jupyter notebooks, place imports inside the function body instead.
add_packages_in_current_file(): Removed. Imports are now detected automatically by@d3function.find_packages_in_current_file(): Removed. Replaced byfind_imports_for_function().
d3_api_pluginhas been renamed tod3_api_execute.d3_api_apluginhas been renamed tod3_api_aexecute.context_modulesparameter type updated fromlist[str]toset[str]onD3Session,D3AsyncSession, andD3SessionBase.- Updated documentation to reflect
pystubproxy support. - Bumped
actions/checkoutto v6 andastral-sh/setup-uvto v7 in CI. - Added Test PyPI publish workflow (
test-publish.yml) for dev version releases.
- Client API: Metaclass-based remote method execution with
D3PluginClient- Support for both sync and async methods
- Automatic Python 2.7 code conversion for Designer compatibility
- Session management with context managers
- Functional API: Decorator-based remote execution
@d3pythonscriptdecorator for one-off script execution@d3function(module_name)decorator for reusable module-based functions- Function chaining support within modules
- Session Management:
D3SessionandD3AsyncSessionclassesrpc()method for simple return value retrievalexecute()method for full response with logs and status- Automatic module registration via context managers
- Type Safety: Full Pydantic models for all API interactions
PluginPayload,PluginResponse,RegisterPayload- Generic type support for type-safe return values
- Logging: Configurable logging with
enable_debug_logging()- NullHandler by default (library best practice)
- Granular module-level control
- AST Utilities: Python 3 to Python 2.7 code transformation
- F-string to
.format()conversion - Type annotation removal
- Async/await removal
- Automatic package import detection
- F-string to
- Comprehensive test suite with 99 tests covering all major functionality
- CI/CD with GitHub Actions (ruff, mypy, pytest)
- PEP 561 type hints marker (
py.typed)