Metadata-Version: 2.4
Name: ssb-pxapi2-arrow
Version: 0.0.1
Summary: Pxwebapi2 arrow
Author: Bjørn Lie Rapp
Author-email: Bjørn Lie Rapp <bjorn.rapp@ssb.no>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Dist: furl>=2.1.4
Requires-Dist: httpx>=0.28.1
Requires-Dist: lru-dict>=1.4.1
Requires-Dist: msgspec>=0.20.0
Requires-Dist: ordered-set>=4.1.0
Requires-Dist: pyarrow>=22.0.0
Requires-Dist: pyparsing>=3.2.5
Maintainer: Statistics Norway, Population statistics Department (320)
Requires-Python: >=3.12
Project-URL: Changelog, https://github.com/statisticsnorway/ssb-pxapi2-arrow/releases
Project-URL: documentation, https://statisticsnorway.github.io/ssb-pxapi2-arrow
Project-URL: homepage, https://github.com/statisticsnorway/ssb-pxapi2-arrow
Project-URL: repository, https://github.com/statisticsnorway/ssb-pxapi2-arrow
Description-Content-Type: text/markdown

# Pxwebapi arrow

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

[![Documentation](https://github.com/statisticsnorway/ssb-pxapi2-arrow/actions/workflows/docs.yml/badge.svg)][documentation]
[![Tests](https://github.com/statisticsnorway/ssb-pxapi2-arrow/actions/workflows/tests.yml/badge.svg)][tests]
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=statisticsnorway_ssb-pxapi2-arrow&metric=coverage)][sonarcov]
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=statisticsnorway_ssb-pxapi2-arrow&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-pxapi2-arrow/
[documentation]: https://statisticsnorway.github.io/ssb-pxapi2-arrow
[tests]: https://github.com/statisticsnorway/ssb-pxapi2-arrow/actions?workflow=Tests
[sonarcov]: https://sonarcloud.io/summary/overall?id=statisticsnorway_ssb-pxapi2-arrow
[sonarquality]: https://sonarcloud.io/summary/overall?id=statisticsnorway_ssb-pxapi2-arrow
[pre-commit]: https://github.com/pre-commit/pre-commit
[black]: https://github.com/psf/black
[poetry]: https://python-poetry.org/

## Features

- Fetch metadata for a table from any Pxweb 2 API, like Statistics Norways "Statistikkbanken" or Statistics Swedens "Statistikdatabasen"
- Fetch data from a table, from a API with Parquet support.

## Installation

You can install _Pxwebapi arrow_ from [PyPI]. We recomend using a package manager like uv, poetry or pdm.

```console
uv add ssb-pxapi2-arrow
```

## Usage

Fetch metadata about a table
```python
from pxwebapi import PxAPI, STATBANK_CONFIG

statbank = PxAPI(STATBANK_CONFIG)
meta = statbank.get_table_metadata(14216)
print(f"Table last updated: {meta.updated}")
```

Get data from the table
```python
df = statbank.get_table(
    14216, value_codes={"ContentsCode": "Bosatte", "TettSted": "*", "Region": "*", "Tid": "*"}
)
```
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],
_Pxwebapi arrow_ 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-pxapi2-arrow/issues
[pip]: https://pip.pypa.io/

<!-- github-only -->

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