semvec/pypi-packages huggingface dataset:
bio2bel-hgnc 0.3.0
A package for converting HGNC to BEL
License: MIT License
Keywords: Biological Expression Language,BEL,Systems Biology,Networks Biology

Bio2BEL HGNC |build| |coverage| |documentation| |zenodo|
========================================================
This package creates:

- HGNC BEL namespace
- HGNC gene families BEL namespace,
- HGNC gene family membership BEL Script
- orthology BEL script

Installation |pypi_version| |python_versions| |pypi_license|
------------------------------------------------------------
``bio2bel_hgnc`` can be installed easily from `PyPI <https://pypi.python.org/pypi/bio2bel_hgnc>`_ with the
following code in your favorite terminal:

.. code-block:: sh

    $ python3 -m pip install bio2bel_hgnc

or from the latest code on `GitHub <https://github.com/bio2bel/hgnc>`_ with:

.. code-block:: sh

    $ python3 -m pip install git+https://github.com/bio2bel/hgnc.git@master

Setup
-----
HGNC can be downloaded and populated from either the Python REPL or the automatically installed command line
utility.

Python REPL
~~~~~~~~~~~
.. code-block:: python

    >>> import bio2bel_hgnc
    >>> hgnc_manager = bio2bel_hgnc.Manager()
    >>> hgnc_manager.populate()

Command Line Utility
~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash

    bio2bel_hgnc populate

Citations
---------
- Gray KA, *et al*. `genenames.org: the HGNC resources in 2015 <http://www.ncbi.nlm.nih.gov/pubmed/25361968>`_. Nucleic
  Acids Res. 2015 Jan;43(Database issue):D1079-85

Acknowledgements
----------------
- This package heavily relies on Andrej Konotopez's package `PyHGNC <https://github.com/lekono/pyhgnc>`_

.. |build| image:: https://travis-ci.org/bio2bel/hgnc.svg?branch=master
    :target: https://travis-ci.org/bio2bel/hgnc
    :alt: Build Status

.. |coverage| image:: https://codecov.io/gh/bio2bel/hgnc/coverage.svg?branch=master
    :target: https://codecov.io/gh/bio2bel/hgnc?branch=master
    :alt: Coverage Status

.. |documentation| image:: http://readthedocs.org/projects/bio2bel-hgnc/badge/?version=latest
    :target: http://bio2bel.readthedocs.io/projects/hgnc/en/latest/?badge=latest
    :alt: Documentation Status

.. |climate| image:: https://codeclimate.com/github/bio2bel/hgnc/badges/gpa.svg
    :target: https://codeclimate.com/github/bio2bel/hgnc
    :alt: Code Climate

.. |python_versions| image:: https://img.shields.io/pypi/pyversions/bio2bel_hgnc.svg
    :alt: Stable Supported Python Versions

.. |pypi_version| image:: https://img.shields.io/pypi/v/bio2bel_hgnc.svg
    :alt: Current version on PyPI

.. |pypi_license| image:: https://img.shields.io/pypi/l/bio2bel_hgnc.svg
    :alt: MIT License

.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1162644.svg
    :target: https://doi.org/10.5281/zenodo.1162644
drf-firebase-authentication 1.0.1
A flexible Django Rest Framework Firebase authentication class
License: MIT License

# Django Rest Framework Firebase Authentication

![PyPI](https://img.shields.io/pypi/v/drf-firebase-authentication)
![PyPI - License](https://img.shields.io/pypi/l/drf-firebase-authentication)

This package provides a base Firebase Authentication backend class for the Django rest framework. Two key methods are not implemented for more flexebility. Let's [keep it simple, stupid](https://en.wikipedia.org/wiki/KISS_principle).

## Requirements

- Python 2.7 or 3.4+
- [Django](https://github.com/django/django) (version 1.11+)
- [Django Rest Framework](https://github.com/encode/django-rest-framework)
- [Firebase Admin Python](https://github.com/firebase/firebase-admin-python)

## Installation

```pip install drf-firebase-authentication```

## Usage

#### 1. Subclass `BaseFirebaseAuthentication` and implement its template methods:

Decide by yourself how you want to associate Firebase users with local django users by implementing the `.get_django_user()` method accordingly.

Put your code into a `authentication.py` file inside an app dedicated to your projects REST Api.

```python
from drf_firebase.authentication import BaseFirebaseAuthentication
from firebase_admin import credentials, initialize_app
from django.contrib.auth import get_user_model

firebase_creds = credentials.Certificate('path/to/firebase/credentials.json')
firebase_app = initialize_app(firebase_creds)

class FirebaseAuthentication(BaseFirebaseAuthentication):
	"""
	Example implementation of a DRF Firebase Authentication backend class
	"""
	def get_firebase_app(self):
		return firebase_app

	def get_django_user(self, firebase_user_record):
		return get_user_model().objects.get_or_create(
			username=firebase_user_record.uid,
		)[0]
```

#### 2. Add the just created Firebase authentication backend to your `settings.py`:

Replace `YOUR_RESTAPI_APP` with the app you put your `authentication.py` file in.

```python
REST_FRAMEWORK = {
	'DEFAULT_AUTHENTICATION_CLASSES': (
		'rest_framework.authentication.SessionAuthentication', # default
		'rest_framework.authentication.BasicAuthentication', # default
		'YOUR_RESTAPI_APP.authentication.FirebaseAuthentication',
	),
}
```