A CLI app to interact with BIG-MAP Archive data repositories
Project description
big-map-archive-api-client
Overview
This is a command line client to interact with BIG-MAP Archive data repositories.
Usage
Overview
$ bma --help
Usage: bma [OPTIONS] COMMAND [ARGS]...
Command line client to interact with a BIG-MAP Archive.
Options:
--help Show this message and exit.
Commands:
finales-db Copy data from the database of a FINALES server to a...
record Manage records on a BIG-MAP Archive.
Create, update, and retrieve records
$ bma record --help
Usage: bma record [OPTIONS] COMMAND [ARGS]...
Manage records on a BIG-MAP Archive.
Options:
--help Show this message and exit.
Commands:
create Create a record on a BIG-MAP Archive and optionally publish it.
get Get the metadata of a published version of an entry on a...
get-all Get the metadata of the latest published version for each...
update Update a published version of an archive entry, or create a...
$ bma record create --help
Usage: bma record create [OPTIONS]
Create a record on a BIG-MAP Archive and optionally publish it.
Options:
--config-file FILE Path to the YAML file that specifies the domain name
and a personal access token for the targeted BIG-MAP
Archive. See bma_config.yaml in the GitHub
repository. [required]
--metadata-file FILE Path to the YAML file for the record's metadata
(title, list of authors, etc). See
data/input/example/create_record/metadata.yaml in
the GitHub repository. [required]
--data-files DIRECTORY Path to the directory that contains the data files
to be uploaded and linked to the record. See
data/input/example/create_record/upload in the
GitHub repository. [required]
--publish Publish the created record.
--help Show this message and exit.
$ bma record get --help
Usage: bma record get [OPTIONS]
Get the metadata of a published version of an entry on a BIG-MAP Archive and
save it to a file.
Options:
--config-file FILE Path to the YAML file that specifies the domain name and
a personal access token for the targeted BIG-MAP
Archive. See bma_config.yaml in the GitHub repository.
[required]
--record-id TEXT Id of the published version of an archive entry (e.g.,
"pxrf9-zfh45"). [required]
--output-file FILE Path to the JSON file where the obtained record's
metadata will be exported to. [required]
--help Show this message and exit.
$ bma record get-all --help
Usage: bma record get-all [OPTIONS]
Get the metadata of the latest published version for each entry on a BIG-MAP
Archive and save them to a file.
Options:
--config-file FILE Path to the YAML file that specifies the domain name and
a personal access token for the targeted BIG-MAP
Archive. See bma_config.yaml in the GitHub repository.
[required]
--all-versions Get all published versions for each entry. By default,
only the latest published version for each entry is
retrieved.
--output-file FILE Path to the JSON file where the obtained record's
metadata will be exported to. [required]
--help Show this message and exit.
$ bma record update --help
Usage: bma record update [OPTIONS]
Update a published version of an archive entry, or create a new version and
optionally publish it. When updating a published version, only the metadata
(title, list of authors, etc) can be modified.
Options:
--config-file FILE Path to the YAML file that specifies the
domain name and a personal access token for
the targeted BIG-MAP Archive. See
bma_config.yaml in the GitHub repository.
[required]
--record-id TEXT Id of the published version (e.g.,
"pxrf9-zfh45"). [required]
--update-only Update the metadata of the published
version, without creating a new version. By
default, a new version is created.
--metadata-file FILE Path to the YAML file that contains the
metadata (title, list of authors, etc) for
updating the published version or creating a
new version. See data/input/example/update_r
ecord/metadata.yaml in the GitHub
repository. [required]
--data-files DIRECTORY Path to the directory that contains the data
files to be linked to the newly created
version. See
data/input/example/update_record/upload in
the GitHub repository. [required]
--link-all-files-from-previous Link all files that are already linked to
the previous version to the new version,
with the exception of files whose content
changed.
--publish Publish the newly created version.
--help Show this message and exit.
Back-up a FINALES database into a BIG-MAP Archive
$ bma finales-db --help
Usage: bma finales-db [OPTIONS] COMMAND [ARGS]...
Copy data from the database of a FINALES server to a BIG-MAP Archive.
Options:
--help Show this message and exit.
Commands:
back-up Perform a partial back-up from the database of a FINALES...
$ bma finales-db back-up --help
Usage: bma finales-db back-up [OPTIONS]
Perform a partial back-up from the database of a FINALES server to a BIG-MAP
Archive. A new entry version is created and published. Its linked files
include data related to capabilities, requests, and results for requests.
Options:
--bma-config-file FILE Path to the YAML file that specifies the
domain name and a personal access token for
the targeted BIG-MAP Archive. See
bma_config.yaml in the GitHub repository.
[required]
--finales-config-file FILE Path to the YAML file that specifies the IP
address, the port, and the credentials of a
user account for the targeted FINALES
server. See finales_config.yaml in the
GitHub repository. [required]
--record-id TEXT Id of the published version for the previous
back-up (e.g., "pxrf9-zfh45"). For the first
back-up, leave to the default.
--metadata-file FILE Path to the YAML file that contains the
metadata (title, list of authors, etc) for
creating a new version. See data/input/examp
le/create_record/metadata.yaml in the GitHub
repository. [required]
--link-all-files-from-previous Link all files that are already linked to
the previous version to the new version,
with the exception of files whose content
changed.
--no-publish Do not publish the newly created version.
This is discouraged in production. If you
select this option, either publish or delete
the newly created draft, e.g., via the GUI.
--help Show this message and exit.
Support
If you have any comments or questions, please send your emails to big-map-archive@materialscloud.org.
Issue
If you find a bug, please create an issue directly into GitHub. If possible, give enough details so that the BIG-MAP Archive team is able to reproduce the encountered problem. Thank you!
Acknowledgements
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 957189. The project is part of BATTERY 2030+, the large-scale European research initiative for inventing the sustainable batteries of the future.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for big-map-archive-api-client-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7b61b95ffb7ce4601f6152db9a5ebd40e8d324efdae53dea27d0d1e5dd898e9 |
|
MD5 | 981025e12938d7ffacf75d6d20df8669 |
|
BLAKE2b-256 | 35c929fcb5eecb31eeef08aaaa504c07e4188ffb72df2159885059a8b6914c10 |
Hashes for big_map_archive_api_client-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c6601db9a6448a642f1c2615520c1790bbb514c8d28356b6ff27d7e6282ca33 |
|
MD5 | 4e88903a10c332a25a40471b157133f6 |
|
BLAKE2b-256 | 5e6bafb97ae19bc0e220eb96e459e7bb7ef355014c67e6ef2b0cd4756e4c2980 |