@@ -4,14 +4,16 @@ This section provides comprehensive examples of using tzst for various scenarios
4
4
5
5
## Table of Contents
6
6
7
- - [ Basic Operations] ( #basic-operations )
8
- - [ Advanced Archive Creation] ( #advanced-archive-creation )
9
- - [ Flexible Extraction] ( #flexible-extraction )
10
- - [ Security and Filtering] ( #security-and-filtering )
11
- - [ Performance Optimization] ( #performance-optimization )
12
- - [ Error Handling] ( #error-handling )
13
- - [ Real-World Scenarios] ( #real-world-scenarios )
14
- - [ Integration Examples] ( #integration-examples )
7
+ - {ref}` basic-operations `
8
+ - {ref}` advanced-archive-creation `
9
+ - {ref}` flexible-extraction `
10
+ - {ref}` security-and-filtering `
11
+ - {ref}` performance-optimization `
12
+ - {ref}` error-handling `
13
+ - {ref}` real-world-scenarios `
14
+ - {ref}` integration-examples `
15
+
16
+ (basic-operations)=
15
17
16
18
## Basic Operations
17
19
@@ -125,6 +127,8 @@ tzst t backup.tzst
125
127
tzst l huge-archive.tzst --streaming
126
128
```
127
129
130
+ (advanced-archive-creation)=
131
+
128
132
## Advanced Archive Creation
129
133
130
134
### Working with the TzstArchive Class
@@ -198,6 +202,8 @@ create_archive("important-data.tzst", ["critical/"], use_temp_file=True)
198
202
create_archive(" temp-data.tzst" , [" temp/" ], use_temp_file = False )
199
203
```
200
204
205
+ (flexible-extraction)=
206
+
201
207
## Flexible Extraction
202
208
203
209
### Extracting with Different Structures
@@ -272,6 +278,8 @@ def extract_large_files_only(archive_path, output_dir, min_size_mb=10):
272
278
extract_large_files_only(" mixed-content.tzst" , " large-files/" , min_size_mb = 5 )
273
279
```
274
280
281
+ (security-and-filtering)=
282
+
275
283
## Security and Filtering
276
284
277
285
### Safe Extraction Practices
@@ -365,6 +373,8 @@ extract_archive("archive.tzst", "output/",
365
373
interactive_callback = custom_conflict_handler)
366
374
```
367
375
376
+ (performance-optimization)=
377
+
368
378
## Performance Optimization
369
379
370
380
### Streaming for Large Archives
@@ -465,6 +475,8 @@ file_groups = {
465
475
create_archive_batch(file_groups)
466
476
```
467
477
478
+ (error-handling)=
479
+
468
480
## Error Handling
469
481
470
482
### Comprehensive Error Handling
@@ -571,6 +583,8 @@ def validate_and_repair_archive(archive_path):
571
583
validate_and_repair_archive(" potentially-corrupted.tzst" )
572
584
```
573
585
586
+ (real-world-scenarios)=
587
+
574
588
## Real-World Scenarios
575
589
576
590
### Automated Backup System
@@ -882,6 +896,8 @@ if __name__ == "__main__":
882
896
)
883
897
```
884
898
899
+ (integration-examples)=
900
+
885
901
## Integration Examples
886
902
887
903
### Django Management Command
0 commit comments