Skip to main content

Cub Client for Python

Project description

https://github.com/praetoriandigital/cub-python/workflows/Tests/badge.svg

Requirements

Python version 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 or PyPy. For better security, we recommend to install Python Requests library, since it supports SSL certs verification. To install Requests, simply run:

$ pip install requests

or using easy_install:

$ easy_install requests

Requests library is optional. If it is not installed, Cub Client will use urllib2 instead. All features of Cub Client will remain fully functional, but it will not verify SSL certificate of Cub API.

Installation

Install using pip:

$ pip install cub

Usage

User Login

import cub

cub.config.api_key = '<your-secret-key>'

user = cub.User.login(
    username='<username>',
    password='<password>',
)

Get User by token

import cub

user = cub.User.get('<token>')

Report bugs

Report issues to the project’s Issues Tracking on Github.

Development

Run tests with local python:

$ INTEGRATION_TESTS_SECRET_KEY={key} INTEGRATION_TESTS_USER_PASS={password} pytest -v --tb=short tests.py

Install tox:

$ pip install tox

Run tests with tox:

$ INTEGRATION_TESTS_SECRET_KEY={key} INTEGRATION_TESTS_USER_PASS={password} tox

To install additional pythons, you can use pyenv:

$ pyenv install 3.11
$ pyenv install 3.10
...
$ # in project dir run pyenv local, use
$ pyenv local system 3.10.x 3.11.x

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

cub-0.29.0.tar.gz (9.3 kB view details)

Uploaded Source

File details

Details for the file cub-0.29.0.tar.gz.

File metadata

  • Download URL: cub-0.29.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cub-0.29.0.tar.gz
Algorithm Hash digest
SHA256 27308b6c699b93fce37b17eb18a5f9174cf6b371d1c38e3b1b49eb131aa66961
MD5 b34912ba1aeb4a5c21f49e9bcf28a4d6
BLAKE2b-256 a47f40e7fc05fee960867aedc5bed7179bde47e96bf040cb22cdf59f03f4bbae

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