users_api.management.commands package

Submodules

users_api.management.commands.dataset_groups module

class users_api.management.commands.dataset_groups.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand, DatasetBaseMixin

Check an existing dataset access groups.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*_args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Check an existing dataset access groups'

users_api.management.commands.dataset_mixin module

class users_api.management.commands.dataset_mixin.DatasetBaseMixin(gpf_instance: GPFInstance | None = None)[source]

Bases: DatasetHelpers

Mixin for dataset management.

get_dataset(dataset_id: str) Dataset | None[source]

Get dataset by id.

remove_wdae_dataset_and_groups(dataset_id: str, *, dry_run: bool = False) None[source]

Remove WDAE dataset and groups.

rename_wdae_dataset_and_groups(dataset_id: str, new_id: str, *, dry_run: bool = False) None[source]

Rename WDAE dataset and groups.

users_api.management.commands.datasets_export module

class users_api.management.commands.datasets_export.Command(**kwargs: Any)[source]

Bases: BaseCommand, DatasetBaseMixin

Export all existing datasets to a CSV file.

add_arguments(parser: Any) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Export all existing datasets'

users_api.management.commands.datasets_restore module

class users_api.management.commands.datasets_restore.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Add rights to datasets from an input CSV file.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

handle_dataset(dataset: dict[str, str]) None[source]
help = 'Add rights to datasets from an input CSV file'

users_api.management.commands.datasets_show module

class users_api.management.commands.datasets_show.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Show all existing datasets

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Show all existing datasets'

users_api.management.commands.export_base module

class users_api.management.commands.export_base.ExportUsersBase[source]

Bases: object

Base class for exporting user-related data.

get_visible_groups(user: AbstractUser) set[str][source]

Get the groups visible to the user.

users_api.management.commands.import_base module

class users_api.management.commands.import_base.ImportUsersBase[source]

Bases: object

Helper for users import.

handle_user(res: dict[str, str]) WdaeUser[source]

Handle creation of user on import.

users_api.management.commands.unlock_user module

class users_api.management.commands.unlock_user.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: ImportUsersBase, BaseCommand

Remove a lockout on a user’s account.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = "Remove a lockout on a user's account."

users_api.management.commands.user_create module

class users_api.management.commands.user_create.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand, ImportUsersBase

Create a new user.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Create new user'

users_api.management.commands.user_set_name module

class users_api.management.commands.user_set_name.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Change the name of a user.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Change the name of the user with the given email'

users_api.management.commands.user_setpasswd module

class users_api.management.commands.user_setpasswd.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Change the password of a user with the given email.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Change the password of a user with the given email'

users_api.management.commands.users_add module

class users_api.management.commands.users_add.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: ImportUsersBase, BaseCommand

Add users from a CSV file.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*_args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Add users from csv. Required column names for the csv file - Email.Optional column names - Groups, Name, Password'

users_api.management.commands.users_export module

class users_api.management.commands.users_export.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand, ExportUsersBase

Export users command.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

handle_user(user: WdaeUser, writer: DictWriter[str]) None[source]

Handle user export.

help = 'Export all users to stdout/csv file.'

users_api.management.commands.users_group_add module

class users_api.management.commands.users_group_add.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Add user to group(s) command.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Add user into group(s)'

users_api.management.commands.users_group_remove module

class users_api.management.commands.users_group_remove.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Remove user from group(s)

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Remove user from group(s)'

users_api.management.commands.users_remove module

class users_api.management.commands.users_remove.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Delete user command.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Delete user'

users_api.management.commands.users_restore module

class users_api.management.commands.users_restore.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: ImportUsersBase, BaseCommand

Restore users command.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Delete all users and adds new ones from csv. Required column names for the csv file - Email. Optional column names - Groups, Name, Password'

users_api.management.commands.users_show module

class users_api.management.commands.users_show.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand, ExportUsersBase

Show user information.

add_arguments(parser: CommandParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

help = 'Show all information about user'

Module contents