Dapla Suv Tools
A collection of tools for integrating with the SUV-platform
Install dapla-suv-tools from PyPI
pip install dapla-suv-tools
Initialize a client using SuvClient
from dapla_suv_tools.suv_client import SuvClient
client = SuvClient()
Setup pagination using PaginationInfo
from dapla_suv_tools.pagination import PaginationInfo
p_info = PaginationInfo(page=1, size=5)
Example 1: fetch skjema by id
from dapla_suv_tools.suv_client import SuvClient
client = SuvClient()
x = client.get_skjema_by_id(skjema_id=116)
print(x)
Example 2: fetch skjema's with PaginationInfo
from dapla_suv_tools.suv_client import SuvClient
from dapla_suv_tools.pagination import PaginationInfo
client = SuvClient()
p_info = PaginationInfo(page=1, size=5)
y = client.get_skjema_by_ra_nummer(
ra_nummer="RA-5566", max_results=0, latest_only=False, pagination_info=p_info
)
print(y)
Function get_skjema_by_id
Gets a 'skjema' based on it's skjema_id.
output = client.get_skjema_by_id(skjema_id=1)
print(output)
Parameters:
skjema_id(int, required): The skjema's id
Returns:
Any: a json object containing skjema data.
Function get_skjema_by_ra_nummer
Attempts to get all skjema with the supplied RA-number.
output = client.get_skjema_by_ra_nummer(ra_nummer="123456789", versjon=1, max_results=0, latest_only=False, pagination_info=None)
print(output)
Parameters:
ra_nummer(str, required): Skjema's RA-number, e.g. 'RA-1234'.versjon(int | None, optional): Limit the version of the skjema. Defaults toNone.max_results(int, optional): Maximum number of results int the result set. A value of 0 will get ALL results. Defaults to0.latest_only(bool, optional): Only return the newest entry. Default is False.pagination_info(PaginationInfo | None, optional): An object holding pagination metadata Defaults toNone.
Returns:
dict: A list of skjema json objects matching the RA-number
Function create_skjema
Creates a new version of metadata for the given skjema, based upon the supplied metadata.
output = client.create_skjema(ra_nummer="RA-1234", versjon=1, undersokelse_nr="123456789", gyldig_fra=date(2024, 1, 1), navn_nb="example", navn_nn="example", infoside="123456789")
print(output)
Parameters:
ra_nummer(str, required).versjon(int, required).undersokelse_nr(str, required).gyldig_fra(date, required).datamodell(str | None, optional). Defaults toNone.beskrivelse(str | None, optional). Defaults toNone.navn_nb(str, required).navn_nn(str, required).navn_en(str | None, optional). Defaults toNone.infoside(str, required).eier(str | None, optional). Defaults toNone.kun_sky(bool, optional). Defaults toFalse.gyldig_til(date | None, optional). Defaults toNone.
Returns:
Any
Function delete_skjema
Attempts to delete the skjema with the supplied id.
output = client.delete_skjema(skjema_id=1)
print(output)
Parameters:
skjema_id(int, required).
Returns:
Any: A json object containing the operation result.
Function update_skjema_by_ra_number
Updates a skjema based on the supplied RA-number, versjon and undersokelse_nr. The RA-number, versjon and undersokelse_nr are required, all other parameters are optional. If a parameter is not provided, the existing value will be used.
output = client.update_skjema_by_ra_number(
ra_nummer="RA-1234",
versjon=1,
undersokelse_nr="1234",
gyldig_fra="2024-01-01",
datamodell="test",
beskrivelse="test",
navn_nb="test",
navn_nn="test",
navn_en="test",
infoside="test",
eier="test",
kun_sky=False,
gyldig_til="2023-01-01"
)
print(output)
Parameters:
ra_nummer(str, required): Skjema's RA-number, e.g. 'RA-1234'.versjon(int, required): The version of the skjema.undersokelse_nr(str, required): The investigation number of the skjema.datamodell(str | None, optional): The data model of the skjema. Defaults toNone.beskrivelse(str | None, optional): The description of the skjema. Defaults toNone.navn_nb(str | None, optional): The name of the skjema in Norwegian Bokmål. Defaults toNone.navn_nn(str | None, optional): The name of the skjema in Norwegian Nynorsk. Defaults toNone.navn_en(str | None, optional): The name of the skjema in English. Defaults toNone.infoside(str | None, optional): URL for the information page of the skjema. Defaults toNone.eier(str | None, optional): The owner of the skjema. Defaults toNone.kun_sky(bool, optional): Whether the skjema is only in the cloud. Defaults toFalse.gyldig_fra(date | None, optional): The valid from date of the skjema. Defaults toNone.gyldig_til(date | None, optional): The valid to date of the skjema. Defaults toNone.
Returns:
dict: A list of skjema json objects matching the RA-number
Function update_skjema_by_id
Updates an existing skjema with the specified skjemea_id. The skjema_id is required, all other parameters are optional. If a parameter is not provided, the existing value will be used.
output = client.update_skjema_by_id(
skjema_id=1, gyldig_fra=date(2024, 8, 24), datamodell="test", kun_sky=False, gyldig_til=date(2025, 1, 31)
)
print(output)
Parameters:
skjema_id(int, required): The id of the skjema to update.datamodell(str | None, optional): The data model of the skjema. Defaults toNone.beskrivelse(str | None, optional): The description of the skjema. Defaults toNone.navn_nb(str | None, optional): The name of the skjema in Norwegian Bokmål. Defaults toNone.navn_nn(str | None, optional): The name of the skjema in Norwegian Nynorsk. Defaults toNone.navn_en(str | None, optional): The name of the skjema in English. Defaults toNone.infoside(str | None, optional): URL for the information page of the skjema. Defaults toNone.eier(str | None, optional): The owner of the skjema. Defaults toNone.kun_sky(bool | None, optional): Whether the skjema is only in the cloud. Defaults toNone.gyldig_fra(date | None, optional): The valid from date of the skjema. Defaults toNone.gyldig_til(date | None, optional): The valid to date of the skjema. Defaults toNone.
Returns:
OperationResult: An object containing the updated skjema information, or an error message if the update fails.
Function get_all_skjema
Attempts to get all skjema's.
output = client.get_all_skjema()
print(output)
Parameters:
max_results(int, optional): Maximum number of results int the result set. A value of 0 will get ALL results. Defaults to0.pagination_info(PaginationInfo | None, optional): An object holding pagination metadata Defaults toNone.
Returns:
dict: A list of all skjema json objects
Function get_periode_by_id
Retrieves a period by its ID.
output = client.get_periode_by_id(periode_id=123)
print(output)
Parameters:
periode_id(int, required): The ID of the period to retrieve.
Returns:
OperationResult: An object containing the period information if found, or an error message if the retrieval fails.
Function get_perioder_by_skjema_id
Retrieves periods associated with a specific schema ID.
output = client.get_perioder_by_skjema_id(
skjema_id=456, periode_type="KVRT", periode_aar=2023
)
print(output)
Parameters:
skjema_id(int, required): The skjema_id of the schema for which to retrieve periods.periode_type(str | None, optional): The type of the period to filter by. If None, periods of any type will be retrieved. Defaults toNone.periode_nr(int | None, optional): The number of the period to filter by. If None, periods of any number will be retrieved. Defaults toNone.periode_aar(int | None, optional): The year of the period to filter by. If None, periods of any year will be retrieved. Defaults toNone.delreg_nr(int | None, optional): The delreg_nr of the period to filter by. If None, periods of any delreg_nr will be retrieved. Defaults toNone.enhet_type(int | None, optional): The enhet_type of the period to filter by. If None, periods of any enhet_type will be retrieved. Defaults toNone.max_results(int, optional): Maximum number of results in the result set. A value of 0 will get ALL results. Defaults to 0latest_only(bool, optional): A boolean flag to trigger a special condition. A True value will retrieve the latest periode added. Defaults to False.pagination_info(PaginationInfo | None, optional): An object holding pagination metadata. Defaults to None.
Returns:
OperationResult: An object containing a list of periods associated with the schema ID, or an error message if the retrieval fails.
Function create_periode
Creates a new period with the specified details.
output = client.create_periode(skjema_id=1)
print(output)
Parameters:
skjema_id(int, required): The skjema_id associated with the new period.periode_type(str | None, optional): Periode type of the new periode. Defaults toNone.periode_nr(int | None, optional): Periode number of the new periode. Defaults toNone.periode_aar(int | None, optional): Year of the new periode. Defaults toNone.periode_dato(date | None, optional): Date for the period. Defaults toNone.delreg_nr(int | None, optional): delreg_nr. Defaults toNone.enhet_type(str | None, optional): enhet_type. Defaults toNone.vis_oppgavebyrde(bool | None, optional): A boolean flag to indicate visibility of "oppgavebyrde". Defaults to None.vis_brukeropplevelse(bool | None, optional): A boolean flag to indicate visibility of "brukeropplevelse". Defaults to None.har_skjemadata(bool | None, optional): A boolean flag to indicate the presence of schema data. Defaults to None.journalnummer(str | None, optional): journalnummer. Defaults to None.
Returns:
OperationResult: An object containing the ID of the created period, or an error message if the creation fails.
Function delete_periode
Deletes the period with the specified periode_id.
output = client.delete_periode(periode_id=1)
print(output)
Parameters:
periode_id(int, required): The ID of the period to delete.
Returns:
OperationResult: An object containing the result of the deletion operation, or an error message if the deletion fails.
Function update_periode_by_id
Updates an existing period with the specified periode_id.
output = client.update_periode_by_id(periode_id=1)
print(output)
Parameters:
periode_id(int, required): The ID of the period to update.periode_dato(date | None, optional): Date for the period. If None, the existing date will be used. Defaults toNone.delreg_nr(int | None, optional): delreg_nr. If None, the existing number will be used. Defaults toNone.enhet_type(str | None, optional): enhet_type. If None, the existing type will be used. Defaults toNone.vis_oppgavebyrde(bool | None, optional): A boolean flag to indicate visibility of "oppgavebyrde". Defaults to None.vis_brukeropplevelse(bool | None, optional): A boolean flag to indicate visibility of "brukeropplevelse". Defaults to None.har_skjemadata(bool | None, optional): A boolean flag to indicate the presence of schema data. Defaults to None.journalnummer(str | None, optional): Journal number. If None, the existing number will be used. Defaults toNone.
Returns:
OperationResult: An object containing the updated period information, or an error message if the update fails.
Function update_periode_by_skjema_id
Updates an existing period with the specified skjema_id.
output = client.update_periode_by_skjema_id(skjema_id=1, periode_type="example", periode_aar=1, periode_nr=1)
print(output)
Parameters:
skjema_id(int, required): The skjema_id of the period to update.periode_type(str, required): Periode type of the period to update.periode_aar(int, required): Year of the period to update.periode_nr(int, required): Periode number of the period to update.periode_dato(date | None, optional): Date for the period. If None, the existing date will be used. Defaults toNone.delreg_nr(int | None, optional): delreg_nr. If None, the existing number will be used. Defaults toNone.enhet_type(str | None, optional): Unit type. If None, the existing type will be used. Defaults toNone.vis_oppgavebyrde(bool | None, optional): A boolean flag to indicate visibility of "oppgavebyrde". Defaults to None.vis_brukeropplevelse(bool | None, optional): A boolean flag to indicate visibility of "brukeropplevelse". Defaults to None.har_skjemadata(bool | None, optional): A boolean flag to indicate the presence of schema data. Defaults to None.journalnummer(str | None, optional): Journal number. If None, the existing number will be used. Defaults toNone.
Returns:
OperationResult: An object containing the updated period information, or an error message if the update fails.
Function create_new_periodes
Creates new periodes using a given exisiting period.
output = client.create_new_periodes(periode_id=80, num_new_periodes=3)
print(output)
Parameters:
periode_id(int, required): The periode_id associated with the new periods.num_new_periodes(int, required): Number of new periodes to be created
Returns:
OperationResult: An object containing the ID of the created periodes, or an error message if the creation fails.
Function get_pulje_by_id
Retrieves a pulje by its ID.
output = client.get_pulje_by_id(pulje_id=123)
print(output)
Parameters:
pulje_id(int, required): The ID of the pulje to retrieve.
Returns:
OperationResult: An object containing the pulje information if found, or an error message if the retrieval fails.
Function get_pulje_by_periode_id
Retrieves a pulje by its periode_id.
output = client.get_pulje_by_periode_id(periode_id=123)
print(output)
Parameters:
periode_id(int, required): The periode_id of the pulje to retrieve.
Returns:
OperationResult: A list of objects containing the pulje information for every pulje under the given pulje_id if found, or an error message if the retrieval fails.
Function create_pulje
Creates a new pulje with the specified details.
output = client.create_pulje(periode_id=1, altinn_tilgjengelig=datetime(2024, 1, 1, 12, 0))
print(output)
Parameters:
periode_id(int, required): The periode_id associated with the new pulje.pulje_nr(int | None, optional): pulje_nr of the new pulje. Has to be unique under the same periode_id if is going to be set. Defaults toNone.altinn_tilgjengelig(datetime, required): Date and time for altinn_tilgjengelig.altinn_svarfrist(date | None, optional): Date for altinn_svarfrist. Defaults toNone.tvangsmulkt_svarfrist(date | None, optional): Date for tvangsmulkt_svarfrist. Defaults toNone.send_si(date | None, optional): Date for send_si. Defaults toNone.
Returns:
OperationResult: An object containing the ID of the created pulje, or an error message if the creation fails.
Function update_pulje_by_id
Updates an existing pulje with the specified pulje_id.
output = client.update_pulje_by_id(
pulje_id=456, send_si=date(2023,10,12)
)
print(output)
Parameters:
pulje_id(int, required): The ID of the period to update.altinn_tilgjengelig(datetime | None, optional): Date and time for altinn_tilgjengelig. Defaults toNone.altinn_svarfrist(date | None, optional): Date for altinn_svarfrist. Defaults toNone.tvangsmulkt_svarfrist(date | None, optional): Date for tvangsmulkt_svarfrist. Defaults toNone.send_si(date | None, optional): Date for send_si. Defaults toNone.
Returns:
OperationResult: An object containing the updated pulje information, or an error message if the update fails.
Function update_pulje_by_periode_id
Updates an existing pulje with the specified periode_id and pulje.
output = client.update_pulje_by_periode_id(
periode_id=456, pulje_nr=2, tvangsmulkt_svarfrist=date(2024,11,13)
)
print(output)
Parameters:
periode_id(int, required): The ID of the pulje to update.pulje_nr(int, required): The pulje_nr of the period to update.altinn_tilgjengelig(datetime | None, optional): Date and time for altinn_tilgjengelig. Defaults toNone.altinn_svarfrist(date | None, optional): Date for altinn_svarfrist. Defaults toNone.tvangsmulkt_svarfrist(date | None, optional): Date for tvangsmulkt_svarfrist. Defaults toNone.send_si(date | None, optional): Date for send_si. Defaults toNone.
Returns:
OperationResult: An object containing the updated pulje information, or an error message if the update fails.
Function delete_pulje
Deletes the pulje with the specified pulje_id.
output = client.delete_pulje(
pulje_id=123
)
print(output)
Parameters:
pulje_id(int, required): The pulje_id of the pulje to delete.
Returns:
OperationResult: An object containing the result of the deletion operation, or an error message if the deletion fails.
Function get_utsending_by_id
Retrieves an utsending by its ID.
output = client.get_utsending_by_id(utsending_id=123)
print(output)
Parameters:
utsending_id(int, required): The ID of the utsending to retrieve.
Returns:
OperationResult: An object containing the utsending information if found, or an error message if the retrieval fails.
Function get_utsending_by_pulje_id
Retrieves a pulje by its pulje_id.
output = client.get_utsending_by_pulje_id(pulje_id=123)
print(output)
Parameters:
pulje_id(int, required): The pulje_id of the utsending to retrieve.
Returns:
OperationResult: A list of objects containing the utsending information for every utsending under the given pulje_id if found, or an error message if the retrieval fails.
Function update_utsending_by_id
Updates an existing utsending with the specified utsending_id.
output = client.update_utsending_by_id(
utsending_id=456,utsendingstype_navn="instansiering", trigger="Manuell", altinn_uts_tidspunkt=datetime(2023,10,12)
)
print(output)
Parameters:
utsending_id(int, required): The ID of the utsending to update.utsendingstype_navn(str | None, optional): utsendingstype_navn for utsending to update Defaults toNone.trigger(str | None, optional). Defaults toNone.test(bool | None, optional). Defaults toNone.altinn_uts_tidspunkt(datetime | None, optional). Defaults toNone.
Returns:
OperationResult: An object containing the updated utsending information, or an error message if the update fails.
Function create_utsending
Creates a new utsending with the specified details.
output = client.create_utsending(
pulje_id=456, test=True
)
print(output)
Parameters:
pulje_id(int, required): The pulje_id associated with the new utsending.utsendingstype_navn(str | None, optional): utsendingstype_navn for utsending to create Defaults toNone.trigger(str | None, optional). Defaults to'Manuell'.test(bool | None, optional). Defaults toFalse.altinn_uts_tidspunkt(datetime | None, optional). Defaults toNone.
Returns:
OperationResult: An object containing the ID of the created utsending, or an error message if the creation fails.
Function delete_utsending
Deletes the utsending with the specified utsending_id.
output = client.delete_utsending(
utsending_id=123
)
print(output)
Parameters:
utsending_id(int, required): The utsending_id of the utsending to delete.
Returns:
OperationResult: An object containing the result of the deletion operation, or an error message if the deletion fails.
Function get_correspondence_by_id
Retrieves a correspondence by its id.
output = client.get_correspondence_by_id(id="019e212d-e74a-7f6e-9d41-ac22eab81970")
print(output)
Parameters:
id(str, required): The guid of the correspondence to retrieve.
Returns:
OperationResult: Object containing the correspondence information for the given id if found, or an error message if the retrieval fails.
Function get_altinn_dialog_by_id
Retrieves an Altinn dialog by its dialog_id.
output = client.get_altinn_dialog_by_id(dialog_id="...")
print(output)
Parameters:
dialog_id(str, required): The dialog_id of the Altinn dialog to retrieve.
Returns:
OperationResult: Object containing the Altinn dialog information for the given dialog_id if found, or an error message if the retrieval fails.
Function get_instance
Gets an 'instance' based on it's owner id and guid.
output = client.get_instance(instance_id="123456789")
print(output)
Parameters:
instance_id(str, required): The combined instance's owner id and guid separated by a '/' (e.g. '123451213/12345678-1234-1234-1234-123456789012').
Returns:
Any: a json object containing instance data.
Function resend_instances
Resend 'instances' based on it's batch_ref, ra_number, period or reportee_id. If no filters are provided, all failed instances will be resent.
output = client.resend_instances(filters="example")
print(output)
Parameters:
filters(str, required): The filters to apply to the instances. Sample filters: {"batch_ref": "123", "ra_number": "123", "period": "2021-01", "reportee_id": "123"}
Returns:
Any: a json object containing instance data.
Function resend_receipts
Resend receipts for instances in error bucket.
output = client.resend_receipts()
print(output)
Parameters:
None
Returns:
Any: a json object containing instance data.
Function get_prefill_meta_by_skjema_id
Gets prefill meta for a 'skjema' based on it's skjema_id.
output = client.get_prefill_meta_by_skjema_id(
skjema_id=123
)
print(output)
Parameters:
skjema_id(int, required): The skjema_id associated with the new period.
Returns:
OperationResult: A list of json objects containing the skjema's prefill meta data
Function get_prefill_meta_by_skjema_def
Gets prefill meta for a 'skjema' based on it's skjema_def.
output = client.get_prefill_meta_by_skjema_def(
ra_nummer="RA-0666A3",
versjon= 1,
undersokelse_nr=1060
)
print(output)
Parameters:
ra_nummer(str, required): The RA number associated with the skjema.versjon(int, required): The version number of the skjema.undersokelse_nr(str, required): The survey number linked to the skjema.
Returns:
OperationResult: A json objects containing the skjema's prefill meta data
Function save_prefill_meta
Creates prefill meta for given skjema_id
output = client.save_prefill_meta(
skjema_id=123, min= 1, maks = 300, obligatorisk = True
)
print(output)
Parameters:
skjema_id(int, required): The ID of the skjema associated with the prefill meta.navn(str, required): The name of the prefill meta.obligatorisk(bool | None, optional): Whether or not it is Required Defaults toFalse.sti(str | None, optional): The path associated with the prefill meta. Defaults toNone.tittel(str | None, optional): The title of the prefill meta. Defaults toNone.type(str | None, optional): The type of the prefill meta (e.g., "ORDINAR"). Defaults to'ORDINAR'.min(int | None, optional): The minimum value allowed for the prefill meta. Defaults toNone.maks(int | None, optional): The maximum value allowed for the prefill meta. Defaults toNone.dublett_sjekk(bool | None, optional). Defaults toFalse.stat_navn(str | None, optional): The statistical name associated with the prefill meta. Defaults toNone.kommentar(str | None, optional): Any comments about the prefill meta. Defaults toNone.
Returns:
OperationResult: An object containing id of the new created prefill meta
Function get_prefill_meta_by_prefill_meta_id
Gets prefill meta based on it's prefill_meta_id.
output = client.get_prefill_meta_by_prefill_meta_id(
prefill_meta_id=123
)
print(output)
Parameters:
prefill_meta_id(int, required): The prefill_meta_id associated with the prefill meta.
Returns:
OperationResult: an object containing prefill meta data
Function update_prefill_meta_by_prefill_meta_id
Updates prefill meta based on it's prefill_meta_id.
output = client.update_prefill_meta_by_prefill_meta_id(
prefill_meta_id=123, min= 1, maks = 300, obligatorisk = True
)
print(output)
Parameters:
prefill_meta_id(int, required): The prefill_meta_id associated with the prefill meta.obligatorisk(bool | None, optional): Whether or not it is Required Defaults toFalse.skjema_id(int | None, optional): The ID of the skjema associated with the prefill meta. Defaults toNone.navn(str | None, optional): The name of the prefill meta. Defaults toNone.sti(str | None, optional): The path associated with the prefill meta. Defaults toNone.tittel(str | None, optional): The title of the prefill meta. Defaults toNone.type(str | None, optional): The type of the prefill meta (e.g., "ORDINAR"). Defaults toNone.min(int | None, optional): The minimum value allowed for the prefill meta. Defaults toNone.maks(int | None, optional): The maximum value allowed for the prefill meta. Defaults toNone.dublett_sjekk(bool | None, optional). Defaults toNone.stat_navn(str | None, optional): The statistical name associated with the prefill meta. Defaults toNone.kommentar(str | None, optional): Any comments about the prefill meta. Defaults toNone.
Returns:
OperationResult: An object containing updated prefill meta
Function delete_skjema_prefill_meta_by_id
Deletes the prefill meta with the specified prefill_meta_id.
output = client.delete_skjema_prefill_meta_by_id(
prefill_meta_id=123
)
print(output)
Parameters:
prefill_meta_id(int, required): The prefill_meta_id of the prefill meta to delete.
Returns:
OperationResult: An object containing the result of the deletion operation, or an error message if the deletion fails.
Function delete_skjema_prefill_meta_by_skjema_id
Deletes all prefill meta within the specified skjema_id.
output = client.delete_skjema_prefill_meta_by_skjema_id(skjema_id=1)
print(output)
Parameters:
skjema_id(int, required): The skjema_id of the prefill meta to delete.
Returns:
OperationResult: An object containing the result of the deletion operation, or an error message if the deletion fails.
Function get_prefill_meta_datamodel_as_csv
Gets datamodel for a 'skjema' as CSV based on it's ra_nummer and version.
output = client.get_prefill_meta_datamodel_as_csv(ra_nummer="RA-1234", version=1)
print(output)
Parameters:
ra_nummer(str, required): The RA number associated with the skjema.version(int, required): The version number of the skjema.
Returns:
OperationResult: A string (csv_data) containing the skjema's prefill meta data in CSV format
Function get_prefill_info_for_skjema
Fetches prefill information for a given combination of skjema-identifiers and periode-identifiers.
output = client.get_prefill_info_for_skjema(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1)
print(output)
Parameters:
ra_nummer(str, required): Ra-number of the skjemaversjon(int, required): Version indicator of the skjemaperiode_aar(int, required): The year of the periodperiode_type(str, required): The type of periodperiode_nr(int | None, required): The number of the period. Not required for annual surveys.include_prefill(bool | None, optional): Whether to include prefill data in the response Defaults toFalse.
Returns:
Any
Function get_prefill_for_enhet
Fetches prefill for a given unit for a combination of skjema-identifiers and periode-identifiers.
output = client.get_prefill_for_enhet(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1, enhetsident="123456789", enhetstype="example")
print(output)
Parameters:
ra_nummer(str, required): Ra-number of the skjemaversjon(int, required): Version indicator of the skjemaperiode_aar(int, required): The year of the periodperiode_type(str, required): The type of periodperiode_nr(int | None, required): The number of the period. Not required for annual surveys.enhetsident(str, required): An identifier for the unitenhetstype(str, required): Type indicator for the unit
Returns:
Any
Function save_prefill_for_enhet
Saves prefill for a given unit for a combination of skjema-identifiers and periode-identifiers. This will overwrite any registered prefill for the unit for the given survey!! This action is not reversible, and can not be undone!!
output = client.save_prefill_for_enhet(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1, enhetsident="123456789", enhetstype="example", prefill={})
print(output)
Parameters:
ra_nummer(str, required): Ra-number of the skjemaversjon(int, required): Version indicator of the skjemaperiode_aar(int, required): The year of the periodperiode_type(str, required): The type of periodperiode_nr(int | None, required): The number of the period. Not required for annual surveys.enhetsident(str, required): An identifier for the unitenhetstype(str, required): Type indicator for the unitprefill(dict[str, Any], required): A dictionary (json-object) containing the prefill information for the unit.undersokelsesnummer(str | None, optional): Undersøkelsesnummer. Required if the same skjema and version is used for multiple surveys. Defaults toNone.
Returns:
Any
Function delete_prefill_for_skjema
Deletes all prefill information for a given combination of skjema-identifiers and periode-identifiers. This operation is not reversible, and can not be undone!!
output = client.delete_prefill_for_skjema(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1)
print(output)
Parameters:
ra_nummer(str, required): Ra-number of the skjemaversjon(int, required): Version indicator of the skjemaperiode_aar(int, required): The year of the periodperiode_type(str, required): The type of periodperiode_nr(int | None, required): The number of the period. Not required for annual surveys.
Returns:
Any
Function delete_prefill_for_enhet
Deletes prefill for a given unit for a combination of skjema-identifiers and periode-identifiers. This operation is not reversible, and can not be undone!!
output = client.delete_prefill_for_enhet(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1, enhetsident="123456789", enhetstype="example")
print(output)
Parameters:
ra_nummer(str, required): Ra-number of the skjemaversjon(int, required): Version indicator of the skjemaperiode_aar(int, required): The year of the periodperiode_type(str, required): The type of periodperiode_nr(int | None, required): The number of the period. Not required for annual surveys.enhetsident(str, required): An identifier for the unitenhetstype(str, required): Type indicator for the unit
Returns:
Any
Function validate_skjemadata
Validates skjemadata for a given unit for a combination of skjema-identifiers.
output = client.validate_skjemadata(skjemadata={}, ra_nummer="RA-1234", versjon=1)
print(output)
Parameters:
skjemadata(dict[str, Any] | str, required): skjemadatara_nummer(str, required): Ra-numberversjon(int, required): Versionundersokelsesnummer(str | None, optional): Undersøkelsesnummer. Required if the same skjema and version is used for multiple surveys. Defaults toNone.
Returns:
Any
Function get_utvalg_from_sfu
Get selection from SFU.
output = client.get_utvalg_from_sfu(delreg_nr="123456789", ra_nummer="123456789", pulje="123456789")
print(output)
Parameters:
delreg_nr(int, required): The delreg number of the selection.ra_nummer(str, required): Skjema's RA-number, e.g. 'RA-1234'.pulje(str | None, optional): Limit the selection by pulje. Default is None, which means ALL puljes will be included. If specified, only the selection for the given pulje will be returned. It's possible to specify one or more puljes by separating them with commas, e.g. pulje="1,2,3". The value "0" can be used to fetch a selection that has not been assigned to a pulje.status(str | None, optional): Limit the selection by status. Possible values are "besvart", "ikke-besvart", "alle". Defaults to'alle'.max_results(int, optional): Specifies the maximum number of results in the returned result. If 0 or omitted, all results matching the query will be returned. Will be ignored if used together with paginiation_info Defaults to0.pagination_info(PaginationInfo | None, optional): Sets the parameters used for paginating the query results. Will take precedence over max_results if both are set. If omitted, will return the full set, or up to max_results, of the query. NOTE: This might take some time for large result sets so be patient if retrieving thousands of records! Defaults toNone.
Returns:
dict: A list of json objects matching the selection
Function get_enhet_from_sfu
Get unit from SFU.
output = client.get_enhet_from_sfu(delreg_nr="123456789", orgnr="123456789")
print(output)
Parameters:
delreg_nr(int, required): The delreg number of the selection.orgnr(str, required): The organization number of the unit.
Returns:
dict: An object matching the organization number
Function get_vareliste
Get vareliste.
output = client.get_vareliste(delreg_nr=1, ra_nummer="RA-1234")
print(output)
Parameters:
delreg_nr(int, required): The delreg number of the selection.ra_nummer(str, required): Skjema's RA-number, e.g. 'RA-1234'.ident_nr(str | None, optional): The ident number of the entity. Defaults toNone.enhets_type(str | None, optional): The type of unit. Defaults toNone.katalog_id(int | None, optional): The catalog ID. Defaults toNone.aktiv(str | None, optional): Aktiv status. Defaults toNone.felt_ids(list[str] | None, optional): List of field ids to include in the response. Defaults toNone.max_results(int, optional): Specifies the maximum number of results in the returned result. If 0 or omitted, all results matching the query will be returned. Will be ignored if used together with paginiation_info Defaults to0.pagination_info(PaginationInfo | None, optional): Sets the parameters used for paginating the query results. Will take precedence over max_results if both are set. If omitted, will return the full set, or up to max_results, of the query. NOTE: This might take some time for large result sets so be patient if retrieving thousands of records! Defaults toNone.
Returns:
dict: A dict object matching the vareliste
Function get_delreg_from_sfu
Get delreg from SFU.
output = client.get_delreg_from_sfu(delreg_nr=1)
print(output)
Parameters:
delreg_nr(int, required): The delreg number of the selection.enhets_type(str | None, optional): Limit selection by the type of unit. Possible values are "BEDR" (bedrift), "FRTK" (foretak). Defaults toNone.max_results(int, optional): Specifies the maximum number of results in the returned result. If 0 or omitted, all results matching the query will be returned. Will be ignored if used together with paginiation_info Defaults to0.pagination_info(PaginationInfo | None, optional): Sets the parameters used for paginating the query results. Will take precedence over max_results if both are set. If omitted, will return the full set, or up to max_results, of the query. NOTE: This might take some time for large result sets so be patient if retrieving thousands of records! Defaults toNone.
Returns:
dict: A list of json objects matching the selection
Function initialize_prefill_isee
Initialize prefill in ISEE.
output = client.initialize_prefill_isee(delreg_nr=123456789, ra_nummer="RA-1234")
print(output)
Parameters:
delreg_nr(int, required): The delreg number of the selection.ra_nummer(str, required): Skjema's RA-number, e.g. 'RA-1234'.max_results(int, optional). Defaults to0.pagination_info(PaginationInfo | None, optional). Defaults toNone.
Returns:
dict: A string matching the ISEE initialization result
Function fetch_prefill_isee
Get prefill from isee.
output = client.fetch_prefill_isee(delreg_nr=1, ra_nummer="RA-1234")
print(output)
Parameters:
delreg_nr(int, required): The delreg number of the selection.ra_nummer(str, required): Skjema's RA-number, e.g. 'RA-1234'.max_age_minutes(int | None, optional): The maximum age of the prefill data in minutes. Default is 1440 (24 hours). If the existing prefill data is older than this, it will be refreshed before being returned.ident_nr(str | None, optional): The ident number. Defaults toNone.enhets_type(str | None, optional): The type of unit. Defaults toNone.felt_ids(list[str] | None, optional). Defaults toNone.max_results(int, optional). Defaults to0.pagination_info(PaginationInfo | None, optional). Defaults toNone.
Returns:
dict: A dict object matching the prefill isee
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dapla_suv_tools-0.1.92.tar.gz.
File metadata
- Download URL: dapla_suv_tools-0.1.92.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15312853a910acb7be5ae57d148520617f884b0af73714a2aff01c82de3217bd
|
|
| MD5 |
75d42706aa6c7f66806f7287e4b26e38
|
|
| BLAKE2b-256 |
93274fce68213a20a3ae6dae645e3270cb09fd52b06828fdb19834b385d6f7cc
|
Provenance
The following attestation bundles were made for dapla_suv_tools-0.1.92.tar.gz:
Publisher:
pypi-release.yaml on statisticsnorway/dapla-suv-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dapla_suv_tools-0.1.92.tar.gz -
Subject digest:
15312853a910acb7be5ae57d148520617f884b0af73714a2aff01c82de3217bd - Sigstore transparency entry: 2055613290
- Sigstore integration time:
-
Permalink:
statisticsnorway/dapla-suv-tools@cbdb631258cab9c4f804a656a55f328854a331f6 -
Branch / Tag:
refs/tags/0.1.92 - Owner: https://github.com/statisticsnorway
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yaml@cbdb631258cab9c4f804a656a55f328854a331f6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dapla_suv_tools-0.1.92-py3-none-any.whl.
File metadata
- Download URL: dapla_suv_tools-0.1.92-py3-none-any.whl
- Upload date:
- Size: 46.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5accd48ca186246d4ac447194b9e9d2e5f5cded5de26eb86a925cfd87d1aea7b
|
|
| MD5 |
252ec60071222f7dd3498582a10566cb
|
|
| BLAKE2b-256 |
ff5d741d2720e53905b8d1cbe5efee8227f63c65efd92061b74255cde09eb03f
|
Provenance
The following attestation bundles were made for dapla_suv_tools-0.1.92-py3-none-any.whl:
Publisher:
pypi-release.yaml on statisticsnorway/dapla-suv-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dapla_suv_tools-0.1.92-py3-none-any.whl -
Subject digest:
5accd48ca186246d4ac447194b9e9d2e5f5cded5de26eb86a925cfd87d1aea7b - Sigstore transparency entry: 2055613799
- Sigstore integration time:
-
Permalink:
statisticsnorway/dapla-suv-tools@cbdb631258cab9c4f804a656a55f328854a331f6 -
Branch / Tag:
refs/tags/0.1.92 - Owner: https://github.com/statisticsnorway
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yaml@cbdb631258cab9c4f804a656a55f328854a331f6 -
Trigger Event:
push
-
Statement type: