Skip to main content

An API Wrapper written for restdb.io which helps host online databases.

Project description

Restdb.io API Wrapper

This package is an API Wrapper for the website restdb.io, which allows for online databases. The API calls to the databases rely on the Rest API, I just made python classes and methods to make things easier to work with. The package is still in development stage, and I have so far only been able to implement a CollectionAPI class, along with custom decorators and exceptions.

Installation

pip install restdbio_api_wrapper

or

python -m pip install restdbio_api_wrapper

Usage

Using the package to connect to your database on restdb.io is pretty straightforward. First of all, you need your dburl and x-apikey. dburl is mostly the same as your database name in the Databases dashboard. Head over to the following link to see your api key: https://restdb.io/account/databases/<dburl>/api
Then, put the following line in your code:

from restdbio_api_wrapper import Connection

Proceed to creating a Connection object:

database_connection = Connection(<dburl>, <x-apikey>)

Everything will be set up for you after this. You can access the CollectionAPI object automatically created within the Connection object using the .collection_api attribute. Through your CollectionAPI object, you are able to make API calls directed at your collection in your database. For example:

result = database_connection.collection_api.get_records_from_collection("demo_collection", q={"first_name": "Jack"})

You can of course, use different methods, customize your queries, use additional parameters like max, skip, filter, groupby, aggregate and so on. Issue the following line to see all methods available:

help(database_connection.collection_api)

Contributing

As I've said earlier, this package is still in development stage. Should you have any issues or ideas, feel free to contribute. You can also e-mail me: hesenisgenderli999@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

restdbio_api_wrapper-0.0.12.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file restdbio_api_wrapper-0.0.12.tar.gz.

File metadata

  • Download URL: restdbio_api_wrapper-0.0.12.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for restdbio_api_wrapper-0.0.12.tar.gz
Algorithm Hash digest
SHA256 835eae475fccd2146d6a2cd1431f427e993afa776d1fbc6b5db51ae88f5b5f3c
MD5 84fedd453050337b3f67f6dae90b4bd6
BLAKE2b-256 789d661595285e36f929a532645cac80b9dc1f39b122a0d65f627882984a5d64

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page