Skip to content

Releases: stac-utils/stac-pydantic

3.5.0

29 Jan 15:12

Choose a tag to compare

What's Changed

  • Mark tests requiring access to the internet by @avalentino in #187

  • switch to uv and hatch by @vincentsarago in #188

  • fix: make sure to return datetime=null event if exclude_none is set by @vincentsarago in #190

    from stac_pydantic.api import Item
    
    stac_item = Item.model_validate(
        {
            "id": "12345",
            "type": "Feature",
            "stac_extensions": [],
            "geometry": None,
            "properties": {
                "datetime": None,
                "start_datetime": "2024-01-01T00:00:00Z",
                "end_datetime": "2024-01-02T00:00:00Z",
            },
            "collection": "collection",
            "links": [
                {
                    "rel": "self",
                    "href": "http://stac.example.com/catalog/collections/CS3-20160503_132130_04/items/CS3-20160503_132130_04.json"
                },
                {
                    "rel": "collection",
                    "href": "http://stac.example.com/catalog/CS3-20160503_132130_04/catalog.json"
                },
                {
                    "rel": "root",
                    "href": "http://stac.example.com/catalog"
                }
            ],
            "assets": {},
        }
    )
    
    out = stac_item.model_dump(exclude_none=True)
    # `geometry` is required
    assert out["geometry"] is None
    # `datetime` is a required property
    assert out["properties"]["datetime"] is None
    
    # force exclusion of required keys
    out = stac_item.model_dump(exclude_none=True, exclude={"properties": {"datetime"}, "geometry": True})
    assert "geometry" not in out
    assert "datetime" not in out["properties"]

New Contributors

Full Changelog: 3.4.0...3.5.0

3.4.0

17 Jul 11:17

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 3.3.2...3.4.0

3.3.2

18 Jun 14:42

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 3.3.1...3.3.2

3.3.1

01 Jun 13:20
68d20aa

Choose a tag to compare

What's Changed

Full Changelog: 3.3.0...3.3.1

3.3.0

29 May 12:10
e512330

Choose a tag to compare

What's Changed

Full Changelog: 3.2.0...3.3.0

3.2.0

20 Mar 09:09
0b5a8a2

Choose a tag to compare

What's Changed

Full Changelog: 3.1.5...3.2.0

3.1.5

28 Feb 14:55

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 3.1.4...3.1.5

3.1.4

08 Jan 13:17
fa2df27

Choose a tag to compare

What's Changed

Full Changelog: 3.1.3...3.1.4

3.1.3

14 Oct 12:45
ffc5275

Choose a tag to compare

What's Changed

Full Changelog: 3.1.2...3.1.3

3.1.2

20 Aug 19:08
f9eda3b

Choose a tag to compare

What's Changed

Full Changelog: 3.1.1...3.1.2