DataLad PublicnEUro extension
This repository contains a datalad extension that simplifies data download from PublicnEUro collections.
Installation
Install the extension via pip (a virtual environment is recommended):
> pip install datalad-publicneuro
Usage
The extension provides the new git annex special remote uncurl-publicneuro. To use it, activate the special remote in your DataLad dataset:
git annex initremote uncurl-publicneuro type=external externaltype=uncurl-publicneuro encryption=none
The uncurl-publicneuro special remote handles URLs with the following structure (where <dataset-id> is the PublicnEUro ID of the dataset, e.g., PN000001, and path is the absolute path of a file within the dataset, e.g., /README.txt):
publicneuro+https://<dataset-id><path>
The following command adds a reference to a file in a PublicnEUro dataset and downloads the file content (here the file /README.txt of dataset PN000001 is added with the local name README.txt):
> git annex addurl --file README.txt publicneuro+https://PN000001/README.txt
The command will prompt for credentials if no credentials are available yet.
After successful authentication, the file will be downloaded and added to the annex.
Valid credentials will be stored in DataLad's credential store and automatically used for subsequent addurl-commands.
Credentials on Windows
The DataLad credential system prompts for credentials that are not yet known. On Windows the special remote might freeze, when prompting for credentials. There are two ways to avoid this:
-
Use
datalad credentials setto set the credentials for the authentication realm before adding or "getting" publicneuro URLs. The authentication realm for the PublicnEUro dataset<dataset-id>ishttps://datacatalog.publicneuro.eu/<dataset-id>. For example, the authentication realm for the datasetPN000001ishttps://datacatalog.publicneuro.eu/PN000001. -
Use the environment variables
PUBLICNEURO_USER_<dataset-id>andPUBLICNEURO_PASSWORD_<dataset-id>to set the credentials. For example, for the datasetPN000001, you can set the environment variablesPUBLICNEURO_USER_PN000001andPUBLICNEURO_PASSWORD_PN000001. If both environment variables are set, the special remote will use them instead of DataLad's credential system and will not prompt for credentials.
Contributing
PRs and issues are very welcome! Please open an issue or a pull request if you find a bug or have a feature request.
Metadata
Release files for datalad-publicneuro 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datalad_publicneuro-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / datalad_publicneuro-0.1.0-py3-none-any.whl
| Download URL | datalad_publicneuro-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fe8ee3c782d76ca4af4255aa926e9d922d6ec5579be3e06c9ca8a318d101be9
|
|
BLAKE2b-256 checksum How to use checksums |
e93148d2fce88f672bea93d2538ad2390807df55582af6ae981b6ededd2b3bbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.28.1
|
Security for datalad-publicneuro 0.1.0
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.