Skip to main content

Some BLiP functionalities right out of the box

Project description

# blipy

Blipy is a http requester made specifically to be used with [BLiP.ai](https://portal.blip.ai/) endpoints, with some requests right out of the box. Available endpoints can be found in [BLiP documentation](https://docs.blip.ai).

  • Instantiate requesters classes using the bot key

  • No need to request all resources manually

  • Magic

## Installation

Use pip to install the package.

`sh $ pip install blipy `

## Modules

Blipy offers the following modules.

Modules | Description |
—— | —— |
Types | Contains base types for the package |
Http | Requesters like Lime and Postmaster |
Postmasters | Pre configured Postmasters |

### Types

Base types are used to have more control on operations over data

#### Data `python Data.new(method, uri, toId, resourceType = None, resource = None) ` Used by Lime client to output a json body to every request

#### Date `python Date.new(year, month, day, hour = 0, minute = 0, second = 0) ` Outputs a date in the format of a Lime QueryString

`python Date.interval(startDate, endDate) ` Outputs an object with keys startDate and endDate

#### Method Dictionary to store the Lime methods used in requests

#### Response Class of serializable data to store Lime responses

#### Resource Class of serializable data to store Lime resources, which are part of responses

#### Serializable Serializable receives a json and creates a new object such as its members are capitalized keys of that json. This enables storing any json as an object without using Python’s reserved words such as from and id

#### URI `python new(baseuri, params = None) ` Outputs an encoded URI to use with Lime, receiving params as a dictionary such as each param will be incorporated to the URI as key=value

### Http

HTTP clients used to make requests to Lime. They require a bot authorization key, which can be obtained [here](https://docs.blip.ai/#http). Just copy and paste.

#### Lime Stardand Lime client to make any request

`python lime = Lime(authorization) ` Creates a new instance of lime using a bot authorization key

`python lime.Get(uri, toId) ` Returns a response to a get command to uri and receiver toId

`python lime.Set(uri, toId, resourceType, resource) ` Returns a response to a set command to uri and receiver toId, with resource of resourceType

`python lime.Delete(uri, toId) ` Returns a response to a delete command to uri and receiver toId

`python lime.GetAll(uri, toId) ` Returns a response with all resources to uri and receiver toId

`python lime.SetAll(uri, toId, resourceType, resources) ` Returns a response to a set of set commands to uri and receiver toId, with multiple resources of resourceType

`python lime.DeleteAll(uri, toId, ids) ` Returns a response to a set of delete commands to uri and receiver toId, with ids of resources to be deleted

#### Postmaster A Postmaster is responsible for handling messages inside an application. The only difference between Postmaster and Lime is that the parameter toId gets subtracted, since the postmaster is a receiver of fixed identity of name postmaster@APPLICATION_NAME.msging.net where APPLICATION_NAME is the name of the corresponding application

`python pm = Postmaster(authorization, name) ` Creates a new postmaster client to send requests to postmaster@`name`.msging.net

### Postmasters Pre configured postmaster with the most common operations available

#### AIPostmaster Client to send messages to AI application

`python aip = AIPostmaster(authorization) ` Creates a new instance of AI Postmaster using a bot authorization key

#### AnalyticsPostmaster Client to send messages to Analytics application

`python anp = AnalyticsPostmaster(authorization) ` Creates a new instance of Analytics Postmaster using a bot authorization key

### Todos
  • Write tests

  • Complete available postmasters

  • Add more postmasters

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

blipy-0.0.6.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blipy-0.0.6-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file blipy-0.0.6.tar.gz.

File metadata

  • Download URL: blipy-0.0.6.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for blipy-0.0.6.tar.gz
Algorithm Hash digest
SHA256 4f30cd2e6632bc93a3febbe71f71d81749cdbc15f7d431ac7c7117ddda5e8a9e
MD5 12fe0f68a3ca573628791ad26d5d7f83
BLAKE2b-256 334e5605469e3d4b7101c9c7f12b4accb80fa435a48db03486026b7bbd12a781

See more details on using hashes here.

File details

Details for the file blipy-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: blipy-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for blipy-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e6eefafda49834bb3e89520fce6684343db0b0cdd88a1dc63fbdd59c9e0606fe
MD5 2a52220d3cf7bd080c9788837e48cce1
BLAKE2b-256 978a9f2e701dc061a5dd0e2b4fb14fc8e17d267677544a2925af5763a67a19a1

See more details on using hashes here.

Supported by

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