You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,20 @@ pip install dist/*.whl
37
37
- Models for RSS-specific schemas have been moved from `rss_parser.models` to `rss_parser.models.rss`. Generic types remain unchanged
38
38
- Date parsing has been improved and now uses pydantic's `validator` instead of `email.utils`, producing better datetime objects where it previously defaulted to `str`
39
39
40
+
## Legacy Models
41
+
42
+
Pydantic v1-based models are still available under `rss_parser.models.legacy`. They retain the previous behaviour and re-export the `import_v1_pydantic` helper as `rss_parser.models.legacy.pydantic_proxy.import_v1_pydantic`. You can continue to use them by pointing your parser at the legacy schema:
43
+
44
+
```python
45
+
from rss_parser import RSSParser
46
+
from rss_parser.models.legacy.rss importRSSas LegacyRSS
47
+
48
+
classLegacyRSSParser(RSSParser):
49
+
schema = LegacyRSS
50
+
```
51
+
52
+
Tests in this repository run against both the v2 and legacy models to ensure parity.
53
+
40
54
## Usage
41
55
42
56
### Quickstart
@@ -163,18 +177,17 @@ If you don't want to deal with these conditions and want to parse something **al
163
177
```python
164
178
from typing import Optional
165
179
180
+
from pydantic import Field
181
+
166
182
from rss_parser.models.rss.item import Item
167
183
from rss_parser.models.types.only_list import OnlyList
168
184
from rss_parser.models.types.tag import Tag
169
-
from rss_parser.pydantic_proxy import import_v1_pydantic
0 commit comments