Spaces:
Runtime error
Runtime error
Download models.py from jedidiahhurt/LivePlanAssistant: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/spaces/jedidiahhurt/LivePlanAssistant/resolve/main/models.py
- Command line
-
hf download hf://spaces/jedidiahhurt/LivePlanAssistant/models.py
-
curl -L -o models.py https://huggingface.co/spaces/jedidiahhurt/LivePlanAssistant/resolve/main/models.py
1.53 kB
| from liveplan_api_model import * | |
| from pydantic.v1 import UUID4, validator, conint | |
| class StrictForecastPeriodResource(BaseModel): | |
| """ | |
| Forecast period resource for a LivePlan company. Call getCompanyForecastPeriods to retrieve the forecastPeriods for a company. | |
| """ | |
| resolution: Resolution = "MONTH" | |
| period: str | |
| month: conint(ge=1, le=12) # Month must be between 1 and 12 | |
| startingYear: conint(ge=2020) # Assuming year >= 1900 | |
| endingYear: conint(le=2040) | |
| def validate_years(cls, v, values, **kwargs): | |
| if 'startingYear' in values and v < values['startingYear']: | |
| raise ValueError( | |
| 'endingYear must be greater or equal to startingYear') | |
| return v | |
| class ValueSource(str, Enum): | |
| FORECAST = "FORECAST" | |
| ACTUAL = "ACTUAL" | |
| class StrictForecastValueResource(BaseModel): | |
| value: float = Field(gte=0) | |
| forecastPeriod: StrictForecastPeriodResource | |
| valueSource: ValueSource = ValueSource.FORECAST | |
| class StrictBasicForecastValuesResource(BaseModel): | |
| frequency: Frequency = "MULTIPLE" | |
| spreadBy: SpreadBy = "MONTH" | |
| values: List[StrictForecastValueResource] | |
| baseNumberType: BaseNumberType = "CURRENCY" | |
| source: Source = "SELF" | |
| class StrictOverallRevenueStreamResource(BaseModel): | |
| overall: StrictBasicForecastValuesResource | |
| class OverallRevenueRevenueStreamResource(BaseModel): | |
| uuid: UUID4 | |
| name: str | |
| overallRevenue: StrictOverallRevenueStreamResource | |
| type: str = "OVERALL" | |