<commit_before>Python SDK to access the `vulnerability database <https://github.com/vulndb/data>`_

.. image:: https://circleci.com/gh/vulndb/python-sdk/tree/master.svg?style=svg
   :alt: Build Status
   :align: right
   :target: https://circleci.com/gh/vulndb/python-sdk/tree/master

Installation
============
It's possible to install `the latest stable release from pypi <https://pypi.python.org/pypi/vulndb>`_:

::

    pip install vulndb


Or if you're interested in the latest version from our repository:

::

    git clone https://github.com/vulndb/python-sdk.git
    python setup.py install

Usage
=====

::

    >>> from vulndb import DBVuln
    >>> dbv = DBVuln.from_id(42)
    >>> dbv.title
    'SQL Injection'
    >>> dbv.severity
    'high'
    >>> r = dbv.references[0]
    >>> r.url
    'http://example.com/sqli-description.html'
    >>> r.title
    'SQL injection cheat-sheet'


More attributes, methods and helpers are well documented and available in the
`source code <https://github.com/vulndb/python-sdk/blob/master/vulndb/db_vuln.py>`_.

Updating the database
=====================
This package embeds the `vulnerability database <https://github.com/vulndb/data>`_
in the ``vulndb/db/`` directory. To update the database with new information
follow these steps:

::

    # Update the database
    git clone https://github.com/vulndb/data.git
    cp -rf data/db/*.json vulndb/db/

    # Bump the version number
    subl vulndb/version.txt

    # Push to repo
    git commit vulndb/db/ vulndb/version.txt -m 'Updated vulnerability database'
    git push

After updating the database it's a good idea to publish the latest at ``pypi`` using:

::

    python setup.py sdist upload


Contributing
============
Send your `pull requests <https://help.github.com/articles/using-pull-requests/>`_
with improvements and bug fixes, making sure that all tests ``PASS``:

::

    $ nosetests vulndb/
    ..........
    ----------------------------------------------------------------------
    Ran 10 tests in 0.355s

    OK


Install the test dependencies by running ``pip install -r vulndb/requirements-dev.txt``<commit_msg>Cosmetic<commit_after>Python SDK to access the `vulnerability database <https://github.com/vulndb/data>`_

.. image:: https://circleci.com/gh/vulndb/python-sdk/tree/master.svg?style=svg
   :alt: Build Status
   :align: right
   :target: https://circleci.com/gh/vulndb/python-sdk/tree/master

Installation
============
It's possible to install `the latest stable release from pypi <https://pypi.python.org/pypi/vulndb>`_:

::

    pip install vulndb


Or if you're interested in the latest version from our repository:

::

    git clone https://github.com/vulndb/python-sdk.git
    python setup.py install

Usage
=====

::

    >>> from vulndb import DBVuln
    >>> dbv = DBVuln.from_id(42)
    >>> dbv.title
    'SQL Injection'
    >>> dbv.severity
    'high'
    >>> r = dbv.references[0]
    >>> r.url
    'http://example.com/sqli-description.html'
    >>> r.title
    'SQL injection cheat-sheet'


More attributes, methods and helpers are well documented and available in the
`source code <https://github.com/vulndb/python-sdk/blob/master/vulndb/db_vuln.py>`_.

Contributing
============
Send your `pull requests <https://help.github.com/articles/using-pull-requests/>`_
with improvements and bug fixes, making sure that all tests ``PASS``:

::

    $ nosetests vulndb/
    ..........
    ----------------------------------------------------------------------
    Ran 10 tests in 0.355s

    OK


Install the dev dependencies by running ``pip install -r vulndb/requirements-dev.txt``

Updating the database
=====================
This package embeds the `vulnerability database <https://github.com/vulndb/data>`_
in the ``vulndb/db/`` directory. To update the database with new information
follow these steps:

::

    # Update the database
    git clone https://github.com/vulndb/data.git
    cp -rf data/db/*.json vulndb/db/

    # Bump the version number
    subl vulndb/version.txt

    # Push to repo
    git commit vulndb/db/ vulndb/version.txt -m 'Updated vulnerability database'
    git push

After updating the database it's a good idea to publish the latest at ``pypi`` using:

::

    python setup.py sdist upload


{'fraction_non_alphanumeric': 0.16936429744311518, 'fraction_numerical': 0.00422237860661506, 'mean_word_length': 2.848375451263538, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 55, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1135023', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1331, 'n_words': 381}