semvec/pypi-packages huggingface dataset:
priority_redis_queue 0.0.4
priority_redis_queue
Requires Python: <4.0,>=3.10

# Sentieo Redis Queue

[![Python Version](https://img.shields.io/pypi/pyversions/sentieos3)][python version]

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]

[python version]: https://pypi.org/project/sentieos3
[tests]: https://github.com/ShubhamBansal1997/sentieos3/actions?workflow=Tests
[codecov]: https://app.codecov.io/gh/ShubhamBansal1997/sentieos3
[pre-commit]: https://github.com/pre-commit/pre-commit
[black]: https://github.com/psf/black

## Installation

You can install _SentieoRedisQueue_ via [pip] from [PyPI]:

```console
$ pip install --extra-index-url https://api.packagr.app/PLesWotlL redis-queue==0.0.2
```

## Documentation

SentieoRedisQueue is a queueing system implemented using Redis Sorted Sets

## Usage

```python
from priority_redis_queue.queue import RedisQueue
queue = RedisQueue("queue_name", "redis_host", "port")
queue.push_to_pipeline("item_1") # push to queue
queue.consumer_pipeline() # process the queue
```

## Development

- Clone this repository
- Requirements:
  - [Poetry](https://python-poetry.org/)
  - Python 3.10+
- Create a virtual environment and install the dependencies

```sh
make poetry-download
```

- Activate the virtual environment

```sh
make env
```

### Testing

```sh
make test
```

### Pre-commit

Pre-commit hooks run all the auto-formatters (e.g. `black`, `isort`), linters (e.g. `mypy`, `flake8`), and other quality
checks to make sure the changeset is in good shape before a commit/push happens.

You can install the hooks with (runs for each commit):

```sh
pre-commit install
```

Or if you want them to run only for each push:

```sh
pre-commit install -t pre-push
```

Or if you want e.g. want to run all checks manually for all files:

```sh
pre-commit run --all-files
```

---

## Contributing

Contributions are very welcome.
jsonschema-cli2 1.3.2
A thin wrapper over to allow validating schemas easily using simple CLI commands.
Requires Python: >=3.8

This is based on the frok from [jsonschema-cli](https://github.com/eyal-mor/jsonschema-cli.git).

# JsonSchema CLI

A thin wrapper over [Python Jsonschema](https://github.com/Julian/jsonschema) to allow validating shcemas easily using simple CLI commands.

## Installing

`pip install jsonschema-cli2`

## Security

The `$ref` resolving will automatically resolve to any path using basic `$ref` notation:

```json
{"$ref": "my-custom.json#...."}
```

That means that when using this tool, an attacker may do the following:

```json
{"$ref": "../../../../all-my-secrets.json"}
```

To make sure this doesn't happen:

1. When using this tool in a backend server, make sure the file access is scoped.
2. Don't run JSONSCHEMAS without sanitizing paths.
3. Treat all un-knwon user input as evil.

This has no actual current  affect other than loading the contets of secrets into memory of the process.
But may lead to misfortune if not addressed.

## Usgae

Using `jsonschema-cli --help`

```bash
usage: jsonschema-cli [-h] {validate} ...

A wrapper around https://github.com/Julian/jsonschema to validate JSON using the CLI

positional arguments:
  {validate}  Validate thet json data with a schema
    validate  Validate

optional arguments:
  -h, --help  show this help message and exit
```

### Validate

Using `jsonschema-cli validate --help`

```bash
usage: jsonschema-cli validate [-h] schema_file_or_string data_file_or_string

positional arguments:
  schema_file_or_string
                        The schema you want to use to validate the data
  data_file_or_string   The data you want validated by the schema

optional arguments:
  -h, --help            show this help message and exit
```

### Examples

```bash
# Returns no errors on stdout, no output needed on success (just exit code 0 is enough)
jsonschema-cli validate '{"properties": {"number": {"type": "integer"}}, "required": ["number"]}' '{"number": 123}'
# Has an error, "number" is now "123" instead of 123, an integer is expected.
jsonschema-cli validate '{"properties": {"number": {"type": "integer"}}, "required": ["number"]}' '{"number": "123"}'
> '123' is not of type 'integer'
>
> Failed validating 'type' in schema['properties']['number']:
>     {'type': 'integer'}
>
> On instance['number']:
>     '123'
```

## Load YAML

The CLI command can read YAML and validate both schema and data written in YAML

```bash
# Returns no errors on stdout, no output needed on success (just exit code 0 is enough)
SCHEMA="
properties:
  number:
    type: integer
"
DATA="
number: 123
"
jsonschema-cli validate "$SCHEMA" "$DATA"
# Has an error, "number" is now "123" instead of 123, an integer is expected.
SCHEMA="
properties:
  number:
    type: integer
"
DATA="
number: \"123\"
"
jsonschema-cli validate "$SCHEMA" "$DATA"
> '123' is not of type 'integer'
>
> Failed validating 'type' in schema['properties']['number']:
>     {'type': 'integer'}
>
> On instance['number']:
>     '123'
```