govpack
Ukrainian open data pack
This package was created to ease and speed up access to the public data published by the Government of Ukraine on the https://data.gov.ua/ website.
At this moment govpack package provides a easy download of few medical datasets from the mentioned web-site, as well as auto creation of pandas variables from the sets.
Installation:
pip install govpack
Usage:
def create_pandas(link=str(), from_api=True, limit=int(), header=int(), force_download=False)
Main module of the package create_var has a function called def create_pandas(). This function takes such arguments:
-
link=str() # While from_api=True (set True by default), you need to pass as an input string, that contains a link on a dataset API from data.gov.ua dataset. In case of setting from_api into False, you should pass here a direct link on a dataset file (csv or excel format) from data.gov.ua.
-
from_api=True # If True (set True by default) you need to pass a link on a dataset API from data.gov.ua dataset into the link parameter. In other case you need to use direct link on dataset file (csv or excel format) from data.gov.ua
-
limit=int() # Limit the quantity of links from API that will be proceed by govpack script
-
header=int() # You don't need to pass anything here, except the case you need to debug table structure (see use cases). Here could be passed an inter that will define the row of header in pandas.read_excel.
-
force_download=False # If True (set False by default) create_pandas() method will try to download all dataset files (from data.gov.ua) that were used to create pandas variables
Here is an explanation from a data.gov.ua how to get link of the dataset you need and combine it with API 'https://data.gov.ua/api/3/action/package_show?id=':
Also you could find several interesting dataset links beyond:
- Інформація про погашені електронні рецепти за програмою реімбурсації лікарських засобів («Доступні ліки»): '5334586c-5bd1-4e24-9c14-9ba826cc9fa1'
- Оплати надавачам медичної допомоги за програмою медичних гарантій: '25a46db9-2f15-4302-9b59-9bd761c80f46'
- Оплати аптечним закладам за договорами реімбурсації лікарських засобів («Доступні ліки») з НСЗУ: '959dca0a-9b74-41ff-a7c8-f8de6398a219'
- Відомості про транспортні засоби та їх власників: '06779371-308f-42d7-895e-5a39833375f0'
After installing govpack and opening Python in your terminal you could use this code example:
from govpack.create_var import create_pandas
var1 = create_pandas('https://data.gov.ua/api/3/action/package_show?id=959dca0a-9b74-41ff-a7c8-f8de6398a219')
var1['dataset_0'].head()
You also could use a direct link from the data.gov.ua on a data file(in this case you will have only one key 'dataset_0'):
link = 'https://data.gov.ua/dataset/1703061d-e0c4-4393-8a29-fc154d2705fe/resource/506977cc-1793-41ee-b14e-6d2bab7c02f4/download/pasport-naboru-danikh.xlsx'
var2 = govpack.create_pandas(link=link, from_api = False)
var2['dataset_0'].head()
Below are several use cases that you could follow with Colab notebooks:
-
Opening from API + a bit of visualisation: https://colab.research.google.com/drive/1GxJarOwAsfxSNVa71BCjBKFVHbax_JWq?usp=sharing
-
Opening from direct link on file, a bit of debugging and analysis: https://colab.research.google.com/drive/1GcSM2DHaQm9aabtiUen9BsjHd9Ytioi7?usp=sharing
-
Opening from zip files, ranking, clustering: https://colab.research.google.com/drive/1FxIOxPBy04rBWR2zqRcSzmfiJrqFNiFU?usp=sharing
Metadata
Release files for govpack 0.1.1
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 |
|---|---|---|---|---|
| govpack-0.1.1.tar.gz | 4.4 kB | Without provenance | Details for govpack-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| govpack-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for govpack-0.1.1-py3-none-any.whl |
Total release size: 9.8 kB
Release files / govpack-0.1.1.tar.gz
| Download URL | govpack-0.1.1.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fefecaf9c616e863171a2d3657ceec58d312e40a335047f5db8e93685976608
|
|
BLAKE2b-256 checksum How to use checksums |
2fb7c6f48936d6e0e8f642deb476a5772c2f3411c4c2e80b11ad9c2e016ae13f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
|
Release files / govpack-0.1.1-py3-none-any.whl
| Download URL | govpack-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62097149962004a69f31bebcce1e1cc6e7695d50ab6a618636e4cbd32cd57d99
|
|
BLAKE2b-256 checksum How to use checksums |
c1d77be9b40919d04214ed8078589f7f857393df89bcbb9cea9cc5b49bd5421c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
|
Security for govpack 0.1.1
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.