Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rgieseke/pandas-datapackage-reader
Data Package reader for Pandas
https://github.com/rgieseke/pandas-datapackage-reader
data-package frictionlessdata pandas
Last synced: about 1 month ago
JSON representation
Data Package reader for Pandas
- Host: GitHub
- URL: https://github.com/rgieseke/pandas-datapackage-reader
- Owner: rgieseke
- License: other
- Created: 2017-03-01T13:49:24.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-02-10T10:54:14.000Z (almost 2 years ago)
- Last Synced: 2024-06-11T16:54:10.690Z (6 months ago)
- Topics: data-package, frictionlessdata, pandas
- Language: Python
- Homepage:
- Size: 125 KB
- Stars: 19
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![PyPI](https://img.shields.io/pypi/v/pandas-datapackage-reader.svg)](https://pypi.python.org/pypi/pandas-datapackage-reader/)
[![CI](https://img.shields.io/github/actions/workflow/status/rgieseke/pandas-datapackage-reader/ci.yml?branch=main&label=actions&logo=github&logoColor=white)](https://github.com/rgieseke/pandas-datapackage-reader/actions)# pandas-datapackage-reader
Easy loading of tabular data from [Data Packages](http://frictionlessdata.io/data-packages/) into Pandas DataFrames.
## Installation
pip install pandas-datapackage-reader
## Usage
```python
from pandas_datapackage_reader import read_datapackage# From GitHub repository
country_codes = read_datapackage("https://github.com/datasets/country-codes")# From local directory
country_codes = read_datapackage("country-codes")# Data Package with GeoJSON
geo_countries = read_datapackage("https://github.com/datasets/geo-countries")
```Resource metadata from the Data Package is returned as a dictionary in the
`_metadata` attribute.```python
country_codes._metadata
```contains
```
{'format': 'csv',
'name': 'country-codes',
'path': 'data/country-codes.csv',
'schema': {'fields': [{'description': 'Country or Area official Arabic short name from UN Statistics Divsion',
'name': 'official_name_ar',
'title': 'official name Arabic',
'type': 'string'},
{'description': 'Country or Area official Chinese short name from UN Statistics Divsion',
'name': 'official_name_cn',
'title': 'official name Chinese',
'type': 'string'},
# ...
```## License
BSD-2-Clause, see [LICENSE](LICENSE)