semvec/pypi-packages huggingface dataset:
django-declarative-apis 0.34.2
Simple, readable, declarative APIs for Django
Keywords: django, rest, declarative, api

[![Documentation Status](https://readthedocs.org/projects/django-declarative-apis/badge/?version=stable)](https://django-declarative-apis.readthedocs.io/en/stable/?badge=stable)


Overview
========

django-declarative-apis is a framework built on top of Django aimed at teams implementing RESTful APis. It provides a simple interface to define endpoints declaratively. Some benefits to using django-declarative-apis:

-   Define endpoints declaratively
-   Define model-bound and unbound resource endpoints with a consistent interface
-   OAuth 1.0a authentication out of the box
-   Define resource and endpoint-bound tasks, promoting modularity
-   Define synchronous and asynchronous tasks (asynchronous tasks implemented with Celery)
-   Separation of concerns between request body processing and business logic


Quick start
===========

This guide is intended to demonstrate the bare minimum in order to get a django-declarative-apis project up and running. The example directory contains further examples using endpoint to model relationships, authentication and response attribute filtering.

Create django app
-----------------

``` sourceCode
./manage startapp myapp
```

Add app to INSTALLED\_APPS
--------------------------

``` python
INSTALLED_APPS = [
   'django_declarative_apis',
   'myapp',
]
```

Add required config
-------------------

``` python
DECLARATIVE_ENDPOINT_RESOURCE_ADAPTER = 'django_declarative_apis.adapters.EndpointResource'
DECLARATIVE_ENDPOINT_AUTHENTICATION_HANDLERS = 'django_declarative_apis.authentication.oauthlib.oauth1.TwoLeggedOauth1'
```

myapp/urls.py
-------------

``` python
from django_declarative_apis import adapters
import myapp.resources

class NoAuth:
   @staticmethod
   def is_authenticated(request):
      return True


urlpatterns = [
    url(
        r'^ping$',
        adapters.resource_adapter(
            get=myapp.resources.PingDefinition,
            authentication=NoAuth
        )
    ),
]
```

myproject/myproject/urls.py
---------------------------

``` python
from django.conf.urls import url, include
import myapp.urls

urlpatterns = [
   url(r'^', include(myapp.urls)),
]
```

myapp/resources.py
------------------

``` python
from django_declarative_apis import machinery


class PingDefinition(machinery.BaseEndpointDefinition):
    def is_authorized(self):
        return True

    @property
    def resource(self):
        return {'ping': 'pong'}
```

Optional: Implement Custom Event Hooks for Event Emission
-----
```bash
# settings.py 
DDA_EVENT_HOOK = "my_app.hooks.custom_event_handler"
```
tottag 1.1.0
TotTag Management Dashboard
Requires Python: >=3.8

TotTag Management Dashboard
===========================

Overview
--------

This directory contains all source code for the TotTag Management Dashboard. All setup and preparation for live pilot testing should be carried out through the TotTag Dashboard.


Installation
------------

The easiest way to install this tool is through `pip` by entering:

``python3 -m pip install tottag``

If you wish to install the package manually or develop it further, you should first clone the `SociTrack repository <https://github.com/lab11/socitrack>`_ to
your hard drive, `cd` into the ``software/management`` directory, then issue the following command in a terminal:

``python3 -m pip install -e .``


Usage
-----

Once installed, the management dashboard is accessible from any terminal by entering the following command:

``tottag``

You do not need to navigate to the SociTrack source code directory to run the application.

Usage of the TotTag Dashboard should be relatively straightforward, keeping in mind a few caveats:

•	A TotTag device is only discoverable and visible if it is currently being charged. If the device is not on a charger, it will not appear in the TotTag Dashboard.
•	You will not be able to carry out any management functionality unless you are actively connected to a TotTag, so if the action buttons are grayed out, ensure that you are actually connected to a device.
•	If, at any time, the application freezes or becomes unresponsive, you can always force it to close by returning to the terminal in which you entered the “tottag” command and simultaneously pressing CTRL+C. This should cause the application to forcefully terminate.

The suggested procedure for setting up a pilot deployment is the following:

1.	Determine exactly how many TotTags will be needed for the deployment, and choose this number of devices to set aside.
2.	Make a note on a piece of scratch paper about which Device IDs should be associated with which user-friendly labels.
3.	Open the TotTag Dashboard and go to the “Deployment” tab. Do not connect to any TotTags at this time.
4.	Enter all relevant information about the upcoming deployment, including the mapping of TotTag labels to Device IDs.
5.	Once all information has been entered, ensure that all relevant TotTags are discoverable in the device bar at the top of the dashboard.
6.	Click the “Start” button to start the deployment programming process for all relevant devices.
7.	Once complete, it is a good idea to individually connect to each of the participating devices and verify that both the current time and the experiment details are correct.

After the above steps have been completed, your devices are ready for shipment and will automatically shut down until time for the deployment to begin. Upon completion of a pilot test, the first thing you should do upon receipt of the TotTags is to download all log files before putting the TotTags back into storage.