A tool for bulk river creation
Project description
Azure Blob Storage batch rivers creation CLI Tool
A command-line interface (CLI) tool to interact with Azure Blob Storage and manage rivers in Rivery. This tool allows you to configure Azure and Rivery credentials, generate river templates based on blob names, populate rivers, delete rivers, and list source configurations.
Table of Contents
Prerequisites
- Python 3.6 or higher
- Azure Blob Storage account
- Rivery account and API token
- Virtual Environment: It is recommended to use a virtual environment to manage dependencies.
Installation
-
Create a Virtual Environment
It is recommended to create a virtual environment to isolate the dependencies.
python3 -m venv venv source venv/bin/activate
-
Install the CLI Tool
Install the
multiriverpackage usingpip:pip install multiriver
(Ensure that the package
multiriveris available in the Python Package Index or replace this command with the appropriate installation method if installing from a local source.)
Configuration
Before using the CLI tool, you need to configure your Azure and Rivery credentials, as well as source settings.
Configure Credentials
Use the configure_creds command to set up your Azure Storage and Rivery API credentials.
multiriver configure-creds \
--account-name YOUR_AZURE_ACCOUNT_NAME \
--account-key YOUR_AZURE_ACCOUNT_KEY \
--rivery-api-token YOUR_RIVERY_API_TOKEN
Options:
--account-name(optional, but mandatory for the connection): Azure Storage account name.--account-key(optional, but mandatory for the connection): Azure Storage account key.--connection-string(optional): Azure Storage connection string.--sas-token(optional): Shared Access Signature (SAS) token.--rivery-api-token(optional, but mandatory for the connection): Rivery API token.--rivery-host(optional): Rivery host URL (default:https://console.rivery.io).
Note: You must provide at least one Azure credential and the Rivery API token.
Configure Source
Use the configure-source command to set up source settings for Azure Blob Storage. This command will generate river templates based on the blobs in the specified container and store them together with the config under ~/.rivery/source_config.
multiriver configure-source \
--container-name YOUR_CONTAINER_NAME \
--template-river-id TEMPLATE_RIVER_ID \
--filename-template FILENAME_TEMPLATE \
--group-id GROUP_ID \
--cron-schedule CRON_SCHEDULE
--merge-keys MERGE_KEYS
Options:
--container-name(optional): Name of the Azure Blob Storage container.- it�� (optional): ID of the base template river in Rivery.
--filename-template(optional): Template used for generating river names.--group-id(required): ID of the group to attach the rivers to in Rivery.--cron-schedule(optional): Cron expression to schedule new rivers.--merge-keys(optional): The merge keys to use in the river. Comma separated list (e.g. "key1,key2").
Note: You must provide the --group-id option. If --filename-template is provided, river templates will be generated based on the blob names.
Commands
populate-rivers
Populate rivers in Rivery based on the generated templates.
multiriver populate-rivers --group-id GROUP_ID
Options:
--group-id(required): ID of the group to attach the rivers to in Rivery.
delete-rivers
Delete all rivers associated with a specific group in Rivery.
multiriver delete-rivers --group-id GROUP_ID
Options:
--group-id(required): ID of the group whose rivers will be deleted.
list-source-configs
List all source configurations that have been set up.
multiriver list-source-configs
Usage Examples
Example Workflow
-
Create a Virtual Environment
python3 -m venv venv source venv/bin/activate
-
Install the CLI Tool
pip install multiriver
-
Configure Credentials
multiriver configure_creds \ --account-name myazureaccount \ --account-key myazurekey \ --rivery-api-token myriverytoken
-
Configure Source
multiriver configure-source \ --container-name mycontainer \ --template-river-id 62b075d34c86b10010ddf473 \ --filename-template "{entity_name}_data.csv" \ --group-id 6720e1592f775cb9fcdbf026 \ --cron-schedule "0 0 * * *" --merge-keys "id1,id2"
-
Populate Rivers
multiriver populate-rivers --group-id 6720e1592f775cb9fcdbf026
This command will:
- Create new rivers in Rivery using the templates.
- Generate mapping for every river.
- Schedule the rivers if a cron schedule was provided.
-
Delete Rivers
If you need to delete all rivers associated with the group:
multiriver delete-rivers --group-id 6720e1592f775cb9fcdbf026
-
List Source Configurations
To view all source configurations:
multiriver list-source-configs
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
For any questions or issues, please contact Rivery support.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multiriver-1.1.13.tar.gz.
File metadata
- Download URL: multiriver-1.1.13.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f274ac0fc26ee26a2812b46a83c13b51ed5088691197b97000cf65ac460c13
|
|
| MD5 |
84e7270f6242ab761ed36c5370a9009d
|
|
| BLAKE2b-256 |
fafca8ffcf9458c752f5609fc50fad8cd7b5e2e6e8aa614d821ee1cc6335ecb5
|
File details
Details for the file multiriver-1.1.13-py3-none-any.whl.
File metadata
- Download URL: multiriver-1.1.13-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6e665d2118401d49559d96ead8eaf785f3319693a4c892a7243cb2025c194df
|
|
| MD5 |
32eb46a6a628596358dfd581ea7b7931
|
|
| BLAKE2b-256 |
d7d7b4873077bd89dca3e264b90dbe09c1f4998b5b8e1e04cf66061edb63bbde
|