Demyst Python Cheat Sheet

For a quick reference to our Python API, check out our cheat sheet that contains the concise set of methods to enable access to external data.


Authorization

Username and Password


analytics_up = Analytics(username="EMAIL ADDRESS",
                        password="DEMYST PASSWORD")


API Key


analytics_key = Analytics(key="REPLACE W/ API KEY")


Single Sign On/SAML


analytics_sso = Analytics(username="EMAIL ADDRESS",
                        jwt="REPLACE W/ TOKEN")



Inputs

Validate Input Dataframe


analytics.validate(input_dataframe)


Validate Input Dataframe Against Product Input


analytics.validate(input_dataframe,
        providers=["PRODUCT NAME"])



Search

Product search using input


analytics.search(input_dataframe)


Product search w/ exact match for inputs


analytics.search(input_dataframe,
                strict=True)


Response Attribute Search


analytics.attribute_search("ATTRIBUTE_NAME")



Catalog

List all data products and details


analytics.products()


See catalog for a product


analytics.product_catalog(["PRODUCT/S NAME"])


See catalog for all products


analytics.product_catalog(all_products=TRUE)


View Inputs of a product


analytics.product_inputs(["PRODUCT/S NAME"])


View Outputs of a product


analytics.product_outputs(["PRODUCT/S NAME"])



Enrich

Get enriched data for your input dataframe


analytics.enrich_and_download(["PRODUCT/S NAME"],
                            input_dataframe)


Run enrichment asynchronously


analytics.enrich(["PRODUCT/S NAME"],
    input_dataframe)


Download the enrichment result from enrich()


analytics.enrich_download(enrich_job_ id)

Check if enrichment is complete


analytics.enrich_status(enrich_job_id)

Wait for enrichment completion


analytics.enrich_wait(enrich_job_id)


Cost of an enrichment


analytics.enrich_credits(["PRODUCT/S NAME"],
                        input_dataframe)



Stats

Statistics on enriched data


from demyst.analytics.report import *

    report(input_dataframe, enrich_result)


Statistics on the product and its attributes


analytics.product_stats(["PRODUCT/S NAME"])