Add installer, proper copy script

pull/1/head
Raphaël Vinot 2014-04-16 15:14:58 +02:00
parent 24f2fab134
commit f2c7bbe5c9
5 changed files with 41 additions and 11 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
*.pyc
pymisp/apikey.py
examples/keys.py

0
examples/__init__.py Normal file
View File

View File

@ -1,12 +1,15 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from api import PyMISP
from pymisp import PyMISP
from keys import src, dest
url_source = 'https://misp.circl.lu'
url_dest = 'https://misppriv.circl.lu'
cert_source = 'misp.circl.lu.crt'
cert_dest = 'misppriv.circl.lu.crt'
source = None
destination = None
@ -14,8 +17,8 @@ destination = None
def init():
global source
global destination
source = PyMISP(url_source, src, 'xml')
destination = PyMISP(url_dest, dest, 'xml')
source = PyMISP(url_source, src, cert_source, 'xml')
destination = PyMISP(url_dest, dest, cert_dest, 'xml')
def _to_utf8(request):
@ -33,12 +36,6 @@ def copy_event(event_id):
return destination.add_event(to_send)
def export_osint():
# Warning: does not exports the samples/attachements
osint = source.search(tags='OSINT')
return _to_utf8(osint)
def list_copy(filename):
with open(filename, 'r') as f:
for l in f:
@ -52,5 +49,11 @@ def export_our_org():
return _to_utf8(circl)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
description='Copy the events from one MISP instance to an other.')
parser.add_argument('-f', '--filename', type=str, required=True,
help='File containing a list of event id.')
args = parser.parse_args()
init()
list_copy('all_ours')
list_copy(args.filename)

View File

@ -0,0 +1 @@
from api import PyMISP

26
setup.py Normal file
View File

@ -0,0 +1,26 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='pymisp',
version='1.0',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
maintainer='Raphaël Vinot',
url='https://github.com/MISP/PyMISP',
description='Python API for MISP.',
long_description=open('README.md').read(),
packages=['pymisp'],
classifiers=[
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Intended Audience :: Telecommunications Industry',
'Programming Language :: Python',
'Topic :: Security',
'Topic :: Internet',
],
install_requires=['requests'],
)