
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Domo API functions to import and export data into usable Pandas dataframes and manage your Domo instancea
This is a series of important Python functions that will allow you to easy work with the Domo API, including exporting and importing data.
Run this command in your Terminal
pip install domo_python
Add this line of Python to the top of any Python script you are using with an integration to Domo
import domo_python
For each request you make to the Domo API, you will need to include an Access Token. For most tasks, you will only need to do this once for all of your calls to the Domo API but the Token can timeout so you will see that we will automatically be creating new Access Tokens for certain tasks like importing and exporting data to ensure a new Access Token has been created
token = domo_python.get_access_token( client_id, client_secret )
print(token)
In order to import data into Domo, you will need to create a Domo dataset first. You will need to follow Domo's schema rules, which are passed to Domo as a JSON object. The following shows an example of how to do this, but you can find more examples in the Domo API documentation as well.
Creating Domo Dataset from Domo API Documentation
dataset_schema = """{
"name" : "Domo API | Sample Domo Dataset Name",
"description" : "This dataset came from the Domo API",
"rows" : 0,
"schema" : {
"columns" : [ {
"type" : "STRING",
"name" : "group"
},{
"type" : "DATETIME",
"name" : "ds"
},{
"type" : "LONG",
"name" : "y"
} ]
}
}"""
domo_python.create_new_domo_dataset ( token, dataset_schema)
The following shows how to get your Domo dataset into a Pandas dataframe, which you can then use for any further analysis or ETL work.
df = domo_python.domo_csv_to_dataframe ( historicalDatasetId, client_id, client_secret )
df.head()
The following shows how to import data from a dataframe into Domo. You will need to first create the dataset as shown above in the Creating a New Dataset section.
domo_python.dataframe_to_domo_dataset ( df, timeseriesForecastDatasetID, client_id, client_secret )
The following shows how to get your Domo dataset onto an SFTP server.
This function has two requirements:
filename = 'fake_file_name'
host = 'sftp.example.com'
username = 'fake_user_name'
password = 'fake_password'
port = 253 # defaults to 22 if not included
df = domo_python.domo_csv_to_dataframe ( historicalDatasetId, client_id, client_secret )
domo_python.domo_to_sftp(filename, df, host, username, password, port)
This repo also contains an example Jupyter Notebook with pre-written examples in the domo-python-examples.ipynb file. To access this, you will need to install Jupyter Notebooks, I recommend doing this through Anaconda.
After you've installed Jupyter Notebooks, you will navigate in your Terminal to the folder where you downloaded this repo and run the following command:
jupyter notebooks
FAQs
Domo API functions to import and export data into usable Pandas dataframes and manage your Domo instancea
We found that domo-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.