Skip to main content

Python client for NIS Backend

A Python client package to operate with NIS-Backend

NIS stands for "Nexus Information System". It is a software system (a set of software components) developed as part of project "MAGIC" activities (H2020 grant #689669). NIS-Backend is the main component, an engine capable of interpreting and resolving MuSIASEM (sustainability, water-energy-food nexus, bioeconomic) models expressed using a DSL in spreadsheet form. For more information go to nis-backend repository at Github.

Getting started

Prerequisites

  • Python 3.x
  • A NIS backend instance has to be running and accessible. The URL of the API endpoint is the required parameter for the construction of the client. See the example in "Basic Usage" section below. For instructions on executing nis-backend please check README.md at Github.

Installing

pip install nexinfosys-client

Basic Usage

from nexinfosys import NISClient

c = NISClient("http://localhost:5000/nis_api") # Construct client
c.login("test_user")  # Login, using test user
c.open_session()  # Open a session (needed before submission)
fname = "<path to XLSX specifying a case study (accessible to the Python interpreter executing this script)>"
c.load_workbook(fname)  # Load a workbook (see DMP's annex "Case study formatting reference") 
# Submit the workbook (execute, return a list of issues, if empty or no issues with type==3, successful execution)
r = c.submit()
success = sum([i.type==3 for i in r]) == 0
for i in r:  # Print issues
    print(str(i))
if success:
    r = c.query_available_datasets()  # Obtain available datasets
    if len(r) > 0:
        for ds in r:  # List available datasets
            print(str(ds))
        # Query for one of the datasets ("ds1" must exist)
        r = c.query_datasets([("ds1", "csv")])
        # Write datasets
        for cnt, f in enumerate(r):
            fd = open(f[0]+"."+f[1], "wb")
            fd.write(f[2])
            fd.close()

# Close session
c.close_session()
# Logout
c.logout()

Authors

  • Rafael Nebot. Instituto Tecnológico de Canarias, SA. Departamento de Computación

License

This project is licensed under the BSD-3 License - see the LICENSE file for details

Acknowledgements

The development of this software was supported by the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 689669 (MAGIC). This work reflects the authors' view only; the funding agencies are not responsible for any use that may be made of the information it contains.

Metadata

Release files for nexinfosys-client 0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nexinfosys-client 0.22
File Size Uploaded Provenance Actions
nexinfosys-client-0.22.tar.gz 33.9 kB Without provenance Details for nexinfosys-client-0.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nexinfosys-client 0.22
File Interpreter ABI Platform Actions
nexinfosys_client-0.22-py3-none-any.whl Python 3 none any Details for nexinfosys_client-0.22-py3-none-any.whl

Total release size: 46.3 kB

Release files / nexinfosys-client-0.22.tar.gz

Download URL nexinfosys-client-0.22.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ecb85b2fff3ba6120936815704d2eba752a427a0378920a44e6bfc343e407e6f
BLAKE2b-256 checksum
How to use checksums
3b7e3c4a2b093671d0a07a425033b7faac77030a4543e69b4539af44be06d90a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0.post20200209 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.6

Release files / nexinfosys_client-0.22-py3-none-any.whl

Download URL nexinfosys_client-0.22-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b2538e39fdb96a407a566f04fafa6a884aab78cffe18763fbb5188f3a939f1a
BLAKE2b-256 checksum
How to use checksums
6e2b0b0c2ea9be2791bf6fcebbbd6d10b6a0ee746f839120a38cce39e451cca9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0.post20200209 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.6

Security for nexinfosys-client 0.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page