Code Monkey home page Code Monkey logo

dataapi's Introduction

DataAPI

Goals

Create a data API to share data in Databricks

Demo

# Running the API
docker-compose up

# Submitting a data request

curl -X 'POST' \
  'http://127.0.0.1:18000/data' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "entity_name": "Individual",
  "key": "TIN",
  "value": "123-45-6789",
  "start_date": "string",
  "end_data": "string"
}'

# Get data request

curl -X 'GET' \
'http://127.0.0.1:18000/data/4f09eaf3-c98a-414e-b90c-9d2a9dfa6a83' \
  -H 'accept: application/json'

## Output
{
  "request_id": "4f09eaf3-c98a-414e-b90c-9d2a9dfa6a83",
  "status": "processing",
  "data": []
}

High Level Functionality

  • Authenticate & Authorize users
  • Generate tokens to allow access to data with TTL
  • Ability to request data
  • Ability to download data
  • Store data requests for audit

API Design

Pre-requisites

  1. Databricks SQL Warehouse is running

Detailed Design

  1. User submits data request to a public API and return a request_id
    • client_id, requested_ts, request_info log for auditing
    • Store request
  2. User use request_id to verify status of request
  3. Private api polls requests
  4. Construct SQLQuery
  5. Private api has permissions to execute query Databricks SQL Warehouse
  6. read permission to allow running queries on Databricks SQLWarehouse
  7. Private api queries SQLWarehouse and returns the data

References

  1. databricks-sdk-py/examples

dataapi's People

Contributors

sharattadimalla avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.