{ "info": { "author": "Uber Product Security", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries" ], "description": ".. role:: python(code)\n :language: python\n\n==\nh1\n==\n\n.. image:: https://img.shields.io/pypi/pyversions/h1.svg\n.. image:: https://img.shields.io/pypi/v/h1.svg\n :target: https://pypi.python.org/pypi/h1\n\n\nA HackerOne API client for Python. The API closely maps to the REST API that HackerOne provides.\nDocumentation for their API is `available here `_.\n\n=======\nLicense\n=======\n\nMIT\n\n============\nInstallation\n============\n\nFor installation via pip:\n\n.. code-block:: bash\n\n pip install h1\n\nFor development, In the project root run:\n\n.. code-block:: bash\n\n virtualenv env\n source env/bin/activate\n make bootstrap\n\nThe manual approach should work as well:\n\n.. code-block:: bash\n\n python setup.py install\n\n========\nExamples\n========\n\n-----------------------\nInitializing the Client\n-----------------------\n\n.. code-block:: python\n\n >>> from h1.client import HackerOneClient\n >>> from h1.models import Report\n >>> c = HackerOneClient(\"YOUR-API-TOKEN-IDENTIFIER\", \"YOUR-API-TOKEN\")\n\n-------------------------------------------\nGetting all reports created in the last day\n-------------------------------------------\n\n:python:`HackerOneClient.find_resources()` allows you to specify a resource to find (only :python:`Report` is\nsupported for now) and some criteria to filter on. The only *required* filter is :python:`program`, which\nmust be set to the target HackerOne program's name. Any additional filters may be passed as kwargs,\nand everything in `HackerOne's filter documentation `_\nshould be supported.\n\nFor example, here's how we'd get all reports created in the past 24 hours:\n\n.. code-block:: python\n\n >>> import datetime as dt\n >>> day_ago = dt.datetime.now() - dt.timedelta(days=1)\n >>> listing = c.find_resources(Report, program=[\"test-program\"], created_at__gt=day_ago)\n >>> len(listing)\n 3\n >>> listing[0].title\n u'This is a test report!'\n\n-----------------------------------------\nGetting all resolved reports in a program\n-----------------------------------------\n\nSimilarly, if we filter on :python:`state` we can get all the :python:`resolved` reports:\n\n.. code-block:: python\n\n >>> resolved_listing = c.find_resources(Report, program=[\"test-program\"], state=[\"resolved\"])\n >>> resolved_listing[0].title\n\n-------------------------------\nGetting a specific report by ID\n-------------------------------\n\n:python:`HackerOneClient.get_resource()` allows you to pass a resource type (again, currently just :python:`Report`,)\nand an ID to fetch:\n\n.. code-block:: python\n\n >>> report = c.get_resource(Report, 110306)\n >>> report.title\n u'Test RCE SQLi'\n >>> report.state\n u'not-applicable'\n\n------------------------------\nTallying report counts by user\n------------------------------\n\nHere's an example of using the client to figure out who your most prolific reporters are:\n\n.. code-block:: python\n\n >>> from collections import Counter\n >>> reporter_count = Counter()\n >>> all_reports = c.find_resources(Report, program=[\"test-program\"])\n >>> for report in all_reports:\n ... reporter_count[report.reporter] += 1\n ...\n >>> print(reporter_count)\n Counter({: 21, : 12, : 2, : 1})\n\n=============\nRunning Tests\n=============\n\n.. code-block:: bash\n\n virtualenv env\n source env/bin/activate\n make bootstrap\n make test", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/uber-common/h1-python", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "h1", "package_url": "https://pypi.org/project/h1/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/h1/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/uber-common/h1-python" }, "release_url": "https://pypi.org/project/h1/1.4.2/", "requires_dist": null, "requires_python": null, "summary": "A HackerOne API client for Python", "version": "1.4.2" }, "last_serial": 2572642, "releases": { "1.3.0": [ { "comment_text": "", "digests": { "md5": "e077b4273449332a5a407002f87ab643", "sha256": "778d76412007d3011093987c74ff8b360dd2130470da6c13261c99c25b1b5716" }, "downloads": -1, "filename": "h1-1.3.0.tar.gz", "has_sig": false, "md5_digest": "e077b4273449332a5a407002f87ab643", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17436, "upload_time": "2016-08-12T00:54:15", "url": "https://files.pythonhosted.org/packages/65/86/aac079320c026c292c1011f573a289c4231753d8e9a04bba64ed720f7da8/h1-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "ecc04c0baf455d1f504cb1c6a13588c1", "sha256": "834676f16cba0659cce0acbc634d4c63091cd82d826ab6bfb6685fdf9b5651a3" }, "downloads": -1, "filename": "h1-1.4.0.tar.gz", "has_sig": false, "md5_digest": "ecc04c0baf455d1f504cb1c6a13588c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17484, "upload_time": "2016-08-15T23:17:36", "url": "https://files.pythonhosted.org/packages/d6/ac/66b7d05dc18dbbef0a9b67b6cac70620dc16e9e32538fd546f65ae439f5d/h1-1.4.0.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "ab3405feb524fd3023f6432999cc5bb9", "sha256": "050a022f40fc333758dc20fa66b030ea3d94f896bf9f5629430a9b9cf3309ff3" }, "downloads": -1, "filename": "h1-1.4.1.tar.gz", "has_sig": false, "md5_digest": "ab3405feb524fd3023f6432999cc5bb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17678, "upload_time": "2016-12-14T21:32:30", "url": "https://files.pythonhosted.org/packages/75/d1/8d23f94732d14385543ed55fdaf2ec811d7bd016f8ecaa6aea59847ddd2f/h1-1.4.1.tar.gz" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "2075ada523b0880ca785a7219da5d5aa", "sha256": "48c531f756e441d5782f4b62e658b060da8808004d0da2e3690afe057088beb8" }, "downloads": -1, "filename": "h1-1.4.2.tar.gz", "has_sig": false, "md5_digest": "2075ada523b0880ca785a7219da5d5aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17699, "upload_time": "2017-01-13T19:07:07", "url": "https://files.pythonhosted.org/packages/e5/ef/99c2c6e306317f51a0ccac73d8650c99eddc59b8f36520e80cb673a17299/h1-1.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2075ada523b0880ca785a7219da5d5aa", "sha256": "48c531f756e441d5782f4b62e658b060da8808004d0da2e3690afe057088beb8" }, "downloads": -1, "filename": "h1-1.4.2.tar.gz", "has_sig": false, "md5_digest": "2075ada523b0880ca785a7219da5d5aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17699, "upload_time": "2017-01-13T19:07:07", "url": "https://files.pythonhosted.org/packages/e5/ef/99c2c6e306317f51a0ccac73d8650c99eddc59b8f36520e80cb673a17299/h1-1.4.2.tar.gz" } ] }