{ "info": { "author": "Chris Arnault", "author_email": "arnault@lal.in2p3.fr", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)", "Programming Language :: Python :: 3.7" ], "description": "Ce package rassemble un ensemble d'outils permettant de communiquer avec, ou agir sur, la base documentaire Atrium\nen utilisant l'interface APIREST entre le serveur Nuxeo et des applications clientes\n\nDeux composantes principales:\n\n- **atrium_shell**: application cliente offrant plusieurs actions de navigation vers la base Atrium\n- **nuxeolib**: la librairie de base impl\u00e9mentant l'APIREST selon le protocole d\u00e9crit dans la documentation Nuxeo,\n ainsi que plusieurs utilitaires bas\u00e9s sur les conventions Atrium.\n\n\nInstallation\n============\n\nInstallation de base\n--------------------\n\nIci, nous allons exploiter le m\u00e9canisme standard du monde Python: **pip** pour installer ce package Python.\n\nLe package **atrium_tools** a \u00e9t\u00e9 configur\u00e9 au format standard des packages Python, et a \u00e9t\u00e9 d\u00e9pos\u00e9 dans le\nd\u00e9p\u00f4t officiel **PyPi**.\n\nLe seul mode d'installation propos\u00e9 ici est bas\u00e9 sur les environnements virtuels de Python. Nous supposons \nque Python (version >= 3) est install\u00e9 dans votre syst\u00e8me\n\n > python -V\n > python -m venv atrium\n\n > source atrium/bin/activate (*sous Unix*)\n > atrium \\Scripts\\activate (*sous Windows*)\n\n > pip install atrium-tools\n > python -m atrium_shell.atrium_shell login= -ls\n\nPour mettre \u00e0 jour la version du package:\n\n > pip install --upgrade atrium-tools\n\nIl est possible de questionner l'installation actuelle:\n\n > pip show atrium-tools\n\n\nOu bien de d\u00e9sinstaller le package:\n\n > pip uninstall -y atrium-tools\n\nEt de d\u00e9sactiver l'environ `atrium` Python\n\n > deactivate\n\nL'application atrium_shell\n==========================\n\nIntroduction\n------------\n\nCette application permet d'interroger la base Atrium un peu comme la commande **ls** en unix ou **dir** en windows.\n\nAuthentification\n----------------\n\nPour acc\u00e9der au serveur Nuxeo, une authentification est n\u00e9cessaire. Deux m\u00e9thodes d'authentification sont possibles:\n\n- en utilisant le param\u00e8tre ``login=xxx`` sur la ligne de commande. Ensuite, le mot de passe\n sera demand\u00e9 en interrogation cach\u00e9e\n\n- en utilisant le fichier **.netrc** (https://sites.google.com/site/diezone/ftp---file-transfert-protocol/ftp---le-fichier-netrc)\n\nIl est ainsi possible de sp\u00e9cifier le couple `/` dans le fichier Unix/Windows standard `$HOME/.netrc`\nCe fichier doit obligatoirement \u00eatre prot\u00e9g\u00e9 ainsi:\n\n > ls -al ../.netrc\n -rw------- 1 arnault SI 399 Apr 8 17:10 ../.netrc\n\nAutrement dit, seul l'utilisateur doit avoir acc\u00e8s \u00e0 ce document\n\nCe fichier texte contient des lignes au format suivant:\n\n machine atrium.in2p3.fr login password \n\nSi le fichier `~/.netrc` existe et que la variable d'environnement `HOME` est d\u00e9finie, \nalors il ne sera pas n\u00e9cessaire d'utiliser l'argument `login=xxx` \net la connexion Atrium sera \u00e9tablie automatiquement avec l'identifant d\u00e9crit dans le ficher `~/.netrc` \n\n\nArguments\n---------\n\n login = str : Compte Atrium (le mot de passe sera demand\u00e9)\n\n cd = str[/] : Dossier courant \n Par exemple cd=/Laboratoires/IPNO\n\n user = str[] : Specification alternative pour le dossier au lieu de cd\n exemple: arnault@lal.in2p3.fr\n\n\n cp = str[] : document \u00e0 copier\n set_acl = str[] : acl \u00e0 installer sur le dossier sp\u00e9cifi\u00e9 (,)\n rm_acl = str[] : acl \u00e0 supprimer du le dossier sp\u00e9cifi\u00e9 (,)\n subs_acl = str[] : acl \u00e0 supprimer du le dossier sp\u00e9cifi\u00e9 (,,,)\n\n permission:\n Publisher\n Approver\n Validator\n Reader\n PublisherSection\n LocalAdmin\n Writer\n\n to = str[] : document destination (cp, set_acl, rm_acl, subs_acl)\n\n depth = int[0] : Profondeur dans l'arborescence. Par d\u00e9faut la valeur 0 indique le seul premier niveau\n\n -ls : Listing des documents \u00e0 partir d'un espace donn\u00e9\n -csv : Production d'un fichier CSV d\u00e9crivant l'arborescence des documents \n -draw : Production d'un graphique d\u00e9crivant l'arborescence des documents \n -rights : Controle l'affichage des droits\n\nQuelques pr\u00e9cisions:\n\n* La cible de d\u00e9part peut \u00eatre sp\u00e9cifi\u00e9e:\n * soit avec `cd` pour un espace institutionnel\n * soit avec `user` pour un espace personnel, en sp\u00e9cifiant l'intitul\u00e9 du compte Atrium\n* L'option `set_acl` s'applique uniquement au dossier sp\u00e9cifi\u00e9 avec `to=`\n* L'option `rm_acl` s'applique r\u00e9cursivement \u00e0 tous les dossiers enfants \u00e0 partir du dossier `to=>> python -m atrium_shell.atrium_shell -ls cd=/Laboratoires/LAL/ATLAS\n //Atrium/Laboratoires/LAL/ATLAS\n ATLAS/PIXELS\n ATLAS/CALORIM\u00c9TRIE Argon Liquide [Block]\n ATLAS/HGTD (High Granularity Timing Detector)\n\n\n >>> python -m atrium_shell.atrium_shell -ls cd=/Laboratoires/LAL/ATLAS depth=1\n //Atrium/Laboratoires/LAL/ATLAS\n ATLAS/PIXELS\n ATLAS/PIXELS/M\u00e9canique [Block]\n ATLAS/PIXELS/Om\u00e9gapix [Block]\n ATLAS/PIXELS/FEi4 [Block]\n ATLAS/PIXELS/Doping_Profile [Block]\n ATLAS/PIXELS/RD53 [Block]\n ATLAS/PIXELS/Interconnexion [Block]\n ATLAS/PIXELS/Acquisition [Block]\n ATLAS/PIXELS/atlas_synchro [Block]\n ATLAS/PIXELS/Salle Blanche PIXELS\n ATLAS/CALORIM\u00c9TRIE Argon Liquide [Block]\n ATLAS/CALORIM\u00c9TRIE Argon Liquide/Banc de tests robotis\u00e9\n ATLAS/HGTD (High Granularity Timing Detector)\n ATLAS/HGTD (High Granularity Timing Detector)/Ing\u00e9nierie M\u00e9canique\n ATLAS/HGTD (High Granularity Timing Detector)/Recrutement-AI bac+2\n\n\n\nNuxeolib\n=========\n\nCe module contient tous les appels de bas niveau vers l'APIREST de Nuxeo, et permet de d\u00e9velopper des applications\nutilitaires acc\u00e9dant \u00e0 la base de donn\u00e9es Atrium.\n\n\n- checkout(ref)\n- checkin(ref, version='minor', comment='')\n- checkoutin(ref, version='minor', comment='')\n- create_tree_snapshot(ref, version='minor')\n- create_version(ref, increment='Minor', save_document=True)\n- set_property(ref, xpath, value)\n- delete(ref)\n- get_children(ref)\n- get_parent(ref)\n- get_versions(ref)\n- lock(ref)\n- unlock(ref)\n- move(ref, target, name=None)\n- publish(ref, target)\n- copy(ref, target, name=None)\n- add_permission(ref, permission, user, acl='local')\n- get_relations(ref)\n- delete_relation(source, destination)\n- create_relation(ref, destination)\n- query(query, language=None)\n- get_blob(ref)\n- get_blobs(ref)\n- attach_blob(ref, blob)\n-\n\n- open_batch()\n- close_batch(batch_id)\n- upload_files(input_names=None, batch_id=None)\n- change_title(uid, title)\n- get_document(name)\n\n get the uid of a document from its path\n\n- create_document_with_properties(path,\n name,\n doc_type,\n properties=None,\n files=None,\n from_uid=None)\n\n\n We create a document in one single operation:\n - mandatory args are: path, name, doc_type\n - properties can be added(dc:title, uid:minor_version, dc:description, ...)\n - files: joint files.\n\n\n- update_document_with_properties(uid,\n title,\n doc_type,\n properties=None,\n files=None)\n\n this function is similar to the create function, but for updating an existing document.\n\n\n\n- read_document(doc_id)\n\n read the properties of an existing document\n\n\n- get_acls(doc_id)\n- delete_document(doc_id)\n- change_document_state(uid, state=u'')\n- read_user(name)\n\n read the properties of an user account\n\n\n- create_user(user,\n first_name=None,\n last_name=None,\n email='a@b.c',\n password='user',\n company=None)\n\n Basic creation function the required properties are:\n identifier (generally it's the email\n first name\n name\n email\n password\n\n\n- update_user(user,\n first_name=None,\n last_name=None,\n email=None,\n password=None,\n company=None,\n is_inactive=None)\n- delete_user(user)\n- get_users(query=u'*', data=False, max_results=None)\n\n query all users using a wildcard expression\n this internally get a multipage request and assembles the pages\n\n\n- get_directory(domain)\n\n query a vocabulary\n\n\n- add_directory_entry(directory, entry)\n- get_groups(pattern)\n- create_group(group)\n- get_group(group)\n- add_user_to_group(group, user)\n- add_subgroup_to_group(group, subgroup)\n- delete_group(group)\n-\n-\n\n- init_session(host=u'local', login='', password='', auth='')\n\n Initialise the session according to the host modes: local, dev, prod\n\n- connect(host, login, auth='')\n\n on top of the init_session function permit to enter the hidden password\n\n- get_login()\n\n retreive the actual login\n\n- purge_document(session, path, title='', edms='')\n\n Deep suppression of a given document (including from the Corbeille)\n\n- init_objets_from_string(lignes, constructor, key, output_dict)\n\n\n\n- init_objets(file_name, constructor, key, output_dict)\n\n Read a CSV file , building a dictionary of objects\n\n - we assume that the input file obeys the following format:\n + the first line contains the object field list\n + fields are separated by ';'\n + empty lines are ignored\n + lines starting with '#' are ignored\n - every line generates one object using the specified constructor\n - the specified key is the key to the dictionary\n\n- set_atrium_functional_domain(session, user, domain, role)\n\n call the SetAtriumFunctionalDomain primitive\n\n- set_atrium_is_inactive(session, user, is_inactive=True)\n\n call the SetAtriumIsInactive primitive\n\n- test_atrium_is_inactive(session, user)\n\n test if atrium_is_inactive\n\n- get_fds(session, cat=\"Laboratoire\")\n\n Reading all functional domains for Laboratoires|Projets|Activites declared in the Atrium base :\n\n we get all primary spaces of type Laboratoire|Projet|Activite then whe read the FunctionalDomain metadata\n this approach is needed since the FunctionalDomain vocabulary does not differenciate\n Laboratoires | Projets | Activit\u00e9s\n\n- test_user_role(session, user, fd)\n\n test if this user has a role for this functional domain\n\n return 2 values:\n bool = True if the user exists\n role or None = granted role.\n\n- get_user_workspace(host, session, email)\n\n Get the user personal space to build the Atrium perma-link\n\n- build_account_creation_mail(email, prenom, nom, pwd, racine, url, role='Reader')\n\n Construct a mail contents after the account creation\n - this mail give\n + the password\n + the perma-link to the personal space\n\n- build_logging_creation_mail(email, prenom, nom, racine, role='Reader')\n\n Construct a mail contents after the account creation\n - this mail give\n + the password\n + the perma-link to the personal space\n\n- sendmail(sender, to, message)\n\n Sending a email to one single destination\n the message itself has to be constructed using the MIMEText facility.\n\n- get_random_password()\n\n Utility to create a random password\n\n- create_user(host, session, nom, prenom, email, racine)\n\n creation of a user account\n - specify the host mode (local|dev|prod)\n - give name and first name\n - email is the account identifier\n - specify the functional domain (IE. laboratory)\n\nInstallation en tant que d\u00e9veloppeur, du package **atrium_tools**\n-----------------------------------------------------------------\n\nOn peut installer ce package \u00e0 partir de **GitLab**, par exemple en t\u00e9l\u00e9chargeant et installant l'archive au format ZIP.\nMais il est aussi possible de *cloner* directement le projet \u00e0 partir de **GitLab** si on souhaite contribuer\nau d\u00e9veloppement.\n\nCe logiciel est enti\u00e8rement bas\u00e9 sur le langage Python. Il est d\u00e9velopp\u00e9 en compatibilit\u00e9 avec la\nversion >=3.6 du langage Python.\nDonc il est indispensable qu'une version >= 3.6 du langage Python soit install\u00e9e sur votre machine\n\nEnsuite pour installer la suite logicielle voici les deux m\u00e9thodes:\n\n1. en clonant le d\u00e9p\u00f4t Git::\n\n > mkdir myworkspace\n > cd myworkspace\n > git clone git@gitlab.in2p3.fr:atrium/atrium_tools.git\n\npetit rappel pour modifier un \u00e9l\u00e9ment en git::\n\n > [edit]...\n > git status\n > git commit -am \"porquoi cette modification\"\n > git push\n\n\n2. en r\u00e9cup\u00e9rant une archive ZIP \u00e0 partir de GitLab::\n\n \u00e0 partir du site GitLab https://gitlab.in2p3.fr/atrium/atrium_tools\n installer et d\u00e9zipper l'archive\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://atrium.in2p3.fr/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "atrium-tools", "package_url": "https://pypi.org/project/atrium-tools/", "platform": "", "project_url": "https://pypi.org/project/atrium-tools/", "project_urls": { "Homepage": "https://atrium.in2p3.fr/" }, "release_url": "https://pypi.org/project/atrium-tools/4.3.3/", "requires_dist": null, "requires_python": "", "summary": "Atrium utilities", "version": "4.3.3" }, "last_serial": 5634811, "releases": { "4.3.3": [ { "comment_text": "", "digests": { "md5": "1e97e5849135ada84aab9592099d7758", "sha256": "aebbd1d2f9e9595091a286c180f55e995d14844259a716dbc58be7b3220e4670" }, "downloads": -1, "filename": "atrium_tools-4.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1e97e5849135ada84aab9592099d7758", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 36082, "upload_time": "2019-08-05T15:01:32", "url": "https://files.pythonhosted.org/packages/e2/1b/3fb8e5d1a6bfce1c825f4f19c47f945bbb0f731178ee6c1030956d869d5d/atrium_tools-4.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5aef65f437b5b63b91020bcc4112b913", "sha256": "d062a464eaa9a7d0066bb77d7ba59cc04aef5d14fe948c1acec9089d4a1215e0" }, "downloads": -1, "filename": "atrium_tools-4.3.3.tar.gz", "has_sig": false, "md5_digest": "5aef65f437b5b63b91020bcc4112b913", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37580, "upload_time": "2019-08-05T15:01:34", "url": "https://files.pythonhosted.org/packages/ab/84/c3c7a3d3212bb5da6aea3a0f7070e2b7d4d1ad0f5cd64159c7b18a476ce3/atrium_tools-4.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1e97e5849135ada84aab9592099d7758", "sha256": "aebbd1d2f9e9595091a286c180f55e995d14844259a716dbc58be7b3220e4670" }, "downloads": -1, "filename": "atrium_tools-4.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1e97e5849135ada84aab9592099d7758", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 36082, "upload_time": "2019-08-05T15:01:32", "url": "https://files.pythonhosted.org/packages/e2/1b/3fb8e5d1a6bfce1c825f4f19c47f945bbb0f731178ee6c1030956d869d5d/atrium_tools-4.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5aef65f437b5b63b91020bcc4112b913", "sha256": "d062a464eaa9a7d0066bb77d7ba59cc04aef5d14fe948c1acec9089d4a1215e0" }, "downloads": -1, "filename": "atrium_tools-4.3.3.tar.gz", "has_sig": false, "md5_digest": "5aef65f437b5b63b91020bcc4112b913", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37580, "upload_time": "2019-08-05T15:01:34", "url": "https://files.pythonhosted.org/packages/ab/84/c3c7a3d3212bb5da6aea3a0f7070e2b7d4d1ad0f5cd64159c7b18a476ce3/atrium_tools-4.3.3.tar.gz" } ] }