Metadata-Version: 1.0
Name: python-sdm
Version: 1.5.0
Summary: A collection of API to manage the Scientific Data from the User Office to the Central storage
Home-page: https://gitlab.maxiv.lu.se/kits-maxiv/lib-maxiv-sdm
Author: KITS
Author-email: kits@maxiv.lu.se
License: GPLv3
Description: # SDM library
        
        This library is composed by several python modules:
          - sdm: Library to manage the AD operations.
          - duo: Library to handle the communications with the Digital User Office.
        
        # DUO Communication Library
        
        ## Introduction
        
        This is a library developed at MAXIV Laboratory used for the communications with
        the Digital User Office (a.k.a DUO).
        
        This communication use a REST API.
        
        ## Monitor Data Path Creation
        
        This library also manages the creation of the path where acquisition data will be stored.
        
        Extracted from [here](https://alfresco.maxiv.lu.se/share/page/site/datamanagement/wiki-page?title=Beamline_Prototype&listViewLinkBack=true) we can read:
        ```
        Data path or central storage
        
        The data path for each data collection should have a structure meeting the following requirements:
        
            Splitting data by user types.
            Grouping by date, proposal and beamline
            Make the mounting of data folders for a specific user not too complicated
        
        The proposed structure is:
        
        /data/<user type>/<proposal>/<beamline>/<visit>/raw
        
        The <user type> includes visitor (bread and butter academic users), staff (MAX IV staff) and proprietary (mostly industrial users with a different need for data security).
        
        The <visit> should begin with the date when the first shift starts.
        
        In addition to /raw there will be a /process folder at the same level. This is where the user has permission to read and write files.
        ```
        
        ## Test Coverage
        To get the test coverage you need to have installed: coverage, pytest, pytest-cov, and if you want distributed
        testing, pytest-xdist.
        
        ```
        pytest --cov=duo tests/
        ```
        Resulting in the following report:
        
        ```
        	Name              Stmts   Miss  Cover
        	-------------------------------------
        	duo/UO.py           208     19    91%
        	duo/__init__.py       5      0   100%
        	duo/commons.py        8      0   100%
        	-------------------------------------
        	TOTAL               221     19    91%
        ```	
        
        and the same for sdm, i.e. sxchange duo for sdm in the coverage test call
        
        ```
        	Name               Stmts   Miss  Cover
        	--------------------------------------
        	sdm/SDM.py           485    134    72%
        	sdm/__init__.py        7      0   100%
        	sdm/__main__.py        2      2     0%
        	sdm/cli.py            52     48     8%
        	sdm/config.py         16      0   100%
        	sdm/directory.py     434     66    85%
        	sdm/storage.py        90     69    23%
        	sdm/user.py          142     66    54%
        	sdm/visitor.py       189    146    23%
        	--------------------------------------
        	TOTAL               1417    531    63%
        ```
        
        # Active Directory Communication Library
        
        ## Introduction
        The sdm/directory.py module handles the communication with the Active Directory through LDAPS protocol. In order to login to the Active Directory you need to have a file in your home directory which give the user and password. The file should located in ~/.sdm/activedirectory.yml and should contains:
        
        ```shell
        cat ~/.sdm/activedirectory.yml
        
        LDAPUSER: user@mydomain.se
        LDAPPASSWORD: my-secret-password
        TESTLDAPUSER: test@test.se
        TESTLDAPPASSWORD: my-secret-test
        
        
        # NOTE on merging
        When merging to master all tests in the tests/ will be run. If they don't pass the merge will not be carried out and the coder will need to fix the code.
        
        
        
        
Platform: UNKNOWN
