This directory contains introductory examples to help you get started with py3plex. These examples demonstrate the core concepts and basic usage patterns.
New to py3plex? Follow this path:
-
5-Minute Introduction: dsl_patterns_quick_reference.py
- 7 essential DSL patterns (executable, copy-paste ready)
- Covers 80% of typical use cases
- Start here for fastest onboarding
-
10-Minute Tutorial: tutorial_10min.py
- Complete workflow from data loading to visualization
- Understand multilayer network basics
-
Interactive Learning: example_ergonomics_demo.py
- Use
.hint()for context-aware suggestions - Learn DSL interactively as you code
- Pedagogical error messages guide you
- Use
-
Deep Dive: See AGENTS.md for comprehensive documentation
The dsl_patterns_quick_reference.py file contains 7 copy-paste patterns for immediate use:
| Pattern | Use Case | When to Use |
|---|---|---|
| 1. Basic Filtering | Find high-degree nodes | Start here for most analyses |
| 2. Cross-Layer Hubs | Nodes appearing in multiple layers | Multilayer structure insights |
| 3. Uncertainty Quantification | Confidence intervals for metrics | Research publications |
| 4. Layer Algebra | Complex layer selection | Advanced multilayer queries |
| 5. Custom Metrics | Derive new metrics from existing | Feature engineering |
| 6. Per-Layer Aggregation | Compare layers statistically | Layer-level analysis |
| 7. Export Formats | Save results in various formats | Data integration |
Pro Tip: Run dsl_patterns_quick_reference.py to see all patterns with live output!
tutorial_10min.py- 10-minute tutorial covering network creation, analysis, and visualization
example_datasets.py- Load bundled datasets and generate synthetic networks (similar to scikit-learn's datasets module)
example_random_generator.py- Generate random multilayer Erdos-Renyi networksexample_random_generators_advanced.py- Advanced random network generators with custom parametersexample_multilayer_functionality.py- Core multilayer network operations (adding nodes, edges, layers)
example_networkx_wrapper.py- Apply NetworkX algorithms to multilayer networksexample_networkx_wrapper_kwargs.py- NetworkX wrapper with keyword arguments supportexample_nx_wrapper.py- Compute betweenness centrality using NetworkX
After completing these examples, explore:
- I/O and Data - Learn to load and save networks in various formats
- Network Analysis - Analyze network properties and compute metrics
- Visualization - Create beautiful visualizations of your networks
All examples in this directory are FAST (< 5 seconds) and standalone - perfect for learning!