semvec/pypi-packages huggingface dataset:
pysensu-ng 0.13.0
This is a client to interact with the Sensu API
License: MIT
Keywords: pysensu

=============================
Sensu client for python
=============================

.. image:: https://badge.fury.io/py/pysensu-ng.svg
    :target: https://badge.fury.io/py/pysensu-ng

.. image:: https://travis-ci.org/sangoma/pysensu.png?branch=master
    :target: https://travis-ci.org/sangoma/pysensu

.. image:: https://pypip.in/d/pysensu-ng/badge.png
    :target: https://pypi.python.org/sangoma/pysensu-ng


This is a client to interact with the Sensu API


Features
--------

- Includes methods for some entrypoints (clients, events, checks, stashes) of the Sensu API (0.24)
  **IMPORTANT**: from 0.6.0 release we are supporting Sensu API 0.24+ .. backward
  compatibility with previous versions of Sensu API might be broken.
- Includes methods for handle subscriptions info (nodes subscribed to a
  specific channel)


Trivial Example
---------------

::

    from pysensu.api import SensuAPI

    url = 'http://localhost:4567'
    my_sensu = SensuAPI(url, username=username, password=password)
    print(my_sensu.get_info())

DEBUG
---------------
To enable debug import logging module and set the debug level

::

    import logging
    logging.getLogger('pysensu.api').setLevel(logging.DEBUG)

Exceptions
---------------
You can handle an exception using a code like this.
Note: Sensu API give you a 404 code if a client does not exists.

::

    import pysensu.api

    url = 'http://localhost:4567'
    my_sensu = pysensu.api.SensuAPI(url)
    client = "testclient"

    try:
        print(my_sensu.get_client_data(client))
    except pysensu.api.SensuAPIException as e:
        if "404" in str(e):
            print("{} does not exists on sensu api".format(client))
        else:
            raise e



Documentation
-------------

The full documentation is at http://pysensu.rtfd.org.



History
-------

0.13.0 (2019-07-23)
~~~~~~~~~~~~~~~~~~~

0.10.0 (2017-05-17)
~~~~~~~~~~~~~~~~~~~

* Add support for results API

0.9.0 (2017-03-13)
~~~~~~~~~~~~~~~~~~

* Add support for silenced API

0.8.0 (2016-11-28)
~~~~~~~~~~~~~~~~~~

* Added operations for Aggregates and Status (Health/Info)
* Added support for optional limit/offset parameters to get_clients
* Modified post_check_request to work properly with subscribers.

0.7.0 (2016-08-17)
~~~~~~~~~~~~~~~~~~

* Fix adding stashes

0.6.0 (2016-08-02)
~~~~~~~~~~~~~~~~~~

* Fix calls to Sensu API entrypoints in order to make them compatible
  with lastest version of Sensu API (0.24) previous versions of Sensu API
  might not behave as expected.

0.1.0 (2015-12-15)
~~~~~~~~~~~~~~~~~~

* First release on PyPI.
django-easy-subscription 0.1.0
A Django application that provides a subscription pop-up form, and can be integrated with multiple email marketing platforms.
License: MIT

========================
Django Easy Subscription
========================

A Django application that provides a subscription pop-up form, and can be integrated with multiple email marketing platforms.

.. contents::
    :local:
    :backlinks: none


Installation
============

1. ``pip install django-easy-subscription``
2. Add ``easy_subscription`` to ``INSTALLED_APPS``
3. Run `python manage.py migrate` to create the subscriber model.
4. Add an URL entry to your project's ``urls.py``, for example::

    from django.conf import settings

    if 'easy_subcription' in settings.INSTALLED_APPS:
        urlpatterns += [
            path('easy-subscription/', include('easy_subscription.urls')),
        ]

Note: you can use whatever you wish as the URL prefix.
CRSPcleaner 0.0.3
Cleans a CRSP .csv database and returns it as a Pandas Dataframe
License: MIT

# CRSPcleaner

This programme takes in a .csv format CRSP database file and returns a cleaned version as a pandas dataframe.

## Installation

Run the following to install:

```python
pip install CRSPcleaner
```

## Usage
Factors can be extracted in monthly ('m') and annual ('a') frequencies. The default is monthly.

```python
from CRSPcleaner import cleanCRSP

crsp_df = cleanCRSP()

# With CIK identifiers:
crsp_df = cleanCRSP(withCIKonly=True)

```
DjangoModelTracker 1.3.9
Track Django Model Objects over time
License: MIT
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*

# Model Tracker

Track model object changes over time so that you know who done what.
 
## Installation

* Install the package
```sh
pip install django-model-tracker
```
* Add Application to your project's INSTALLED_APPs
```python
INSTALLED_APPS = (
     '....',
    'ModelTracker',
    )
```    
* Add the following line to your urls.py
```python
import ModelTracker
urlpatterns = patterns('',
...
url(r'^track/', include('ModelTracker.urls')),
...
)
```
* Run Migrations
```sh
   python manage.py migrate ModelTracker 
```

* Add the following line to your models.py file
```python
from ModelTracker import Tracker
```
*  Convert each Model you want to track to inhert from `Tracker.ModelTracker` instead of `models.Model`
   
**Old Code**

```python
   class Employee(models.Model):
     name=models.CharField(max_length=255)
     address=models.CharField(max_length=255)
     age=models.IntegerField()
 ``` 
  **New Code**
 
   ```python
    class Employee(Tracker.ModelTracker):
      name=models.CharField(max_length=255)
      address=models.CharField(max_length=255)
      age=models.IntegerField()
```
* For each save() call, add the user the username
    * Old Code
 ```python
    emp=Employee()
    emp.save()
 ``` 
 
     * New Code
 ```python
        emp=Employee()
        emp.save(request.user.username)
 ```
* Starting from version of 0.5, you can pass a event_name parameter to mark change as an event
 
     * New Code
 ```python
        emp=Employee()
        emp.save(request.user.username,event_name="Created the user")
 ```

Using The Middleware
====================
You can add `ModelTracker.middleware.ModelTrackerMiddleware` to your Middleware classes to get the username automatically from the request.

```python
MIDDLEWARE_CLASSES = (
     '....',
    'ModelTracker.middleware.ModelTrackerMiddleware',
    )
```   

**Note:** If you pass username as `None` then the change won't be saved.