semvec/pypi-packages huggingface dataset:
django-model-publisher-mj 0.6.1
Handy mixin/abstract class for providing a "publisher workflow" to arbitrary Django models.

=========================
Django Model Publisher AI
=========================

Django model mixins and utilities for a standard publisher workflow.

This is a fork of `django-model-publisher
<https://github.com/jp74/django-model-publisher>`_.

``django-model-publisher-ai`` supports `Django`_ 1.8 through 1.11 (latest bugfix
release in each series only) on Python 2.7, 3.3 (Django 1.8 only), 3.4, and 3.5.

.. _Django: http://www.djangoproject.com/

This app is available on `PyPI`_.

.. _PyPI: https://pypi.python.org/pypi/django-model-publisher-ai/


Getting Help
============

Documentation for django-model-publisher is available at https://django-model-publisher.readthedocs.org.


Quickstart
==========

Install django-model-publisher-ai:

``pip install django-model-publisher-ai``


Features
========

- Django CMS placeholders support.
- Hvad/Parler support.
- Restrict user access to publish functions with user permissions.
objectify-json 0.2.19
Make accessing JSON like data more convenient.
Keywords: json

# Objectify JSON

Make accessing JSON like data more convenient.

## Features

* Access dict value via dot `.` (`data.a.b.c`).
* Always return `ObjectifyJSON` type, which holds the data with type of dict, list or any other primitive types.
* Use `x._data` to get the real data.
* Always return `ObjectifyJSON(None)` if doesn't exist.
* An CLI tool named `object` to process JSON data.

## Install

```
pip3 install objectify-json
```

## Example

See `test.py`

## Functions to process data in batch

* The return value is always `ObjectifyJOSN` too!
* The return value of lambda funtions will always be unwrapped to primitive types.
* Most of the `fn_*` functions accept optional `unwrap` parameter to enable passing the underlying value as primitive types to lambda. Default is False.
* When used in CLI tool, if it failed getting the property by property name, e.g. `map`, it will retry to get function with prefix `fn_` added to the name. This will simplify writting the CLI command.

### Common

Following methods of `ObjectifyJOSN` accept optional `unwrap` to unwrap `ObjectifyJOSN` data to the underlying built-in data, the default value is `False`.

* `fn_map(fn, unwrap=False)`: `map` on the iterator
* `fn_reduce(fn, initializer=None, unwrap=False)`: `reduce` on the iterator, lambda as the first positional parameter, optional `initializer` parameter will be passed to built-in `reduce`.
* `fn_lambda(fn, unwrap=False)`: value in-and-out
* `fn_filter(fn, unwrap=False)`: `filter` on the iterator

### Dict

* `fn_keys()`: Return keys as list.
* `fn_values()`: Return values as list.
* `fn_items()`: Return items as list. Element has the type `tuple`, e.g. `("key", "value")`.
* `fn_include_keys(keys)`: Filter dict. Keep the `keys` you give.
* `fn_exclude_keys(keys)`: Filter dict. Remove the `keys` you give.
* `fn_filter_by_value(fn)`: Filter dict. Filter by the lambda you give, which accept the value of dict item.
* `fn_filter_by_kv(fn)`: Filter dict. Filter by the lambda you give, which accept `key` and `value` two variables.
* `fn_update(key, fn, unwrap=False)`: Update dict value. The lambda you give accept the origin value and return a new value.
* `fn_items_update(fn, unwrap=False)`: Update dict value. The lambda you give accept `key` and `value` two variables and return a new value.
* `fn_rename(mapping)`: Update dict key. The `mapping` is a list of two-elements list.

### List

* `fn_sort(fn)`: Sort the list in place. The lambda you give will be passed as `key` argument to the `sort` method of list.
* `fn_dedup(fn=None, all=True)`: Dedup the elements in list. If `all` if `False`, the duplication will checked by comparing current value between last value, else will compare to all appeared before.