Register In- and Outputs for Workflow Visualization
putior is an R package designed to extract and process structured annotations from R and Python source files, enabling workflow visualization in polyglot software environments. The package scans source code for special PUT annotations that define nodes, connections, and metadata within data processing workflows, making it easier to document and visualize complex data pipelines.
putior offers comprehensive annotation processing capabilities:
- Extracts structured annotations from both R and Python source files
- Supports flexible annotation formats (
#put
,# put
,#put|
) - Captures arbitrary key-value properties for customizable metadata
- Returns results in a clean, tabular format ready for visualization
- Handles both single-file and directory-wide scanning
If you're using renv for package management, you can install putior directly from GitHub:
# Initialize renv if you haven't already
renv::init()
# Install putior
renv::install("pjt222/putior")
# Update renv.lock
renv::snapshot()
Alternatively, you can install using devtools:
# Install devtools if needed
if (!require("devtools")) install.packages("devtools")
# Install putior
devtools::install_github("pjt222/putior")
Add PUT annotations to your R or Python source files:
# In your R script
#put name:"load_data", label:"Load Dataset", node_type:"input"
data <- read.csv("data.csv")
#put name:"process", label:"Transform Data", node_type:"process"
processed_data <- transform(data)
# In your Python script
#put name:"train_model", label:"Train ML Model", node_type:"process"
model.fit(X_train, y_train)
Then use putior to extract these annotations:
library(putior)
# Process a single directory
workflow_nodes <- put("./src")
# View the results
print(workflow_nodes)
PUT annotations support arbitrary properties for flexible metadata:
#put name:"analyze", label:"Statistical Analysis", node_type:"process", node_color:"blue", node_group:"statistics", execution_time:"120"
Access the package documentation within R:
?put
?parse_put_annotation
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Philipp Thoss ([email protected]) ORCID: 0000-0002-4672-2792