Skip to content

me2d09/ILLData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

illdata

Lightweight Python client for working with ILL SFTP (Institut Laue–Langevin). It lets you:

  • connect to SFTP,
  • list available proposals,
  • open a specific proposal,
  • list files,
  • download files.

This package also offers logging, and a small CLI.

Installation (local)

pip install illdata

Requirements

  • Python >= 3.8
  • pysftp (installed automatically)

Quick start (Python)

from illdata import IllSftp

with IllSftp(hostname="host", username="user", password="pass") as ill:
    # list availavble proposals
    for p in ill.proposals():
        print(p)

    ill.open_proposal("12345")
    print(ill.listdir("."))
    ill.download("path/remote/file.dat", "downloads/file.dat")

Try it interactively by opening the example notebook: example.ipynb.

CLI

Install the package, then run:

illdata proposals --host HOST --user USER --password PASS
illdata open --proposal 12345 --host HOST --user USER --password PASS
illdata ls --proposal 12345 --path . --host HOST --user USER --password PASS
illdata get --proposal 12345 --remote path/on/server.dat --local ./data/file.dat --host HOST --user USER --password PASS

You can also provide credentials via environment variables:

  • ILL_HOST, ILL_USER, ILL_PASS, (optional) ILL_PORT, ILL_KNOWN_HOSTS

Logging

The library uses Python’s standard logging. Configure it in your app if you want to see info messages:

import logging
logging.basicConfig(level=logging.INFO)

Security notes

By default, host key verification is disabled (for compatibility with older SFTP setups). For secure use, pass a known_hosts file to the CLI (--known-hosts) or set known_hosts_path in code.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors