semvec/pypi-packages huggingface dataset:
django-render-partial 0.4
Django render_partial tag allows inserting rendered views into templates
Keywords: django

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


1. ``pip install django_render_partial``
2. Add ``'django_render_partial'`` to ``INSTALLED_APPS``
3. Ensure that ``'django.template.context_processors.request'`` is in
   ``TEMPLATES['OPTIONS']['context_processors']``


Usage
=====

Write a template for partial view, e.g. ``partial_view.html``::

    <p>{{ arg1 }} + {{ arg2 }} = {{ result }}</p>

Write a partial view::

    def partial_view(request, *args, **kwargs):
        result = kwargs['arg1'] + kwargs['arg2']
        kwargs['result'] = result
        return render(request, 'partial_view.html', kwargs)

if you are using function-based views, or::

    class PartialView(TemplateView):
        template_name = 'partial_view.html'

        def get_context_data(self, **kwargs):
            result = kwargs['arg1'] + kwargs['arg2']
            kwargs['result'] = result
            return super(PartialView, self).get_context_data(**kwargs)

if you are using class-based views.


Add it to ``urls.py``::

    url(r'^partial-view/(?P<arg1>\w+)/(?P<arg2>\w+)/$',
        partial_view,
        name='partial_view'),

or::

    url(r'^partial-view/(?P<arg1>\w+)/(?P<arg2>\w+)/$',
        PartialView.as_view(),
        name='partial_view'),

In your template::

    {% load render_partial %}
    {% with some_var=2 %}
      {% render_partial 'partial_view' arg1=40 arg2=some_var %}
    {% endwith %}

The ``render_partial`` tag would be rendered to::

    <p>40 + 2 = 42</p>

Note that the ``with`` tag above is not required for ``render_partial``
to work. It is used to show that ``render_partial`` accepts variables.
Every argument will be evaluated against context except for the names of
any keyword arguments.

If you don't want to expose your partial view in ``urls.py``, you can
also use fully qualified dot separated view name::

  {% render_partial 'partial_test.views.PartialView' arg1=40 arg2=some_var %}
  {% render_partial 'partial_test.views.partial_view' arg1=40 arg2=some_var %}


**IMPORTANT**: the calling template must receive a context variable called
``request`` containing the original ``HttpRequest``. Don't forget to add
``'django.template.context_processors.request'`` to
``TEMPLATES['OPTIONS']['context_processors']``.


Adapted from https://djangosnippets.org/snippets/1568/
ig-streaming-client 0.1
IG streaming API client
Keywords: IG trading

# IG streaming API client

Small Python library to connect to [IG](https://www.ig.com/) streaming API (more information and API reference is available on [IG Labs](https://labs.ig.com/) website).

## Installation

To use most recent release:

```bash
pip install ig-streaming-client
```

To use current master branch:

```bash
pip install git+https://github.com/wjszlachta/ig-streaming-client.git
```

## Usage

For demo account:

```python
import time

from ig_streaming_client import IgStreamingSession
from lightstreamer_client import LightstreamerSubscription

api_key = '...'
account_id = '...'
rest_api_username = '...'
rest_api_password = '...'

session = IgStreamingSession(api_key, account_id, rest_api_username, rest_api_password)

subscription = LightstreamerSubscription('MERGE',
                                         ['MARKET:CS.D.BITCOIN.TODAY.IP'],
                                         ['UPDATE_TIME', 'BID', 'OFFER'])
subscription.addlistener(lambda item: print(item))
session.subscribe(subscription)

time.sleep(30)

session.log_out()
```

For live account:

```python
import time

from ig_rest_client import IG_REST_TRADING_API_LIVE_URL
from ig_streaming_client import IgStreamingSession
from lightstreamer_client import LightstreamerSubscription

api_key = '...'
account_id = '...'
rest_api_username = '...'
rest_api_password = '...'

session = IgStreamingSession(api_key, account_id, rest_api_username, rest_api_password, rest_api_url=IG_REST_TRADING_API_LIVE_URL)

subscription = LightstreamerSubscription('MERGE',
                                         ['MARKET:CS.D.BITCOIN.TODAY.IP'],
                                         ['UPDATE_TIME', 'BID', 'OFFER'])
subscription.addlistener(lambda item: print(item))
session.subscribe(subscription)

time.sleep(30)

session.log_out()
```
ig-rest-client 0.1
IG REST trading API client
Keywords: IG trading

# IG REST trading API client

Small Python library to connect to [IG](https://www.ig.com/) REST trading API (more information and API reference is available on [IG Labs](https://labs.ig.com/) website).

## Installation

To use most recent release:

```bash
pip install ig-rest-client
```

To use current master branch:

```bash
pip install git+https://github.com/wjszlachta/ig-rest-client.git
```

## Usage

For demo account:

```python
from ig_rest_client import IgRestSession

api_key = '...'
account_id = '...'
rest_api_username = '...'
rest_api_password = '...'

session = IgRestSession(api_key, account_id, rest_api_username, rest_api_password)

print(session.session_details())

session.log_out()
```

For live account:

```python
from ig_rest_client import IgRestSession, IG_REST_TRADING_API_LIVE_URL

api_key = '...'
account_id = '...'
rest_api_username = '...'
rest_api_password = '...'

session = IgRestSession(api_key, account_id, rest_api_username, rest_api_password, rest_api_url=IG_REST_TRADING_API_LIVE_URL)

print(session.session_details())

session.log_out()
```
lightstreamer-client 0.1
Lightstreamer Python client
Keywords: lightstreamer

# Lightstreamer Python client

[Lightstreamer](https://lightstreamer.com/) Python client adapted from [Lightstreamer-example-StockList-client-python](https://github.com/Lightstreamer/Lightstreamer-example-StockList-client-python).

## Installation

To use most recent release:

```bash
pip install lightstreamer-client
```

To use current master branch:

```bash
pip install git+https://github.com/wjszlachta/lightstreamer-client.git
```
r53ddns 0.1.0b3
Route 53 Dynamic DNS Update Client

r53ddns
=======

r53ddns (Route 53 Dynamic DNS) is a simple command-line utility used to update
an AWS Route 53 DNS entry with the current public IP Address of the executing
host. Used to maintain DNS records which point to a dynamic address.

r53ddns utilizes the boto3 Python API to interface with AWS.

Usage
-----

From the commandline or via systemd/cron service.
A valid AWS credential file is required for the user executing the utility. This
is typically placed in ~/.aws/credentials or the credentials may be specified
using environment variables.

.. code-block::

    [default]
    aws_access_key_id = ACCESSKEY-ID
    aws_secret_access_key = SECRET-KEY
    region = us-west-2

The user associated with the access key requires the following AWS permissions:

- route53:ChangeResourceRecordSets
- route53:ListResourceRecordSets

Optionally the following permission is required to permit SNS notifications
(used with the --notify option or environment variable):

- sns:Publish


An example AWS JSON Policy document might look like:

.. code-block::

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "1",
                "Effect": "Allow",
                "Action": "sns:Publish",
                "Resource": "arn:aws:sns:REGION:ACCT-NO:TOPIC-NAME"
            },
            {
                "Sid": "2",
                "Effect": "Allow",
                "Action": [
                    "route53:ChangeResourceRecordSets",
                    "route53:ListResourceRecordSets"
                ],
                "Resource": "arn:aws:route53:::hostedzone/ZONEID"
            }
        ]
    }

*Note the Resource qualifiers should be replaced with valid Resource ARN's if utilized.*

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

Requirements:

- Python >= 3.6.x

Using venv & pip
^^^^^^^^^^^^^^^^

.. code-block::

    python3 -m venv venv
    source venv/bin/activate
    pip install dnsupdater

Installation as a daemon using Systemd
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Create/install systemd service and timer unit files.
.timer will execute the .service file periodically upon boot of the OS, and
every 5 minutes thereafter.

.. code-block::

    [Unit]
    Description=route53 dynamic dns update client
    After=network.target

    [Service]
    Type=oneshot
    User=awsuser
    Environment="PATH=/opt/r53ddns/venv/bin"
    ExecStart=/opt/r53ddns/venv/bin/dnsupdater

    [Install]
    WantedBy=network.target


.. code-block::

    [Unit]
    Description=Execute r53ddns periodically

    [Timer]
    OnBootSec=1min
    OnUnitActiveSec=5min

    [Install]
    WantedBy=timers.target