Skip to content

Download data from TSD via API

First

pip3 install tsd-api-client --user

To view guides on all topics, in the command line, type

tacl --guide topics

To view instructions on how to register, type

tacl --guide config

This displays the guide:

To use tacl, you first need to register with the TSD API:

    tacl --register

A registration lasts one year, after which you need to register
again. If you are a member of different TSD projects, you need to
register separately for each project.

For an overview of current registrations:

    tacl --config-show

To delete all existing config:

    tacl --config-delete

Type

tacl --register

gives

Choose the API environment by typing one of the following numbers:
1 - for normal production usage
2 - for use over fx03 network
3 - for testing
4 - for Educloud normal production usage
5 - for Educloud testing

Choose 1.

If choosing 4 or 5, see the information on the technical details of Fox HPC. See also job types and max wall time.

To see guide on downloads, type

tacl --guide downloads

This gives

To view files and folders available for download:

    tacl p11 --download-list

Download a file:

    tacl p11 --download anonymised-sensitive-data.txt

If something goes wrong during the download, resume it:

    tacl p11 --download anonymised-sensitive-data.txt --download-id 869b432d7703e62134fcca775c98ba38

To download a directory (resumable):

    tacl p11 --download mydir --ignore-prefixes mydir/.git

To delete a downloadable resource:

    tacl p11 --download-delete myfile

To view and manage the directory download cache:

    tacl p11 --download-cache-show
    tacl p11 --download-cache-delete mydir
    tacl p11 --download-cache-delete-all

Using on-the-fly encryption, with automatic decryption:

    tacl p11 --download data.txt --encrypt

When downloading you can specify a remote path to download from:

    tacl p11 --download data.txt --remote-path /path/to/remote

This will download the file from the remote path if it exists as well as list remote directories.

    tacl p11 --download-list /path/to/remote

To see the guide for uploading, use

tacl --guide upload

This gives

Upload a single file:

    tacl p11 --upload myfile.txt

Files larger than 1GB are resumable if something goes wrong:

    tacl p11 --upload myfile.txt --upload-id 52928fed-8c29-4135-88e9-27f2c0bec526

To browse and manage resumables:

    tacl p11 --resume-list
    tacl p11 --resume-delete 52928fed-8c29-4135-88e9-27f2c0bec526
    tacl p11 --resume-delete-all

Uploading directories (automatically resumable for the whole directory):

    tacl p11 --upload mydirectory

To control which folders and files are included:

    tacl p11 --upload mydirectory --ignore-prefixes .git,build,dist --ignore-suffixes .pyc,.db

To disable the resume functionality for a directory:

    tacl p11 --upload mydirectory --cache-disable

To view and manage directory upload cache:

    tacl p11 --upload-cache-show
    tacl p11 --upload-cache-delete mydirectory
    tacl p11 --upload-cache-delete-all

Using on-the-fly encryption, with automatic server-side decryption:

 tacl p11 --upload myfile.txt --encrypt
 tacl p11 --upload mydirectory --encrypt

When uploading you can specify a remote path to upload to:

 tacl p11 --upload myfile.txt --remote-path /path/to/remote    

This will create a directory structure in the remote path if it does not exist.

Debugging “zsh: command not found: tacl”

zsh: command not found: tacl
even though it’s already installed:
Requirement already satisfied: tsd-api-client in ./.local/lib/python3.13/site-packages (3.9.0)

This is a classic issue where your shell doesn’t know where to look for the command you just installed.

The problem is that the directory where pip installed the tacl command is not in your shell’s PATH environment variable. Your shell only searches the directories listed in the PATH for executable commands.

Why This Happens

When you use pip to install a package locally (in your .local directory), it places the Python library files in .local/lib/... and any included command-line tools, like tacl, into a separate bin (binary) directory, which is almost always ~/.local/bin.

The output Requirement already satisfied... confirms the Python package is there, but your Zsh shell (zsh) hasn’t been told to look in ~/.local/bin for commands.


🛠️ How to Fix It

You need to add ~/.local/bin to your PATH. Here’s how to do it permanently.

1. Edit your Zsh configuration file:

Open your .zshrc file in a text editor. This file runs every time you open a new terminal.

Bash

nano ~/.zshrc

(You can use any editor you like, such as vim, emacs, or VS Code).

2. Add the directory to your PATH:

Go to the end of the file and add the following line. This line tells your shell to add your user’s local bin directory to the list of places it looks for commands.

Bash

export PATH="$HOME/.local/bin:$PATH"

Note: We use $HOME/.local/bin instead of ~/.local/bin as it’s generally more robust inside shell scripts and configuration files. Placing it at the beginning ensures that locally installed commands are found before system-wide ones of the same name.

3. Apply the changes:

Save the file and exit the editor. For the changes to take effect, you can either:

  • Close and reopen your terminal, OR
  • Source the configuration file directly in your current terminal session:Bashsource ~/.zshrc

✅ Verify the Fix

Now, you can check if the shell can find the command.

  1. Check your PATH:Bashecho $PATH You should see $HOME/.local/bin (e.g., /home/yourusername/.local/bin) at the beginning of the output.
  2. Find the command:Bashwhich tacl This should now return the full path to the command, like /home/yourusername/.local/bin/tacl.

You should now be able to run the tacl command without getting an error. However, if you meet this error

└> echo $PATH
/home/thu/miniconda3/bin:/home/thu/miniconda3/condabin:/home/thu/.vscode-server/cli/servers/Stable-7d842fb85a0275a4a8e4d7e040d2625abbf7f084/server/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/thu/.vscode-server/extensions/ms-python.debugpy-2025.14.1-linux-x64/bundled/scripts/noConfigScripts:/home/thu/.vscode-server/data/User/globalStorage/github.copilot-chat/debugCommand
(base) ┌[thu☮ms4]-(~)
└> which tacl
tacl not found

As you can see in the output of your PATH, the directory /home/thu/.local/bin is still missing. This means the changes you made to your .zshrc file haven’t been loaded into your current terminal session yet.


👉 Your Next Steps

You just need to “refresh” your shell’s configuration.

1. Load the new configuration:

Run the following command to apply the changes you made to .zshrc immediately:

Bash

source ~/.zshrc

2. Verify the PATH again:

Now, check your PATH variable again.

Bash

echo $PATH

You should now see /home/thu/.local/bin at the very beginning of the output.

3. Find the tacl command:

With the PATH corrected, your shell should now be able to find the command.

Bash

which tacl

This time, it should return /home/thu/.local/bin/tacl.

Once you see that output, you can go ahead and use the tacl command normally.

Leave a Reply

error: Content is protected !!