Metadata-Version: 2.5
Name: openmeteo_sdk
Version: 1.28.1
Summary: Open-Meteo Python SDK
Project-URL: Documentation, https://github.com/open-meteo/sdk/tree/main#readme
Project-URL: Source, https://github.com/open-meteo/sdk
Project-URL: Tracker, https://github.com/open-meteo/sdk/issues
Author-email: Patrick Zippenfenig <info@open-meteo.com>
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8.1
Requires-Dist: flatbuffers==25.9.23
Description-Content-Type: text/markdown


# Open-Meteo Python SDK

https://pypi.org/project/openmeteo-sdk/

`pip install openmeteo-sdk`

## Missing sunrise, sunset, moonrise, and moonset timestamps

`VariableWithValues.ValuesInt64AsNumpy()` returns raw Unix timestamps in seconds for `sunrise`, `sunset`, `moonrise`, and `moonset`. When an event does not occur during the local calendar day, the value is the missing timestamp sentinel `INT64_MAX` (`9223372036854775807`).

For pandas, convert the raw accessor result to `NaT` like this:

```python
import numpy as np
import pandas as pd

missing_int64 = np.iinfo(np.int64).max

raw = variable.ValuesInt64AsNumpy()
timestamps = pd.to_datetime(
    pd.Series(raw).mask(raw == missing_int64),
    unit="s",
    utc=True,
)
```
