Utility to download or upload data from/to .Stat Suite using ADFS authentication to connect to it
Project description
DotStat_IO:
A generic python package which could be integrated with other end-user applications and Gitlab runner to perform basic io with .Stat Suite. Its role is to mask the complexities of authentication to connect to .Stat Suite. The user needs to provide a set of parameters and the package exposes a couple of methods which will download or upload data from/to .Stat Suite.
This package contains two modules:
- ADFS-authentication module
- Download-upload module
In ADFS-authentication module, four methods are available:
1. To initialise the module for interactive use:
interactive(client_id: str, sdmx_resource_id: str, scopes: list[str], authority_url: str, redirect_port: int)
client_id:
The Application (client) ID that the ADFS assigned to your appsdmx_resource_id:
The ID of the application to be accessed such as .Stat Suite PPscopes:
Scopes requested to access a protected API (a resource defined by sdmx_resource_id)authority_url:
URL that identifies a token authorityredirect_port:
The port of the address to return to upon receiving a response from the authority
2. To initialise the module for non-interactive use using a secret:
nointeractive_with_secret(client_id: str, sdmx_resource_id: str, scopes: list[str], authority_url: str, client_secret: str)
client_id:
The Application (client) ID that the ADFS assigned to your appsdmx_resource_id:
The ID of the application to be accessed such as .Stat Suite PPscopes:
Scopes requested to access a protected API (a resource defined by sdmx_resource_id)authority_url:
URL that identifies a token authorityclient_secret:
The application secret that you created during app registration in ADFS
3. To initialise the module for non-interactive use using windows client authentication:
nointeractive_with_adfs(client_id: str, sdmx_resource_id: str, token_url: str)
client_id:
The Application (client) ID that the ADFS assigned to your appsdmx_resource_id:
The ID of the application to be accessed such as .Stat Suite PPtoken_url:
URL of the authentication service
4. To get a token after initialisation:
get_token()
In Download-upload module, four methods are available:
1. To download a file from .Stat:
download_file(self, dotstat_url: str, content_format: str, file_path: Path)
dotstat_url:
URL of data to be downloaded from .Stat Suitecontent_format:
Format of the downloaded contentfile_path:
The full path where the file will downloaded
2. To download streamed content from .Stat:
download_stream(self, dotstat_url: str, content_format: str)
dotstat_url:
URL of data to be downloaded from .Stat Suitecontent_format:
Format of the downloaded content
3. To upload a data file to .Stat:
upload_file(self, transfer_url: str, file_path: Path, space: str)
transfer_url:
URL of the transfer servicefile_path:
The full path of the SDMX-CSV file, which will be uploaded to .Stat Suitespace:
Data space where the file will be uploaded
4. To upload a structure to .Stat:
upload_structure(self, transfer_url: str, file_path: Path)
transfer_url:
URL of the transfer servicefile_path:
The full path of the SDMX-ML file, which will be uploaded to .Stat Suite
For more information about how to use this package, all test cases can be accessed from this link
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dotstat_io-0.1.1.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for dotstat_io-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62509d0ead3eb1c6fbe4a00d601f58753b953042eb821521bd5776651ab91f91 |
|
MD5 | 80f2c5035e4835c683670ad9294db9a9 |
|
BLAKE2b-256 | 3f5b4f4a4f2d13b2d4a0e43d0878835c19929f50aa5fc34a6e04158394dc300c |