Skip to main content

RestBase

Python License: MIT GitHub Repo

RestBase is a Python-based CLI tool that lets you fetch data from any REST API and sync it directly into a PostgreSQL database. It automatically infers table schemas from JSON responses, creates tables, and inserts data — no SQL or ORM required.


🚀 Features

  • 🌐 Query parameter support per endpoint
  • 🔍 Automatic schema inference from JSON
  • 📦 Nested JSON handled as JSONB columns
  • 🛠 Table creation only if not already present
  • ⚡ Fast, minimal CLI
  • ✅ Interactive config builder (no manual editing)

📦 Installation

Install directly from PyPI:

pip install restbase-cli

restbase

Or via Python module

python -m restbase

🛠 First-Time Setup

When you first run restbase, it will ask you for:

  • API base URL and endpoints
  • Optional query parameters
  • PostgreSQL credentials

This generates a config.yaml file used for syncing.


🧪 Example config.yaml

api:
  base_url: https://api.openbrewerydb.org/v1
  headers: {}
  endpoints:
    - path: /breweries
      params:
        by_city: san_diego
postgres:
  host: localhost
  port: 5432
  dbname: restbase_db
  user: postgres
  password: secret

🔧 Tech Stack

  • Python 3.7+
  • PostgreSQL
  • Libraries: requests, psycopg2-binary, PyYAML

🙋 Contributing

Pull requests are welcome!

To run the project locally:

git clone https://github.com/soumyadeep423/restbase-cli.git
cd restbase-cli
pip install .
pip install -e . #edit mode
restbase

📝 License

Licensed under the MIT License.


📫 Author

Soumyadeep Das GitHub: @soumyadeep423


Metadata

Release files for restbase-cli 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for restbase-cli 0.0.2
File Size Uploaded
restbase_cli-0.0.2.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for restbase-cli 0.0.2
File Interpreter ABI Platform
restbase_cli-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 kB

Release files / restbase_cli-0.0.2.tar.gz

Download URL restbase_cli-0.0.2.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0c12c1461362e4a8de50787277687de679da344bc86a4b754ea4f8c8c44a9ba8
BLAKE2b-256 checksum
How to use checksums
97bf489e56687718cfea299bd31ee36380fb58d5e1eb76ae49343055460736c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / restbase_cli-0.0.2-py3-none-any.whl

Download URL restbase_cli-0.0.2-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccfbea71e3fb485ddb22a54ef2495992d473017097364bc04dbcdcff9aa02497
BLAKE2b-256 checksum
How to use checksums
4cfdc56d248b979ce0c143e1850e695da8ece7f54a6659a15684a92000cbaf2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page