@@ -38,17 +38,25 @@ else:
38
38
39
39
### Creating a USF file
40
40
``` python
41
- schedule = usf.create()
41
+ import usf
42
42
43
- definition = {
44
- " name" : " Mathematics" ,
45
- " teacher" : " Dr. Smith" ,
46
- " location" : " Room 101" ,
47
- " time" : [(1 , 2 )], # Periods
48
- " week" : " all" # Every week
49
- }
50
- usf.add_subject(schedule, definition)
51
- usf.save(schedule, " my_schedule.usf" )
43
+ # Initialize the USF Generator (version 1 by default)
44
+ usf_generator = usf.USFGenerator()
45
+
46
+ # Add subjects
47
+ usf_generator.add_subject(" Mathematics" , simplified_name = " Math" , teacher = " Dr. Smith" , room = " Room 101" )
48
+ usf_generator.add_subject(" Physics" , simplified_name = " Phys" , teacher = " Prof. Johnson" , room = " Room 203" )
49
+
50
+ # Add class periods
51
+ usf_generator.add_period(" 08:00:00" , " 09:30:00" )
52
+ usf_generator.add_period(" 10:00:00" , " 11:30:00" )
53
+
54
+ # Add schedule entries
55
+ usf_generator.add_schedule(day = 1 , week_type = " all" , subject = " Mathematics" , period_index = 1 ) # Monday
56
+ usf_generator.add_schedule(day = 2 , week_type = " odd" , subject = " Physics" , period_index = 2 ) # Tuesday (Odd Week)
57
+
58
+ # Generate the USF data and save it to a file
59
+ usf_generator.save_to_file(" schedule.usf" )
52
60
```
53
61
54
62
### Adding a Course to an Existing USF File
0 commit comments