Skip to main content

A simple, yet useful Python toolkit

Project description

CircleCI

Noos Energy Request Toolkit

This is a simple, yet useful toolkit that supports you in writing Python clients to microservices-style apps.

Installation

Package available from the PyPi repository:

pip install noos-pyk

Usage as a library

The project currently houses a boilerplate to build Python HTTP and WebSocket clients to web services.

As an example, to implement a Python client wrapping up HashiCorp's Terraform Cloud API,

# Import the namespace within your project
from noos_pyk.clients import auth, json


# Define a bearer token authentication class
class TerraformAuth(auth.HTTPTokenAuth):
    default_header = "Authorization"
    default_value = "Bearer"


# Wireup all components for a JSON REST client
class TerraformClient(json.JSONClient, auth.AuthClient):
    default_base_url = "https://app.terraform.io/api/"
    default_content_type = "application/vnd.api+json"

    default_auth_class = TerraformAuth

Development

On Mac OSX, make sure poetry has been installed and pre-configured,

brew install poetry

This project is shipped with a Makefile, which is ready to do basic common tasks.

~$ make
help                           Display this auto-generated help message
update                         Lock and install build dependencies
clean                          Clean project from temp files / dirs
format                         Run auto-formatting linters
install                        Install build dependencies from lock file
lint                           Run python linters
test                           Run pytest with all tests
package                        Build project wheel distribution
release                        Publish wheel distribution to PyPi

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

noos_pyk-0.0.10.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

noos_pyk-0.0.10-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

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