Skip to main content

Python client for interacting with the necmec API

Project description

NECMEC API python wrapper Client

A Python client for interacting with the NECMEC API python wrapper. This API allows users to submit reports, upload files, and perform other operations necessary to complete the submission process. Base API docs https://exttest.cybertip.org/ispws/documentation/index.html#overview

Features

  • Verify Connection: Check if the client can connect to the server and authenticate.
  • Download XSD Schema: Retrieve the latest XML Schema Definition (XSD) for report submission.
  • Report Submission: Open and submit a report in the system.
  • File Upload: Upload files to a report.
  • File Details: Provide additional details for uploaded files.
  • Finish Submission: Finish the report submission process.
  • Retract Submission: Cancel an open report submission.

Installation

To install the package, you can use pip:

pip install necmec-api

help

python3 -m necmec_api.cli --help

status

python3 -m necmec_api.cli --config config.json --username your_username --password your_password --environment test status

submit a report

python3 -m necmec_api.cli --config config.json --username your_username --password your_password --environment test  submit "<xml_data>"

Cancel the Report

python3 -m necmec_api.cli --config config.json --username your_username --password your_password --environment test  retract <report_id>

Refer demo.py

python3 -m venv env
source env/bin/activate
pip install necmec-api
cat <<EOF > config.json
{
    "production": {
      "base_url": "https://report.cybertip.org/ispws",
      "status_url": "/status",
      "xsd_url": "/xsd",
      "submit_url": "/submit",
      "upload_url": "/upload",
      "fileinfo_url": "/fileinfo",
      "finish_url": "/finish",
      "retract_url": "/retract"
    },
    "test": {
      "base_url": "https://exttest.cybertip.org/ispws",
      "status_url": "/status",
      "xsd_url": "/xsd",
      "submit_url": "/submit",
      "upload_url": "/upload",
      "fileinfo_url": "/fileinfo",
      "finish_url": "/finish",
      "retract_url": "/retract"
    }
  }
EOF
python3 demo.py

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

necmec_api-0.1.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

necmec_api-0.1.3-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file necmec_api-0.1.3.tar.gz.

File metadata

  • Download URL: necmec_api-0.1.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for necmec_api-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bfa795589ed49babf6e716f59e68059c22555dd335cbbd500d3a613ffb725da9
MD5 598259706410f6df881c34417dafe5bd
BLAKE2b-256 2be7ce2734a4b31d375d01820b6d5a1ee052b06b3320e1915f7e49a0a11b8ce9

See more details on using hashes here.

File details

Details for the file necmec_api-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: necmec_api-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for necmec_api-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a1e4d6b9edcaeadd5ea27082326fd7e687208905c3adfdeea07433796c539caf
MD5 368bfcb0b49439d0c5d11fad9190d4a4
BLAKE2b-256 a46f1a3a43b019d3bb0e475cdc24c8ae156b90a4ae8ec27db109e2e0080fc503

See more details on using hashes here.

Supported by

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