-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathentry.py
More file actions
55 lines (36 loc) · 1.73 KB
/
Copy pathentry.py
File metadata and controls
55 lines (36 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from typing import Optional
from pydantic import Field
from rss_parser.models import XMLBaseModel
from rss_parser.models.atom.person import Person
from rss_parser.models.types.date import DateTimeOrStr
from rss_parser.models.types.only_list import OnlyList
from rss_parser.models.types.tag import Tag
class RequiredAtomEntryMixin(XMLBaseModel):
id: Tag[str]
"Identifier for the entry."
title: Tag[str]
"The title of the entry."
updated: Tag[DateTimeOrStr]
"Indicates when the entry was updated."
class RecommendedAtomEntryMixin(XMLBaseModel):
authors: OnlyList[Tag[Person]] = Field(alias="author", default_factory=OnlyList)
"Entry authors."
links: OnlyList[Tag[str]] = Field(alias="link", default_factory=OnlyList)
"The URL of the entry."
content: Optional[Tag[str]] = None
"The main content of the entry."
summary: Optional[Tag[str]] = None
"Conveys a short summary, abstract, or excerpt of the entry. Some feeds use this tag as the main content."
class OptionalAtomEntryMixin(XMLBaseModel):
categories: OnlyList[Tag[dict]] = Field(alias="category", default_factory=OnlyList)
"Specifies a categories that the entry belongs to."
contributors: OnlyList[Tag[Person]] = Field(alias="contributor", default_factory=OnlyList)
"Entry contributors."
rights: Optional[Tag[str]] = None
"The copyright of the entry."
published: Optional[Tag[DateTimeOrStr]] = None
"Indicates when the entry was published."
source: Optional[Tag[str]] = None
"Contains metadata from the source feed if this entry is a copy."
class Entry(RequiredAtomEntryMixin, RecommendedAtomEntryMixin, OptionalAtomEntryMixin, XMLBaseModel):
"""https://validator.w3.org/feed/docs/atom.html"""