semvec/pypi-packages huggingface dataset:
django-reversion-rest-framework 3.0.0
A package for adding a django-reversion history endpoint to django-rest-framework ModelViewSet
Requires Python: >=3.10

# django-reversion-rest-framework

A package for adding a django-reversion history endpoint to django-rest-framework ModelViewSet.


## Configuration

Follow the official website for the installation and the integration of django-reversion in your project, otherwise future steps won't work.

You might need to enable the `ReversionMiddleware` for storing a version for each API change.<br>
Follow the instructions [here](https://django-reversion.readthedocs.io/en/stable/middleware.html),
you should add `'reversion.middleware.RevisionMiddleware'` to your `MIDDLEWARE` setting.


### Using the HistoryModelViewSet

The `HistoryModelViewSet` extends django-rest-framework's `ModelViewSet` adding

- a GET `history` action in the detail (`/my-model-url/<pk>/history/`)

    displaying a list of all revisions of that specific record

- a GET `version` action in the history detail (`/my-model-url/<pk>/history/<version_pk>/`)

    displaying a specific revisions of that specific record

- a GET `deleted` action in the list (`/my-model-url/deleted/`)

    displaying a list of all deleted records

- a POST `revert` action in the detail (`/my-model-url/<pk>/revert/<version_pk>/`)

    allowing users to revert to a previous revision of the object

You can use the `HistoryModelViewSet` in place of the `ModelViewSet`
during viewsets definition.

```py
from reversion_rest_framework.viewsets import HistoryModelViewSet


class MyModelViewSet(HistoryModelViewSet):
    # ...
```

For advanced or selective implementation, you can use `reversion_rest_framework.mixins`.

- `HistoryMixin` contains `history` and `version` actions

- `DeletedMixin` contains only the `deleted` action

- `RevertMixin` contains `history`, `version` and `revert` actions


### Customizing the VersionSerializer

The `HistoryModelViewSet` comes up with actions using a `VersionSerializer`.<br>
To customize the serializer with one of your own, you can use `version_serializer`.<br>
For example, if you want to customize the `user` serializer inside a revision,
you can use the following code:

```py
from django.contrib.auth.models import User
from rest_framework import serializers
from reversion.models import Revision, Version
from reversion_rest_framework.serializers import (
    RevisionSerializer,
    VersionSerializer,
)
from reversion_rest_framework.viewsets import HistoryModelViewSet


class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ["id", "username"]


class CustomRevisionSerializer(RevisionSerializer):
    user = UserSerializer()


class CustomVersionSerializer(VersionSerializer):
    revision = CustomRevisionSerializer()


class MyModelViewSet(HistoryModelViewSet):
    version_serializer = CustomVersionSerializer
    # ...
```
find-reference-genomes 1.1.2
Easily find and download reference genomes stored at NCBI

# find_reference_genomes

Easily find and download reference genomes stored at NCBI

# Dependencies
- [NCBI datasets](https://github.com/ncbi/datasets) 
- Python >= 3.7

```
find_reference_genomes -h
usage: find_reference_genomes [-h] [-n NAME] [-d DOWNLOAD] [-p] [--no-genome] [-o OUTPUT_DIR] [-l {chromosome,complete,scaffold,contig}]
                              [--max-rank {strain,subspecies,species,genus,subfamily,family,suborder,order,subclass,class,phylum,kingdom,superkingdom}] [--allow-clade]

Find and download reference genomes from the NCBI

options:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  Scientific name of the species of interest
  -d DOWNLOAD, --download DOWNLOAD
                        Comma-separated list of GCA accessions to download (example: '-d GCA_047652355.1,GCA_049901935.1,GCA_048126915.1')
  -p, --proteins        When used with --download, also download the corresponding protein FASTA files (.faa)
  --no-genome           When used with --download, do not download the genome (use with -p to download only proteins)
  -o OUTPUT_DIR, --output OUTPUT_DIR
                        If using --download, path to the output directory to store the downloaded genomes
  -l {chromosome,complete,scaffold,contig}, --level {chromosome,complete,scaffold,contig}
                        Limits the results to at least this level of assembly
  --max-rank {strain,subspecies,species,genus,subfamily,family,suborder,order,subclass,class,phylum,kingdom,superkingdom}
                        Limits the search to taxonomic ranks up to the specified level (e.g., '--max-rank genus' will only search up to genus level)
  --allow-clade         Allow the search to include clade level (default: False)
```