Content-Length: 273009 | pFad | http://dqops.com/docs/client/operations/dictionaries/

DQOps REST API dictionaries operations
Skip to content

Last updated: January 14, 2025

DQOps REST API dictionaries operations

Operations for managing data dictionary CSV files in DQOps. Data dictionaries can be used in accepted_values data quality checks.


create_dictionary

Creates (adds) a new data dictionary CSV file, which creates a file in the DQOps user's home dictionaries/ folder named as the dictionary and with the content that is provided in this call.

Follow the link to see the source code on GitHub.

POST

http://localhost:8888/api/dictionaries

Request body

 Description                       Data type   Required 
Data dictionary model DataDictionaryModel

Usage examples

Execution

curl -X POST http://localhost:8888/api/dictionaries^
    -H "Accept: application/json"^
    -H "Content-Type: application/json"^
    -d^
    "{\"dictionary_name\":\"sample_dictionary\",\"file_content\":\"USD\nEUR\nGBP\nAUD\nCHF\n\"}"

Execution

from dqops import client
from dqops.client.api.dictionaries import create_dictionary
from dqops.client.models import DataDictionaryModel

dqops_client = client.Client(
    'http://localhost:8888/'
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = create_dictionary.sync(
    client=dqops_client,
    json_body=request_body
)

Execution

from dqops import client
from dqops.client.api.dictionaries import create_dictionary
from dqops.client.models import DataDictionaryModel

dqops_client = client.Client(
    'http://localhost:8888/'
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = await create_dictionary.asyncio(
    client=dqops_client,
    json_body=request_body
)

Execution

from dqops import client
from dqops.client.api.dictionaries import create_dictionary
from dqops.client.models import DataDictionaryModel

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = create_dictionary.sync(
    client=dqops_client,
    json_body=request_body
)

Execution

from dqops import client
from dqops.client.api.dictionaries import create_dictionary
from dqops.client.models import DataDictionaryModel

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = await create_dictionary.asyncio(
    client=dqops_client,
    json_body=request_body
)

delete_dictionary

Deletes a data dictionary CSV file from the DQOps user's home dictionaries/ folder.

Follow the link to see the source code on GitHub.

DELETE

http://localhost:8888/api/dictionaries/{dictionaryName}

Parameters of this method are described below

 Property name   Description                       Data type   Required 
dictionary_name Data dictionary name string

Usage examples

Execution

curl -X DELETE http://localhost:8888/api/dictionaries/status_codes.csv^
    -H "Accept: application/json"

Execution

from dqops import client
from dqops.client.api.dictionaries import delete_dictionary

dqops_client = client.Client(
    'http://localhost:8888/'
)

call_result = delete_dictionary.sync(
    'status_codes.csv',
    client=dqops_client
)

Execution

from dqops import client
from dqops.client.api.dictionaries import delete_dictionary

dqops_client = client.Client(
    'http://localhost:8888/'
)

call_result = await delete_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client
)

Execution

from dqops import client
from dqops.client.api.dictionaries import delete_dictionary

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token
)

call_result = delete_dictionary.sync(
    'status_codes.csv',
    client=dqops_client
)

Execution

from dqops import client
from dqops.client.api.dictionaries import delete_dictionary

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token
)

call_result = await delete_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client
)

download_dictionary

Downloads a data dictionary CSV file

Follow the link to see the source code on GitHub.

GET

http://localhost:8888/api/dictionaries/{dictionaryName}/download

Parameters of this method are described below

 Property name   Description                       Data type   Required 
dictionary_name Data dictionary CSV file name string

Usage examples

Execution

curl http://localhost:8888/api/dictionaries/status_codes.csv/download^
    -H "Accept: application/json"

Execution

from dqops import client
from dqops.client.api.dictionaries import download_dictionary

dqops_client = client.Client(
    'http://localhost:8888/',
    raise_on_unexpected_status=True
)

call_result = download_dictionary.sync(
    'status_codes.csv',
    client=dqops_client
)

Execution

from dqops import client
from dqops.client.api.dictionaries import download_dictionary

dqops_client = client.Client(
    'http://localhost:8888/',
    raise_on_unexpected_status=True
)

call_result = await download_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client
)

Execution

from dqops import client
from dqops.client.api.dictionaries import download_dictionary

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token,
    raise_on_unexpected_status=True
)

call_result = download_dictionary.sync(
    'status_codes.csv',
    client=dqops_client
)

Execution

from dqops import client
from dqops.client.api.dictionaries import download_dictionary

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token,
    raise_on_unexpected_status=True
)

call_result = await download_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client
)

get_all_dictionaries

Returns a list of all data dictionary CSV files that are present in the DQOps user's home dictionaries/ folder.

Follow the link to see the source code on GitHub.

GET

http://localhost:8888/api/dictionaries

Return value

 Property name   Description                       Data type 
data_dictionary_list_model List[DataDictionaryListModel]

Usage examples

Execution

curl http://localhost:8888/api/dictionaries^
    -H "Accept: application/json"
Expand to see the returned result
[ {
  "can_edit" : false,
  "can_access_dictionary" : false
}, {
  "can_edit" : false,
  "can_access_dictionary" : false
}, {
  "can_edit" : false,
  "can_access_dictionary" : false
} ]

Execution

from dqops import client
from dqops.client.api.dictionaries import get_all_dictionaries

dqops_client = client.Client(
    'http://localhost:8888/',
    raise_on_unexpected_status=True
)

call_result = get_all_dictionaries.sync(
    client=dqops_client
)
Expand to see the returned result
[
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    )
]

Execution

from dqops import client
from dqops.client.api.dictionaries import get_all_dictionaries

dqops_client = client.Client(
    'http://localhost:8888/',
    raise_on_unexpected_status=True
)

call_result = await get_all_dictionaries.asyncio(
    client=dqops_client
)
Expand to see the returned result
[
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    )
]

Execution

from dqops import client
from dqops.client.api.dictionaries import get_all_dictionaries

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token,
    raise_on_unexpected_status=True
)

call_result = get_all_dictionaries.sync(
    client=dqops_client
)
Expand to see the returned result
[
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    )
]

Execution

from dqops import client
from dqops.client.api.dictionaries import get_all_dictionaries

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token,
    raise_on_unexpected_status=True
)

call_result = await get_all_dictionaries.asyncio(
    client=dqops_client
)
Expand to see the returned result
[
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    ),
    DataDictionaryListModel(
        can_edit=False,
        can_access_dictionary=False
    )
]

get_dictionary

Returns the content of a data dictionary CSV file as a model object

Follow the link to see the source code on GitHub.

GET

http://localhost:8888/api/dictionaries/{dictionaryName}

Return value

 Property name   Description                       Data type 
data_dictionary_model DataDictionaryModel

Parameters of this method are described below

 Property name   Description                       Data type   Required 
dictionary_name Data dictionary CSV file name string

Usage examples

Execution

curl http://localhost:8888/api/dictionaries/status_codes.csv^
    -H "Accept: application/json"
Expand to see the returned result
{
  "dictionary_name" : "sample_dictionary",
  "file_content" : "USD\nEUR\nGBP\nAUD\nCHF\n"
}

Execution

from dqops import client
from dqops.client.api.dictionaries import get_dictionary

dqops_client = client.Client(
    'http://localhost:8888/',
    raise_on_unexpected_status=True
)

call_result = get_dictionary.sync(
    'status_codes.csv',
    client=dqops_client
)
Expand to see the returned result
DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

Execution

from dqops import client
from dqops.client.api.dictionaries import get_dictionary

dqops_client = client.Client(
    'http://localhost:8888/',
    raise_on_unexpected_status=True
)

call_result = await get_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client
)
Expand to see the returned result
DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

Execution

from dqops import client
from dqops.client.api.dictionaries import get_dictionary

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token,
    raise_on_unexpected_status=True
)

call_result = get_dictionary.sync(
    'status_codes.csv',
    client=dqops_client
)
Expand to see the returned result
DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

Execution

from dqops import client
from dqops.client.api.dictionaries import get_dictionary

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token,
    raise_on_unexpected_status=True
)

call_result = await get_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client
)
Expand to see the returned result
DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

update_dictionary

Updates an existing data dictionary CSV file, replacing the dictionary's file content.

Follow the link to see the source code on GitHub.

PUT

http://localhost:8888/api/dictionaries/{dictionaryName}

Parameters of this method are described below

 Property name   Description                       Data type   Required 
dictionary_name Data dictionary file name that will be updated string

Request body

 Description                       Data type   Required 
Data dictionary model DataDictionaryModel

Usage examples

Execution

curl -X PUT http://localhost:8888/api/dictionaries/status_codes.csv^
    -H "Accept: application/json"^
    -H "Content-Type: application/json"^
    -d^
    "{\"dictionary_name\":\"sample_dictionary\",\"file_content\":\"USD\nEUR\nGBP\nAUD\nCHF\n\"}"

Execution

from dqops import client
from dqops.client.api.dictionaries import update_dictionary
from dqops.client.models import DataDictionaryModel

dqops_client = client.Client(
    'http://localhost:8888/'
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = update_dictionary.sync(
    'status_codes.csv',
    client=dqops_client,
    json_body=request_body
)

Execution

from dqops import client
from dqops.client.api.dictionaries import update_dictionary
from dqops.client.models import DataDictionaryModel

dqops_client = client.Client(
    'http://localhost:8888/'
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = await update_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client,
    json_body=request_body
)

Execution

from dqops import client
from dqops.client.api.dictionaries import update_dictionary
from dqops.client.models import DataDictionaryModel

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = update_dictionary.sync(
    'status_codes.csv',
    client=dqops_client,
    json_body=request_body
)

Execution

from dqops import client
from dqops.client.api.dictionaries import update_dictionary
from dqops.client.models import DataDictionaryModel

token = 's4mp13_4u7h_70k3n'

dqops_client = client.AuthenticatedClient(
    'http://localhost:8888/',
    token=token
)

request_body = DataDictionaryModel(
    dictionary_name='sample_dictionary',
    file_content='USD
    EUR
    GBP
    AUD
    CHF
    '
)

call_result = await update_dictionary.asyncio(
    'status_codes.csv',
    client=dqops_client,
    json_body=request_body
)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://dqops.com/docs/client/operations/dictionaries/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy