semvec/pypi-packages huggingface dataset:
desec-dns-api 1.3.0
Wrapper for desec DNS API
Requires Python: >=3.6
Keywords: desec dns api

[![pipeline status](https://gitlab.com/XenGi/desec-dns-api/badges/master/pipeline.svg)](https://gitlab.com/XenGi/desec-dns-api/commits/master)
[![coverage report](https://gitlab.com/XenGi/desec-dns-api/badges/master/coverage.svg)](https://gitlab.com/XenGi/desec-dns-api/commits/master)
[![pypi](https://img.shields.io/pypi/v/desec-dns-api)](https://pypi.org/project/desec-dns-api/)
[![aur](https://img.shields.io/aur/version/python-desec-dns-api)](https://aur.archlinux.org/packages/python-desec-dns-api/)

# desec-dns-api

Python library wrapper for [deSEC DNS API][desec]. Used by [desec-dns-cli][cli] and [ansible-desec-dns][ansible].

# Installation

Arch Linux:

```
yay -S python-desec-dns-api
```

Python:

```
pip install desec-dns-cli
```

# Usage

Here's a simple example:

```python
>>> from desec_dns_api.account import login, info
>>> mytoken = login('foobar@example.com', 'supersecure123!')
>>> myinfo = info(mytoken.token)
>>> print(myinfo.email)
'foobar@example.com'
```

---

Made with ❤️ and 🐍.


[desec]: https://desec.io
[cli]: https://gitlab.com/xengi/desec-dns-cli
[ansible]: https://gitlab.com/xengi/ansible-desec-dns
python-polar-coding 0.0.1
Polar coding implementation in Python
Requires Python: >=3.6, <4
Keywords: polar codes,fec,simulation

# Python-polar-coding

A package for Polar codes simulation.

## Installation

```bash
pip install python-polar-coding
```

## Example

Here is a simple example of simulation using `python_polar_coding`.

Binary messages encoded with Polar code, modulated using BPSK, transmitted over
channel with AWGN and decoded using [Fast SSC](https://arxiv.org/abs/1307.7154) algorithm.

```python
from python_polar_coding.channels import SimpleBPSKModulationAWGN
from python_polar_coding.polar_codes import FastSSCPolarCodec
from python_polar_coding.simulation.functions import (
    compute_fails,
    generate_binary_message,
)

N = 128
K = 64
design_snr = 2.0
messages = 10000
# SNR in [.0, .5, ..., 4.5, 5]
snr_range = [i / 2 for i in range(11)]

codec = FastSSCPolarCodec(N=N, K=K, design_snr=design_snr)
bpsk = SimpleBPSKModulationAWGN(fec_rate=K/N)

result_ber = dict()
result_fer = dict()

for snr in snr_range:
    ber = 0
    fer = 0

    for _ in range(messages):
        msg = generate_binary_message(size=K)
        encoded = codec.encode(msg)
        transmitted = bpsk.transmit(message=encoded, snr_db=snr)
        decoded = codec.decode(transmitted)

        bit_errors, frame_error = compute_fails(msg, decoded)
        ber += bit_errors
        fer += frame_error

    result_ber[snr] = ber
    result_fer[snr] = fer
```

## Current progress

### Polar code construction

- [x] Arikan's Bhattacharyya bounds [Section V.A](https://arxiv.org/pdf/1501.02473.pdf)

### Decoding
- [x] SC Decoding
- [x] [SC LIST Decoding](https://arxiv.org/abs/1206.0050)
- [x] [Fast SSC Decoding](https://arxiv.org/abs/1307.7154)
- [x] [RC SCAN Decoding]()
- [x] [Generalized Fast SSC Decoding](https://arxiv.org/pdf/1804.09508.pdf)

### Modulation

- [x] BPSK

## TODO

### Polar code construction

- [ ] Arikan’s Monte-Carlo estimation [Section V.B](https://arxiv.org/pdf/1501.02473.pdf)
- [ ] Trifonov’s Gaussian approximation [Section V.D](https://arxiv.org/pdf/1501.02473.pdf)

### Decoding
- [ ] [SC STACK Decoding](https://ieeexplore.ieee.org/document/6215306)
- [ ] [Fast SSC List Decoding](https://arxiv.org/pdf/1703.08208.pdf)
- [ ] [Generalized Fast SSC LIST Decoding](https://arxiv.org/pdf/1804.09508.pdf)
- [ ] CRC-aided decoders

### Modulation

- [ ] Q-PSK
- [ ] 4-QAM

## License

[MIT License](LICENSE.txt)
lonny-common-pg-queue 0.1.1
A lightweight distributed queue using a postgres DB.
Requires Python: >=3.8,<4.0

# `lonny_common_pg_queue`

A lightweight distributed queue using a postgres DB.

## Installation

```bash
pip install lonny_common_pg_queue
```

## Usage

The first step is importing the `Queue` class. This can be done as:

```python
from lonny_common_pg_queue import Queue
```

We then need to ensure the requisite queue table is implemented. This can be done by passing a `lonny_common_pg` connection object to the `Queue.setup(db)` method (This method is idempotent and can be run multiple times).

To create a `queue` object simply invoke the constructor with a `lonny_common_pg` connection and a mandatory `namespace`:

```python
queue_1 = Queue(db, "queue_1")
queue_2 = Queue(db, "queue_2")
```

The messages placed in these queues will be isolated from one another.

To enqueue objects, simply call `queue.put(obj)` on any JSON serializable object.

To retrieve an object from the queue, call `queue.get()`. This will return a `Message` object. The underlying payload can be accessed via `message.payload`. Messages work similar to how they work in AWS SQS - messages retrieved from the queue are immediately "locked". In this state they cannot be retrieved by another consume. After a timeout, they become unlocked and can be accessed as before by another consumer. This happens a maximum number of times until the message is deleted permanently. 

Once you are done with a message, you should call `.consume()` on it - this will prevent it being accessed again at a later point. To simplify this procedure, we can use the `with` syntax:

```python
with queue.get() as payload:
    do_stuff(payload)
```

If we leave the block with no exception, the message is consumed/deleted as expected. However, if something goes wrong, `consume` isn't called, giving us another chance in the future to handle this message.
lonny-common-pg 0.1.0
A quality-of-life wrapper for the psycopg2 connection object.
Requires Python: >=3.8,<4.0

# `lonny_common_pg`

A quality-of-life wrapper for the psycopg2 connection object.

## Installation

```bash
pip install lonny_common_pg
```

## Usage

To import the connection object, simply do:

```python
from lonny_common_pg import Connection
```

 - The connection object constructor takes `host`, `port`, `dbname`, `user` and `password` kwargs.
 - The connection isn't initialized until a query is made or `init` is explicitly called.
 - The connection can be closed by using `close` - however it can be subsequently re-opened at anytime. When used in a `with` contextmanager context - the connection is closed when leaving the block.
 - The 3 methods for querying the database are: `execute`, `fetch_one` and `fetch_all`. All of these can either take a SQL string, or a callable (see the `lonny_sql` module for usage).
 - This connection wrapper uses `autocommit` mode and the `DictCursor` for returning results.

 ### Nested Transactions

Nested transactions are possible using this library. The outermost transaction uses a standard `TRANSACTION` construct. Inner transactions use a `SAVEPOINT` instead.

```python
conn = Connection(**kwargs)
with conn.transaction():
    try:
        do_something_else()
        with conn.transaction():
            do_something()
    except:
        pass
```
Flexihash 1.5.1
Python port of PHP Flexihash

flexihash-py
============

![Unit Tests](https://github.com/shish/flexihash-py/workflows/Unit%20Tests/badge.svg)

A python port of https://github.com/pda/flexihash , aiming for 1:1 compatibility


Usage Example
-------------

```
import flexihash

hash = flexihash.Flexihash()

# bulk add
hash.addTargets(['cache-1', 'cache-2', 'cache-3'])

# simple lookup
hash.lookup('object-a')  # "cache-1"
hash.lookup('object-b')  # "cache-2"

# add and remove
hash \
  .addTarget('cache-4') \
  .removeTarget('cache-1')

# lookup with next-best fallback (for redundant writes)
hash.lookupList('object', 2)  # ["cache-2", "cache-4"]

# remove cache-2, expect object to hash to cache-4
hash.removeTarget('cache-2')
hash.lookup('object')  # "cache-4"
```
lonny-common-sql 0.1.1
A library for building inline SQL queries safely using python callables.
Requires Python: >=3.8,<4.0

# `lonny_common_sql`

A library for building inline SQL queries safely using python `callables`.

## Installation:

```bash
pip install lonny_common_sql
```

## Usage:

Usage is very straightforward. Please see example below:

```python
from lonny_common_sql import build

table = "TABLE"
value = "VALUE"

sql, params = build(lambda w: f"""
    SELECT * FROM {table}
    WHERE value = {w(value)}
""")
```

We simply pass `build` a callable that takes a `wrapper` argument. This wrapper is itself a `callable` that returns the substituted parameter name whilst simultaneously adds the value to the parameter dictionary to be returned along with the finalized SQL.
odi-token-contracts 0.0.5
Implementation of Mintable, Burnable, Capped, Pausable and Snapshot IRC2 token that can be used as standard token equivalent to ERC20 for ICON blockchain.
Requires Python: >=3.6

# ODI Token Contracts

OpenDevICON Token Contracts implement IRC2 standard token which is equivalent to [ERC20](https://eips.ethereum.org/EIPS/eip-20) for [ICON](https://icon.foundation/?lang=en) blockchain. It helps to keep track of [fungible](https://en.wikipedia.org/wiki/Fungibility) tokens.

There are a few core contracts to implement IRC2 token.

-   [IIRC2](https://github.com/icon-project/IIPs/blob/master/IIPS/iip-2.md): Interface IRC2 methods should confirm into.
-   [IRC2](https://docs.opendevicon.io/v/development/score-library/irc2standard): The base implementation of IRC2 contract.

This has been extended to implement the following.

-   [IRC2Mintable](https://docs.opendevicon.io/v/development/score-library/irc2standard/irc2mintable): To create token supply.
-   [IRC2Capped](https://docs.opendevicon.io/v/development/score-library/irc2standard/irc2capped): Total supply cannot exceed the cap amount.
-   [IRC2Burnable](https://docs.opendevicon.io/v/development/score-library/irc2standard/irc2burnable): To destroy the tokens.
-   [IRC2Pausable](https://docs.opendevicon.io/v/development/score-library/irc2standard/irc2pausable): To pause token operation for all users.
-   [IRC2Snapshot](https://docs.opendevicon.io/v/development/score-library/irc2standard/irc2snapshot): To add snapshot mechanism.

> Visit [OpenDevICON]("https://docs.opendevicon.io/v/development/") for more info.