All Projects → roapi → Roapi

roapi / Roapi

Licence: apache-2.0
Create full-fledged APIs for static datasets without writing a single line of code.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Roapi

V8 Archive
Directus Database API — Wraps Custom SQL Databases with a REST/GraphQL API
Stars: ✭ 486 (+92.09%)
Mutual labels:  graphql, rest-api, sql
Rumble
⛈️ Rumble 1.11.0 "Banyan Tree"🌳 for Apache Spark | Run queries on your large-scale, messy JSON-like data (JSON, text, CSV, Parquet, ROOT, AVRO, SVM...) | No install required (just a jar to download) | Declarative Machine Learning and more
Stars: ✭ 58 (-77.08%)
Mutual labels:  s3, query, parquet
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+399.6%)
Mutual labels:  graphql, cloud-native, sql
Walkable
A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
Stars: ✭ 384 (+51.78%)
Mutual labels:  graphql, sql, query
Gitstats
An open source github contribution analyzer
Stars: ✭ 115 (-54.55%)
Mutual labels:  graphql, rest-api, analytics
Workshops
Workshops organized to introduce students to security, AI, AR/VR, hardware and software
Stars: ✭ 162 (-35.97%)
Mutual labels:  graphql, rest-api
Express Graphql Example
Example project how to use Express and GraphQL
Stars: ✭ 163 (-35.57%)
Mutual labels:  graphql, sql
Bigdata Playground
A complete example of a big data application using : Kubernetes (kops/aws), Apache Spark SQL/Streaming/MLib, Apache Flink, Scala, Python, Apache Kafka, Apache Hbase, Apache Parquet, Apache Avro, Apache Storm, Twitter Api, MongoDB, NodeJS, Angular, GraphQL
Stars: ✭ 177 (-30.04%)
Mutual labels:  graphql, parquet
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-25.69%)
Mutual labels:  graphql, rest-api
Basic Shopify Api
A simple API wrapper for Shopify using Guzzle for REST and GraphQL
Stars: ✭ 137 (-45.85%)
Mutual labels:  graphql, rest-api
Storefront Api
Storefront GraphQL API Gateway. Modular architecture. ElasticSearch included. Works great with Magento1, Magento2, Spree, OpenCart, Pimcore and custom backends
Stars: ✭ 180 (-28.85%)
Mutual labels:  graphql, rest-api
Tipe
🎉 Next Generation API-first CMS for developers. Generate an API-first CMS from a GraphQL schema with offline prototyping and an inline editor
Stars: ✭ 2,157 (+752.57%)
Mutual labels:  graphql, rest-api
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (-36.76%)
Mutual labels:  graphql, rest-api
Webtau
Webtau (short for web test automation) is a testing API, command line tool and a framework to write unit, integration and end-to-end tests. Test across REST-API, Graph QL, Browser, Database, CLI and Business Logic with consistent set of matchers and concepts. REPL mode speeds-up tests development. Rich reporting cuts down investigation time.
Stars: ✭ 156 (-38.34%)
Mutual labels:  graphql, rest-api
Sqldatasource
SQL DataSource for Apollo GraphQL projects
Stars: ✭ 176 (-30.43%)
Mutual labels:  graphql, sql
Use Http
🐶 React hook for making isomorphic http requests
Stars: ✭ 2,066 (+716.6%)
Mutual labels:  graphql, query
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-28.46%)
Mutual labels:  graphql, rest-api
Strapi Sdk Javascript
🔌 Official JavaScript SDK for APIs built with Strapi.
Stars: ✭ 247 (-2.37%)
Mutual labels:  graphql, rest-api
Graphql Rest Proxy
Turn your REST API into GraphQL - A Proxy Server that pipes request from GraphQL to REST with GraphQL DSL, performant nested children, mutations, input types, and more.
Stars: ✭ 218 (-13.83%)
Mutual labels:  graphql, rest-api
cubefs
CubeFS is a cloud native distributed storage platform.
Stars: ✭ 3,062 (+1110.28%)
Mutual labels:  s3, cloud-native

ROAPI

build Documentation

ROAPI automatically spins up read-only APIs for static datasets without requiring you to write a single line of code. It builds on top of Apache Arrow and Datafusion. The core of its design can be boiled down to the following:

  • Query frontends to translate SQL, GraphQL and REST API queries into Datafusion plans.
  • Datafusion for query plan execution.
  • Data layer to load datasets from a variety of sources and formats with automatic schema inference.
  • Response encoding layer to serialize intermediate Arrow record batch into various formats requested by client.

See below for a high level diagram:

roapi-design-diagram

Installation

Install pre-built binary

pip install roapi-http

Check out Github release page for pre-built binaries for each platform. Pre-built docker images are also available at ghcr.io/roapi/roapi-http.

Install from source

cargo install --git https://github.com/roapi/roapi --branch main --bin roapi-http

Usage

Quick start

Spin up APIs for test_data/uk_cities_with_headers.csv and test_data/spacex-launches.json:

roapi-http \
    --table 'uk_cities:test_data/uk_cities_with_headers.csv' \
    --table 'spacex_launches:test_data/spacex-launches.json'

Or using docker:

docker run -t --rm -p 8080:8080 ghcr.io/roapi/roapi-http:latest --addr 0.0.0.0:8080 \
    --table 'uk_cities:test_data/uk_cities_with_headers.csv' \
    --table 'spacex_launches:test_data/spacex-launches.json'

Query tables using SQL, GraphQL or REST:

curl -X POST -d "SELECT city, lat, lng FROM uk_cities LIMIT 2" localhost:8080/api/sql
curl -X POST -d "query { uk_cities(limit: 2) {city, lat, lng} }" localhost:8080/api/graphql
curl "localhost:8080/api/tables/uk_cities?columns=city,lat,lng&limit=2"

Get inferred schema for all tables:

curl 'localhost:8080/api/schema'

Config file

You can also configure multiple table sources using YAML config, which supports more advanced format specific table options:

addr: 0.0.0.0:8084
tables:
  - name: "blogs"
    uri: "test_data/blogs.parquet"

  - name: "ubuntu_ami"
    uri: "test_data/ubuntu-ami.json"
    option:
      format: "json"
      pointer: "/aaData"
      array_encoded: true
    schema:
      columns:
        - name: "zone"
          data_type: "Utf8"
        - name: "name"
          data_type: "Utf8"
        - name: "version"
          data_type: "Utf8"
        - name: "arch"
          data_type: "Utf8"
        - name: "instance_type"
          data_type: "Utf8"
        - name: "release"
          data_type: "Utf8"
        - name: "ami_id"
          data_type: "Utf8"
        - name: "aki_id"
          data_type: "Utf8"

  - name: "spacex_launches"
    uri: "https://api.spacexdata.com/v4/launches"
    option:
      format: "json"

  - name: "github_jobs"
    uri: "https://jobs.github.com/positions.json"

To run serve tables using config file:

roapi-http -c ./roapi.yml

See config documentation for more options including using Google spreadsheet as a table source.

Response serialization

By default, ROAPI encodes responses in JSON format, but you can request different encodings by specifying the ACCEPT header:

curl -X POST \
    -H 'ACCEPT: application/vnd.apache.arrow.stream' \
    -d "SELECT launch_library_id FROM spacex_launches WHERE launch_library_id IS NOT NULL" \
    localhost:8080/api/sql

REST API query interface

You can query tables through REST API by sending GET requests to /api/tables/{table_name}. Query operators are specified as query params.

REST query frontend currently supports the following query operators:

  • columns
  • sort
  • limit
  • filter

To sort column col1 in ascending order and col2 in descending order, set query param to: sort=col1,-col2.

To find all rows with col1 equal to string 'foo', set query param to: filter[col1]='foo'. You can also do basic comparisons with filters, for example predicate 0 <= col2 < 5 can be expressed as filter[col2]gte=0&filter[col2]lt=5.

GraphQL query interface

To query tables using GraphQL, send the query through POST request to /api/graphql endpoint.

GraphQL query frontend supports the same set of operators supported by REST query frontend. Here how is you can apply various operators in a query:

{
    table_name(
        filter: {
            col1: false
            col2: { gteq: 4, lt: 1000 }
        }
        sort: [
            { field: "col2", order: "desc" }
            { field: "col3" }
        ]
        limit: 100
    ) {
        col1
        col2
        col3
    }
}

SQL query interface

To query tables using a subset of standard SQL, send the query through POST request to /api/sql endpoint. This is the only query interface that supports table joins.

Features

Query layer:

  • [x] REST API GET
  • [x] GraphQL
  • [x] SQL
  • [ ] join between tables
  • [ ] support filter on nested struct fields
  • [ ] index
  • protocol
    • [ ] gRPC
    • [ ] MySQL
    • [ ] Postgres

Response serialization:

  • [x] JSON application/json
  • [x] Arrow application/vnd.apache.arrow.stream
  • [ ] msgpack

Data layer:

  • [x] filesystem
  • [x] HTTP/HTTPS
  • [x] S3
  • [ ] GCS
  • [x] Google spreadsheet
  • [ ] MySQL
  • [ ] Postgres
  • [ ] Airtable
  • Data format

Misc:

  • [ ] auto gen OpenAPI doc for rest layer
  • [ ] query input type conversion based on table schema
  • [ ] stream arrow encoding response
  • [ ] authentication layer

Development

The core of ROAPI, including query frontends and data layer, lives in the self-contained columnq crate. It takes queries and outputs Arrow record batches. Data sources will also be loaded and stored in memory as Arrow record batches.

The roapi-http crate wraps columnq with a HTTP based API layer. It serializes Arrow record batches produced by columnq into different formats based on client request.

Building ROAPI with simd optimization requires nightly rust toolchain.

Build Docker image

docker build --rm -t ghcr.io/roapi/roapi-http:latest .

You can set RELEASE variable to any git reference to build for a specific version.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].