Skip to content

Commit

Permalink
Metadata docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chocoearly44 committed Jul 25, 2022
1 parent 8ef2661 commit a639ede
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
The OTTF file format was created in 2022 by [ClassCompanion Team](https://github.com/ClassCompanion) in order to standardize the way of providing school timetables for applications and websites. It's a JSON file format with strict guidelines in order to keep it as simple as possible.

## File structure in general
An OTTF file consist of it's version and other 2 major parts [`cues`](#cues) (define week periods and their duration) and [`days`](#days) (define what classes for each day are there in set periods).
An OTTF file consist of 3 parts [`metadata`](#metadata) (details about document), [`cues`](#cues) (define week periods and their duration), and [`days`](#days) (define what classes for each day are there in set periods).

```json
{
"version: "1.0",
"metadata": {
...
},
"cues": {
...
},
Expand All @@ -37,7 +39,26 @@ An OTTF file consist of it's version and other 2 major parts [`cues`](#cues) (de
### Objects
Objects defined by our standard.

**Please note that all timestamps must be in a 24-hour `HH.mm` format and all the dates must be in a `YYYY-MM-DD` (ISO-8601) format. All times should also be in UTC.**
**Please note that all times must be in a 24-hour `HH.mm` format and all the dates must be in a `YYYY-MM-DD` (ISO-8601) format.**

#### Metadata
Metadata object provides information about the document.

| Field | Datatype | Description | Example |
| --------: | -------- | ----------------------------------------------- | ---------: |
| version | `String` | OTTF specification version. | 1.0 |
| timezone | `String` | Timezone of timestamps. | UTC |
| author | `String` | Document author. | Doc Author |
| timestamp | `Long` | Document creation epoch timestamp (in seconds). | 123456 |

```json
{
"version": "1.0",
"timezone": "UTC",
"author": "Doc Author",
"timestamp": 123456
}
```

#### Span
Period object is used to define a timespan of either periods or recesses.
Expand Down Expand Up @@ -189,9 +210,9 @@ Recesses throughout the day.
```

## Days
`Days` is a maps day abbreviations (MON, TUE, WED, THU, FRI, SAT, SUN) to corresponding `Day` objects.
`Days` dates with `Day` objects.

Day object consists of [`classes`](#classes), [`events`](#events) and [`dayevents`](#day-events) and is a map where the key is a date in yyyy-mm-dd format specified by the ISO8601 standard.
Day object consists of [`classes`](#classes), [`events`](#events) and [`dayevents`](#day-events).

```json
{
Expand Down Expand Up @@ -235,7 +256,7 @@ Day object consists of [`classes`](#classes), [`events`](#events) and [`dayevent
Classes are classes throughout the day.

#### Structure
`classes` element maps an id of [`span object`](#span) from [`periods`](#periods) with an array of corresponsing [`class objects`](#class) (since there can be multiple classes with the same timespan).
`classes` element maps an id of [`span object`](#span) from [`periods`](#periods) with an array of corresponsing array of [`class`](#class) objects (since there can be multiple classes with the same timespan).

```json
"classes": {
Expand Down
2 changes: 1 addition & 1 deletion example.ottf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0",
"timezone": "UTC",
"author": "Doc Author",
"created": "2022-02-06"
"timestamp": 123456
},
"cues": {
"periods": {
Expand Down

0 comments on commit a639ede

Please sign in to comment.