Skip to main content

Integrate openhub APIs with Django

Project description

https://badge.fury.io/py/openhub-django.svg https://travis-ci.org/sks444/openhub-django.svg?branch=master https://codecov.io/gh/sks444/openhub-django/branch/master/graph/badge.svg

Integrate openhub APIs with Django

Documentation

The full documentation is at https://openhub-django.readthedocs.io.

Quickstart

  1. Install openhub-django:

pip install openhub-django
  1. Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'openhub_django.apps.OpenhubDjangoConfig',
    ...
)
  1. Add openhub-django’s URL patterns:

urlpatterns = [
    ...
    url(r'^', include('openhub_django.urls')),
    ...
]
  1. Configure following environment variables:

    • OpenHub Token

      How to get OpenHub Token?

      1. Signup with GitHub on OpenHub

      2. Go to your profile settings to create a new API Key.

      3. Choose “API Keys” from the section and create a new one by clicking on button “Request New API Key”

      4. Fill in the required fields and Save it.

      5. Copy the API Key for the generated token to add it to your environment.

      Add it to your Linux (or Ubuntu) environment-

      1. Open the terminal and run cat ~/.bashrc.

      2. Find this peice of code

      if [ -f ~/.bash_aliases ]; then
           . ~/.bash_aliases
      fi
      1. In this case we will create a new file in $HOME directory named .bash_aliases to store our environment variables. As it will execute everytime we open a new terminal window.

      vi ~/.bash_aliases
      1. Enter into the insert mode and add the value of token that you generated from OpenHub settings.

      export OH_TOKEN=<PASTE THE COPIED API KEY OF TOKEN>
      1. Exit the insert mode by pressing esc key and the editor.

      2. Restart your terminal and run printenv to verify the API Key added.

    • Organization name

      Set the environment variable ORG_NAME following the above mentioned steps like you did adding the environment variable OH_TOKEN. Once you setup these two environment variables, you’re ready to run a management command to fetch the organization related information from OpenHub.

  2. Run management command

python manage.py migrate

python manage.py import_openhub_data
  1. View the fetched data:

python manage.py runserver

# Open http://127.0.0.1:8000/openhub/ in browser

Features

  • Import all the organization portfolio projects data

  • Import all the organization outside projects data such as dependencies

  • Import all the affiliated committers data who made contributions to the projects

  • Import all the outside committers data

  • Import the organization related information

  • Generate the static web-pages of all the imported data with an interactive UI/UX design.

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

History

0.1.0 (2018-08-14)

  • First release on PyPI.

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

openhub-django-0.1.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

openhub_django-0.1.0-py2.py3-none-any.whl (25.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file openhub-django-0.1.0.tar.gz.

File metadata

  • Download URL: openhub-django-0.1.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9

File hashes

Hashes for openhub-django-0.1.0.tar.gz
Algorithm Hash digest
SHA256 22ac0e91ac01878a0d10cd01aedc04db4d76c682698fffe7073fec2faecf5dc5
MD5 fe5af041f6354ea0195a1e0283c4c4ff
BLAKE2b-256 a316b72b49f0cad5a3e1e5befee732e511138a894f89af1adbbe3de933a85fd8

See more details on using hashes here.

File details

Details for the file openhub_django-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: openhub_django-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9

File hashes

Hashes for openhub_django-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 771d3ec318f16daddbebda8c9923ff29e41b213bdf7fb5734b33e2eb760d8d73
MD5 5e9ef4451b7a2293bbf11b2d423ec8b6
BLAKE2b-256 46da22e015528d506a3dcaffd29cd68db9b20e7c30919558b9eb57b033d75a78

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