Skip to main content

Python Library to access MOSP.

Project description

PyMOSP

Latest release License Workflow PyPi version

PyMOSP is a Python library to access MOSP.

Installation

Use it as a command line tool

$ pipx install pymosp
installed package pymosp 0.5.0, Python 3.10.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-2022 Cédric Bonhomme
  • Copyright (C) 2019-2022 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.5.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

pymosp-0.5.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file pymosp-0.5.0.tar.gz.

File metadata

  • Download URL: pymosp-0.5.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.0 Linux/5.11.0-49-generic

File hashes

Hashes for pymosp-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7fb4a6c8066336b12352cf3e74fd30f5f248a4995ea9cb88e5246f9a03354846
MD5 b39810be3610160b7dc1dea4870690e8
BLAKE2b-256 4335015a1ce9d7cd0be84ed4a76dca66fe0c9cd7f1fe40947508a12a571dd305

See more details on using hashes here.

File details

Details for the file pymosp-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pymosp-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.0 Linux/5.11.0-49-generic

File hashes

Hashes for pymosp-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bab66a9f9ab4e89886597e9d7ffad1f74733cd113d5b509f4150d9af9e00519
MD5 97ce99b4d57f526f5bf2b6bb17ef9b21
BLAKE2b-256 effde6ec0ca71d9ded58331142d47a22e45fd169e33018df145382d12840ca1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page