pyaxis


Namepyaxis JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/icane/pyaxis
SummaryLibrary to handle PC-Axis data in python using pandas DataFrames.
upload_time2024-12-20 11:03:20
maintainerNone
docs_urlNone
authorInstituto Cántabro de Estadística & Swiss Data Science Center
requires_pythonNone
licenseApache License 2.0
keywords pcaxis json-stat statistics dataframe converter
VCS
bugtrack_url
requirements numpy requests pandas pyjstat
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======
pyaxis
=======

**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.

.. [1] https://www.scb.se/px-en for PC-Axis information  
.. [2] https://pandas.pydata.org for Python Data Analysis Library information   

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'])

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/icane/pyaxis",
    "name": "pyaxis",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "pcaxis, json-stat, statistics, dataframe, converter",
    "author": "Instituto C\u00e1ntabro de Estad\u00edstica & Swiss Data Science Center",
    "author_email": "icane@cantabria.es",
    "download_url": "https://files.pythonhosted.org/packages/bc/7a/4c57859bb06e057c3fee1b4f9cc3e50eb9208bf46a088cc27007376265f5/pyaxis-0.4.0.tar.gz",
    "platform": null,
    "description": "=======\npyaxis\n=======\n\n**pyaxis** is a python library for **PC-Axis (or PX)** formatted data manipulation\nwhich allows reading and writing PC-Axis [1]_ format with python, using the\nDataFrame structures provided by the widely accepted pandas library [2]_.\nPX is a standard format for statistical files used by a large number of\nstatistical offices (Spain, Switzerland, Sweden). A package of software has been developed for this format: \nPX-Win, PX-Web and PX-Edit. **pyaxis** eases reading and parsing of PX files data \nand metadata into a pandas Dataframe and a dict structure, allowing their manipulation\nin a tabular and pythonic manner. It supports both monolingual and multilingual PX files. The package was initially developped by the [Instituto C\u00e1ntabro de Estadistica](https://www.icane.es) and is now jointly maintained by ICANE and the [Swiss Data Science Center](https://datascience.ch).  \n**pyaxis** is provided under the Apache License 2.0.\n\n.. [1] https://www.scb.se/px-en for PC-Axis information  \n.. [2] https://pandas.pydata.org for Python Data Analysis Library information   \n\nInstallation\n============\n\nFor installation::\n\n    pip install pyaxis\n\nUsage\n=====\n\nFrom PX to pandas DataFrame\n-----------------------------------\n\nTypical usage often looks like this::\n\n    from pyaxis import pyaxis\n\n    EXAMPLE_URL = 'https://www.ine.es/jaxiT3/files/t/es/px/2184.px'\n    \n    px = pyaxis.parse(EXAMPLE_URL, encoding='ISO-8859-2')\n    print(px['DATA'])\n    print(px['METADATA'])\n\nFor Multilingual PX files\n-----------------------------------\n\nTypical usage often looks like this::\n\n    from pyaxis import pyaxis\n\n    EXAMPLE_URL = 'https://www.pxweb.bfs.admin.ch/DownloadFile.aspx?file=px-x-0602000000_107'\n    \n    # Swiss PX files are in German(de), French(fr), Italian(it), and English(en)\n    px = pyaxis.parse(EXAMPLE_URL, encoding='ISO-8859-2', lang='fr')\n    print(px['DATA'])\n    print(px['METADATA'])\n    print(px['TRANSLATION'])\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Library to handle PC-Axis data in python using pandas DataFrames.",
    "version": "0.4.0",
    "project_urls": {
        "Homepage": "https://github.com/icane/pyaxis"
    },
    "split_keywords": [
        "pcaxis",
        " json-stat",
        " statistics",
        " dataframe",
        " converter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc7a4c57859bb06e057c3fee1b4f9cc3e50eb9208bf46a088cc27007376265f5",
                "md5": "a2c0e08004e6e9b0b091f926c560f830",
                "sha256": "0438f374d3ed852a1311aeb9a0aa277326f84a12d5091224f8ab1484dfd78467"
            },
            "downloads": -1,
            "filename": "pyaxis-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a2c0e08004e6e9b0b091f926c560f830",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 239176,
            "upload_time": "2024-12-20T11:03:20",
            "upload_time_iso_8601": "2024-12-20T11:03:20.691278Z",
            "url": "https://files.pythonhosted.org/packages/bc/7a/4c57859bb06e057c3fee1b4f9cc3e50eb9208bf46a088cc27007376265f5/pyaxis-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 11:03:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "icane",
    "github_project": "pyaxis",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.22.4"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "pyjstat",
            "specs": [
                [
                    "==",
                    "2.2.0"
                ]
            ]
        }
    ],
    "lcname": "pyaxis"
}
        
Elapsed time: 0.43773s