semvec/pypi-packages huggingface dataset:
django-auditable-model 0.1.4
A Django app providing reusable abstract models.
License: MIT

# About
This library creates Abstract models which will be used to reduce work across all the models of your application. You can
just import the library and inherit it in other models to make usage of its functionality.

## Usage

```
from django_auditable_models.models import AbstractAuditableModel

class MyModel(models.Model,AbstractAuditableModel):
    name = models.CharField(max_length = 150,null=True,blank=True)
    
test = MyModel()
test.name = 'TestName'
test.save()

print(test.created_on)

```

### Use the Mixin in Your Serializers

When defining serializers for your models, inherit from both `AuditableModelMixin` and `serializers.ModelSerializer` (or any other base serializer class you're using). The `AuditableModelMixin` ensures that the `created_by` field is automatically populated from the request context.

```python
from myapp.models import MyModel
from rest_framework import serializers
from django_auditable_models.serializers import AuditableModelMixin

class MyModelSerializer(AuditableModelMixin, serializers.ModelSerializer):
    class Meta:
        model = MyModel
        fields = ['id', 'name', 'created_by']
        read_only_fields = ('created_by',)
```

### Ensure the Request Context is Passed to the Serializer

In your views, ensure that the serializer's context includes the request object. This is automatically handled if you're using DRF's generic views or viewsets.

```python
from myapp.models import MyModel
from myapp.serializers import MyModelSerializer
from rest_framework import generics

class MyModelListCreateAPIView(generics.ListCreateAPIView):
    queryset = MyModel.objects.all()
    serializer_class = MyModelSerializer
```

If you're not using DRF's view classes that automatically pass the context, make sure to include the request context manually when initializing the serializer.

```python
serializer = MyModelSerializer(data=request.data, context={'request': request})
```

### Advantages

- **Separation of Concerns**: This approach keeps the logic for assigning the `created_by` field within the API layer, maintaining a clear separation from the model layer.
- **Flexibility and Reusability**: By using a mixin, you can easily apply this functionality to any serializer without duplicating code.
- **Explicit Context Usage**: It leverages the serializer context, which is explicitly designed for passing additional information like the request object, ensuring that the implementation aligns with DRF's design patterns.

This serializer-level solution is particularly suited for Django projects that use DRF for building APIs, providing a clean, reusable way to automatically handle `created_by` fields across different models and serializers.
docstring_parser 0.16
Parse Python docstrings in reST, Google and Numpydoc format
License: MIT
Requires Python: >=3.6,<4.0

docstring_parser
================

[![Build](https://github.com/rr-/docstring_parser/actions/workflows/build.yml/badge.svg)](https://github.com/rr-/docstring_parser/actions/workflows/build.yml)

Parse Python docstrings. Currently support ReST, Google, Numpydoc-style and
Epydoc docstrings.

Example usage:

```python
>>> from docstring_parser import parse
>>>
>>>
>>> docstring = parse(
...     '''
...     Short description
...
...     Long description spanning multiple lines
...     - First line
...     - Second line
...     - Third line
...
...     :param name: description 1
...     :param int priority: description 2
...     :param str sender: description 3
...     :raises ValueError: if name is invalid
...     ''')
>>>
>>> docstring.long_description
'Long description spanning multiple lines\n- First line\n- Second line\n- Third line'
>>> docstring.params[1].arg_name
'priority'
>>> docstring.raises[0].type_name
'ValueError'
```

Read [API Documentation](https://rr-.github.io/docstring_parser/).

# Installation

Installation using pip

```shell
pip install docstring_parser

# or if you want to install it in a virtual environment

python -m venv venv # create environment
source venv/bin/activate # activate environment
python -m pip install docstring_parser
```

Installation using conda


1. Download and install miniconda or anaconda
2. Install the package from the conda-forge channel via:
  - `conda install -c conda-forge docstring_parser`
  - or create a new conda environment via `conda create -n my-new-environment -c conda-forge docstring_parser`


# Contributing

To set up the project:
```sh
pip install --user poetry

git clone https://github.com/rr-/docstring_parser.git
cd docstring_parser

poetry install
poetry run pre-commit install
```

To run tests:
```
poetry run pytest
```
named 1.4.2
Named types.
License: MIT
Requires Python: >=3.8
Keywords: python,named,name

# `named`

[![License][License Badge]][License]
[![Version][Version Badge]][Package]
[![Downloads][Downloads Badge]][Package]
[![Discord][Discord Badge]][Discord]

[![Documentation][Documentation Badge]][Documentation]
[![Check][Check Badge]][Actions]
[![Test][Test Badge]][Actions]
[![Coverage][Coverage Badge]][Coverage]

> *Named types.*

## Installing

**Python 3.8 or above is required.**

### pip

Installing the library with `pip` is quite simple:

```console
$ pip install named
```

Alternatively, the library can be installed from source:

```console
$ git clone https://github.com/nekitdev/named.git
$ cd named
$ python -m pip install .
```

### poetry

You can add `named` as a dependency with the following command:

```console
$ poetry add named
```

Or by directly specifying it in the configuration like so:

```toml
[tool.poetry.dependencies]
named = "^1.4.2"
```

Alternatively, you can add it directly from the source:

```toml
[tool.poetry.dependencies.named]
git = "https://github.com/nekitdev/named.git"
```

## Example

```python
>>> from named import get_name, get_type_name, is_named
>>> print(is_named(int))
True
>>> print(get_name(int))
int
>>> print(is_named(42))
False
>>> print(get_type_name(42))
int
```

## Documentation

You can find the documentation [here][Documentation].

## Support

If you need support with the library, you can send an [email][Email]
or refer to the official [Discord server][Discord].

## Changelog

You can find the changelog [here][Changelog].

## Security Policy

You can find the Security Policy of `named` [here][Security].

## Contributing

If you are interested in contributing to `named`, make sure to take a look at the
[Contributing Guide][Contributing Guide], as well as the [Code of Conduct][Code of Conduct].

## License

`named` is licensed under the MIT License terms. See [License][License] for details.

[Email]: mailto:support@nekit.dev

[Discord]: https://nekit.dev/chat

[Actions]: https://github.com/nekitdev/named/actions

[Changelog]: https://github.com/nekitdev/named/blob/main/CHANGELOG.md
[Code of Conduct]: https://github.com/nekitdev/named/blob/main/CODE_OF_CONDUCT.md
[Contributing Guide]: https://github.com/nekitdev/named/blob/main/CONTRIBUTING.md
[Security]: https://github.com/nekitdev/named/blob/main/SECURITY.md

[License]: https://github.com/nekitdev/named/blob/main/LICENSE

[Package]: https://pypi.org/project/named
[Coverage]: https://codecov.io/gh/nekitdev/named
[Documentation]: https://nekitdev.github.io/named

[Discord Badge]: https://img.shields.io/discord/728012506899021874
[License Badge]: https://img.shields.io/pypi/l/named
[Version Badge]: https://img.shields.io/pypi/v/named
[Downloads Badge]: https://img.shields.io/pypi/dm/named

[Documentation Badge]: https://github.com/nekitdev/named/workflows/docs/badge.svg
[Check Badge]: https://github.com/nekitdev/named/workflows/check/badge.svg
[Test Badge]: https://github.com/nekitdev/named/workflows/test/badge.svg
[Coverage Badge]: https://codecov.io/gh/nekitdev/named/branch/main/graph/badge.svg