Access clean external data easily.
Project description
Fidap Python Client
This Fidap client connect to our big data warehouses and gives you seamless access to external data.
NOTE: Fidap is currently invite only and requires an api_key
to work.
Installation
pip install fidap
Getting Started
from fidap import fidap_client
client = fidap_client(api_key="Paste API_KEY here from fidap dashboard")
you can also provide the database during initializing the client
from fidap import fidap_client
client = fidap_client(source='bq', api_key="Paste API_KEY here from fidap dashboard")
API
.sql
You can run your queries by using this method, it will return a Pandas dataframe containing the results of the query. Result would be None if something goes wrong i.e. incorrect query / not a valid API key.
from fidap import fidap_client
client = fidap_client(api_key="Paste API_KEY here from fidap dashboard")
df = client.sql(sql="paste your QUERY")
NOTE: You can also change the database at this level!
df = client.sql(sql="paste your QUERY", source="sf_gcp")
.send_email
You can send yourself or someone you know the Pandas dataframe as a csv attachment by using this method.
from fidap import fidap_client
client = fidap_client(api_key="Paste API_KEY here from fidap dashboard")
df = client.sql(sql="paste your QUERY")
success = client.send_email(df=df, emails=[]) #'List of Emails')
NOTE: By default, it will share the file containing 1000 rows and 30 columns only
.create_dataset
You can create dataset using this method and it can be seen on Dashboard
fidap.create_dataset(
name='xxx',
description='xxxx',
source='bq', project='xxxx',
dataset='xxxx',
public=False
)
.datasets
You can list dataset in json format or pandas dataframe by using this method
fidap.datasets(limit=100, json=True)
NOTE: By default, it will return only pandas dataframe of 100 datasets, you can increase the limit and change the output format.
.dataset
This method takes two arguments dataset_id and returns a dict of dataframes contains dataset info and its table.
fidap.dataset(dataset_id, json=False)
NOTE: By default json=False, when json=True it will return json.
.table
This method takes one argument table_id and returns a dict of dataframes contains table info and its fields list
fidap.table(table_id, json=False)
NOTE: By default json=False, when json=True it will return json.
.field
This method takes one argument field_id and returns pandas dataframe contains info about table field.
fidap.field(field_id, json=False)
NOTE: By default json=False, when json=True it will return json.
.update_dataset
This method takes 2 arguments 1st dataset_id 2nd dict of values
fidap.update_dataset(dataset_id=xxx, values=dict(description, name, is_public, additional_data=JSON))
.update_table
This method takes 2 arguments 1st table_id 2nd dict of values
fidap.update_table(table_id=xxx, values=dict(description, display_name, is_public, additional_data=JSON))
.update_field
This method takes 2 arguments 1st field_id 2nd dict of values
fidap.update_field(field_id=xxx, values=dict(description, display_name, additional_data=JSON))
.update_entity
This method takes 3 arguments entity name (dataset, table, field) and 2nd argument is entity's id and 3rd argument is dict, which attribute you want to update.
fidap.update_entity(
entity='dataset',
id=xxx,
values=dict(description="This dataset is very fascinating, fidap datasets are awesome")
)
.load_table_as_dataframe
Load table via delta share, df_type can be 'pandas' or 'spark'
fidap.load_table_as_dataframe(
share_name='xxx',
schema_name='xxx',
table_name='xxx',
df_type=pandas
)
Contributing
git clone https://github.com/fidapco/fidap-python-client.git
cd fidap-python-client
pip install --editable .
Change log
[0.0.1] - 2021-01-04
Initial version.
Added
fidap.sql()
runs a query on the Fidap DB.
Changed
Removed
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file fidap-0.0.16.tar.gz
.
File metadata
- Download URL: fidap-0.0.16.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92b9bda2490aa3229a719bc0a2ee6608e16d3fd15b97bcf6a66c6622f88dc644 |
|
MD5 | bb7106293e6435e112f27672dfa55e27 |
|
BLAKE2b-256 | cb8cce1713b6854eb25fa0f3d49b12866eadf9adc608223fc6605c480e3abe0f |
File details
Details for the file fidap-0.0.16-py3-none-any.whl
.
File metadata
- Download URL: fidap-0.0.16-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa85209a324112e210b6cf76b6c9efb22dfcdd093490d79a861c9b9d31c77071 |
|
MD5 | 479c48b4861b986e2eb03041127502b8 |
|
BLAKE2b-256 | 7f0a0c23b515c5faef3a510378185db1580db0dc4e8e0feecb810830d71ce2ac |