Python package for the Ion Channel API
Project description
PyIonic
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.
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.6.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for pyionic-0.0.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e76b7de435a4143bfeddf260804f77c2bfc27b8bd9c8b07110fe65c0bb8b5d9e |
|
MD5 | e8ee22d7aee7cb98165a0aaf842d6d35 |
|
BLAKE2b-256 | 6574c2aa65e6acf84d2fd6375719575b8ac57b78d0878cecbf4b63f95f519510 |