Metadata-Version: 2.4
Name: artip
Version: 0.1.0
Summary: A Python library for managing temporal intervals in Power BI
License: MIT License
        
        Copyright (c) 2024 
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: polars>=0.20.0
Provides-Extra: dev
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# artip

A Python library for managing temporal intervals in Power BI.

## Description

The `artip` library provides a class to produce a scalar representation of time intervals usable in Power BI models. It is designed for use in Python ETL pipelines to build period identifiers, as opposed to using (start date, end date) tuples.

## Installation

```bash
pip install .
```

Or with uv:

```bash
uv pip install .
```

## Usage

```python
from artip import Artip
from datetime import date

# Create an Artip instance
artip = Artip(min_time=date(2020, 1, 1), max_time=date(2025, 12, 31), granularity='day')

# Generate a period ID
period_id = artip.make_period_id(start=date(2023, 1, 1), end=date(2023, 1, 31))
print(period_id)

# Generate calendar table
calendar = artip.make_calendar_table()
print(calendar)

# Get DAX UDF
dax_udf = artip.get_DAX_UDF()
print(dax_udf)
```

## Features

- Scalar representation of time intervals
- Optimized for Power BI Vertipaq engine (fits in 64-bit integer)
- Lazy Polars DataFrames for performance
- Modular and typed Python code

## License

MIT