Skip to main content

Python package for the Ion Channel API

Project description

PyIonic

Documentation Status https://travis-ci.org/ion-channel/pyionic.svg?branch=master https://img.shields.io/pypi/v/pyionic.svg

PyIonic is a Python library to interact with Ion Channel’s API. With PyIonic it should be very easy for a user to interact with Ion Channel and get their data.

Documentation

Read up on the docs here: http://pyionic.readthedocs.io/

Quick Start

Install PyIonic:

pip install pyionic

Set the IONCHANNEL_SECRET_KEY:

export IONCHANNEL_SECRET_KEY=####IONCHANNEL_SECRET_KEY####

Examples

Sample code to report the name, id, and source of all of the projects in a team.

from pyionic import core
users = core.Users()
team_id = list(users.get_self()['data']['teams'].keys())[0]
projects = core.Projects()
print('--------------------------------')
for project in projects.get_projects(team_id)['data']:
    print('Name: %s' % project['name'])
    print('ID: %s' % project['id'])
    print('Source: %s' % project['source'])
    print('--------------------------------')

Sample code to get an analysis for all projects in a team. Reports the name, id, source and if the project passed the last analysis.

from pyionic import core
users = core.Users()
team_id = list(users.get_self()['data']['teams'].keys())[0]
projects = core.Projects()
analysis = core.Analysis()
print('--------------------------------')
for project in projects.get_projects(team_id)['data']:
    print('Name: %s' % project['name'])
    print('ID: %s' % project['id'])
    print('Source: %s' % project['source'])
    analysis_id = analysis.get_analysis_summery(
        team_id=team_id,
        project_id=project['id']
    )['data']['id']
    if analysis.get_analysis(
        team_id=team_id,
        project_id=project['id'],
        analysis_id=analysis_id
    )['data']['status'] == 'finished':
        print('Scan is good!')
    print('--------------------------------')

Sample code to count all of the vulnerabilities for Python 3.4

from pyionic import core
vuln = core.Vulnerability()
vulnerabilities = vuln.get_vulnerabilities('python', '3.4')
print('%s total vulnerabilities found.' % vulnerabilities['meta']['total_count'])

Tests

To setup tests you must first export a valid token for the pyionic test team:

export IONCHANNEL_SECRET_KEY=####IONCHANNEL_SECRET_KEY####

Then run:

pipenv run python setup.py test

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

pyionic-0.0.9.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

pyionic-0.0.9-py2.py3-none-any.whl (11.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyionic-0.0.9.tar.gz.

File metadata

  • Download URL: pyionic-0.0.9.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyionic-0.0.9.tar.gz
Algorithm Hash digest
SHA256 239138568f3996ba3d0ca880e05a79d6572a5c3e7cc24d81b8e58a78678dda55
MD5 abac5d8a5a50766a67367887de44f924
BLAKE2b-256 6aac8250c95236d3710cd39784fa7e570054dd10ec9241fc35dae2e80b422115

See more details on using hashes here.

File details

Details for the file pyionic-0.0.9-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyionic-0.0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4f885cac220196694eb89bda36c682c4a92ad2fcfd9ea61717c15d5894935084
MD5 6b1206ba6f85fdfb41db93eb7838d190
BLAKE2b-256 f0a198dcbea5d2d4eab924c3e3f6e230a71511ff7b289b431f39f7d361ee6e75

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