Metadata-Version: 2.4
Name: cub
Version: 0.29.0
Summary: Cub Client for Python
Home-page: https://github.com/praetoriandigital/cub-python
Author: Denis Stebunov
Author-email: support@praetoriandigital.com
License: The MIT License (MIT)
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=2.7.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4
License-File: LICENSE
Requires-Dist: requests>=0.9
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

Cub Client for Python
=====================

.. image:: https://github.com/praetoriandigital/cub-python/workflows/Tests/badge.svg
        :target: https://github.com/praetoriandigital/cub-python/actions?query=workflow%3ATests

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.

.. _`Python Requests`: http://docs.python-requests.org/

Installation
------------

Install using pip::

    $ pip install cub

Usage
-----

User Login
~~~~~~~~~~

.. code:: python

    import cub

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

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


Get User by token
~~~~~~~~~~~~~~~~~

.. code:: python

    import cub

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


Report bugs
-----------

Report issues to the project's `Issues Tracking`_ on Github.

.. _`Issues Tracking`: https://github.com/praetoriandigital/cub-python/issues


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

.. _`pyenv`: https://github.com/pyenv/pyenv/
