Skip to main content

package to make calls to loni ida

Project description

loniapi

loniapi is a Python package to make calls to the LONI API. It can list all files associated with a group-id and download specific files.

Installation

  1. Download the latest version of the loniapi package from Pypi https://pypi.org/project/loniapi/
pip install loniapi
  1. If step 1 errors outInstall pandas if it is not already installed. and requests. or upgrade
pip install pandas      # pip install pandas --upgrade
pip install requests    # pip install requests --upgrade
  1. Create a config file in your home directory
cd ~
vim .loniApiConfig
  1. Specify your group-id and loni log-in credentials
[<your-group-id>]
email = <your-email>
password = <your-password

Usage

from loniapi import filedownloader
myAPI = filedownloader.LoniApi()

# Log-in using a group ID acquired from IDA/LONI
myAPI.login('ampad')

# get list of files associated with the group id
loniAPI.get_LONI_files()

# test download a few file types 
myAPI.download_LONI_file('1')   #is a pdf
myAPI.download_LONI_file('3')   #is a csv

# to download a specific file version
myAPI.download_LONI_file(file_id = '2', version = '2015-11-13') #is a pdf

# log out
myAPI.logout()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

loniapi-0.0.6.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

loniapi-0.0.6-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file loniapi-0.0.6.tar.gz.

File metadata

  • Download URL: loniapi-0.0.6.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.6

File hashes

Hashes for loniapi-0.0.6.tar.gz
Algorithm Hash digest
SHA256 5a9241bb79190b9b6dc2c2691c8953d741f9a232c9a82972501c32d076164709
MD5 75ae984163adcad6404c0c2e07081f5e
BLAKE2b-256 0d8e3fbc7764e61da577ea2b429f88e9f77cb1fc0b05500e3f6f590b00f0f99c

See more details on using hashes here.

File details

Details for the file loniapi-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: loniapi-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.6

File hashes

Hashes for loniapi-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 159e4e2a202ea9d9ce1650022ed7973fcde0480c24ba78bcd4950baf6ed3e57e
MD5 5f1bba7c7152f75c629ecd129690604b
BLAKE2b-256 21443cb3baa787ab8ad17b12b55448be22d378edb8f01d22eb5d596d0ca1e964

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