Python Library to access MOSP.
Project description
PyMOSP
PyMOSP is a Python library to access MOSP.
Installation
Use it as a command line tool
$ pipx install pymosp
installed package pymosp 0.4.0, Python 3.9.2
These apps are now globally available
- pymosp
done! ✨ 🌟 ✨
$ export MOSP_URL_API=https://objects.monarc.lu/api/v2/
$ export TOKEN=<YOUR-TOKEN>
$ pymosp object --list
{'metadata': {'count': '5074', 'offset': '0', 'limit': '10'}, 'data': [{'id': 144, 'name': 'Use of an obsolete version of the messaging server', 'description': '', 'schema_id': 14, 'org_id': 4, 'last_updated': '2021-03-16T12:45:35.046659', 'json_object': {'code': '1118', 'uuid': '69fc03a0-4591-11e9-9173-0800277f0571', 'label': 'Use of an obsolete version of the messaging server', 'language': 'EN', 'description': ''}, 'organization': {'id': 4, 'name': 'MONARC', 'description': 'MONARC is a tool and a method allowing an optimised, precise and repeatable risk assessment.', 'organization_type': 'Non-Profit', 'is_membership_restricted': True, 'last_updated': '2018-05-18T09:50:57'}, 'licences': None}, ... , {'id': 284, 'name': 'Tempting equipment (trading value, technology, strategic)', 'description': '', 'schema_id': 14, 'org_id': 4, 'last_updated': '2021-03-16T12:45:33.862787', 'json_object': {'code': '278', 'uuid': '69fc0ee2-4591-11e9-9173-0800277f0571', 'label': 'Tempting equipment (trading value, technology, strategic)', 'language': 'EN', 'description': ''}, 'organization': {'id': 4, 'name': 'MONARC', 'description': 'MONARC is a tool and a method allowing an optimised, precise and repeatable risk assessment.', 'organization_type': 'Non-Profit', 'is_membership_restricted': True, 'last_updated': '2018-05-18T09:50:57'}, 'licences': None}]}
Use it as a Python library
pip install pymosp
import pymosp, os
mosp = pymosp.PyMOSP(os.getenv("MOSP_URL_API"), os.getenv("TOKEN"))
params = {"organization": "MONARC", "schema": "Library objects"}
r = mosp.objects(params=params)
print(r)
or via the Git repository:
$ git clone https://github.com/CASES-LU/PyMOSP
$ cd PyMOSP
$ poetry install
$ poetry run nose2 -v --pretty-assert
Examples
See the examples in the file example.py or in the tests folder.
License
This software is licensed under GNU General Public License version 3.
- Copyright (C) 2019-2021 Cédric Bonhomme
- Copyright (C) 2019-2021 SMILE gie securitymadein.lu
For more information, the list of authors and contributors is available.
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
pymosp-0.4.1.tar.gz
(18.1 kB
view details)
Built Distribution
pymosp-0.4.1-py3-none-any.whl
(33.0 kB
view details)
File details
Details for the file pymosp-0.4.1.tar.gz
.
File metadata
- Download URL: pymosp-0.4.1.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-70-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4594a8954d77214f3ff9a3d43f58429f08ac5754ebc1778b5862722bb394b6ce |
|
MD5 | 0194522da033fa3879a4d5e5c1542cae |
|
BLAKE2b-256 | 4394703867871a1ede7e9c6b1d8f1964b7334b0eca2ca88fb863d4943efbcfe2 |
File details
Details for the file pymosp-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: pymosp-0.4.1-py3-none-any.whl
- Upload date:
- Size: 33.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.4.0-70-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dacb53b0766240c77f1f551928a227308986da2e9fc7f9742afaa72ace78cf4d |
|
MD5 | 1956251d8e90f3025be0036069decbba |
|
BLAKE2b-256 | c69a37a7c9562dc7799ed707fd7fafac1edc53396acc7b65fd35710d97f3a3e9 |