Skip to main content

A small convenience command-line utility to upload files via HTTP to an elements instance

Project description

Elements HTTP Upload Uitility

CI Code coverage

Latest Release

Code style: black Imports: isort PEP8 Checked with mypy

A small convenience command-line utility to upload files via HTTP to an elements instance

The command-line utility provided by this package has been tested with an ELEMENTS installation of v25.1.2. It mimics the upload of the web interface when uploading a file via HTTP(S). The file is split into chunks and uploaded one by one.

Note that the authors of this package are not affiliated in any kind with syslink GmbH (the copyright holders of elements).

Installation

Install this package in a dedicated python environment via

python -m venv venv
source venv/bin/activate
pip install elements-http-upload

To use this in a development setup, clone the source code from gitlab, start the development server and make your changes::

git clone https://codebase.helmholtz.cloud/hcdc/elements/elements-http-upload
cd elements-http-upload
python -m venv venv
source venv/bin/activate
make dev-install

More detailed installation instructions my be found in the docs.

Command-line usage

To upload a file, run

elements-http-upload -t <api-token> -H https://<elements-host> <local-file>:<remote-folder>/<remote-file>

An API token can be retrieved from the MAMS web interface by clicking your profile in the upper right corner and selecting the API tab. For further instructions, please have a look into the usage docs.

API usage

To use it from within python, see the following example and the usage docs for more

from elements_http_upload import upload

upload_info = {
    "source": "<local-file>",
    "target": "<remote-folder>/<remote-file>",
}

upload(
    upload_info,
    host="https://<elements-host>",
    api_token="<api-token>",
)

Technical note

This package has been generated from the template https://codebase.helmholtz.cloud/hcdc/software-templates/python-cli-package-template.git.

See the template repository for instructions on how to update the skeleton for this package.

License information

Copyright © 2025 Helmholtz-Zentrum hereon GmbH

Code files in this repository are licensed under the Apache-2.0, if not stated otherwise in the file.

Documentation files in this repository are licensed under CC-BY-4.0, if not stated otherwise in the file.

Supplementary and configuration files in this repository are licensed under CC0-1.0, if not stated otherwise in the file.

Please check the header of the individual files for more detailed information.

License management

License management is handled with reuse. If you have any questions on this, please have a look into the contributing guide or contact the maintainers of elements-http-upload.

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

elements_http_upload-0.2.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elements_http_upload-0.2.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file elements_http_upload-0.2.0.tar.gz.

File metadata

  • Download URL: elements_http_upload-0.2.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for elements_http_upload-0.2.0.tar.gz
Algorithm Hash digest
SHA256 34abc579a332f4c9dca2a781a75a62cd32bf60eff351b65e5ac44ac0c095bde9
MD5 fba5b49c027b10c717cb06d0948a9bf8
BLAKE2b-256 21bc161bca58bae2f9da80e570cb4fb29a51622834ab70b5b675f15a980341a5

See more details on using hashes here.

File details

Details for the file elements_http_upload-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for elements_http_upload-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a10cae24eecc70517e019d1eccbdd705ae10f04ec82302cd199e26a46c0a439a
MD5 965e868fb9502348c4e250e3918e55f7
BLAKE2b-256 01ba9fa974955c7844813f2884db4d485e0d7fa354bcde1a4e25a1155b836adc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page