Metadata-Version: 2.1
Name: pytechfin
Version: 1.0.1
Summary: Techfin Python API and Tools
Home-page: https://github.com/jnefoussi/pytechfin
Author: Jonathan J Nefoussi
Author-email: jnefoussi@gmail.com
Maintainer: Jonathan J Nefoussi
License: MIT
Keywords: TOTVS Techfin,Carol.ai,TOTVS
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Operating System :: OS Independent
Description-Content-Type: text/x-rst
Provides-Extra: complete
License-File: LICENSE

.. note::
   For the latest source, discussion, etc, please visit the
   `GitHub repository <https://github.com/jnefoussi/pytechfin>`_


.. image:: https://raw.githubusercontent.com/jnefoussi/pytechfin/main/logos/pytechfin_logo.png

============
pytechfin
============

Initializing 
------------

.. code:: python

    from pytechfin import Techfin, TOTVSRacAuth

    cred = {
        "client_id": "123",
        "client_secret": "123",  }

    auth = TOTVSRacAuth(**cred)
    tf = Techfin(auth)


Good practice using token
-------------------------

Never write in plain text your credentials. One can use 
the environment variables

 1. ``TECHFINCLIENTID`` for the client ID
 2. ``TECHFINCLIENTSECRET`` for the client secret
 3. ``CAROLUSER`` Carol User with tenant access
 4. ``CAROLPWD`` Carol User Password
 
 e.g., one can create a ``.env`` file like this:

.. code:: python

    TECHFINCLIENTID=123
    TECHFINCLIENTSECRET=1234
    CAROLUSER=mycaroluser@mail.com
    CAROLUSER=My@Pwd

and then

.. code:: python

    from pytechfin import Techfin
    from dotenv import load_dotenv
    load_dotenv(".env") #this will import these env variables to your execution.
    tf = Techfin()

