pyaxis is a python library for PC-Axis (or PX) formatted data manipulation which allows reading and writing PC-Axis [1] format with python, using the DataFrame structures provided by the widely accepted pandas library [2]. PX is a standard format for statistical files used by a large number of statistical offices (Spain, Switzerland, Sweden). A package of software has been developed for this format: PX-Win, PX-Web and PX-Edit. pyaxis eases reading and parsing of PX files data and metadata into a pandas Dataframe and a dict structure, allowing their manipulation in a tabular and pythonic manner. It supports both monolingual and multilingual PX files. The package was initially developped by the [Instituto Cántabro de Estadistica](https://www.icane.es) and is now jointly maintained by ICANE and the [Swiss Data Science Center](https://datascience.ch). pyaxis is provided under the Apache License 2.0.
Installation
For installation:
pip install pyaxis
Usage
From PX to pandas DataFrame
Typical usage often looks like this:
from pyaxis import pyaxis EXAMPLE_URL = 'https://www.ine.es/jaxiT3/files/t/es/px/2184.px' px = pyaxis.parse(EXAMPLE_URL, encoding='ISO-8859-2') print(px['DATA']) print(px['METADATA'])
For Multilingual PX files
Typical usage often looks like this:
from pyaxis import pyaxis EXAMPLE_URL = 'https://www.pxweb.bfs.admin.ch/DownloadFile.aspx?file=px-x-0602000000_107' # Swiss PX files are in German(de), French(fr), Italian(it), and English(en) px = pyaxis.parse(EXAMPLE_URL, encoding='ISO-8859-2', lang='fr') print(px['DATA']) print(px['METADATA']) print(px['TRANSLATION'])
Metadata
Release files for pyaxis 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyaxis-0.4.3.tar.gz | 239.3 kB | Without provenance | Details for pyaxis-0.4.3.tar.gz |
Release files / pyaxis-0.4.3.tar.gz
| Download URL | pyaxis-0.4.3.tar.gz |
|---|---|
| Size | 239.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc17697d61bc6ba9b25c64823e2f527fbe4ae7beb49fde07c970ef67c6403ee5
|
|
BLAKE2b-256 checksum How to use checksums |
7e1492fbf27ddb0dbf890d4801d759ff0f53993a23c1356c55d759820e239fc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.10
|
Security for pyaxis 0.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.