Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Redash API Client written in Python.
pip install redash-api-client
from redashAPI import RedashAPIClient
# Create API client instance
"""
:args:
API_KEY
REDASH_HOST (optional): `http://localhost:5000` by default
"""
Redash = RedashAPIClient(API_KEY, REDASH_HOST)
URI | Supported Methods |
---|---|
users | GET, POST |
users/1 | GET, POST |
data_sources | GET, POST |
data_sources/1 | GET, POST, DELETE |
queries | GET, POST |
queries/1 | GET, POST, DELETE |
query_results | POST |
query_results/1 | GET |
visualizations | POST |
visualizations/1 | POST, DELETE |
dashboards | GET, POST |
dashboards/slug | GET, POST, DELETE |
widgets | POST |
widgets/1 | POST, DELETE |
### EXAMPLE ###
# List all Data Sources
res = Redash.get('data_sources')
res.json()
"""
[
{
'name': 'data_source1',
'pause_reason': None,
'syntax': 'sql',
'paused': 0,
'view_only': False,
'type': 'pg',
'id': 1
},
...
]
"""
# Retrieve specific Data Source
res = Redash.get('data_sources/1')
res.json()
"""
{
"scheduled_queue_name": "scheduled_queries",
"name": "test1",
"pause_reason": "None",
"queue_name": "queries",
"syntax": "sql",
"paused": 0,
"options": {
"password": "--------",
"dbname": "bi",
"user": ""
},
"groups": {
"1":False
},
"type": "pg",
"id": 1
}
"""
# Create New Data Source
Redash.post('data_sources', {
"name": "New Data Source",
"type": "pg",
"options": {
"dbname": DB_NAME,
"host": DB_HOST,
"user": DB_USER,
"passwd": DB_PASSWORD,
"port": DB_PORT
}
})
"""
{
"scheduled_queue_name": "scheduled_queries",
"name": "New Data Source",
"pause_reason": "None",
"queue_name": "queries",
"syntax": "sql",
"paused": 0,
"options": {
"dbname": DB_NAME,
"host": DB_HOST,
"user": DB_USER,
"passwd": DB_PASSWORD,
"port": DB_PORT
},
"groups": {
"2": False
},
"type": "pg",
"id": 2
}
"""
# Delete specific Data Source
Redash.delete('data_sources/2')
_type
name
options
### EXAMPLE ###
Redash.create_data_source("pg", "First Data Source", {
"dbname": DB_NAME,
"host": DB_HOST,
"user": DB_USER,
"passwd": DB_PASSWORD,
"port": DB_PORT
})
ds_id
name
qry
desc (optional)
with_results (optional)
True
by default.options (optional)
### EXAMPLE ###
Redash.create_query(1, "First Query", "SELECT * FROM table_name;")
qry_id
### EXAMPLE ###
Redash.refresh_query(1)
ds_id
qry
qry_id (optional)
max_age (optional)
parameters (optional)
return_results (optional)
True
by default.### EXAMPLE ###
Redash.generate_query_results(1)
ds_id
qry
timeout (optional)
### EXAMPLE ###
Redash.query_and_wait_result(1, 'select * from my_table;', 60)
qry_id
_type
table
, line
, column
, area
, pie
, scatter
, bubble
, box
, pivot
)name
columns (optional)
table
)x_axis (optional)
table
nor pivot
)y_axis (optional)
table
nor pivot
)size_column (optional)
group_by (optional)
custom_options (optional)
desc (optional)
### EXAMPLE 1 ###
Redash.create_visualization(1, "table", "First Visualization", columns=[
{"name": "column1", "type": "string"},
{"name": "column2", "type": "datetime"}
])
### EXAMPLE 2 ###
Redash.create_visualization(1, "line", "Second Visualization", x_axis="column1", y_axis=[
{"type": "line", "name": "column2", "label": "c2"}
])
name
### EXAMPLE ###
Redash.create_dashboard("First Dashboard")
db_id
text (optional)
vs_id (optional)
full_width (optional)
False
by default.position (optional)
### EXAMPLE 1 ###
Redash.add_widget(1, text="Test")
### EXAMPLE 2 ###
Redash.add_widget(1, visualization_id=1, full_width=True)
db_id
### EXAMPLE ###
url = Redash.publish_dashboard(1)
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Redash API Client
We found that redash-api-client 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.