semvec/pypi-packages huggingface dataset:
django-mobi2 1.0.2
Django middleware and view decorator to detect phones and small-screen devices
Keywords: Django UserAgent

Author: Ken Cochrane
Fork of: http://minidetector.googlecode.com
Fork Description: I reorganized the code, added caching, and made a few tweaks here and there.
Description: Django middleware and view decorator to detect phones and small-screen devices
Version: 0.1.7
Last Update: 11/17/2013

Requirements:
-------------
Django 1.1 or newer
Django caching to be enabled if you want to cache the objects

How to use:
-----------
Using django-mobi is very simple. Simply place the mobi package into your project's path, and then do one of the following:


Using the mobi.middleware.MobileDetectionMiddleware Middleware
---------------------------------------------------
This middleware will scan all incoming requests to see if it is a mobile device. If it is it will set the request.mobile property to True.

To use all you have to do is `add mobi.middleware.MobileDetectionMiddleware` to your `MIDDLEWARE_CLASSES` tuple in your `settings.py`

Then in your view you can check request.mobile - if it's True then treat it like a small screen device. If it's False then it's probably a desktop browser, or a spider or something else.

If you want to have some items not triggered by the middleware (for example iPad) then add a settings called MOBI_USER_AGENT_IGNORE_LIST and add the item to the list.

MOBI_USER_AGENT_IGNORE_LIST = ['ipad',]

If you want to distinguish tablet devices from phones, then set MOBI_DETECT_TABLET = True and use request.tablet attribute

{% if not request.mobile or request.tablet %}
	<p>This section enabled only for descktop and tablets</p>
{% endif %}




Using the mobi.middleware.MobileRedirectMiddleware Middleware
---------------------------------------------------
This middleware will scan all incoming requests to see if it is a mobile device, if so it will redirect the request to a different URL. This is good if you want to force all mobile traffic to a mobile only version of your site.

To use all you have to do is add `mobi.middleware.MobileRedirectMiddleware` to your `MIDDLEWARE_CLASSES` tuple in your `settings.py`, and also add MOBI_REDIRECT_URL = "http://example.mobi" where http://example.mobi is the website you want to redirect all mobile traffic.


Not using the Middleware
------------------------
If you only have certain views that need the distinction, you can choose not to search every request you receive. All you need to do is wrap the relevant views like this:

from mobi.decorators import detect_mobile

@detect_mobile
def my_mobile_view(request):
    if request.mobile:
        #do something with mobile
systemsim 0.22
Simulator for dynamical feedback systems and networks.
Requires Python: >=3
Keywords: dynamics simulation control

systemsim: a python simulator for dynamical systems and networks
================================================================

A general purpose Python simulator for networks of systems with the dynamics :math:`\dot{\boldsymbol{x}}_i=\boldsymbol{f}_i(\boldsymbol{x}_i,\boldsymbol{u}_i,t)` and the output :math:`\boldsymbol{y}_i=\boldsymbol{h}_i(\boldsymbol{x}_i,t)`.

This package is compatible with Python 3 and requires ``numpy`` for matrix and vector operations, ``sympy`` for symbolic derivations, and ``scipy`` for ODE integration.

Though not required, it is recommended to use this simulator in a ``jupyter`` notebook. Any library can be used to generate graphs, but the provided examples rely on ``plotly`` to generate interactive plots.

Examples and usage instructions are given in this repository_.

This package was developed to generate simulation results in the MSc thesis entitled *Distributed Control of Underactuated and Heterogeneous Mechanical Systems* which can be viewed here_.

.. _repository: https://github.com/laurensvalk/systemsim-examples
.. _here: https://repository.tudelft.nl/