Giter Site home page Giter Site logo

certn-python-public's Introduction

certn-python

A Python client for Certn. API

Latest PyPI version

Latest Travis CI build status

made-with-python

MIT license

Installation

pip install certn-python

Requirements

  • requests>=2,<3

Basic Usage

Submit an application and check its results

from certn import Client
import time


client = Client(username='*****' password='***')

body = {
    "information": {
        "first_name": "Fake",
        "last_name": "Name",
        "date_of_birth": "1987-03-04",
        "addresses": [
            {
                "address": "123 fakestreet",
                "city": "VICTORIA",
                "province_state": "BC",
                "country": "CA"
            }
        ]
    }
}

application = client.Applications.quick(body)

while application.status == 'Analyzing':
    time.sleep(5)  # 2-10 seconds to process, but can occasionally take up to 300 seconds
    application = client.Applicants.get(application.id)

print('Application has returned!')

client.logout()

Invite an applicant to apply

from certn import Client

client = Client(username='*****' password='***')

body = {
    'email': '[email protected]',
    'email_applicants': False
}

application = client.Applications.invite(body)

client.logout()

List all the logged in sessions and log them all count

from certn import Client

client = Client(username='*****' password='***')

client.Auth.list()

client.Auth.logout_all()

add a property, list, get the property information and remove the property

from certn import Client

client = Client(username='*****' password='***')

body = {
    'address': '123 fakestreet',
    'city': 'VICTORIA',
    'province_state': 'BC',
    'owner_id': client.user_id,
}

property = client.Properties.add(body)

client.Properties.list()

client.Properties.get(property.get('id'))

client.Properties.delete(property.get('id'))

client.logout()

add a listing, list, get the listings information and remove the listing

from certn import Client

client = Client(username='*****' password='***')

body = {
    'address': '123 fakestreet',
    'city': 'VICTORIA',
    'province_state': 'BC',
    'owner_id': client.user_id,
}

property = client.Properties.add(body)

body = {
    'rent': 1000,
    'owner_id': client.user_id,
    'property_id': property.get('id'),
    'notification_list_ids': [],
}

listing = client.Listings.add(body)

client.Listings.list()

client.Listings.get(listing.get('id'))

client.Listings.delete(listing.get('id'))

client.Properties.delete(property.get('id'))

client.logout()

can also be called alternatively

from certn import Client

with Client(username, password) as client:
    client.Listings.list()

Authors

certn-python was written by Bungalow Living.

certn-python-public's People

Contributors

ableeck avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

divi255

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.