Package: SafeMapper 1.0.0

SafeMapper: Fault-Tolerant Functional Programming with Automatic Checkpointing

Provides drop-in replacements for 'purrr' and 'furrr' mapping functions with built-in fault tolerance, automatic checkpointing, and seamless recovery capabilities. When long-running computations are interrupted due to errors, system crashes, or other failures, simply re-run the same code to automatically resume from the last checkpoint. Ideal for large-scale data processing, API calls, web scraping, and other time-intensive operations where reliability is critical.

Authors:Zaoqu Liu [aut, cre]

SafeMapper_1.0.0.tar.gz
SafeMapper_1.0.0.zip(r-4.7)SafeMapper_1.0.0.zip(r-4.6)SafeMapper_1.0.0.zip(r-4.5)
SafeMapper_1.0.0.tgz(r-4.6-any)SafeMapper_1.0.0.tgz(r-4.5-any)
SafeMapper_1.0.0.tar.gz(r-4.7-any)SafeMapper_1.0.0.tar.gz(r-4.6-any)
SafeMapper_1.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
SafeMapper/json (API)

# Install 'SafeMapper' in R:
install.packages('SafeMapper', repos = c('https://zaoqu-liu.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/zaoqu-liu/safemapper/issues

On CRAN:

Conda:

3.98 score 1 stars 12 scripts 1 downloads 42 exports 8 dependencies

Last updated from:5ffddad8a0 (on main). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK145
source / vignettesOK245
linux-release-x86_64OK146
macos-release-arm64OK81
macos-oldrel-arm64OK99
windows-develOK85
windows-releaseOK73
windows-oldrelOK81
wasm-releaseOK119

Exports:s_clean_sessionss_configures_future_imaps_future_maps_future_map_chrs_future_map_dbls_future_map_dfcs_future_map_dfrs_future_map_ints_future_map_lgls_future_map2s_future_map2_chrs_future_map2_dbls_future_map2_dfcs_future_map2_dfrs_future_map2_ints_future_map2_lgls_future_pmaps_future_walks_future_walk2s_imaps_imap_chrs_maps_map_chrs_map_dbls_map_dfcs_map_dfrs_map_ints_map_lgls_map2s_map2_chrs_map2_dbls_map2_dfcs_map2_dfrs_map2_ints_map2_lgls_pmaps_possiblys_quietlys_safelys_walks_walk2

Dependencies:clidigestgluelifecyclemagrittrpurrrrlangvctrs

Best Practices for Production Use
Overview | Architecture Patterns | Pattern 1: The Robust Pipeline | Implementation | Configuration Best Practices | Environment-Based Configuration | Configuration Decision Tree | Error Handling Strategies | The Three-Layer Defense | Error Recovery Workflow | Session Management | Naming Convention | Cleanup Strategy | Performance Optimization | Batch Size Tuning | Memory Management | Monitoring and Logging | Progress Tracking | Production Checklist | Anti-Patterns to Avoid | Summary | Additional Resources

Last update: 2026-01-22
Started: 2026-01-22

Core Concepts and Architecture
Overview | Architecture Overview | 1. Fingerprinting Mechanism | What is a Fingerprint? | Fingerprint Generation Flow | Feature Selection Rationale | Custom Session IDs | 2. Checkpointing Mechanism | Checkpoint Data Structure | Checkpoint Save Timing | Configuring Batch Size | 3. Auto-Recovery Mechanism | Recovery Flow | Recovery Demo | 4. Error Retry Mechanism | Retry Flow | Configure Retry Attempts | 5. Storage Location | Complete Execution Flow | Design Principles | Next Steps

Last update: 2026-01-22
Started: 2026-01-22

Error Handling Strategies
Overview | Error Handling Architecture | Layer 1: Built-in Fault Tolerance | Automatic Retry | Retry Flow Diagram | Layer 2: Error Wrapper Functions | s_safely() - Capture Errors | Using s_safely with Mapping | s_possibly() - Default on Error | Using s_possibly for Robust Pipelines | s_quietly() - Capture Side Effects | Comparison of Error Handlers | Combining Strategies | Strategy 1: s_safely + Post-Processing | Strategy 2: s_possibly for Clean Pipelines | Strategy 3: Multi-Layer Protection | Decision Guide | Error Handling Patterns | Pattern 1: Fail Fast | Pattern 2: Log and Continue | Pattern 3: Collect Errors for Reporting | Best Practices | Next Steps

Last update: 2026-01-22
Started: 2026-01-22

Map Functions: A Complete Guide
Overview | Function Family Overview | s_map Family: Single-Input Mapping | s_map - Basic Mapping | s_map_chr - Return Character Vector | s_map_dbl - Return Numeric Vector | s_map_int - Return Integer Vector | s_map_lgl - Return Logical Vector | s_map_dfr - Return Data Frame (Row-Bind) | s_map_dfc - Return Data Frame (Column-Bind) | s_map2 Family: Dual-Input Mapping | s_map2 Basic Usage | Practical Examples | s_pmap: Multi-Input Mapping | s_pmap Basic Usage | Combining with Data Frames | s_imap: Indexed Mapping | s_imap Basic Usage | s_walk Family: Side-Effect Functions | s_walk Basic Usage | s_walk2 Dual-Input Side Effects | Function Parameter Passing | Session ID Usage | Performance Considerations | Common Patterns | Pattern 1: Data Transformation Pipeline | Pattern 2: Conditional Processing | Pattern 3: Safe NULL Handling | Next Steps

Last update: 2026-01-22
Started: 2026-01-22

Parallel Processing with SafeMapper
Overview | Why Parallel + Fault Tolerance? | Prerequisites | Setting Up Parallel Processing | Step 1: Load Required Packages | Step 2: Configure Workers | Step 3: Use s_future_* Functions | Available Parallel Functions | Basic Usage Examples | s_future_map | s_future_map2 | s_future_pmap | Execution Flow | Configuration Options | Batch Size for Parallel | furrr Options | When to Use Parallel Processing | Good Use Cases for Parallel | Poor Use Cases for Parallel | Handling Progress | Error Handling in Parallel | Best Practices | Complete Example | Next Steps

Last update: 2026-01-22
Started: 2026-01-22

Quick Start: Get Up and Running in 5 Minutes
Why SafeMapper? | Installation | Your First Example: From purrr to SafeMapper | Traditional Approach (using purrr) | The SafeMapper Way | Core Features Demo | 1. Automatic Recovery | 2. Multiple Output Types | 3. Dual-Input Mapping | 4. Multi-Input Mapping | Function Reference Table | Workflow Diagram | Configuration (Optional) | Clean Old Sessions | Next Steps | Summary

Last update: 2026-01-22
Started: 2026-01-22

Real-World Examples
Overview | Example 1: Web API Data Collection | Scenario | Implementation | Convert to Data Frame | Example 2: Batch File Processing | Example 3: Machine Learning Cross-Validation | Example 4: Web Scraping Pipeline | Example 5: Parallel Bioinformatics Pipeline | Example 6: Database Migration | Quick Reference: Configuration by Use Case | Next Steps

Last update: 2026-01-22
Started: 2026-01-22

Session and Configuration Management
Overview | Configuration | s_configure() - Customize Behavior | Configuration Options Explained | Configuration Recommendations | Session IDs | Automatic vs Manual Session IDs | When to Use Manual Session IDs | Checkpoint Storage | Storage Location | Checkpoint File Structure | Session Cleanup | s_clean_sessions() - Remove Old Checkpoints | Cleanup Options | Cleanup Workflow | Workflow Examples | Example 1: Long-Running Daily Job | Example 2: Development and Debugging | Example 3: Multiple Related Tasks | Best Practices | Troubleshooting | Checkpoint Not Resuming | Too Many Checkpoint Files | Checkpoint Corrupted | Next Steps

Last update: 2026-01-22
Started: 2026-01-22

Readme and manuals

Help Manual

Help pageTopics
Clean Old SafeMapper Sessionss_clean_sessions
Configure SafeMapper Settingss_configure
Safe Future Map - Parallel with Auto-Recoverys_future_map s_future_map_chr s_future_map_dbl s_future_map_dfc s_future_map_dfr s_future_map_int s_future_map_lgl
Safe Future Map2 - Parallel Two-Input with Auto-Recoverys_future_map2 s_future_map2_chr s_future_map2_dbl s_future_map2_dfc s_future_map2_dfr s_future_map2_int s_future_map2_lgl
Safe IMap - Drop-in Replacement for purrr::imap with Auto-Recoverys_future_imap s_imap s_imap_chr
Safe Map - Drop-in Replacement for purrr::map with Auto-Recoverys_map s_map_chr s_map_dbl s_map_dfc s_map_dfr s_map_int s_map_lgl
Safe Map2 - Drop-in Replacement for purrr::map2 with Auto-Recoverys_map2 s_map2_chr s_map2_dbl s_map2_dfc s_map2_dfr s_map2_int s_map2_lgl
Safe PMap - Drop-in Replacement for purrr::pmap with Auto-Recoverys_future_pmap s_pmap
Safe Possibly - Wrap Function to Return Default on Errors_possibly
Safe Quietly - Wrap Function to Capture Side Effectss_quietly
Safe Safely - Wrap Function to Capture Errorss_safely
Safe Walk - Drop-in Replacement for purrr::walk with Auto-Recoverys_future_walk s_future_walk2 s_walk s_walk2