<commit_before>TerminalOne-Python
==================

Python library for MediaMath's APIs. This library consists of
classes for working with T1 APIs and managing entities. It is written
for Python 2.7 and >=3.3. Compatibility with Python 3 is made possible
by bundling the module `six <https://pypi.python.org/pypi/six>`__.

API Documentation is availble at
`https://developer.mediamath.com/docs/TerminalOne_API_Overview <https://developer.mediamath.com/docs/TerminalOne_API_Overview>`__.

Table of Contents
-----------------

-  `Installation <#installation>`__
-  `Usage <#usage>`__

   -  `Service Object <#service-object>`__
   -  `Fetching Entities and
      Collections <#fetching-entities-and-collections>`__

      -  `Collections <#collections>`__
      -  `Searching for entities <#searching-for-entities>`__
      -  `Entities <#entities>`__
      -  `Reports <#reports>`__
      -  `Appendix <#appendix>`__

-  `Contact <#contact>`__
-  `Copyright <#copyright>`__

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

Installation is simple with pip in a virtual environment:

.. code:: bash

    $ pip install --extra-index-url=https://code.mediamath.com/pypi/simple/ TerminalOne

The ``--extra-index-url`` flag specifies a package index URL; this is
where the code is hosted. Alternatively, download the latest tag of the
repository as a tarball or zip file and run:

.. code:: bash

    $ python setup.py install

Usage
-----

Service Object
~~~~~~~~~~~~~~

*class* ``terminalone.T1``\ (*username*\ =\ ``None``,
*password*\ =\ ``None``, *api\_key*\ =\ ``None``,
*auth\_method*\ =\ ``None``, *session\_id*\ =\ ``None``,
*environment*\ =\ ``"production"``, *api\_base*\ =\ ``None``)

The starting point for this package. Authentication and session, entity
retrieval, creation, etc. are handled here. Parameters:

-  *username*: Username of a valid T1 user (that is, valid at
   `https://t1.mediamath.com <https://t1.mediamath.com>`__).
-  *password*: Password for corresponding T1 user
-  *api\_key*: Approved API key generated at `MediaMath's Developer
   Portal <https://developer.mediamath.com>`__.
-  *session\_id*: For applications receiving a session ID instead of
   user credentials, such as an app in T1's Apps tab. *api\_key* should
   still be provided.
-  *auth\_method*: string enum corresponding to which method of<commit_msg>Update installation location to PyPI<commit_after>TerminalOne-Python
==================

Python library for MediaMath's APIs. This library consists of
classes for working with T1 APIs and managing entities. It is written
for Python 2.7 and >=3.3. Compatibility with Python 3 is made possible
by bundling the module `six <https://pypi.python.org/pypi/six>`__.

API Documentation is availble at
`https://developer.mediamath.com/docs/TerminalOne_API_Overview <https://developer.mediamath.com/docs/TerminalOne_API_Overview>`__.

Table of Contents
-----------------

-  `Installation <#installation>`__
-  `Usage <#usage>`__

   -  `Service Object <#service-object>`__
   -  `Fetching Entities and
      Collections <#fetching-entities-and-collections>`__

      -  `Collections <#collections>`__
      -  `Searching for entities <#searching-for-entities>`__
      -  `Entities <#entities>`__
      -  `Reports <#reports>`__
      -  `Appendix <#appendix>`__

-  `Contact <#contact>`__
-  `Copyright <#copyright>`__

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

Installation is simple with pip in a virtual environment:

.. code:: bash

    $ pip install TerminalOne

Alternatively, download the latest tag of the
repository as a tarball or zip file and run:

.. code:: bash

    $ python setup.py install

Usage
-----

Service Object
~~~~~~~~~~~~~~

*class* ``terminalone.T1``\ (*username*\ =\ ``None``,
*password*\ =\ ``None``, *api\_key*\ =\ ``None``,
*auth\_method*\ =\ ``None``, *session\_id*\ =\ ``None``,
*environment*\ =\ ``"production"``, *api\_base*\ =\ ``None``)

The starting point for this package. Authentication and session, entity
retrieval, creation, etc. are handled here. Parameters:

-  *username*: Username of a valid T1 user (that is, valid at
   `https://t1.mediamath.com <https://t1.mediamath.com>`__).
-  *password*: Password for corresponding T1 user
-  *api\_key*: Approved API key generated at `MediaMath's Developer
   Portal <https://developer.mediamath.com>`__.
-  *session\_id*: For applications receiving a session ID instead of
   user credentials, such as an app in T1's Apps tab. *api\_key* should
   still be provided.
-  *auth\_method*: string enum corresponding to which method of
{'fraction_non_alphanumeric': 0.15808091974353305, 'fraction_numerical': 0.005306212690692019, 'mean_word_length': 3.64, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3331772', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1350, 'n_words': 441}