Skip to content

Commit 1183f49

Browse files
Update README.md
1 parent 14a5ef0 commit 1183f49

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,25 @@ else:
3838

3939
### Creating a USF file
4040
```python
41-
schedule = usf.create()
41+
import usf
4242

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")
5260
```
5361

5462
### Adding a Course to an Existing USF File

0 commit comments

Comments
 (0)