Metadata-Version: 2.3
Name: ssb-datafangst-person-fagfunksjoner
Version: 0.0.3
Summary: SSB Datafangst Person Fagfunksjoner
License: MIT
Author: Elise ALstad
Author-email: lal@ssb.no
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 3 - Alpha
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
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: click (>=8.0.1)
Requires-Dist: dapla-toolbelt (>=3.0.2,<4.0.0)
Requires-Dist: ipykernel (>=6.29.5,<7.0.0)
Requires-Dist: nox (>=2024.10.9,<2025.0.0)
Requires-Dist: pandas (>=2.2.3,<3.0.0)
Requires-Dist: pandas-stubs (>=2.2.3.241009,<3.0.0.0)
Requires-Dist: polars (>=1.14.0,<2.0.0)
Requires-Dist: pyarrow (>=18.0.0,<19.0.0)
Project-URL: Changelog, https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner/releases
Project-URL: Documentation, https://statisticsnorway.github.io/ssb-datafangst-person-fagfunksjoner
Project-URL: Homepage, https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner
Project-URL: Repository, https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner
Description-Content-Type: text/markdown

# SSB Datafangst Person Fagfunksjoner

[![PyPI](https://img.shields.io/pypi/v/ssb-datafangst-person-fagfunksjoner.svg)][pypi status]
[![Status](https://img.shields.io/pypi/status/ssb-datafangst-person-fagfunksjoner.svg)][pypi status]
[![Python Version](https://img.shields.io/pypi/pyversions/ssb-datafangst-person-fagfunksjoner)][pypi status]
[![License](https://img.shields.io/pypi/l/ssb-datafangst-person-fagfunksjoner)][license]

[![Documentation](https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner/actions/workflows/docs.yml/badge.svg)][documentation]
[![Tests](https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner/actions/workflows/tests.yml/badge.svg)][tests]
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=statisticsnorway_ssb-datafangst-person-fagfunksjoner&metric=coverage)][sonarcov]
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=statisticsnorway_ssb-datafangst-person-fagfunksjoner&metric=alert_status)][sonarquality]

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)][poetry]

[pypi status]: https://pypi.org/project/ssb-datafangst-person-fagfunksjoner/
[documentation]: https://statisticsnorway.github.io/ssb-datafangst-person-fagfunksjoner
[tests]: https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner/actions?workflow=Tests

[sonarcov]: https://sonarcloud.io/summary/overall?id=statisticsnorway_ssb-datafangst-person-fagfunksjoner
[sonarquality]: https://sonarcloud.io/summary/overall?id=statisticsnorway_ssb-datafangst-person-fagfunksjoner
[pre-commit]: https://github.com/pre-commit/pre-commit
[black]: https://github.com/psf/black
[poetry]: https://python-poetry.org/

## Features

Functions:

**hent_status_pd**
Retrieves status data for a specific InstrumentId and date range from datafangst-person GCS bucket, returning it as a Pandas DataFrame.

```
hent_status_pd(
    instrument_id: str,
    start_dato: Optional[date] = None,
    slutt_dato: Optional[date] = None,
) -> pd.DataFrame

```

**hent_status_pl**
Retrieves status data for a specific InstrumentId and date range from datafangst-person GCS bucket, returning it as a Polars DataFrame.

```
hent_status_pl(
    instrument_id: str,
    start_dato: Optional[date] = None,
    slutt_dato: Optional[date] = None,
) -> pl.DataFrame
```

**hent_utvalg_pd**
Retrieves utvalg data for a specific InstrumentId from datafangst-person GCS bucket, returning it as a Pandas DataFrame.

```
hent_utvalg_pd(
    instrument_id: str,
) -> pd.DataFrame
```

**hent_utvalg_pl**
Retrieves utvalg data for a specific InstrumentId from datafangst-person GCS bucket, returning it as a Polars DataFrame.

```
hent_utvalg_pl(
    instrument_id: str,
) -> pl.DataFrame
```

**question_sorting**
Processes a Paradata DataFrame returning a list of FieldNames in the order they were asked in the survey.

```
question_sorting(
    x: pd.DataFrame,
) -> list[str]
```

**make_bolk**
Extracts and returns a nested section (bolk) name from a string, such as FieldName.

```
make_bolk(
    row: str,
) -> str
```

**fill_all_para_pl**
Prepares a Polars DataFrame with paradata for analysis by filling missing values, creating new columns, and transforming the data for analysis.

```
fill_all_para_pl(
    table_df: pl.DataFrame,
) -> pl.DataFrame
```

**fill_para_pl**
Prepares a Polars DataFrame with paradata for analysis, transforming data as necessary if the data has a min TimeStamp after we started doing fill_para automatically in out iac repo.

```
fill_para_pl(
    table_df: pl.DataFrame,
) -> pl.DataFrame
```

**fill_para_pd**
Prepares a Pandas DataFrame with paradata for analysis, transforming data as necessary if the data has a min TimeStamp after we started doing fill_para automatically in out iac repo.

```
fill_para_pd(
    table_df: pd.DataFrame,
) -> pd.DataFrame
```

## Requirements

- TODO

## Installation

You can install _SSB Datafangst Person Fagfunksjoner_ via [pip] from [PyPI]:

```console
pip install ssb-datafangst-person-fagfunksjoner
```

## Usage

Please see the [Reference Guide] for details.

## Contributing

Contributions are very welcome.
To learn more, see the [Contributor Guide].

## License

Distributed under the terms of the [MIT license][license],
_SSB Datafangst Person Fagfunksjoner_ is free and open source software.

## Issues

If you encounter any problems,
please [file an issue] along with a detailed description.

## Credits

This project was generated from [Statistics Norway]'s [SSB PyPI Template].

[statistics norway]: https://www.ssb.no/en
[pypi]: https://pypi.org/
[ssb pypi template]: https://github.com/statisticsnorway/ssb-pypitemplate
[file an issue]: https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner/issues
[pip]: https://pip.pypa.io/

<!-- github-only -->

[license]: https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner/blob/main/LICENSE
[contributor guide]: https://github.com/statisticsnorway/ssb-datafangst-person-fagfunksjoner/blob/main/CONTRIBUTING.md
[reference guide]: https://statisticsnorway.github.io/ssb-datafangst-person-fagfunksjoner/reference.html

