# packages

pkgId: f0c6946d721246f55fd9d3f3374626e5d2ef2b39bdbbb88d73d18ee06fc2ac51
name: python-blipnlptest
arch: src
version: 0.2.3
epoch: 0
release: 1
summary: Teste dos provedores integrados na plataforma em conjunto com o Assistente de Conteudo.
url: https://pypi.org/project/blipnlptest/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blipnlptest-0.2.3-1.src.rpm
checksum_type: sha256
description:
  Essa é uma classe que permite o teste de mensagens em provedores integrados na plataforma, com o retorno do conteúdo cadastrado no Assistente de Conteudo.



  Para instalar o pacote, basta executar o comando abaixo:

  <pre><code>pip install blipnlptest</code></pre>



  Após a instalação do pacote, você terá acesso a classe que permitirá a execução do teste.

  Os parâmetros necessários são:

  - data (opcional) : Dataframe de entrada
  - resource (opcional) : Nome do recurso com o texto de tests
  - threshold (opcional) : float referente ao threshold do provedor com valores entre 0.1 (10%) a 1.0 (100%). (default: 0.5)
  - key: chave do bot
  - contract_id: id do contrato.

  Exemplo do código:


  Caso a análise seja de dados já analisados pelo provedor (envie um dataframe que tenha no mínimo as colunas Text, Intentions, Entities e Score), use:

  <pre><code>

  import blipnlptest as bnt

  cc = bnt.contentchecker(key, data=df, contract_id="cliente_x")
  cc.identityanalysis()
  </code></pre>

  Se a análise for feita com dados que não foram analisados (envie um dataframe que a coluna de texto tenha o nome Text), use:

  <pre><code>
  import blipnlptest as bnt

  cc = bnt.contentchecker(key, data=df)
  cc.sentences()
  </code></pre>

  OBS: A divisão foi feita para que os dados já rotulados não realizem outra análise no provedor.

  Caso queira analisar com dados que não estejam na base de dados, utilize o recurso do bot. O recurso deverá ser do tipo texto, e as mensagens separadas por vírgula. Use:

  <pre><code>

  import blipnlptest as bnt

  cc = bnt.contentchecker(key, resource='nome_do_recurso')
  cc.byresource()
  </code></pre>

  Em todos os casos, você pode colocar o valor do threshold personalizado, da seguinte forma:

  <pre><code>
  cc = bnt.contentchecker(key, data=df,threshold=0.6)
  cc.sentences()
  </code></pre>

  Com os parâmetros previamente atribuídos, rodando o código acima você terá como saída a exibição do resultado com:

  - A mensagem de entrada;
  - A intenção reconhecida;
  - As entidades reconhecidas;
  - O score;
  - A resposta entregue pelo Assistente de Conteudo;
  - Se foi entregue (y/n);
  - Ponto de atenção.

  Os pontos de atenção são sugestões de pontos para observar, eles tem os status abaixo:

  - model = Se o score for baixo e não retornar conteúdo, necessário avaliar o aumento da confiança no modelo;
  - refine = Se o score for baixo e existir uma resposta no Assistente de Conteudo, é necessário refinar e entender os próximos passos (aumentar a confiança ou ajustar os exemplos de alguma intenção);
  - valid = Se o score for alto e retornou uma resposta, avaliar se a resposta está válida.
  - content | entity in the combination = Se o score estiver alto, foi identificada entidade e não retornou uma resposta, é válido checar a falta da entidade na combinação;
  - content | entity in the model = Se o score estiver alto, e não foi identificada alguma entidade, é válido checar a falta dela no modelo (que se criada, consequentemente irá impactar o conteúdo.



  Esse projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.


pkgId: ff07e9c3ae40e36c4f3309cdc9db8ed8c0bd2b09a1203c9b592a6574798d647d
name: python-blisswriter
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Bliss NeXus-compliant HDF5 file writer
url: https://gitlab.esrf.fr/bliss/bliss/-/tree/master/blisswriter
rpm_license: LGPLv3
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blisswriter-1.0.1-1.src.rpm
checksum_type: sha256
description:
  The `blisswriter` project provides NeXus-compliant HDF5 file writing based on
  data published by `blissdata`. It can be used in three ways
  * writer service for a single `bliss` session as a *process*
    * command line interface: `NexusSessionWriter`
    * consumer of Redis data published by `blissdata`
  * writer service for a single `bliss` session as a *Tango device*
    * command line interface: `NexusWriterService`
    * consumer of Redis data published by `blissdata`
  * writer python API
    * python API: `from blisswriter.writer.main import ScanWriterWithState`
    * same API used by the writer services
  `blisswriter` is developed and maintained by the [Software group](https://www.esrf.fr/Instrumentation/software)
  of the [European Synchrotron](https://www.esrf.fr/).


pkgId: cbb8aada4ace813f29a29a29286c869db09c0ea2bd388dc32c9a9a89a498d3d7
name: python-blitz-work
arch: src
version: 0.6.70
epoch: 0
release: 1
summary: Django-based framework for rapid application development.
url: https://github.com/VizardEdward/blitz_work
rpm_license: MIT-License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blitz-work-0.6.70-1.src.rpm
checksum_type: sha256
description:
  1. Add blitz_work to installed apps in settings.py.

     ```python
     INSTALLED_APPS = [
      ...,
      ...,
      'blitz_work',
     ]
     ```

  2. Create the models.

     ```python
     from django.db import models


      class Author(models.Model):
          name = models.CharField(verbose_name="Name", max_length=255)
          birth_date = models.DateField(verbose_name="Birth date")


          class Meta:
              verbose_name = "Author"
              verbose_name_plural = "Authors"

          def __str__(self):
              return self.name



      class Book(models.Model):
          title = models.CharField(verbose_name="Title", max_length=255)
          publication_date = models.DateField(verbose_name="Publication date")
          authors = models.ManyToManyField(Author,verbose_name="Authors")


          class Meta:
              verbose_name = "Book"
              verbose_name_plural = "Books"

          def __str__(self):
              return self.title

     ```

  3. Create the template.

      ```html
          {% extends 'blitz_base_offline.html' %}
          {% block main %}
              &lt;nav class="navbar navbar-expand-lg navbar-light bg-light"&gt;
                  &lt;a class="navbar-brand" href="#"&gt;Test&lt;/a&gt;
                  &lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation"&gt;
                      &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
                  &lt;/button&gt;
                  &lt;div class="collapse navbar-collapse" id="navbarNavDropdown"&gt;
                      &lt;ul class="navbar-nav"&gt;
                      &lt;li class="nav-item"&gt;
                          &lt;a class="nav-link" href="{% url 'book/view' %}"&gt;Libros&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li class="nav-item"&gt;
                          &lt;a class="nav-link" href="{% url 'author/view' %}"&gt;Autores&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/nav&gt;
              {% block content %}{% endblock %}
          {% endblock %}
      ```

  4. Create the views.

      ```python
          from Book.models import Author, Book
          from blitz_work.blitzcrud import BlitzCRUD


          class BookCRUD(BlitzCRUD):
              show_title = True
              show_caption = False
              caption_is_title = True
              extend_template = "base.html"
              data = Book

          class AuthorCRUD(BlitzCRUD):
              show_title = True
              show_caption = False
              caption_is_title = True
              extend_template = "base.html"
              data = Author
      ```

  5. Include the URLs.

     ```python
      from app.views import AuthorCRUD, BookCRUD
      from django.urls import path,include
      from blitz_work.blitzcrud import get_urls

      urlpatterns = [
          path('book/', include(get_urls(BookCRUD,"book"))),
          path('author/', include(get_urls(AuthorCRUD,"author"))),
      ]
     ```

  6. More help

     1. Include Blitz Work help urls in urls.py

         ```python
         from blitz_work.urls import urlpatterns

         urlpatterns = [
              path('',include(urlpatterns)),
         ]
         ```

     2. Run the server.

          ```bash
          python manage.py runserver localhost:8000
          ```

     3. Go to the url [blitz-doc-en/](http://localhost:8000/blitz-doc-en/) or [blitz-doc-es/](http://localhost:8000/blitz-doc-es/)


pkgId: f2be8822c34b5a98330218a3b6c48f7943f67d3c094151fcda801ee43ccbd21e
name: python-blitzdb
arch: src
version: 0.4.4
epoch: 0
release: 1
summary: A document-oriented database written purely in Python.
url: https://github.com/adewes/blitzdb
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blitzdb-0.4.4-1.src.rpm
checksum_type: sha256
description:
  * Document-based, object-oriented interface.
  * Powerful and rich querying language.
  * Deep document indexes on arbitrary fields.
  * Compressed storage of documents.
  * Support for multiple backends (e.g. file-based storage, MongoDB).
  * Support for database transactions (currently only for the file-based backend).


pkgId: b42dfb6ea385d444c6cc527b462273f7b7e82e53cd594f3215253e120987255f
name: python-blitzkrieg
arch: src
version: 0.3.43
epoch: 0
release: 1
summary: A tool for rapid project setup and management
url: https://pypi.org/project/blitzkrieg/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blitzkrieg-0.3.43-1.src.rpm
checksum_type: sha256
description:
  Blitzkrieg simplifies software development by automating CLI project setups and PostgreSQL database configurations. This allows developers to focus more on innovation and less on setup.




  1. **Workspace Management**
     - Automated setup of development workspaces
     - Creation and management of Docker networks for isolated environments
     - Initialization of project directories with necessary configurations

  2. **Database Management**
     - Automated PostgreSQL database setup and configuration
     - Integration with PgAdmin for database administration
     - Dynamic management of database connections and credentials

  3. **Migration Handling**
     - Alembic integration for database schema migrations
     - Automatic setup of Alembic configuration files
     - Dynamic modification of migration files for schema creation

  4. **Docker Integration**
     - Automated creation and management of Docker containers
     - Generation of Dockerfile and docker-compose configurations
     - Handling of container lifecycle (creation, startup, teardown)

  5. **Environment Configuration**
     - Automated creation and management of .env files
     - Dynamic allocation of ports for services
     - Centralized management of environment variables

  6. **Project Scaffolding**
     - Creation of basic project structure
     - Setup of SQLAlchemy models



  - Python 3.7+
  - PostgreSQL installed on your local machine or accessible remotely



  Install Blitzkrieg using pip to get started with simplifying your project setups:

  ```bash
  pip install blitzkrieg
  ```



  1. **Creating a Blitzkrieg Workspace**
  To initialize Blitzkrieg on your local:
  ```bash
  blitz create workspace <workspace_name>
  ```

  This sets up your workspace database and workspace pgadmin instance, as well as your workspace directory - so that Blitzkrieg can manage your projects and databases. The ```workspace_name``` can be an organization name, first and last name, etc.

  2. **cd Into New Workspace**
  ```bash
  cd <workspace_name>
  ```

  3. **Create a New CLI Tool**
  ```bash
  blitz create project <project_name>
  ```

  4. **cd Into New Project**
  ```bash
  cd <project_name>
  ```

  5. **Release Project**
  ```bash
  blitz release <project_name>
  ```

  7. (side quest) **Deleting a Blitzkrieg Workspace:** To delete a workspace, simply enter into the CLI:
  ```bash
  blitz delete <workspace_name>
  ```


  To ensure all your issues are up-to-date across blitzkrieg, your local host directory, and github issues:

  ```bash
  blitz sync
  ```

  This will update your project management tools and local documentation to reflect the latest changes and issues.



  - **Autonomous Software Lifecycle Management**: Automates every phase of development, from environment setup to production deployment.
  - **Advanced Project Extrapolation (Coming Soon)**: Utilizes AI to analyze project specifications and automatically generate development tasks and manage timelines.
  - **AI-Powered Code Generation (Coming Soon)**: Seamlessly integrates with AI systems like Sweep AI to execute development tasks, including coding and testing.



  - **Reduce Manual Effort**: Significantly cut the manual tasks required in software development.
  - **Accelerate Project Lifecycle**: Speed up the process from concept to market, enabling faster releases and updates.
  - **Enhance Accuracy and Efficiency**: Improve project management and execution with AI-driven predictions and task automation.
  - **Achieve Full Development Automation**: Integrate cutting-edge AI to automate not just planning and design but also execution and deployment.



  - **Full Autonomy**: Designed to operate independently, learning and adapting from ongoing projects without needing human guidance.
  - **Efficiency and Speed**: Optimizes all processes to minimize development time.
  - **Scalability**: Capable of managing projects of any size, from small startups to large enterprise applications (hopefully).
  - **Multiple Interaction Modes**: Offers flexible interaction through CLI commands, document editing, or direct inputs, catering to various user preferences.
  - **Continuous Innovation**: Regularly updated with the latest technological advancements to stay at the forefront of the development tools industry.


  Blitzkrieg is not just a project initialization tool—it's evolving into an intelligent context-aware development environment. Future enhancements will focus on:

  - **Advanced AI Integration**: Automating more complex aspects of software development, including code generation and issue resolution based on AI learning from project data.
  - **Project Extrapolation**: Using inputs from initial project descriptions to automatically generate detailed project roadmaps and, ultimately tickets/issues.
  - **Continuous Integration/Continuous Deployment (CI/CD) Automation**: Fully automating the CI/CD pipelines, enabling seamless deployments directly from the development environment.



  Blitzkrieg is designed to evolve through several stages, each enhancing its capabilities to manage and automate software development projects with increasing sophistication. Below, we outline the stages and their functionalities:


  **Objective**: Automate foundational aspects of software project management.
  - **Capabilities**:
    - **Project Initialization**: Automates the setup of development environments, including repositories, databases, and basic configurations.
    - **Documentation Synchronization**: Ensures that documentation is automatically updated whenever there are changes in the codebase, maintaining consistency.
  - **How It Works**: At this stage, Blitzkrieg uses scripts and integration tools to perform tasks that are typically repetitive and time-consuming, freeing up developers to focus on more complex issues.


  **Objective**: Enhance project management by introducing adaptive workflows and predictive analytics.
  - **Capabilities**:
    - **Task Management**: Automatically manages tasks based on project progress and developer interactions.
    - **Predictive Analytics**: Uses historical data to predict issues and optimize project timelines and resource allocation.
  - **How It Works**: Blitzkrieg integrates machine learning models that analyze past project data to provide insights and automate decisions, such as adjusting timelines or reallocating resources based on predicted needs.


  **Objective**: Enable Blitzkrieg to autonomously create and modify software components.
  - **Capabilities**:
    - **Code Generation**: Automatically generates code snippets or modules based on project requirements.
    - **Self-Optimization**: Modifies its own operational algorithms to improve efficiency and effectiveness.
  - **How It Works**: This stage employs advanced AI techniques, including deep learning, to generate and refine code. It also allows Blitzkrieg to self-assess its algorithms and make adjustments to optimize its performance.


  **Objective**: Transform Blitzkrieg into a strategic partner capable of undertaking significant business and development initiatives autonomously.
  - **Capabilities**:
    - **Strategic Planning**: Interprets high-level business goals and develops software strategies to achieve them.
    - **Business Initiative Automation**: Autonomously launches new projects or ventures to meet strategic objectives.
  - **How It Works**: At this stage, Blitzkrieg leverages sophisticated NLP and strategic decision-making algorithms to understand abstract concepts and long-term goals. It then autonomously plans and executes projects that align with these goals.


  Each stage builds upon the previous one, allowing Blitzkrieg to gradually take on more responsibility and operate with greater independence. The transition between stages involves careful monitoring and fine-tuning to ensure that each new capability integrates seamlessly with existing functionalities.


  We encourage the community to contribute to Blitzkrieg's development. Whether you are fixing bugs, proposing new features, or improving the documentation, your contributions are welcome. Please refer to our [Contributing Guidelines](./CONTRIBUTING.md) for more information on how you can contribute.


  Blitzkrieg is open-sourced under the MIT License. See the [LICENSE](./LICENSE) file for more details.


pkgId: c4e717107e4b43d0f6d961864d935831aed380ecdd9e475b651129c7130d4168
name: python-blitzly
arch: src
version: 0.6.2
epoch: 0
release: 1
summary: Lightning-fast way to get plots with Plotly
url: https://github.com/invia-flights/blitzly
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blitzly-0.6.2-1.src.rpm
checksum_type: sha256
description:
  <img src="https://github.com/invia-flights/blitzly/raw/main/docs/assets/images/icon.png" alt="blitzly logo" width="200" height="200"/><br>

  ***Lightning-fast way to get plots with Plotly***

  [![DeployPackage](https://github.com/invia-flights/blitzly/actions/workflows/deploy-package.yml/badge.svg)](https://github.com/invia-flights/blitzly/actions/workflows/deploy-package.yml)
  [![Testing](https://github.com/invia-flights/blitzly/actions/workflows/testing.yml/badge.svg?branch=main)](https://github.com/invia-flights/blitzly/actions/workflows/testing.yml)
  [![codecov](https://codecov.io/gh/invia-flights/blitzly/branch/develop/graph/badge.svg?token=ROCDJJV8JV)](https://codecov.io/gh/invia-flights/blitzly)
  [![pypi](https://img.shields.io/pypi/v/blitzly)](https://pypi.org/project/blitzly/)
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/blitzly)](https://pypistats.org/packages/blitzly)
  [![python version](https://img.shields.io/pypi/pyversions/blitzly?logo=python&logoColor=yellow)](https://www.python.org/downloads/)
  [![docs](https://img.shields.io/badge/docs-mkdoks%20material-blue)](https://invia-flights.github.io/blitzly/)
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
  [![license](https://img.shields.io/github/license/invia-flights/blitzly)](https://github.com/invia-flights/blitzly/blob/main/LICENSE)
  [![isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://github.com/PyCQA/isort)
  [![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
  [![mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](https://github.com/python/mypy)
  [![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint)

  Plotly is great and powerful. But with great power comes great responsibility 🕸. And sometimes you just want to get a plot up and running as fast as possible. That's where blitzly ⚡️ comes in. It provides a set of functions that allow you to create plots with Plotly in a lightning-fast way. It's not meant to replace Plotly, but rather to complement it.

  Check out some examples in the [Jupyter notebook](https://github.com/invia-flights/blitzly/blob/main/examples/playground.ipynb).<br>
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/invia-flights/blitzly/blob/main/examples/playground.ipynb)


  If you are using [pip](https://pip.pypa.io/en/stable/), you can install the package with the following command:
  ```bash
  pip install blitzly
  ```

  If you are using [Poetry](https://python-poetry.org/), you can install the package with the following command:
  ```bash
  poetry add blitzly
  ```

  With [pip](https://pip.pypa.io/en/stable/):
  ```bash
  pip install -r requirements.txt
  ```

  With [Poetry](https://python-poetry.org/):
  ```bash
  poetry install
  ```

  | Module | Method | Description |
  | ------ | ------ | ----------- |
  | [`bar`](https://invia-flights.github.io/blitzly/plots/bar/) | [`model_feature_importances`](https://invia-flights.github.io/blitzly/plots/bar/#blitzly.plots.bar.model_feature_importances) | Creates a bar chart with the feature importance of a model. |
  | [`bar`](https://invia-flights.github.io/blitzly/plots/bar/) | [`multi_chart`](https://invia-flights.github.io/blitzly/plots/bar/#blitzly.plots.bar.multi_chart) | Creates a bar chart with multiple groups. |
  | [`dumbbell`](https://invia-flights.github.io/blitzly/plots/dumbbell/) | [`simple_dumbbell`](https://invia-flights.github.io/blitzly/plots/dumbbell/#blitzly.plots.dumbbell.simple_dumbbell) | Plots a dumbbell plot. This can be used to compare two columns of data to visualize changes. |
  | [`histogram`](https://invia-flights.github.io/blitzly/plots/histogram/) | [`simple_histogram`](https://invia-flights.github.io/blitzly/plots/histogram/#blitzly.plots.histogram.simple_histogram) | Plots a histogram with one ore more distributions. |
  | [`matrix`](https://invia-flights.github.io/blitzly/plots/matrix/) | [`binary_confusion_matrix`](https://invia-flights.github.io/blitzly/plots/matrix/#blitzly.plots.matrix.binary_confusion_matrix) | Plots a confusion matrix for binary classification data. |
  | [`matrix`](https://invia-flights.github.io/blitzly/plots/matrix/) | [`cramers_v_corr_matrix`](https://invia-flights.github.io/blitzly/plots/matrix/#blitzly.plots.matrix.cramers_v_corr_matrix) | Cramer's V correlation for categorical features. |
  | [`matrix`](https://invia-flights.github.io/blitzly/plots/matrix/) | [`pearson_corr_matrix`](https://invia-flights.github.io/blitzly/plots/matrix/#blitzly.plots.matrix.pearson_corr_matrix) | Plots a Pearson product-moment correlation coefficients matrix. |
  | [`scatter`](https://invia-flights.github.io/blitzly/plots/scatter/) | [`scatter_matrix`](https://invia-flights.github.io/blitzly/plots/scatter/#blitzly.plots.scatter.scatter_matrix) | Plots a scatter matrix. |
  | [`scatter`](https://invia-flights.github.io/blitzly/plots/scatter/) | [`multi_scatter`](https://invia-flights.github.io/blitzly/plots/scatter/#blitzly.plots.scatter.multi_scatter) | Create a multi scatter plot. It can be used to visualize the relationship between multiple variables from the same Pandas DataFrame. |
  | [`scatter`](https://invia-flights.github.io/blitzly/plots/scatter/) | [`dimensionality_reduction`](https://invia-flights.github.io/blitzly/plots/scatter/#blitzly.plots.scatter.dimensionality_reduction) | Creates a plot to visualize higher dimensionality reduced data using matrix decomposition |




  | Module | Method | Description |
  | ------ | ------ | ----------- |
  | [`subplots`](https://invia-flights.github.io/blitzly/plots/subplots/) | [`make_subplots`](https://invia-flights.github.io/blitzly/plots/subplots/#blitzly.subplots.make_subplots) | Create subplots using figure objects created with any of the above available plots. |


  Here are some examples. You can also open the [playground notebook](https://github.com/invia-flights/blitzly/blob/main/examples/playground.ipynb) 📒.

  **[`dimensionality_reduction`](https://invia-flights.github.io/blitzly/plots/scatter/#blitzly.plots.scatter.dimensionality_reduction):**
  ```python
  from blitzly.plots.scatter import dimensionality_reduction
  import plotly.express as px

  df = px.data.iris()
  dimensionality_reduction(
    df,
    n_components=2,
    target_column="species",
    reduction_funcs=["PCA", "TNSE"],
  )
  ```
  Gives you this:
  <img src="https://github.com/invia-flights/blitzly/raw/main/docs/assets/images/example_plots/dimensionality_reduction.png" alt="dimensionality reduction plot" width="1000" height="555"/>


  **[`multi_bar`](https://invia-flights.github.io/blitzly/plots/bar/#blitzly.plots.bar.multi_bar):**
  ```python
  from blitzly.plots.bar import multi_bar
  import numpy as np

  data = np.array([[8, 3, 6], [9, 7, 5]])
  error_array = np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]])

  multi_bar(
      data,
      x_labels=["Vienna", "Berlin", "Lisbon"],
      group_labels=["Personal rating", "Global rating"],
      errors=error_array,
      title="City ratings 🏙",
      mark_x_labels=["Lisbon"],
      write_html_path="see_the_blitz.html",
  )
  ```
  Gives you this:
  <img src="https://github.com/invia-flights/blitzly/raw/main/docs/assets/images/example_plots/multi_bars.png" alt="multi bars plot" width="1000" height="555"/>

  **[`scatter matrix`](https://invia-flights.github.io/blitzly/plots/scatter/#blitzly.plots.scatter.scatter_matrix):**
  ```python
      from blitzly.plots.scatter import scatter_matrix
      import numpy as np
      import pandas as pd

      foo = np.random.randn(1000)
      bar = np.random.randn(1000) + 1
      blitz = np.random.randint(2, size=1000)
      licht = np.random.randint(2, size=1000)
      data = np.array([foo, bar, blitz, licht])
      df = pd.DataFrame(data.T, columns=["foo", "bar", "blitz", "licht"])

      scatter_matrix(
          df,
          dimensions=["foo", "bar", "blitz"],
          color_dim=df["licht"],
          title="My first scatter matrix 🙃",
          show_upper_half=True,
          diagonal_visible=False,
          marker_color_scale="Rainbow",
          marker_line_color="blue",
          size=(500, 500),
      )
  ```
  Gives you this:
  <img src="https://github.com/invia-flights/blitzly/raw/main/docs/assets/images/example_plots/scatter_matrix.png" alt="scatter-matrix plot" width="500" height="500"/>



  Please check out the [guide](https://invia-flights.github.io/blitzly/CONTRIBUTING/) on how to contribute to this project.


pkgId: 0789af7c63057b2585917537d9d27f85c8dc7c6e421102c83b4222ca71496738
name: python-blitzml
arch: src
version: 0.20.0
epoch: 0
release: 1
summary: A low-code library for machine learning pipelines
url: https://github.com/AhmedMohamed25/blitzml
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blitzml-0.20.0-1.src.rpm
checksum_type: sha256
description:
  <div align="center">
  <img src="auxiliary/docs/logo.png" alt="BlitzML" width="400"/>




  <div align="left">

  - [Install BlitzML](#install-blitzml)
  - [Classification](#classification)
  - [Regression](#regression)
  - [Time-Series](#time-series)
  - [Clustering](#clustering)






  ```bash
  pip install blitzml
  ```




  ```python
  from blitzml.tabular import Classification
  import pandas as pd


  train_df = pd.read_csv("auxiliary/datasets/banknote/train.csv")
  test_df = pd.read_csv("auxiliary/datasets/banknote/test.csv")


  auto = Classification(train_df, test_df, algorithm = 'RF', n_estimators = 50)


  auto.run()


  pred_df = auto.pred_df
  metrics_dict = auto.metrics_dict

  print(pred_df.head())
  print(metrics_dict)
  ```




  - Random Forest 'RF'
  - LinearDiscriminantAnalysis 'LDA'
  - Support Vector Classifier 'SVC'
  - KNeighborsClassifier 'KNN'
  - GaussianNB 'GNB'
  - LogisticRegression 'LR'
  - AdaBoostClassifier 'AB'
  - GradientBoostingClassifier 'GB'
  - DecisionTreeClassifier 'DT'
  - MLPClassifier 'MLP'



  **classifier**
  options: {'RF','LDA','SVC','KNN','GNB','LR','AB','GB','DT','MLP', 'auto', 'custom'}, default = 'RF'
  `auto: selects the best scoring classifier based on f1-score`
  `custom: enables providing a custom classifier through *file_path* and *class_name* parameters`
  **file_path**
  when using 'custom' classifier, pass the path of the file containing the custom class, default = 'none'
  **class_name**
  when using 'custom' classifier, pass the class name through this parameter, default = 'none'
  **feature_selection**
  options: {'correlation', 'importance', 'none'}, default = 'none'
  `correlation: use feature columns with the highest correlation with the target`
  `importance: use feature columns that are important for the model to predict the target`
  `none: use all feature columns`
  **validation_percentage**
  value determining the validation split percentage (value from 0 to 1), default = 0.1
  **average_type**
  when performing multiclass classification, provide the average type for the resulting metrics, default = 'macro'
  **cross_validation_k_folds**
  number of k-folds for cross validation, if 1 then no cv will be performed, default = 1
  ****kwargs**
  optional parameters for the chosen classifier. you can find available parameters in the [sklearn docs](https://scikit-learn.org/stable/user_guide.html)

  **train_df**
  the preprocessed train dataset (after running `Classification.preprocess()`)
  **test_df**
  the preprocessed test dataset (after running `Classification.preprocess()`)
  **model**
  the trained model (after running `Classification.train_the_model()`)
  **pred_df**
  the prediction dataframe (test_df + predicted target) (after running `Classification.gen_pred_df(Classification.test_df)`)
  **metrics_dict**
  the validation metrics (after running `Classification.gen_metrics_dict()`)
  {
      "accuracy": acc,
      "f1": f1,
      "precision": pre,
      "recall": recall,
      "hamming_loss": h_loss,
      "cross_validation_score":cv_score, `returns None if cross_validation_k_folds==1`
  }

  **run()**
  a shortcut that runs the entire process:
  - preprocessing
  - model training
  - prediction
  - model evaluation

  **accuracy_history()**
  accuracy scores when varying the sampling size of the train_df (after running `Classification.train_the_model()`).
  *returns:*
  {
      'x':train_df_sample_sizes,
      'y1':train_scores_mean,
      'y2':test_scores_mean,
      'title':title
  }
  **plot()**

  plotting line chart visualizes accuracy history




  ```python
  from blitzml.tabular import Regression
  import pandas as pd


  train_df = pd.read_csv("auxiliary/datasets/house prices/train.csv")
  test_df = pd.read_csv("auxiliary/datasets/house prices/test.csv")


  auto = Regression(train_df, test_df, algorithm = 'RF')


  auto.run()


  pred_df = auto.pred_df
  metrics_dict = auto.metrics_dict

  print(pred_df.head())
  print(metrics_dict)
  ```




  - Random Forest 'RF'
  - Support Vector Regressor 'SVR'
  - KNeighborsRegressor 'KNN'
  - Lasso Regressor 'LSS'
  - LinearRegression 'LR'
  - Ridge Regressor 'RDG'
  - GaussianProcessRegressor 'GPR'
  - GradientBoostingRegressor 'GB'
  - DecisionTreeRegressor 'DT'
  - MLPRegressor 'MLP'


  **regressor**
  options: {'RF','SVR','KNN','LSS','LR','RDG','GPR','GB','DT','MLP', 'auto', 'custom'}, default = 'RF'
  `auto: selects the best scoring regressor based on r2 score`
  `custom: enables providing a custom regressor through *file_path* and *class_name* parameters`
  **file_path**
  when using 'custom' regressor, pass the path of the file containing the custom class, default = 'none'
  **class_name**
  when using 'custom' regressor, pass the class name through this parameter, default = 'none'
  **feature_selection**
  options: {'correlation', 'importance', 'none'}, default = 'none'
  `correlation: use feature columns with the highest correlation with the target`
  `importance: use feature columns that are important for the model to predict the target`
  `none: use all feature columns`
  **validation_percentage**
  value determining the validation split percentage (value from 0 to 1), default = 0.1
  **cross_validation_k_folds**
  number of k-folds for cross validation, if 1 then no cv will be performed, default = 1
  ****kwargs**
  optional parameters for the chosen regressor. you can find available parameters in the [sklearn docs](https://scikit-learn.org/stable/user_guide.html)

  **train_df**
  the preprocessed train dataset (after running `Regression.preprocess()`)
  **test_df**
  the preprocessed test dataset (after running `Regression.preprocess()`)
  **model**
  the trained model (after running `Regression.train_the_model()`)
  **pred_df**
  the prediction dataframe (test_df + predicted target) (after running `Regression.gen_pred_df(Regression.test_df)`)
  **metrics_dict**
  the validation metrics (after running `Regression.gen_metrics_dict()`)
  {
      "r2_score": r2,
      "mean_squared_error": mse,
      "root_mean_squared_error": rmse,
      "mean_absolute_error" : mae,
      "cross_validation_score":cv_score, `returns None if cross_validation_k_folds==1`
  }



  **run()**
  a shortcut that runs the entire process:
  - preprocessing
  - model training
  - prediction
  - model evaluation

  **plot()**

  plotting line chart visualizes RMSE history

  **RMSE_history()**
  RMSE scores when varying the sampling size of the train_df (after running `Regression.train_the_model()`).
  *returns:*
  {
      'x':train_df_sample_sizes,
      'y1':train_scores_mean,
      'y2':test_scores_mean,
      'title':title
  }

  time series is a particular problem of Regression, but time series have some additional functions:
  - stationary test (IsStationary()).
  - convert to stationary.
  - reverse predicted.

  and the dataset must have a DateTime column, even if the DataType of this column is Object.
  ```python
  from blitzml.tabular import TimeSeries
  import pandas as pd


  train_df = pd.read_csv("train_dataset.csv")
  test_df = pd.read_csv("test_dataset.csv")


  auto = TimeSeries(train_df, test_df, algorithm = 'RF')


  auto.run()


  pred_df = auto.pred_df
  metrics_dict = auto.metrics_dict

  print(pred_df.head())
  print(metrics_dict)
  ```


  ```python
  from blitzml.unsupervised import Clustering
  import pandas as pd


  train_df = pd.read_csv("auxiliary/datasets/customer personality/train.csv")


  auto = Clustering(train_df, clustering_algorithm = 'KM')


  auto.preprocess()

  auto.train_the_model()


  auto.gen_pred_df()
  auto.gen_metrics_dict()


  print(auto.pred_df.head())
  print(auto.metrics_dict)
  ```




  - K-Means 'KM'
  - Affinity Propagation 'AP'
  - Agglomerative Clustering 'AC'
  - Mean Shift 'MS'
  - Spectral Clustering 'SC'
  - Birch 'Birch'
  - Bisecting K-Means 'BKM'
  - OPTICS 'OPTICS'
  - DBSCAN 'DBSCAN'


  **clustering_algorithm**
  options: {"KM", "AP", "AC", "MS", "SC", "Birch", "BKM", "OPTICS", "DBSCAN", 'auto', 'custom'}, default = 'KM'
  `auto: selects the best scoring clustering algorithm based on silhouette score`
  `custom: enables providing a custom clustering algorithm through *file_path* and *class_name* parameters`
  **file_path**
  when using 'custom' clustering_algorithm, pass the path of the file containing the custom class, default = 'none'
  **class_name**
  when using 'custom' clustering_algorithm, pass the class name through this parameter, default = 'none'
  **feature_selection**
  options: {'importance', 'none'}, default = 'none'
  `importance: use feature columns that are important for the model to predict the target`
  `none: use all feature columns`
  ****kwargs**
  optional parameters for the chosen clustering_algorithm. you can find available parameters in the [sklearn docs](https://scikit-learn.org/stable/user_guide.html)

  **train_df**
  the preprocessed train dataset (after running `Clustering.preprocess()`)
  **model**
  the trained model (after running `Clustering.train_the_model()`)
  **pred_df**
  the prediction dataframe (test_df + predicted target) (after running `Clustering.gen_pred_df()`)
  **metrics_dict**
  the validation metrics (after running `Clustering.gen_metrics_dict()`)
  {
      "silhouette_score": sil_score,
      "calinski_harabasz_score": cal_har_score,
      "davies_bouldin_score": dav_boul_score,
      "n_clusters" : n
  }

  **preprocess()**
  perform preprocessing on train_df
  **train_the_model()**
  train the chosen clustering algorithm on the train_df
  **clustering_visualization()**
  2-d visualization of the data points with its corresponding labels  (after doing dimensionality reduction using Principal Componenet Analysis).
  *returns:*
  {
      'principal_component_1':pc1,
      'principal_component_2':pc2,
      'cluster_labels':labels,
      'title':title
  }
  **gen_pred_df()**
  generates the prediction dataframe and assigns it to the `pred_df` attribute
  **gen_metrics_dict()**
  generates the clustering metrics and assigns it to the `metrics_dict`
  **run()**
  a shortcut that runs the following methods:
  preprocess()
  train_the_model()
  gen_pred_df()
  gen_metrics_dict()


  - Clone the repo
  - run `pip install virtualenv`
  - run `python -m virtualenv venv`
  - run `. ./venv/bin/activate` on UNIX based systems or `. ./venv/Scripts/activate.ps1` if on windows
  - run `pip install -r requirements.txt`
  - run `pre-commit install`


pkgId: d72672261c9271d808b08030d4808635435cf6157ab6947033a094f8e1a235fc
name: python-blive
arch: src
version: 0.2.5
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://pypi.org/project/blive/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blive-0.2.5-1.src.rpm
checksum_type: sha256
description:
  - 简单，只需房间号即可监听
  - 异步，io 不阻塞，及时获取消息



  [PROTOCOL 分析](./PROTOCOL.md)



  1. 安装

     `pip install blive`

  2. 创建 app

     ```python
     from blive import  BLiver

     app = BLiver(123) #123为房间号
     ```

  3. 创建处理器

     ```python
     from blive import  BLiver, Events, BLiverCtx
     from blive.msg import DanMuMsg

     app = BLiver(123)

     
     @app.on(Events.DANMU_MSG)
     async def listen_danmu(ctx: BLiverCtx):
         danmu = DanMuMsg(ctx.body) #ctx.body 套上相应的消息操作类即可得到消息的基本内容,也可直接操作 ctx.body
         print(danmu.content)
         print(danmu.sender)
         print(danmu.timestamp)
     ```

  4. 运行

     ```python

     from blive import  BLiver, Events, BLiverCtx
     from blive.msg import DanMuMsg

     app = BLiver(123)

     @app.on(Events.DANMU_MSG)
     async def listen_danmu(ctx: BLiverCtx):
         danmu = DanMuMsg(ctx.body)
         print(danmu.content)
         print(danmu.sender)
         print(danmu.timestamp)

     app.run() # 运行app!

     ```



  ```python
  import asyncio
  from blive import BLiver, Events, BLiverCtx
  from blive.msg import DanMuMsg



  async def listen(ctx: BLiverCtx):
     danmu = DanMuMsg(ctx.body)
     print(
        f'\n{danmu.sender.name} ({danmu.sender.medal.medal_name}:{danmu.sender.medal.medal_level}): "{danmu.content}"\n'
     )


  async def main():
     
     ke = BLiver(605)
     azi = BLiver(510)

     
     ke.on(Events.DANMU_MSG, listen)
     azi.on(Events.DANMU_MSG, listen)

     
     task1 = ke.run_as_task()
     task2 = azi.run_as_task()

     
     await asyncio.gather(*[task1, task2])


  if __name__ == "__main__":
     loop = asyncio.get_event_loop()
     loop.run_until_complete(main())
  ```



  ```python
  from blive.core import BWS_MsgPackage

  packman = BWS_MsgPackage() # 实例化一个消息包处理器

  while True:
     data = ws.receive() # 当收到消息时
     msg = packman.unpack(data) # 使用packman解析消息,返回一个形如 [(header,body), (header,body), ... ] 数组
     print(msg)
  ```



  ```python
  from fastapi import FastAPI
  from blive import BLiver,Events
  from blive.msg import DanMuMsg

  app = FastAPI()

  BLIVER_POOL = {}



  async def handler(ctx):
     danmu = DanMuMsg(ctx.body)
     print(
        f'\n{danmu.sender.name} ({danmu.sender.medal.medal_name}:{danmu.sender.medal.medal_level}): "{danmu.content}"\n'
     )

  def create_bliver(roomid):
      b = BLiver(roomid)
      b.on(Events.DANMU_MSG,handler)
      return b


  @app.get("/create")
  async def create_new_bliver(roomid:int):
      room = BLIVER_POOL.get(roomid,None)
      if not room:
          b = create_bliver(roomid)
          BLIVER_POOL[roomid] = b.run_as_task() # 启动监听
      return {"msg":"创建一个新直播间弹幕监听成功"}


  @app.get("/del")
  async def rm_bliver(roomid:int):
      room = BLIVER_POOL.get(roomid,None)
      if room:
          room.cancel()
          BLIVER_POOL.pop(roomid)
      return {"msg":"移除直播间弹幕监听成功"}


  @app.get("/show")
  async def show():
      return list(BLIVER_POOL.keys())
  ```



  - blive 文件夹为框架代码

    - core.py 为B站ws直播聊天室协议包处理的核心代码

    - eeframework.py 为框架代码

    - msg.py 为消息操作类代码

  - example/app.py
     以框架形式运行例子

  - example/multi_room.py
     同时监听多个直播间的实现

  - example/with_fastapi.py
     与fastapi 配合使用的例子




  - 更多的消息操作类（欢迎各位提pr）
  - 尝试加入中间件架构（目前感觉需求不大）


pkgId: 5781767459c12b2ffe9b2ce28039f2100beb24885d6f1e255b88b0accae3a101
name: python-blivet
arch: src
version: 3.11.0
epoch: 0
release: 1
summary: Python module for system storage configuration
url: http://github.com/storaged-project/blivet
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blivet-3.11.0-1.src.rpm
checksum_type: sha256
description:
  Blivet is a python module for system storage configuration.



  <img alt="CI status" src="https://fedorapeople.org/groups/storage_apis/statuses/blivet-master.svg" width="100%" height="300ex" />



  See [COPYING](https://github.com/storaged-project/blivet/blob/master/COPYING)





  Blivet is available in Fedora repositories. You can install it using

      



  Daily builds of Blivet are available in `@storage/blivet-daily` Copr repository.
  You can enable it using

      

  Daily builds of _libblockdev_ and _libbytesize_ are also in this repo.



  Packages for Debian and Ubuntu are available through the Open Build Service.
  Instructions for adding the repository are available [here](https://software.opensuse.org/download.html?project=home:vtrefny&package=python3-blivet).



  Packages for openSUSE Tumbleweed, Mageia (8 and newer) and OpenMandriva (Cooker and Rolling) are available in our [blivet-stable Copr repository](https://copr.fedorainfracloud.org/coprs/g/storage/blivet-stable/).



  Blivet is also available through the [Python Package Index](https://pypi.org/project/blivet/).
  You can install it using

      $ pip3 install blivet

  Blivet depends on some C libraries that are not available on PyPI so you need to install these manually.

  The main dependencies include [libblockdev](https://github.com/storaged-project/libblockdev), [libbytesize](https://github.com/storaged-project/libbytesize), parted and their Python bindings.
  These libraries should be available on most distributions in the standard repositories.

  To install these dependencies use following commands:

   * On Fedora and RHEL/CentOS based distributions:

         
   * On Debian and Ubuntu based distributions:

         



  See [CONTRIBUTING.md](https://github.com/storaged-project/blivet/blob/main/CONTRIBUTING.md)

  Developer documentation is available on our [website](http://storaged.org/blivet/) or on [Read the Docs](https://blivet.readthedocs.io/en/latest/).

  Additional information about the release process, roadmap and other development-related materials are also available in the [GitHub Wiki](https://github.com/storaged-project/blivet/wiki).



  [![Translation](https://translate.fedoraproject.org/widgets/blivet/-/blivet-master/287x66-grey.png)](https://translate.fedoraproject.org/engage/blivet/?utm_source=widget)



  Bugs should be reported to [bugzilla.redhat.com](https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=python-blivet).

  You can also report bug using the [GitHub issues](https://github.com/storaged-project/blivet/issues).


pkgId: 6235c37bfde84d7fb688c437eafca1bd4dcdfa5b6f78c971b9e87d56de7846dc
name: python-blizzardapi2
arch: src
version: 1.1.1
epoch: 0
release: 1
summary: A Python wrapper for Blizzard API
url: https://pypi.org/project/blizzardapi2/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blizzardapi2-1.1.1-1.src.rpm
checksum_type: sha256
description:
  ![GitHub](https://img.shields.io/github/license/lostcol0ny/python-blizzardapi2)[![Pytest](https://github.com/lostcol0ny/python-blizzardapi2/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/lostcol0ny/python-blizzardapi2/actions/workflows/python-package.yml)[![Dependabot](https://github.com/lostcol0ny/blizzardapi2/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/lostcol0ny/blizzardapi2/actions/workflows/dependabot/dependabot-updates)[![CodeQL](https://github.com/lostcol0ny/python-blizzardapi2/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/lostcol0ny/python-blizzardapi2/actions/workflows/github-code-scanning/codeql)[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

  blizzardapi2 is a client library for Blizzard's APIs. It's a fork of [the original library](https://github.com/trevorphillipscoding/python-blizzardapi/).

  Current supported features include:
  - Battle.net User
  - WoW Profile
  - WoW Game Data
  - WoW Classic Game Data
  - Diablo 3 Community
  - Diablo 3 Game Data
  - Hearthstone Game Data
  - Starcraft 2 Community
  - Starcraft 2 Game Data

  Type hints have been added as well.

  To gain access to Blizzard's API please register [here](https://develop.battle.net/access/) to obtain a client id and client secret.

  For more information on Blizzard's API visit:

  [Official Documentation](https://develop.battle.net/documentation)
  [Official API Forum](https://us.forums.blizzard.com/en/blizzard/c/api-discussion)



  Python (3.9, 3.10, 3.11)



  `pip install blizzardapi2`



  **main.py**
  ```python
  from blizzardapi2 import BlizzardApi

  api_client = BlizzardApi("client_id", "client_secret")


  categories_index = api_client.wow.game_data.get_achievement_categories_index("us", "en_US")


  summary = api_client.wow.profile.get_account_profile_summary("us", "en_US", "access_token")


  connected_realms_index = api_client.wow.game_data.get_connected_realms_index("us", "en_US", is_classic=True)
  ```



  You can pass in a `client_id` and `client_secret` and use almost any endpoint except for a few that require an `access_token` obtained via OAuth authorization code flow. You can find more information at https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow.

  Here is the list of endpoints, specified by Blizzard, that require an OAuth token.

  ```
  GET /oauth/userinfo
  GET /profile/user/wow
  GET /profile/user/wow/protected-character/{realm-id}-{character-id}
  GET /profile/user/wow/collections
  GET /profile/user/wow/collections/pets
  GET /profile/user/wow/collections/mounts
  ```


pkgId: e1dd0cda2ad02c50fdeb3fcdac9d8f09f93bdea9dd3cfb2c6f03e188d402a8fb
name: python-bln
arch: src
version: 2.3.10
epoch: 0
release: 1
summary: Python client for the biglocalnews.org API
url: https://github.com/biglocalnews/sdk/py
rpm_license: Apache
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bln-2.3.10-1.src.rpm
checksum_type: sha256
description:
  Python client for the biglocalnews.org API



  - Documentation: [bln-python-client.readthedocs.io](https://bln-python-client.readthedocs.io/)
  - Repository: [github.com/biglocalnews/bln-python-client](https://github.com/biglocalnews/bln-python-client)
  - Packaging: [pypi.org/project/bln](https://pypi.org/project/bln/)



  The project is sponsored by [Big Local News](https://biglocalnews.org/#/about), a program at Stanford University that collects data for impactful journalism. The code is maintained by Stanford Lecturer [Serdar Tumgoren](https://comm.stanford.edu/faculty-tumgoren/) and [Ben Welsh](https://palewi.re/who-is-ben-welsh/), a visiting data journalist from the Los Angeles Times.


pkgId: 9180f4484f0de3f6ff02658e74acd4cb79be2cc318138245a11489e9e07c896b
name: python-blob-mounting-helper-utility
arch: src
version: 1.1.4
epoch: 0
release: 1
summary: Blob mapping utility for easy translation between azure urls and local paths
url: https://pypi.org/project/blob-mounting-helper-utility/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blob-mounting-helper-utility-1.1.4-1.src.rpm
checksum_type: sha256
description:
  When your code needs to access many mapped blobs as a mounted folder, the utility to make translation between blob urls and filepaths easier was made.
  It can be configured using the configuration json file.

  You can also use this utility to download and uploads the blobs to/from the local file system without having to worry about the filepaths.

  Configuration file example:

  ``` json
  {
    "blob_mounting_configurations": [
      {
        "storage_account_name": "examplestagingstrgacc",
        "storage_account_url": "https://examplestagingstrgacc.blob.core.windows.net/",
        "container_name": "example-container-raw",
        "mount_point": "/mnt/example-container-raw"
      }
    ]
  }
  ```



  ```python
  from blob_mounting_helper_utility import BlobMappingUtility
  json_config_file = "blob_mapping_config.json"


  with open(json_config_file) as json_file:
      config = json.load(json_file)["blob_mounting_configurations"]


  blob_mapping_utility = BlobMappingUtility(config)

  filepath1 = "/mnt/example-container-raw/cool_picture.png
  blob_url = blob_mapping_utility.get_url_from_mounted_filepath(filepath1) # -> https://examplestagingstrgacc.blob.core.windows.net/example-container-raw/cool_picture.png

  filepath2 = get_mounted_filepath_from_url(blob_url) # -> /mnt/example-container-raw/cool_picture.png
  ```

  Also, if you were to pass the azure storage account key you can download and upload the blob to a local file path:

  ```python
  from blob_mounting_helper_utility import BlobMappingUtility
  json_config_file = "blob_mapping_config.json"


  with open(json_config_file) as json_file:
      config = json.load(json_file)["blob_mounting_configurations"]

  azure_storage_account_key = "example_key"

  blob_mapping_utility = BlobMappingUtility(config, azure_storage_account_key)
  url = "https://examplestagingstrgacc.blob.core.windows.net/example-container-raw/cool_picture.png"
  blob_mapping_utility.download_blob(url) # -> Downloads the blob to the local file path "/mnt/example-container-raw/cool_picture.png"
  local_filepath = "/mnt/example-container-raw/cool_picture.png"
  do_something_to_file(local_filepath)
  blob_mapping_utility.upload_blob(local_filepath) # -> Uploads the file to the blob url
  blob_mapping_utility.cleanup_files() # cleans both downloaded and uploaded files from the local file system

  ```


pkgId: 221fc0d39edf838651bf20ce3eb983095dfee33dd0cdb4254dae1f92d992a2b8
name: python-blobBgone
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: A lightweight tool to remove blob artifacts from 2D/3D point cloud data as produced by MINFLUX
url: https://github.com/Eggeling-Lab-Microscope-Software/blob-B-gone
rpm_license: BSD License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blobBgone-0.2.0-1.src.rpm
checksum_type: sha256
description:
  Dependencies:
  - Python 3
  - Numpy
  - Scipy
  - Matplotlib
  - Scikit-learn
  - seaborn
  - Pandas (Only for Evaluation)
  - TkInter (If on Windows)

  More precise dependencies will come once the original article is published.
  Technically, this should run on both Windows and Linux.


pkgId: 47f950c57bde31e9f8e42ad0aa0c4d676ac82f46d2ca8329d7e77408eb2083a8
name: python-blobconverter
arch: src
version: 1.4.3
epoch: 0
release: 1
summary: The tool that allows you to convert neural networks to MyriadX blob
url: https://github.com/luxonis/blobconverter
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blobconverter-1.4.3-1.src.rpm
checksum_type: sha256
description:
  This tool allows you to convert neural network files (from various sources, like Tensorflow, Caffe or OpenVINO)
  to MyriadX blob file



  ```
  python3 -m pip install blobconverter
  ```


  ```
  usage: blobconverter [-h] [-zn ZOO_NAME] [-zt ZOO_TYPE] [-onnx ONNX_MODEL]
                       [-cp CAFFE_PROTO] [-cm CAFFE_MODEL] [-tf TENSORFLOW_PB]
                       [-ox OPENVINO_XML] [-ob OPENVINO_BIN] [-rawn RAW_NAME]
                       [-rawc RAW_CONFIG]
                       [-sh {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}]
                       [-dt DATA_TYPE] [-o OUTPUT_DIR]
                       [-v {2021.2,2021.3,2021.4,2022.1,2022.3_RVC3}]
                       [--optimizer-params OPTIMIZER_PARAMS]
                       [--compile-params COMPILE_PARAMS] [--converter-url URL]
                       [--no-cache] [--dry] [--zoo-list] [--download-ir]

  optional arguments:
    -h, --help            show this help message and exit
    -zn ZOO_NAME, --zoo-name ZOO_NAME
                          Name of a model to download from OpenVINO Model Zoo
    -zt ZOO_TYPE, --zoo-type ZOO_TYPE
                          Type of the model zoo to use, available: "intel", "depthai"
    -onnx ONNX_MODEL, --onnx-model ONNX_MODEL
                          Path to ONNX .onnx file
    -cp CAFFE_PROTO, --caffe-proto CAFFE_PROTO
                          Path to Caffe .prototxt file
    -cm CAFFE_MODEL, --caffe-model CAFFE_MODEL
                          Path to Caffe .caffemodel file
    -tf TENSORFLOW_PB, --tensorflow-pb TENSORFLOW_PB
                          Path to TensorFlow .pb file
    -ox OPENVINO_XML, --openvino-xml OPENVINO_XML
                          Path to OpenVINO .xml file
    -ob OPENVINO_BIN, --openvino-bin OPENVINO_BIN
                          Path to OpenVINO .bin file
    -rawn RAW_NAME, --raw-name RAW_NAME
                          Name of the converted model (advanced)
    -rawc RAW_CONFIG, --raw-config RAW_CONFIG
                          Path to raw .yml file with model config (advanced)
    -sh {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}, --shaves {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
                          Specifies number of SHAVE cores that converted model will use
    -dt DATA_TYPE, --data-type DATA_TYPE
                          Specifies model data type
    -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                          Directory where the output blob should be saved
    -v {2021.2,2021.3,2021.4,2022.1,2022.3_RVC3}, --version {2021.2,2021.3,2021.4,2022.1,2022.3_RVC3}
                          OpenVINO version to use for conversion. To export
                          model for RVC3, you must set OpenVINO version to
                          '2022.3_RVC3'.
    --optimizer-params OPTIMIZER_PARAMS
                          Additional params to use when converting a model to OpenVINO IR
    --compile-params COMPILE_PARAMS
                          Additional params to use when compiling a model to MyriadX blob
    --converter-url URL   URL to BlobConverter API endpoint used for conversion
    --no-cache            Omit .cache directory and force new compilation of the blob
    --dry                 Instead of compiling the blob, return compilation commands (for manual conversion)
    --zoo-list            List all models available in OpenVINO Model Zoo
    --download-ir         Downloads OpenVINO IR files used to compile the blob. Result path points to a result ZIP archive
  ```





  ```
  python3 -m blobconverter --zoo-name face-detection-retail-0004 --shaves 6
  ```

  To list all available models, run

  ```
  python3 -m blobconverter --zoo-list
  ```



  ```
  python3 -m blobconverter --caffe-proto /path/to/mobilenet-ssd.prototxt --caffe-model /path/to/mobilenet-ssd.caffemodel --shaves 6
  ```




  ```
  python3 -m blobconverter --tensorflow-pb /path/to/deeplabv3_mnv2_pascal_train_aug.pb --optimizer-params --reverse_input_channels --input_shape=[1,513,513,3] --input=1:mul_1 --output=ArgMax --shaves 6
  ```




  ```
  python3 -m blobconverter --onnx-model /path/to/model.onnx --shaves 6
  ```




  ```
  python3 -m blobconverter --openvino-xml /path/to/face-detection-retail-0004.xml --openvino-bin /path/to/face-detection-retail-0004.bin --shaves 7
  ```




  ```
  python3 -m blobconverter --raw-config /path/to/model.yml --raw-name license-plate-recognition-barrier-0007 --shaves 6
  ```





  ```python
  import blobconverter

  blob_path = blobconverter.from_zoo(
      name="face-detection-retail-0004",
      shaves=6,
  )
  ```

  To get all available models, use

  ```python
  import blobconverter

  available_models = blobconverter.zoo_list()
  ```



  ```python
  import blobconverter

  blob_path = blobconverter.from_caffe(
      proto="/path/to/mobilenet-ssd.prototxt",
      model="/path/to/mobilenet-ssd.caffemodel",
      data_type="FP16",
      shaves=5,
  )
  ```




  ```python
  import blobconverter

  blob_path = blobconverter.from_tf(
      frozen_pb="/path/to/deeplabv3_mnv2_pascal_train_aug.pb",
      data_type="FP16",
      shaves=5,
      optimizer_params=[
          "--reverse_input_channels",
          "--input_shape=[1,513,513,3]",
          "--input=1:mul_1",
          "--output=ArgMax",
      ],
  )
  ```



  ```python
  import blobconverter

  blob_path = blobconverter.from_onnx(
      model="/path/to/model.onnx",
      data_type="FP16",
      shaves=5,
  )
  ```




  ```python
  import blobconverter

  blob_path = blobconverter.from_openvino(
      xml="/path/to/face-detection-retail-0004.xml",
      bin="/path/to/face-detection-retail-0004.bin",
      data_type="FP16",
      shaves=5,
  )
  ```




  ```python
  import blobconverter

  blob_path = blobconverter.from_config(
      name="license-plate-recognition-barrier-0007",
      path="/path/to/model.yml",
      data_type="FP16",
      shaves=5,
  )
  ```



  ```python
  import blobconverter

  blob_path = blobconverter.from_zoo(name="megadepth", zoo_type="depthai")
  ```


  ```python
  import blobconverter

  blob_path = blobconverter.from_openvino(
      xml="https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.4/models_bin/3/age-gender-recognition-retail-0013/FP16/age-gender-recognition-retail-0013.xml",
      xml_size=31526,
      xml_sha256="54d62ce4a3c3d7f1559a22ee9524bac41101103a8dceaabec537181995eda655",
      bin="https://storage.openvinotoolkit.org/repositories/open_model_zoo/2021.4/models_bin/3/age-gender-recognition-retail-0013/FP16/age-gender-recognition-retail-0013.bin",
      bin_size=4276038,
      bin_sha256="3586df5340e9fcd73ba0e2d802631bd9e027179490635c03b273d33d582e2b58"
  )
  ```


pkgId: c5e701c1a945f733ee897961dfe2ff4a9eba9dc9a04aaa9ef816a373ddcccc6e
name: python-blobfile
arch: src
version: 3.0.0
epoch: 0
release: 1
summary: Read GCS, ABS and local paths with the same interface, clone of tensorflow.io.gfile
url: https://github.com/christopher-hesse/blobfile
rpm_license: Public Domain
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blobfile-3.0.0-1.src.rpm
checksum_type: sha256
description:
  This is a library that provides a Python-like interface for reading local and remote files (only from blob storage), with an API similar to `open()` as well as some of the `os.path` and `shutil` functions.  `blobfile` supports local paths, Google Cloud Storage paths (`gs://<bucket>`), and Azure Blob Storage paths (`az://<account>/<container>` or `https://<account>.blob.core.windows.net/<container>/`).

  The main function is `BlobFile`, which lets you open local and remote files that act more or less like local ones.  There are also a few additional functions such as `basename`, `dirname`, and `join`, which mostly do the same thing as their `os.path` namesakes, only they also support GCS paths and ABS paths.

  This library is inspired by TensorFlow's [`gfile`](https://www.tensorflow.org/api_docs/python/tf/io/gfile/GFile) but does not have exactly the same interface.



  ```sh
  pip install blobfile
  ```



  ```py


  import blobfile as bf

  with bf.BlobFile("gs://my-bucket-name/cats", "wb") as f:
      f.write(b"meow!")

  print("exists:", bf.exists("gs://my-bucket-name/cats"))

  with bf.BlobFile("gs://my-bucket-name/cats", "rb") as f:
      print("contents:", f.read())
  ```

  There are also some [examples processing many blobs in parallel](docs/parallel_examples.md).

  Here are the functions in `blobfile`:

  * `BlobFile` - like `open()` but works with remote paths too, data can be streamed to/from the remote file.  It accepts the following arguments:
      * `streaming`:
          * The default for `streaming` is `True` when `mode` is in `"r", "rb"` and `False` when `mode` is in `"w", "wb", "a", "ab"`.
          * `streaming=True`:
              * Reading is done without downloading the entire remote file.
              * Writing is done to the remote file directly, but only in chunks of a few MB in size.  `flush()` will not cause an early write.
              * Appending is not implemented.
          * `streaming=False`:
              * Reading is done by downloading the remote file to a local file during the constructor.
              * Writing is done by uploading the file on `close()` or during destruction.
              * Appending is done by downloading the file during construction and uploading on `close()`.
      * `buffer_size`: number of bytes to buffer, this can potentially make reading more efficient.
      * `cache_dir`: a directory in which to cache files for reading, only valid if `streaming=False` and `mode` is in `"r", "rb"`.   You are reponsible for cleaning up the cache directory.
      * `file_size`: size of the file being opened, can be specified directly to avoid checking the file size when opening the file.  While this will avoid a network request, it also means that you may get an error when first reading a file that does not exist rather than when opening it.  Only valid for modes "r" and "rb".  This valid will be ignored for local files.

  Some are inspired by existing `os.path` and `shutil` functions:

  * `copy` - copy a file from one path to another, this will do a remote copy between two remote paths on the same blob storage service
  * `exists` - returns `True` if the file or directory exists
  * `glob`/`scanglob` - return files matching a glob-style pattern as a generator.  Globs can have [surprising performance characteristics](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames#efficiency-consideration:-using-wildcards-over-many-objects) when used with blob storage.  Character ranges are not supported in patterns.
  * `isdir` - returns `True` if the path is a directory
  * `listdir`/`scandir` - list contents of a directory as a generator
  * `makedirs` - ensure that a directory and all parent directories exist
  * `remove` - remove a file
  * `rmdir` - remove an empty directory
  * `rmtree` - remove a directory tree
  * `stat` - get the size and modification time of a file
  * `walk` - walk a directory tree with a generator that yields `(dirpath, dirnames, filenames)` tuples
  * `basename` - get the final component of a path
  * `dirname` - get the path except for the final component
  * `join` - join 2 or more paths together, inserting directory separators between each component

  There are a few bonus functions:

  * `get_url` - returns a url for a path (usable by an HTTP client without any authentication) along with the expiration for that url (or None)
  * `md5` - get the md5 hash for a path, for GCS this is often fast, but for other backends this may be slow.  On Azure, if the md5 of a file is calculated and is missing from the file, the file will be updated with the calculated md5.
  * `set_mtime` - set the modified timestamp for a file
  * `configure` - set global configuration options for blobfile
      * `log_callback=default_log_fn`: a log callback function `log(msg: string)` to use instead of printing to stdout.  If you use `parallel=True`, you probably want to use a log callback function that is pickleable.
      * `connection_pool_max_size=32`: the max size for each per-host connection pool
      * `max_connection_pool_count=10`: the maximum count of per-host connection pools
      * `azure_write_chunk_size=8 * 2 ** 20`: the size of blocks to write to Azure Storage blobs in bytes, can be set to a maximum of 100MB.  This determines both the unit of request retries as well as the maximum file size, which is `50,000 * azure_write_chunk_size`.
      * `google_write_chunk_size=8 * 2 ** 20`: the size of blocks to write to Google Cloud Storage blobs in bytes, this only determines the unit of request retries.
      * `retry_log_threshold=0`: set a retry count threshold above which to log failures to the log callback function
      * `retry_common_log_threshold=2`: set a retry count threshold above which to log very common failures to the log callback function
      * `connect_timeout=10`: the maximum amount of time (in seconds) to wait for a connection attempt to a server to succeed, set to None to wait forever
      * `read_timeout=30`: the maximum amount of time (in seconds) to wait between consecutive read operations for a response from the server, set to None to wait forever
      * `output_az_paths=True`: output `az://` paths instead of using the `https://` for azure
      * `use_azure_storage_account_key_fallback=False`: fallback to storage account keys for azure containers, having this enabled requires listing your subscriptions and may run into 429 errors if you hit the low azure quotas for subscription listing
      * `get_http_pool=None`: a function that returns a `urllib3.PoolManager` to be used for requests
      * `use_streaming_read=False`: if set to `True`, use a single read per file instead of reading a chunk at a time (not recommended for azure)
      * `default_buffer_size=io.DEFAULT_BUFFER_SIZE`: the default buffer size to use for reading files (and writing local files)
      * `save_access_token_to_disk=True`: if set to `True` to save access tokens to disk so that other processes can read the access tokens to avoid the small amount of time it usually takes to get a token (if the token is still valid).
      * `multiprocessing_start_method="spawn"`: the start method to use when creating processes for parallel work
  * `create_context` - (same arguments as `configure`), creates a new instance of `blobfile` with a custom configuration instead of modifying the global configuration





  The following methods will be tried in order:

  1) Check the environment variable `GOOGLE_APPLICATION_CREDENTIALS` for a path to service account credentials in JSON format.
  2) Check for "application default credentials".  To setup application default credentials, run `gcloud auth application-default login`.
  3) Check for a GCE metadata server (if running on GCE) and get credentials from that service.



  The following methods will be tried in order:

  1) If `AZURE_USE_IDENTITY=1` is set, use [DefaultAzureCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python) from the `azure-identity` package to acquire tokens. Note: your application must install the `azure-identity` package; `blobfile` does not specify it as a required dependency.
  2) Check the environment variable `AZURE_STORAGE_KEY` for an azure storage account key (these are per-storage account shared keys described in https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage)
  3) Check the environment variable `AZURE_APPLICATION_CREDENTIALS` which should point to JSON credentials for a service principal output by the command `az ad sp create-for-rbac --name <name>`
  4) Check the environment variables `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID` corresponding to a service principal described in the previous step but without the JSON file.
  4) Check the environment variable `AZURE_STORAGE_CONNECTION_STRING` for an [Azure Storage connection string](https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string)
  6) Use credentials from the `az` command line tool if they can be found.

  If access using credentials fails, anonymous access will be tried.  `blobfile` supports public access for containers marked as public, but not individual blobs.



  For Google Cloud Storage and Azure Blobs, directories don't really exist.  These storage systems store the files in a single flat list.  The "/" separators are just part of the filenames and there is no need to call the equivalent of `os.mkdir` on one of these systems.

  <!-- As a result, directories can be either "implicit" or "explicit".

  * An "implicit" directory would be if the file "a/b" exists, then we would say that the directory "a" exists.  If you delete "a/b", then that directory no longer exists because no file exists with the prefix "a/".
  * An "explicit" directory would be if the file "a/" exists.  All other files with the prefix "a/" could be deleted, and the directory "a" would still exist because of this dummy file. -->

  To make local behavior consistent with the remote storage systems, missing local directories will be created automatically when opening a file in write mode.



  These are just normal paths for the current machine, e.g. `/root/hello.txt`



  GCS paths have the format `gs://<bucket>/<blob>`, you cannot perform any operations on `gs://` itself.



  Azure Blobs URLs have the format `az://<account>/<container>` or `https://<account>.blob.core.windows.net/<container>/<blob>`.  The highest you can go up the hierarchy is `az://<account>/<container>/`, `blobfile` cannot perform any operations on `az://<account>/`.  The `https://` url is the output format by default, but the `az://` urls are accepted as inputs and you can set `output_az_paths=True` to get `az://` urls as output.



  * `Error` - base class for library-specific exceptions
  * `RequestFailure(Error)` - a request has failed permanently, the status code can be found in the property `response_status:int` and an error code, if available, is in `error:Optional[str]`.
  * `RestartableStreamingWriteFailure(RequestFailure)` - a streaming write has failed permanently, which requires restarting from the beginning of the stream.
  * `ConcurrentWriteFailure(RequestFailure)` - a write failed because another process was writing to the same file at the same time.
  * `VersionMismatch(RequestFailure)` - a write failed because the remote file did not match the version specified by the user.
  * The following generic exceptions are raised from some functions to make the behavior similar to the original versions: `FileNotFoundError`, `FileExistsError`, `IsADirectoryError`, `NotADirectoryError`, `OSError`, `ValueError`, `io.UnsupportedOperation`



  `blobfile` will keep retrying transient errors until they succeed or a permanent error is encountered (which will raise an exception).  In order to make diagnosing stalls easier, `blobfile` will log when retrying requests.

  To route those log lines, use `configure(log_callback=<fn>)` to set a callback function which will be called whenever a log line should be printed.  The default callback prints to stdout with the prefix `blobfile:`.



  If you use the python `logging` module, you can have `blobfile` log there:

  ```py
  bf.configure(log_callback=logging.getLogger("blobfile").warning)
  ```

  While `blobfile` does not use the python `logging` module by default, it does use other libraries which use that module.  So if you configure the python `logging` module, you may need to change the settings to adjust logging behavior:

  * `urllib3`: `logging.getLogger("urllib3").setLevel(logging.ERROR)`
  * `filelock`: `logging.getLogger("filelock").setLevel(logging.ERROR)`

  Also, as a tip, make sure to use a format that tells you the name of the logger:

  ```py
  logging.basicConfig(format="s [s] s: s", level=logging.WARNING)
  ```

  This will let you see which package is producing log messages.



  The library should be thread safe and fork safe with the following exceptions:

  * A `BlobFile` instance is not thread safe (only 1 thread should own a `BlobFile` instance at a time)
  * Calls to `bf.configure()` are not thread-safe and should ideally happen before performing any operations



  Google Cloud Storage supports multiple writers for the same blob and the last one to finish should win.  However, in the event of a large number of simultaneous writers, the service will return 429 or 503 errors and most writers will stall.  In this case, write to different blobs instead.

  Azure Blobs doesn't support multiple writers for the same blob.  With the way `BlobFile` is currently configured, the last writer to start writing will win.  Other writers will get a `ConcurrentWriteFailure`.  In addition, all writers could fail if the file size is large and there are enough concurrent writers.  In this case, you can write to a temporary blob (with a random filename), copy it to the final location, and then delete the original.  The copy will be within a container so it should be fast.



  See [CHANGES](CHANGES.md)



  Create [testing buckets](https://github.com/christopher-hesse/blobfile/blob/bb885e72e97ddade675d4493db235b43888a2191/blobfile/_ops_test.py#L30-L36) for each cloud provider with appropriate credentials.

  To make a new release:
  - Update CHANGES.md
  - Update blobfile/VERSION
  - `rm -rf build dist`
  - `python -m build .`
  - `twine upload dist/*`
  - Tag the release on Github



  This will auto-format the code, check the types, and then run the tests:

  ```sh
  python testing/run.py
  ```

  Run a single test:

  ```sh
  python testing/run.py -v -s -k test_windowed_file
  ```

  Modify `testing/run.py` if you only want to do some of these things.  The tests are rather slow, ~7 minutes to run (even though large file tests are disabled) and require accounts with every cloud provider.


pkgId: 6449e1e2adb4f6ec5f755ff18b8312756a29bbe23666dd51b4731735e820905b
name: python-blobmodel
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Two dimensional model of propagating blobs
url: https://pypi.org/project/blobmodel/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blobmodel-1.0.1-1.src.rpm
checksum_type: sha256
description:
  [![Python version](./readme_files/tmp5kfvrjp5.svg)](https://www.python.org/)
  [![Pypi](https://github.com/uit-cosmo/blobmodel/blob/main/readme_files/tmp5kfvrjp5.svg)](https://pypi.org/project/blobmodel/#description)
  [![codecov](https://github.com/uit-cosmo/blobmodel/blob/main/readme_files/tmpp0mi4n8p.svg)](https://codecov.io/github/uit-cosmo/blobmodel)
  ![Tests](https://github.com/uit-cosmo/2d_propagating_blobs/actions/workflows/workflow.yml/badge.svg)
  [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  [![Documentation Status](https://readthedocs.org/projects/blobmodel/badge/?version=latest)](https://blobmodel.readthedocs.io/en/latest/?badge=latest)

  This package provides realizations of advecting and dissipating blobs in up to two dimensions.

  All blob parameters can be choosen freely, and multiple blob shapes are implemented. Originally, the model is developed for studying the scrape-off layer of fusion experiments, but it can be applicable to many 1d or 2d systems. See the [blobmodel documentation](https://blobmodel.readthedocs.io/en/latest/?badge=latest) for further details.

  Examples for one and two dimensions are shown below:

  <table>
  <tr>
  <th> 1D </th>
  <th> 2D </th>
  </tr>
  <tr>
  <td>
  <img src="https://github.com/uit-cosmo/blobmodel/blob/main/readme_files/1d_blobs.gif" alt="Density evolution" style="max-width: 40%;" />


  </td>
  <td>

  <img src="https://github.com/uit-cosmo/blobmodel/blob/main/readme_files/2d_blobs.gif" alt="Density evolution" style="max-width: 40%;" />


  </td>
  </tr>
  </table>


  The package is published to PyPI and can be installed with
  ```sh
  pip install blobmodel
  ```

  If you want the development version you must first clone the repo to your local machine,
  then install the project in development mode:

  ```sh
  git clone https://github.com/uit-cosmo/blobmodel.git
  cd blobmodel
  python -m pip install -e .
  ```


  Create a grid on which the blobs are discretized using the `Model` class. The `make_realization()` method computes the output as an xarray dataset which can also be written out as a `netcdf` file if the argument `file_name` is specified. A simple example is shown below:

  ```Python
  from blobmodel import Model, show_model

  bm = Model(Nx=200, Ny=100, Lx=10, Ly=10, dt=0.1, T=20, blob_shape='gauss',num_blobs=100)

  ds = bm.make_realization(file_name="example.nc")
  ```
  The data can be shown as an animation using the `show_model` function:
  ```Python
  show_model(ds)
  ```
  You can specify the blob parameters with a BlobFactory class. The DefaultBlobFactory class has some of the most common distribution functions implemented. An example would look like this:

  ```Python
  from blobmodel import Model, DefaultBlobFactory


  bf = DefaultBlobFactory(A_dist="exp", wx_dist="uniform", vx_dist="deg", vy_dist="normal")


  tmp = Model(
      Nx=100,
      Ny=1,
      Lx=10,
      Ly=0,
      dt=1,
      T=1000,
      blob_shape="exp",
      t_drain=2,
      periodic_y=False,
      num_blobs=10000,
      blob_factory=bf,
  )
  ```
  Alternatively, you can specify all blob parameters exactly as you want by writing your own class which inherits from BlobFactory. See `examples/custom_blobfactory.py` as an example or take a look at the [blobmodel documentation](https://blobmodel.readthedocs.io/en/latest/?badge=latest).



  Feel free to raise issues about anything. Contributions through pull requests are also very welcome. Please take a look at our [Contributor guide](https://blobmodel.readthedocs.io/en/latest/contributor_guide.html) for further details.

rpm_license:
  MIT License  Copyright (c) 2021 Gregor Decristoforo  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


pkgId: 2299ade728a6884b3d7d0caae6eb40b79a86f089383d6ff1f3acdb6d8bad76d6
name: python-block-cascade
arch: src
version: 2.6.0
epoch: 0
release: 1
summary: Library for model training in multi-cloud environment.
url: https://pypi.org/project/block-cascade/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-block-cascade-2.6.0-1.src.rpm
checksum_type: sha256
description:
  Cascade is a library for submitting and managing jobs across multiple cloud environments. It is designed to integrate seamlessly into existing Prefect workflows or can be used as a standalone library.





    ```bash
    poetry add block-cascade
    ```
  or
  ```
  pip install block-cascade
  ```



  ```python
  from block_cascade import remote
  from block_cascade import GcpEnvironmentConfig, GcpMachineConfig, GcpResource

  machine_config = GcpMachineConfig("n2-standard-4", 1)
  environment_config = GcpEnvironmentConfig(
      project="example-project",
      region="us-west1",
      service_account=f"example-project@vertex.iam.gserviceaccount.com",
      image="us.gcr.io/example-project/cascade/cascade-test",
      network="projects/123456789123/global/networks/shared-vpc"
  )
  gcp_resource = GcpResource(
      chief=machine_config,
      environment=environment_config,
  )

  @remote(resource=gcp_resource)
  def addition(a: int, b: int) -> int:
      return a + b

  result = addition(1, 2)
  assert result == 3
  ```


  Cascade supports defining different resource requirements via a configuration file titled either cascade.yaml or cascade.yml. This configuration file must be located in the working directory of the code execution to be discovered at runtime.

  ```yaml
  calculate:
    type: GcpResource
    chief:
      type: n1-standard-1
  You can even define a default configuration that can be overridden by specific tasks to eliminate redundant definitions.

  default:
      GcpResource:
          environment:
              project: example-project
              service_account: example-project@vertex.iam.gserviceaccount.com
              region: us-central-1
          chief:
              type: n1-standard-4
  ```


  Cascade requires authorization both to submit jobs to either GCP or Databricks and to stage picklied code to a cloud storage bucket. In the GCP example below, an authorization token is obtained via IAM by running the following command:

  ```bash
  gcloud auth login --update-adc
  ```
  No additional configuration is required in your application's code to use this token.

  However, for authenticating to Databricks and AWS you will need to provide a token and secret key respectively. These can be passed directly to the `DatabricksResource` object or set as environment variables. The following example shows how to provide these values in the configuration file.


  Cascade supports creating persistent resources in GCP. These resources can be reused across multiple tasks and will persist until deleted manually by the user. This can be useful for debugging tasks that involve large images that take a long time to be loaded onto a node or for reserving scarce resources like A100 GPUs.

  You can create a persistent resource using the `cascade` CLI and suppling a `cascade.yml` with a configuration block that contains a `persistent_resource_id` field. This field will be used to identify the persistent resource when submitting tasks to it. It is recommended that you use the configuration file to define the resource as well as the tasks that will be submitted to it. This will ensure that the resource specified for your task is compatible with the shape of the persistent resource.

  ```yaml
  persistent-resource:
    type: GcpResource
    environment:
        project: example-project
        service_account: example-project@example-project.iam.gserviceaccount.com
        region: us-west1
        image: us.gcr.io/example-project/cascade/block-cascade
    chief:
        type: n1-standard-4
    persistent_resource_id: my-persistent-resource
  ```


  ```bash
  cascade create-persistent-resource --config persistent-resource
  ```


  ```python
  from block_cascade import remote


  @remote(config_name="persistent-resource", job_name="hello-world")
  def test_job():
      print("Hello World")


  test_job()

  ```


  ```bash
  cascade delete-persistent-resource -i my-persistent-resource
  ```
  Note: persistent resource ids can not be reused. If you delete a persistent resource, you will need to create a new one with a different id.





  When developing cascade, you can optionally use [hermit](https://cashapp.github.io/hermit/usage/get-started/) to manage the Python executable used by cascade. Together with using poetry to manage dependencies, this will ensure that your development environment is identical to other contributors. Follow the linked instructions for installing hermit and then you can create a virtualenv with Python@3.9 by running:

  `. ./bin/activate-hermit`

  Then, install the dependencies with poetry:
  `poetry install`


pkgId: 95e7d31743bca302c6b3108783834f3e445c769894e89ef7239a5e684f5a4cc1
name: python-block-io
arch: src
version: 2.0.6
epoch: 0
release: 1
url: https://github.com/BlockIo/block_io-python
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-block-io-2.0.6-1.src.rpm
checksum_type: sha256
summary:
  The easiest way to integrate Bitcoin, Dogecoin and Litecoin in your applications. Sign up at Block.io for your API key.

description:
  This Python package is the official reference client for the Block.io payments API. To use this, you will need the Dogecoin, Bitcoin, or Litecoin API key(s) from <a href="https://block.io" target="_blank">Block.io</a>. Go ahead, sign up :)





  [Using virtualenv is recommended when installing Python packages](https://packaging.python.org/en/latest/installing.html#virtual-environments).

  Install the package using `pip3`:

      pip3 install block-io



  It's super easy to get started. In your Python shell, do:

      from block_io import BlockIo

      block_io = BlockIo('API KEY', 'SECRET PIN', API_VERSION)

      
      print block_io.get_balance()

      
      print block_io.get_my_addresses()

  For more information, see [Python API Docs](https://block.io/api/simple/python). This Python client provides a mapping for all methods listed on the Block.io API site.



  1. Fork it ( https://github.com/BlockIo/block_io-python/fork )
  2. Create your feature branch (`git checkout -b my-new-feature`)
  3. Commit your changes (`git commit -am 'Add some feature'`)
  4. Push to the branch (`git push origin my-new-feature`)
  5. Create a new Pull Request


pkgId: 10fe5a25baf3e19cf2790e0b394e607c7c11fc2f50a26a50c6aebcd1d7d13786
name: python-blockapi
arch: src
version: 0.48.2
epoch: 0
release: 1
summary: BlockAPI library
url: https://pypi.org/project/blockapi/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockapi-0.48.2-1.src.rpm
checksum_type: sha256
description:
  Library to interact with numerous cryptocurrency data APIs to get the basic info about account balance, transactions, staking informations, etc.
  List of supported coins:

  | coin  | API name | supported operations
  | :---- | :------------| :---------------------
  | XTZ   | TzscanAPI   | balance, transactions, activations, originations, delegations, endorsements, bakings
  |       | TzStatsAPI  | staking (balance, rewards)
  | ATOM  | CosmosAPI   | balance, transactions, rewards, delegates, votes
  | DCR   | DcrdataAPI  | balance, transactions
  | ADA   | CardanoExplorerAPI | balance, transactions
  | ZEC   | ChainSoAPI  | balance, transactions
  |       | MercerweissAPI | balance
  |       | ZchainAPI | balance
  | ETC   | BlockscoutAPI | balance
  | NEO   | NeoscanAPI | balance, transactions
  | ZEN   | ZensystemAPI | balance
  | DASH  | ChainSoAPI | balance, transactions
  |       | CryptoIDAPI | balance
  | DOGE  | ChainSoAPI |balance, transactions
  | BNB   | BinanceAPI |balance,transactions
  | EOS   | EosparkAPI |balance, transactions
  |       | GreymassAPI | balance
  | BCH   | BtcAPI | balance
  | XLM   | StellarAPI | balance
  | RVN   | RavencoinAPI | balance
  | TRX   | TronscanAPI | balance
  | LTC   | BlockcypherAPI | balance
  |       | ChainSoAPI | balance, transactions
  |       | CryptoIDAPI | balance
  |       | Ltc1TrezorAPI | balance, transactions
  | BTC   | BlockchainInfoAPI | balance, transactions
  |       | BlockonomicsAPI | balance, transactions
  |       | ChainSoAPI | balance, transactions
  |       | Btc1TrezorAPI | balance, transactions
  |       | Btc2TrezorAPI | balance, transactions
  |       | BitpayAPI | balance
  | GRS   | CryptoIDAPI | balance
  | ETH   | AlethioAPI | balance, transactions, events
  |       | EtherscanAPI | balance, transactions
  |       | EthplorerAPI | balance
  | ONT   | OntioAPI | balance, transactions
  | VET   | DigonchainAPI | balance
  | BOS   | BlockchainosAPI | balance, transactions
  | LUNA  | TerraMoneyAPI | balance, transactions, delegations
  | DOT   | SubscanPolkaAPI | balance, transactions, staking (locked, rewards)
  | KSM   | SubscanKusamaAPI | balance, transactions, staking (locked, rewards)



  These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.



  Python 3.x, PIP (if you'd like to install it this way).



  Library can be installed simply with pip:

  ```
  pip install blockapi
  ```

  or by running:
  ```
  make install
  ```



  Example usage to get account balance:
  ```
  import blockapi
  myobj = blockapi.api.BlockchainInfoAPI("bitcoin-address-here")
  myobj.get_balance()
  ```

  For some coins there are multiple APIs available. With get_random_api_class_for_coin it is possible
  to randomly pick any of the available APIs:
  ```
  myapi = blockapi.get_random_api_class_for_coin('BTC')('1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX')
  myapi.get_balance()
  ```

  To directly pick first random working API and ask it for the account balance:
  ```
  >>> blockapi.get_balance_from_random_api('BTC','16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe')
  0.010034040000000001
  ```

  It is possible to ask for a list of working APIs for a coin. They are automatically checked first if they work (test is done with asking for a balance). Only APIs which pass this check are returned:
  ```
  >>> blockapi.get_working_apis_for_coin('BTC')
  (<class 'blockapi.api.blockchaininfo.BlockchainInfoAPI'>, <class 'blockapi.api.blockonomics.BlockonomicsAPI'>, <class 'blockapi.api.insight.BitpayAPI'>, <class 'blockapi.api.trezor.Btc2TrezorAPI'>, <class 'blockapi.api.trezor.Btc1TrezorAPI'>)
  ```

  During the API instance creation the supplied address is being checked for validity, if the address
  is not valid, ValueError exception is being raised:
  ```
  >>> import blockapi
  >>> blockapi.api.CosmosAPI('blahblah')
  Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 195, in __init__
  self.check_validity()
  File "/srv/apps/blockapi/src/blockapi/blockapi/services.py", line 201, in check_validity
  self.symbol, self.address_info.address
  ValueError: Not a valid ATOM address: b'blahblah'
  ```

  It is possible to display the result of the address validation with included details like validity, network type, address type, or the info whether the supplied address is an extended one.
  Not for all coins all the details are available though:
  ```
  >>> import blockapi
  >>> myapi = blockapi.api.TzscanAPI('valid tezos address here')
  >>> myapi.address_info
  ValidationResult(name='tezos', ticker='xtz', address=b'valid tezos-address here', valid=True, network='both', is_extended=False, address_type='originated_account')
  ```



  To run the included tests simply issue:

  ```
  make test
  ```



  TBD



  * **Devmons s.r.o. - *Initial work* - [crypkit](https://github.com/crypkit)

  See also the list of [contributors](https://github.com/crypkit/blockapi/contributors) who participated in this project.



  * **Chris Priest - *moneywagon library we took many ideas from* - [moneywagon](https://github.com/priestc/moneywagon)
  * **Joe Black - *Address validation library* - [coinaddr](https://github.com/joeblackwaslike/coinaddr)



  This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


pkgId: 42c26981274ae5170ac7c87b9cbd276cdb163f1951df42b248b5d53cfb9f2f11
name: python-blockbax-sdk
arch: src
version: 1.2.1
epoch: 0
release: 1
summary: Blockbax Python SDK
url: https://blockbax.com/docs/integrations/python-sdk/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockbax-sdk-1.2.1-1.src.rpm
checksum_type: sha256
description:
  For more information please refer to our [Python SDK documentation](https://blockbax.com/docs/integrations/python-sdk/).



  Release notes can be found [here](https://blockbax.com/docs/python-sdk/#release-notes).


pkgId: fbe4ba4765b760434b00e3ebbee047903d3f0f45aefd962bbb896ac37abc69e5
name: python-blockchain-certificates
arch: src
version: 2.1.9
epoch: 0
release: 1
summary: Create pdf certificate files and issue on the blockchain!
url: https://github.com/verifiable-pdfs/blockchain-certificates
rpm_license: AGPLv3
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockchain-certificates-2.1.9-1.src.rpm
checksum_type: sha256
description:
  This project allows an institution to issue digital certificates. It
  creates pdf certificate files (or uses existing ones) and issues a hash
  representing those files into the Bitcoin network's blockchain. Now


pkgId: f20e43cd6f80418d3156409765e67b889e0f05d5c9935a6ecf4ae0d03ff37d4e
name: python-blockchain-data-subnet-shared-libs
arch: src
version: 0.0.22
epoch: 0
release: 1
url: https://github.com/blockchain-insights/blockchain-data-subnet-shared-libs
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockchain-data-subnet-shared-libs-0.0.22-1.src.rpm
checksum_type: sha256
summary:
  All shared libs that all components, executables, and services of blockchain data subnet are based on


pkgId: 8cddeb235c58b1db48e76fd5e2cd8a3cd74059305e36f279fc9462ff90c64736
name: python-blockchain-etl-common
arch: src
version: 1.7.1
epoch: 0
release: 1
summary: Common utils for Blockchain ETL
url: https://github.com/blockchain-etl/blockchain-etl-common
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockchain-etl-common-1.7.1-1.src.rpm
checksum_type: sha256
description:
  Common utils for https://github.com/blockchain-etl.



  ```bash
  > pip3 install -e .[streaming]
  ```



  ```bash
  > pytest -vv
  ```


pkgId: 5bf1af11278a7100dd306286f443dbbe63cdc693ac2c5c624e67f7e7e49088dd
name: python-blockchaintxtools
arch: src
version: 0.1.1
epoch: 0
release: 1
url: https://github.com/yorkeccak/blockchaintxtools
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockchaintxtools-0.1.1-1.src.rpm
checksum_type: sha256
summary:
  A comprehensive toolkit for collecting, analyzing, filtering, and exporting blockchain transactions using Blockchair's database dumps.

description:
  A comprehensive toolkit for collecting and analyzing blockchain transactions using Blockchair's database dumps.



  - Collect blockchain transactions from Blockchair's data dumps
  - Filter transactions based on value, amount, and date range
  - Flexible collection intervals: daily, weekly, or random
  - Progress saving and resuming capabilities
  - Transaction analysis tools
  - Export data to CSV and JSON formats



  You can install the Blockchain Transaction Collector using pip:

  ```
  pip install blockchaintxcollector
  ```



  Here's a quick example of how to use the BTC Transaction Collector:

  ```python
  from blockchaintxcollector import BTCTransactionCollector, TransactionFilter, IntervalType
  from datetime import datetime


  collector = BTCTransactionCollector()


  transaction_filter = TransactionFilter(
      min_usd_value=10000000, # Minimum transaction value in USD
      start_date=datetime(2018, 1, 1),
      end_date=datetime(2024, 6, 26)
  )


  collector.collect_transactions(transaction_filter, interval=IntervalType.WEEKLY)


  analysis, transactions = collector.analyze_transactions()
  print(analysis)


  collector.export_analysis_to_json(analysis, "large_transactions_analysis.json")
  collector.export_transactions_to_csv(transactions, "large_transactions.csv")
  collector.export_transactions_to_json(transactions, "large_transactions.json")
  ```



  For full documentation, please refer to the [docs](https://github.com/yorkeccak/blockchaintxtools/docs) directory.



  Contributions are welcome! Please feel free to submit a Pull Request.



  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


pkgId: 7a2db3559296e4032b130a2223cf0028691459038b8ccd8425438ff4c7669b2a
name: python-blockchyp
arch: src
version: 2.19.0.post1
epoch: 0
release: 1
summary: The official library for accessing the BlockChyp Terminal and Gateway APIs
url: https://github.com/blockchyp/blockchyp-python
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockchyp-2.19.0.post1-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://github.com/blockchyp/blockchyp-python/actions/workflows/main.yml/badge.svg)](https://github.com/blockchyp/blockchyp-python/actions/workflows/main.yml)
  [![PyPI](https://img.shields.io/pypi/v/blockchyp.svg)](https://pypi.org/project/blockchyp/)
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/blockchyp/blockchyp-python/blob/master/LICENSE)

  The official library for accessing the [BlockChyp] Terminal and Gateway APIs
  from Python.



  BlockChyp can be simply installed by running:

  ```sh
  pip install blockchyp
  ```




  Complete documentation can be found on our [Developer Documentation Portal].

  [Developer Documentation Portal]: https://docs.blockchyp.com/



  In order to test your integration with real terminals, you'll need a BlockChyp
  Developer Kit. Our kits include a fully functioning payment terminal with
  test pin encryption keys. Every kit includes a comprehensive set of test
  cards with test cards for every major card brand and entry method, including
  Contactless and Contact EMV and mag stripe cards. Each kit also includes
  test gift cards for our blockchain gift card system.

  Access to BlockChyp's developer program is currently invite only, but you
  can request an invitation by contacting our engineering team at **nerds@blockchyp.com**.

  You can also view a number of long form demos and learn more about us on our [YouTube Channel](https://www.youtube.com/channel/UCE-iIVlJic_XArs_U65ZcJg).



  You don't want to read words. You want examples. Here's a quick rundown of the
  stuff you can do with the BlockChyp Python SDK and a few basic examples.




  These are the core payment APIs used to execute and work with payment transactions in BlockChyp.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Our most popular transaction executes a standard authorization and capture.
  This is the most basic of
  basic payment transactions, typically used in conventional retail.

  Charge transactions can use a payment terminal to capture a payment or
  use a previously enrolled payment token.

  **Terminal Transactions**

  For terminal transactions, make sure you pass in the terminal name using the `terminalName` property.

  **Token Transactions**

  If you have a payment token, omit the `terminalName` property and pass in the token with the `token`
  property instead.

  **Card Numbers and Mag Stripes**

  You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will
  put you in PCI scope and the most common vector for POS breaches is keylogging.
  If you use terminals for manual card entry, you'll bypass any keyloggers that
  might be maliciously running on the point-of-sale system.

  **Common Variations**

  * **Gift Card Redemption**:  There's no special API for gift card redemption in BlockChyp. Simply execute a plain charge transaction and if the customer swipes a gift card, our terminals will identify the gift card and run a gift card redemption. Also note that if for some reason the gift card's original purchase transaction is associated with fraud or a chargeback, the transaction will be rejected.
  * **EBT**: Set the `card_type` field to `blockchyp.CardType.EBT` to process an EBT SNAP transaction. Note that test EBT transactions always assume a balance of $100.00, so test EBT transactions over that amount may be declined.
  * **Cash Back**: To enable cash back for debit transactions, set the `cash_back` field. If the card presented isn't a debit card, the `cash_back` field will be ignored.
  * **Manual Card Entry**: Set the `manual_entry` field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine the `manual_entry` field with the `card_type` field set to `blockchyp.CardType.EBT` for manual EBT card entry.
  * **Inline Tokenization**: You can enroll the payment method in the token vault inline with a charge transaction by setting the `enroll` field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data.
  * **Prompting for Tips**: Set the `prompt_for_tip` field if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other service related scenarios.
  * **Cash Discounting and Surcharging**:  The `surcharge` and `cash_discount` fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
  * **Cryptocurrency** The `cryptocurrency` field can be used to switch the standard present card screen to a cryptocurrency screen.  The field value can be `ANY` to enable any supported cryptocurrency or a single currency code such as `BTC` for Bitcoin.



  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "amount": "55.00",
  }


  response = client.charge(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  A preauthorization puts a hold on funds and must be captured later.  This is used
  in scenarios where the final transaction amount might change.  A common example is
  fine dining, where a tip adjustment is required before final settlement.

  Another use case for preauthorization is e-commerce.  Typically, an online order
  is preauthorized at the time of the order and then captured when the order ships.

  Preauthorizations can use a payment terminal to capture a payment or
  use a previously enrolled payment token.

  **Terminal Transactions**

  For terminal transactions, make sure you pass in the terminal name using the `terminalName` property.

  **Token Transactions**

  If you have a payment token, omit the `terminalName` property and pass in the token with the `token`
  property instead.

  **Card Numbers and Mag Stripes**

  You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will
  put you in PCI scope and the most common vector for POS breaches is key logging.
  If you use terminals for manual card entry, you'll bypass any key loggers that
  might be maliciously running on the point-of-sale system.

  **Cryptocurrency**

  Note that preauths are not supported for cryptocurrency.

  **Common Variations**

  * **Manual Card Entry**: Set the `manual_entry` field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine the `manual_entry` field with `card_type` set to `blockchyp.CardType.EBT` for manual EBT card entry.
  * **Inline Tokenization**: You can enroll the payment method in the token vault in line with a charge transaction by setting the `enroll` field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data.
  * **Prompting for Tips**: Set the `prompt_for_tip` field if you'd like to prompt the customer for a tip before authorization. You can prompt for tips as part of a preauthorization, although it's not a very common approach.
  * **Cash Discounting and Surcharging**: The `surcharge` and `cash_discount` fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "amount": "27.00",
  }


  response = client.preauth(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to capture a previously approved preauthorization.

  You'll need to make sure you pass in the Transaction ID returned by the original preauth transaction
  so we know which transaction we're capturing.  If you want to capture the transaction for the
  exact amount of the preauth, the Transaction ID is all you need to pass in.

  You can adjust the total if you need to by passing in a new `amount`.  We
  also recommend you pass in updated amounts for `tax` and `tip` as it can
  sometimes reduce your interchange fees. (Level II Processing, for example.)




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "transactionId": "<ORIGINAL TRANSACTION ID>",
      "amount": "32.00",
  }


  response = client.capture(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  It's not ideal, but sometimes customers want their money back.

  Our refund API allows you to confront this unpleasant reality by executing refunds in a few different scenarios.

  The most fraud resistent method is to execute refunds in the context of a previous transaction.  You should always keep track of the Transaction ID
  returned in a BlockChyp response.  To refund the full amount of the previous transaction, just pass in the original Transaction ID with the refund requests.

  **Partial Refunds**

  For a partial refund, just pass in an amount along with the Transaction ID.
  The only rule is that the amount must be equal to or less than the original
  transaction.  You can execute multiple partial refunds against the same
  original transaction as long as the total refunded amount doesn't exceed the original amount.

  **Tokenized Refunds**

  You can also use a token to execute a refund.  Pass in a token instead
  of the Transaction ID and the desired refund amount.

  **Free Range Refunds**

  When you execute a refund without referencing a previous transaction, we
  call this a *free range refund*.

  We don't recommend this type of refund, but it is permitted.  If you absolutely insist on
  doing it, pass in a Terminal Name and an amount.

  You can execute a manual or keyed refund by passing the `manual_entry` field
  to a free range refund request.

  **Gift Card Refunds**

  Gift card refunds are allowed in the context of a previous transaction, but
  free range gift card refunds are not allowed.  Use the gift card activation
  API if you need to add more funds to a gift card.

  **Store and Forward Support**

  Refunds are not permitted when a terminal falls back to store and forward mode.

  **Auto Voids**

  If a refund referencing a previous transaction is executed for the full amount
  before the original transaction's batch is closed, the refund is automatically
  converted to a void.  This saves the merchant a little bit of money.

  **Cryptocurrency**

  Note that refunds are not supported for cryptocurrency.  You must refund crypto transactions
  manually from your cryptocurrency wallet.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionId": "<PREVIOUS TRANSACTION ID>",

      
      "amount": "5.00",
  }


  response = client.refund(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Mistakes happen.  If a transaction is made by mistake, you can void it
  with this API.  All that's needed is to pass in a Transaction ID and execute
  the void before the original transaction's batch closes.

  Voids work with EBT and gift card transactions with no additional parameters.

  **Cryptocurrency**

  Note that voids are not supported for cryptocurrency.  You must refund crypto transactions
  manually from your cryptocurrency wallet.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "transactionId": "<PREVIOUS TRANSACTION ID>",
  }


  response = client.void(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Payment transactions require a stable network to function correctly and
  no network is stable all the time.  Time out reversals are a great line
  of defense against accidentally double charging consumers when payments
  are retried during shaky network conditions.

  We highly recommend developers use this API whenever a charge, preauth, or refund transaction times out.  If you don't receive a definitive response
  from BlockChyp, you can't be certain about whether or not the transaction went through.

  The best practice in this situation is to send a time out reversal request.  Time out reversals check for a transaction and void it if it exists.

  The only caveat is that developers must use the `transactionRef` property (`txRef` for the CLI) when executing charge, preauth, and refund transactions.

  The reason for this requirement is that if a system never receives a definitive
  response for a transaction, the system would never have received the BlockChyp
  generated Transaction ID.  We have to fall back to Transaction Ref to identify
  a transaction.

  **Cryptocurrency**

  Note that refunds are not supported for cryptocurrency.  You must refund crypto transactions
  manually from your cryptocurrency wallet.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionRef": "<LAST TRANSACTION REF>",
  }


  response = client.reverse(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API activates or adds value to BlockChyp gift cards.
  Just pass in the terminal name and the amount to add to the card.
  Once the customer swipes their card, the terminal will use keys
  on the mag stripe to add value to the card.

  You don't need to handle a new gift card activation or a gift card recharge any
  differently.  The terminal firmware will figure out what to do on its
  own while also returning the new balance for the gift card.

  This is the part of the system where BlockChyp's blockchain DNA comes
  closest to the surface.  The BlockChyp gift card system doesn't really
  use gift card numbers.  This means they can't be stolen.

  BlockChyp identifies cards with an elliptic curve public key instead.
  Gift card transactions are actually blocks signed with those keys.
  This means there are no shared secrets sent over the network.
  To keep track of a BlockChyp gift card, hang on to the **public key** returned
  during gift card activation.  That's the gift card's elliptic curve public key.

  We sometimes print numbers on our gift cards, but these are actually
  decimal encoded hashes of a portion of the public key to make our gift
  cards seem *normal* to *normies*.  They can be used
  for balance checks and play a lookup role in online gift card
  authorization, but are of little use beyond that.

  **Voids and Reversals**

  Gift card activations can be voided and reversed just like any other
  BlockChyp transaction.  Use the Transaction ID or Transaction Ref
  to identify the gift activation transaction as you normally would for
  voiding or reversing a conventional payment transaction.

  **Importing Gift Cards**

  BlockChyp does have the ability to import gift card liability from
  conventional gift card platforms.  Unfortunately, BlockChyp does not
  support activating cards on third party systems.  However, you can import
  your outstanding gift cards and customers can swipe them on the
  terminals like BlockChyp's standard gift cards.

  No special coding is required to access this feature.  The gateway and
  terminal firmware handle everything for you.

  **Third Party Gift Card Networks**

  BlockChyp does not currently provide any native support for other gift card
  platforms beyond importing gift card liability.  We do have a white listing system
  that can be used to support your own custom gift card implementations.  We have a security review
  process before we can allow a BIN range to be white listed, so contact
  support@blockchyp.com if you need to white list a BIN range.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "amount": "50.00",
  }


  response = client.gift_activate(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API checks a gift or EBT card balance.

  **Gift Card Balance Checks**

  For gift cards, pass in a terminal name and the customer will be prompted
  to swipe a card on that terminal.  The remaining balance will be displayed
  briefly on the terminal screen and the API response will include the gift card's public key and the remaining balance.

  **EBT Balance Checks**

  All EBT transactions require a PIN, so to check an EBT card balance,
  you need to pass in the `ebt` flag just like you would for a normal EBT
  charge transaction.  The customer will be prompted to swipe their card and
  enter a PIN code.  If everything checks out, the remaining balance on the
  card will be displayed on the terminal for the customer and returned with the API response.

  **Testing Gift Card Balance Checks**

  Test gift card balance checks work no differently than live gift cards.  You
  must activate a test gift card first to test balance checks.  Test
  gift cards are real blockchain cards that live on our parallel test blockchain.

  **Testing EBT Gift Card Balance Checks**

  All test EBT transactions assume a starting balance of $100.00.  As a result,
  test EBT balance checks always return a balance of $100.00.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "cardType": blockchyp.CardType.EBT,
  }


  response = client.balance(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API will close the merchant's batch if it's currently open.

  By default, merchant batches will close automatically at 3 AM in their
  local time zone.  The automatic batch closure time can be changed
  in the Merchant Profile or disabled completely.

  If automatic batch closure is disabled, you'll need to use this API to
  close the batch manually.



  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
  }


  response = client.close_batch(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to send an invoice to a customer and capture payment
  via a BlockChyp hosted payment page.

  If you set the `autoSend` flag, BlockChyp will send a basic invoice email
  to the customer for you that includes the payment link.  If you'd rather have
  more control over the look of the email message, you can omit the `autoSend`
  flag and send the customer email yourself.

  There are a lot of optional parameters for this API, but at a minimum
  you'll need to pass in a total, customer name, and email address. (Unless
  you use the `cashier` flag.)

  **Customer Info**

  Unless you're using the `cashier` flag, you must specify a customer; either by
  creating a new customer record inline or passing in an existing Customer ID or Customer Ref.

  **Line Item Level Data**

  It's not strictly required, but we strongly recommend sending line item level
  detail with every request.  It will make the invoice look more complete
  and the data format for line item level data is the exact same format used
  for terminal line item display, so the same code can be used to support both areas.

  **Descriptions**

  You can also provide a free form description or message to display near
  the bottom of the invoice.  Usually this is some kind of thank you note
  or instruction.

  **Terms and Conditions**

  You can include long form contract language with a request and capture
  terms and conditions accepted at the same time payment is captured.

  The interface is identical to that used for the terminal based Terms and
  Conditions API in that you can pass in content directly via `tcContent` or via
  a preconfigured template via `tcAlias`.  The Terms and Conditions log will also be updated when
  agreement acceptance is incorporated into a send link request.

  **Auto Send**

  BlockChyp does not send the email notification automatically.   This safeguard prevents real
  emails from going out when you may not expect them If you want BlockChyp to send the email
  for you, just add the `autoSend` flag with all requests.

  **Cryptocurrency**

  If the merchant is configured to support cryptocurrency transactions, the payment page will
  display additional UI widgets that allowing customers to switch to a crypto payment method.

  **Tokenization**

  Add the `enroll` flag to a send link request to enroll the payment method
  in the token vault.

  Add the `enrollOnly` flag to enroll the payment method in the token vault without any immediate payment taking place. The payment link will ask the user for their payment information and inform them that they will not be charged immediately, but that their payment may be used for future transactions.

  **Cashier Facing Card Entry**

  BlockChyp can be used to generate internal/cashier facing card entry pages as well.  This is
  designed for situations where you might need to take a phone order and don't
  have an available terminal.

  If you pass in the `cashier` flag, no email will be sent and you'll be able to
  load the link in a browser or iframe for payment entry.  When the `cashier` flag
  is used, the `autoSend` flag will be ignored.

  Note that cryptocurrency is not supported for cashier facing payment entry.

  **Payment Notifications**

  When a customer successfully submits payment, the merchant will receive an email
  notifying them that the payment was received.

  **Real Time Callback Notifications**

  Email notifications are fine, but you may want your system to be informed
  immediately whenever a payment event occurs.  By using the optional `callbackUrl` request
  property, you can specify a URL to which the Authorization Response will be posted
  every time the user submits a payment, whether approved or otherwise.

  The response will be sent as a JSON encoded POST request and will be the exact
  same format as all BlockChyp charge and preauth transaction responses.

  **Status Polling**

  If real time callbacks aren't practical or necessary in your environment, you can
  always use the Payment Link Status API described futher on.

  A common use case for the send link API with status polling is curbside pickup.
  You could have your system check the Payment Link Status when a customer arrives to
  ensure it's been paid without necessarily needing to create background threads
  to constantly poll for status updates.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionRef": "<TX REF>",
      "amount": "199.99",
      "description": "Widget",
      "subject": "Widget invoice",
      "transaction": {
          "subtotal": "195.00",
          "tax": "4.99",
          "total": "199.99",
          "items": [
              {
                  "description": "Widget",
                  "price": "195.00",
                  "quantity": 1,
              },
          ],
      },
      "autoSend": True,
      "customer": {
          "customerRef": "Customer reference string",
          "firstName": "FirstName",
          "lastName": "LastName",
          "companyName": "Company Name",
          "emailAddress": "notifications@blockchypteam.m8r.co",
          "smsNumber": "(123) 123-1231",
      },
  }


  response = client.send_payment_link(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API will resend a previously created payment link.  An error is returned if the payment link is expired, has been
  cancelled, or has already been paid.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "linkCode": "<PAYMENT LINK CODE>",
  }


  response = client.resend_payment_link(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API cancels a payment link.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "linkCode": "<PAYMENT LINK CODE>",
  }


  response = client.cancel_payment_link(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to check on the status of a payment link, including transaction data
  and the full history of attempted transactions.

  This API is the preferred source of truth and best practice when you want to check on the
  status of a payment link (as opposed to Transaction Status). The Transaction Status API is not
  ideal because of ambiguity when there are multiple transactions associated with a single
  payment link.

  You must pass the `linkCode` value associated with the payment link. It is included in the response from BlockChyp when the payment link is originally created.






  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "linkCode": "<PAYMENT LINK CODE>",
  }


  response = client.payment_link_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API returns the current status for any transaction.  You can lookup a transaction
  by its BlockChyp assigned Transaction ID or your own Transaction Ref.

  You should always use globally unique Transaction Ref values, but in the event
  that you duplicate Transaction Refs, the most recent transaction matching your
  Transaction Ref is returned.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionId": "<TRANSACTION ID>",
  }


  response = client.transaction_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API calculates the surcharge, cash discount, and total amounts for cash transactions.

  If you're using BlockChyp's cash discounting features, you can use this endpoint
  to ensure the numbers and receipts for true cash transactions are consistent
  with transactions processed by BlockChyp.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "amount": "100.00",
      "cashDiscount": True,
      "surcharge": True,
  }


  response = client.cash_discount(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint allows developers to query the gateway for the merchant's batch history.
  The data will be returned in descending order of open date with the most recent
  batch returned first.  The results will include basic information about the batch.
  Consider using the Batch Details API for more detail about a specific batch.

  **Limiting Results**

  This API will return a maximum of 250 results.  Use the `maxResults` property to
  limit maximum results even further and use the `startIndex` property to
  page through results that span multiple queries.

  For example, if you want the ten most recent batches, pass in a value of
  `10` for `maxResults`.  Also note that `startIndex` is zero based. Use a value of `0` to
  get the first batch in the dataset.

  **Filtering by Date Range**

  You can also filter results by date.  Use the `startDate` and `endDate`
  properties to return only those batches opened between those dates.
  You can use either `startDate` and `endDate` and you can use date filters
  in conjunction with `maxResults` and `startIndex`




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "maxResults": 250,
      "startIndex": 0,
  }


  response = client.batch_history(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows developers to pull down details for a specific batch,
  including captured volume, gift card activity, expected deposit, and
  captured volume broken down by terminal.

  The only required request parameter is `batchId`.  Batch IDs are returned
  with every transaction response and can be discovered using the Batch
  History API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "batchId": "<BATCH ID>",
  }


  response = client.batch_details(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint provides several different methods to sift through
  transaction history.

  By default with no filtering properties, this endpoint will return the 250
  most recent transactions.

  **Limiting Results**

  This API will return a maximum of 50 results in a single query.  Use the `maxResults` property
  to limit maximum results even further and use the `startIndex` property to
  page through results that span multiple queries.

  For example, if you want the ten most recent batches, pass in a value of
  `10` for `maxResults`.  Also note that `startIndex` is zero based. Use a value of `0` to
  get the first transaction in the dataset.

  **Filtering By Date Range**

  You can also filter results by date.  Use the `startDate` and `endDate`
  properties to return only transactions run between those dates.
  You can use either `startDate` or `endDate` and you can use date filters
  in conjunction with `maxResults` and `startIndex`

  **Filtering By Batch**

  To restrict results to a single batch, pass in the `batchId` parameter.

  **Filtering By Terminal**

  To restrict results to those executed on a single terminal, pass in the terminal name.

  **Combining Filters**

  None of the above filters are mutually exclusive.  You can combine any of the
  above properties in a single request to restrict transaction results to a
  narrower set of results.

  **Searching Transaction History**

  You can search transaction history by passing in search criteria with the
  `query` option.  The search system will match the amount (requested and authorized),
  last four of the card number, cardholder name, and the auth code.

  Note that when search queries are used, terminalName or
  batch id filters are not supported.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "maxResults": 10,
      "batchId": "<BATCH ID>",
  }


  response = client.transaction_history(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Returns a list of transaction refs of transactions queued on a terminal.
  Details about the transactions can be retrieved using the Transaction Status
  API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.list_queued_transactions(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Deletes one or all queued transactions from a terminal. If `*` is passed as
  a transaction ref, then the entire terminal queue will be cleared. An error is
  returned if the passed transaction ref is not queued on the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
      "transactionRef": "*",
  }


  response = client.delete_queued_transaction(request)

  print("Response: %r" % response)


  ```




  These APIs support terminal management functions and additional terminal
  features such as line item display, messages, and interactive prompts.
  These features can be used to extend a point of sale system's functionality.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This simple test transaction helps ensure good communication with a payment terminal
  and is usually the first test you'll run in development.

  It tests communication with the terminal and returns a positive response if everything
  is okay.  It works the same way in local or cloud relay mode.

  If you get a positive response, you've successfully verified all of the following:

  * The terminal is online.
  * There is a valid route to the terminal.
  * The API Credentials are valid.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.ping(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint returns a terminal's routing and location information.

  The result will indicate whether or not the terminal is in cloud relay mode and will
  return the local IP address if the terminal is in local mode.

  The terminal will also return the public key for the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.locate(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API interrupts whatever a terminal may be doing and returns it to the
  idle state.





  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
  }


  response = client.clear(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API returns the current status of a payment terminal.  This is typically used
  as a way to determine if the terminal is busy before sending a new transaction.

  If the terminal is busy, `idle` will be false and the `status` field will return
  a short string that indicates the transaction type currently in progress.  The system
  will also return the timestamp of the last status change in the `since` field.

  The `cardInSlot` field in the response will indicates whether or not a card is currently in the card reader slot.

  If the system is running a payment transaction and you wisely passed in a
  Transaction Ref, this API will also return the Transaction Ref of the in progress
  transaction.

  The table below lists all possible status responses.

  | Status Code          | Description                                                                             |
  |----------------------|-----------------------------------------------------------------------------------------|
  | idle                 | The terminal is idle and ready for transactions.  The default branding is being displayed. |
  | activate             | The terminal is in the process of activating and pairing with the merchant account.     |
  | balance              | A balance check (EBT or Gift Card) is pending on the terminal.                          |
  | boolean-prompt       | A boolean prompt (yes/no) operation is pending on the terminal.                         |
  | signature            | A signature capture is pending.                                                         |
  | crypto               | A cryptocurrency transaction is pending.                                                |
  | enroll               | A token vault enrollment operation is pending.                                          |
  | gift-activate        | A gift card activation operation is in progress.                                        |
  | message              | The terminal is displaying a custom message.                                            |
  | charge               | The terminal is executing a charge transaction.                                         |
  | preauth              | The terminal is executing a preauth transaction.                                        |
  | refund               | The terminal is executing a refund transaction.                                         |
  | survey               | The terminal is displaying post transaction survey questions.                           |
  | terms-and-conditions | The terminal is pending terms and conditions acceptance and signature.                  |
  | text-prompt          | The terminal is awaiting response to a text input prompt.                               |
  | txdisplay            | The terminal is displaying transaction and/or line item level details.                  |




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.terminal_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint captures a written signature from the terminal and returns the
  image.

  Unlike the Terms & Conditions API, this endpoint performs basic signature
  capture with no agreement display or signature archival.

  Under the hood, signatures are captured in a proprietary vector format and
  must be converted to a common raster format in order to be useful to most
  applications.  At a minimum, you must specify an image format using the
  `sigFormat` parameter.  Currently, JPG and PNG are supported.

  By default, images are returned in the JSON response as hex encoded binary.
  You can redirect the binary image output to a file using the `sigFile`
  parameter.

  You can also scale the output image to your preferred width by
  passing in a `sigWidth` parameter.  The image will be scaled to that
  width, preserving the aspect ratio of the original image.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",

      
      "sigFormat": blockchyp.SignatureFormat.PNG,

      
      "sigWidth": 200,
  }


  response = client.capture_signature(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API sends totals and line item level data to the terminal.

  At a minimum, you should send total information as part of a display request,
  including `total`, `tax`, and `subtotal`.

  You can also send line item level data and each line item can have a `description`,
  `qty`, `price`, and `extended` price.

  If you fail to send an extended price, BlockChyp will multiply the `qty` by the
  `price`.  However, we strongly recommend you precalculate all the fields yourself
  to ensure consistency.  For example, your treatment of floating-point multiplication
  and rounding may differ slightly from BlockChyp's.

  **Discounts**

  You have the option to show discounts on the display as individual line items
  with negative values or you can associate discounts with a specific line item.
  You can apply any number of discounts to an individual line item with a description
  and amount.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "transaction": {
          "subtotal": "60.00",
          "tax": "5.00",
          "total": "65.00",
          "items": [
              {
                  "description": "Leki Trekking Poles",
                  "price": "35.00",
                  "quantity": 2,
                  "extended": "70.00",
                  "discounts": [
                      {
                          "description": "memberDiscount",
                          "amount": "10.00",
                      },
                  ],
              },
          ],
      },
  }


  response = client.new_transaction_display(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Similar to *New Transaction Display*, this variant allows developers to update
  line item level data currently being displayed on the terminal.

  This feature is designed for situations where you want to update the terminal display as
  items are scanned.  You'll only have to send information to the
  terminal that's changed, which usually means the new line item and updated totals.

  If the terminal is not in line item display mode and you invoke this endpoint,
  the first invocation will behave like a *New Transaction Display* call.

  At a minimum, you should send total information as part of a display request,
  including `total`, `tax`, and `subtotal`.

  You can also send line item level data and each line item can have a `description`,
  `qty`, `price`, and `extended` price.

  If you fail to send an extended price, BlockChyp will multiply the `qty` by the
  `price`.  However, we strongly recommend you precalculate all the fields yourself
  to ensure consistency.  For example, your treatment of floating-point multiplication and rounding
  may differ slightly from BlockChyp's.

  **Discounts**

  You have the option to show discounts on the display as individual line items
  with negative values or you can associate discounts with a specific line item.
  You can apply any number of discounts to an individual line item with a description
  and amount.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "transaction": {
          "subtotal": "60.00",
          "tax": "5.00",
          "total": "65.00",
          "items": [
              {
                  "description": "Leki Trekking Poles",
                  "price": "35.00",
                  "quantity": 2,
                  "extended": "70.00",
                  "discounts": [
                      {
                          "description": "memberDiscount",
                          "amount": "10.00",
                      },
                  ],
              },
          ],
      },
  }


  response = client.update_transaction_display(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API displays a message on the payment terminal.

  Just specify the target terminal and the message using the `message` parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "message": "Thank you for your business.",
  }


  response = client.message(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API prompts the customer to answer a yes or no question.

  You can specify the question or prompt with the `prompt` parameter and
  the response is returned in the `response` field.

  This can be used for a number of use cases including starting a loyalty enrollment
  workflow or customer facing suggestive selling prompts.

  **Custom Captions**

  You can optionally override the "YES" and "NO" button captions by
  using the `yesCaption` and `noCaption` request parameters.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "prompt": "Would you like to become a member?",
      "yesCaption": "Yes",
      "noCaption": "No",
  }


  response = client.boolean_prompt(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API prompts the customer to enter numeric or alphanumeric data.

  Due to PCI rules, free-form prompts are not permitted when the response
  could be any valid string.  The reason for this is that a malicious
  developer (not you, of course) could use text prompts to ask the customer to
  input a card number or PIN code.

  This means that instead of providing a prompt, you provide a `promptType` instead.

  The prompt types currently supported are listed below:

  * **phone**: Captures a phone number.
  * **email**: Captures an email address.
  * **first-name**: Captures a first name.
  * **last-name**: Captures a last name.
  * **customer-number**: Captures a customer number.
  * **rewards-number**: Captures a rewards number.

  You can specify the prompt with the `promptType` parameter and
  the response is returned in the `response` field.





  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",

      
      
      "promptType": blockchyp.PromptType.EMAIL,
  }


  response = client.text_prompt(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant & Partner
  * **Required Role:** Terminal Management

  This API returns details about terminals associated with a merchant account.

  Status and resource information is returned for all terminals along with a preview of the
  current branding image displayed on the terminal




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.terminals(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant & Partner
  * **Required Role:** Terminal Management

  This API deactivates a payment terminal.

  If the terminal exists and is currently online, it will be removed from the merchant's
  terminal inventory.  The terminal will be remotely cleared and factory reset.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalId": "<TERMINAL ID>",
  }


  response = client.deactivate_terminal(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant & Partner
  * **Required Role:** Terminal Management

  This API activates a payment terminal.

  If successful, the payment terminal will restart, generate new encryption keys, and download any active
  branding assets for the merchant account it's been added to.

  Activation requests require an activation code and a unique terminal name.  All terminal names must be unique across
  a merchant account.

  Optional Parameters

  * **merchantId:** For partner scoped API credentials, a merchant ID is required.  For merchant scoped API credentials, the merchant ID is implicit and cannot be overridden.
  * **cloudRelay:** Activates the terminal in cloud relay mode.



  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
      "activationCode": "<ACTIVATION CODE>",
  }


  response = client.activate_terminal(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API reboots the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.reboot(request)

  print("Response: %r" % response)


  ```




  Developers can use BlockChyp to display and capture acceptance of contracts or agreements related to transactions.
  These agreements can be any long-form contract ranging from rental agreements to HIPPA disclosures.

  There are two basic approaches to terms and conditions capture.  Merchants can store contract templates in
  BlockChyp or they can send the full agreement text as part of every API call.  The right approach will largely
  depend on whether or not the system being integrated with BlockChyp already has a mechanism for organizing
  and managing agreements.  For systems that already have this feature built in, it's probably not necessary
  to use Terms and Conditions.

  When agreements are displayed on a terminal, the consumer can scroll through and read the entire agreement,
  and provide a signature.  Results are returned as part of the API response, but BlockChyp also stores a
  record of the agreement including the signature image, timestamp, and the full text of the agreement that was
  agreed to.

  The Terms and Conditions Log APIs can be used to search and retrieve acceptance records.  Those records
  can also be linked to a transaction if a transaction id is provided with the original API request.







  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API allows you to prompt a customer to accept a legal agreement on the terminal
  and (usually) capture their signature.

  Content for the agreement can be specified in two ways.  You can reference a
  previously configured T&C template or pass in the full agreement text with every request.

  **Using Templates**

  If your application doesn't keep track of agreements you can leverage BlockChyp's
  template system.  You can create any number of T&C Templates in the merchant dashboard
  and pass in the `tcAlias` flag to specify which one should display.

  **Raw Content**

  If your system keeps track of the agreement language or executes complicated merging
  and rendering logic, you can bypass our template system and pass in the full text with
  every transaction.  Use `tcName` to pass in the agreement name and `tcContent` to
  pass in the contract text.  Note that only plain text is supported.

  **Bypassing Signatures**

  Signature images are captured by default.  If for some reason this doesn't fit your
  use case and you'd like to capture acceptance without actually capturing a signature image, set
  the `disableSignature` flag in the request.

  **Terms & Conditions Log**

  Every time a user accepts an agreement on the terminal, the signature image (if captured),
  will be uploaded to the gateway.  The image will also be added to the log along with the full text of the
  agreement.  This preserves the historical record in the event that standard agreements
  or templates change over time.

  **Associating Agreements with Transactions**

  To associate a Terms & Conditions log entry with a transaction, just pass in the
  Transaction ID or Transaction Ref for the associated transaction.





  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",

      
      
      "tcAlias": "hippa",

      
      "tcName": "HIPPA Disclosure",

      
      "tcContent": "Full contract text",

      
      "sigFormat": blockchyp.SignatureFormat.PNG,

      
      "sigWidth": 200,

      
      "sigRequired": True,
  }


  response = client.terms_and_conditions(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API returns all terms and conditions templates associated with a merchant account.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.tc_templates(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API returns as single terms and conditions template.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "templateId": "<TEMPLATE ID>",
  }


  response = client.tc_template(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API updates or creates a terms and conditions template.

  Terms and conditions templates are fairly simple and essentially consist of a name, content, and alias.

  The name is the caption that will be displayed at the top of the screen.  The alias is a code or short
  description that will be used in subsequence API calls to refer to the template.

  Content is the full text of the contract or agreement.  Currently, no special formatting or
  merge behavior is supported.  Only plain text is supported.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "alias": "HIPPA",
      "name": "HIPPA Disclosure",
      "content": "Lorem ipsum dolor sit amet.",
  }


  response = client.tc_update_template(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API deletes a terms and conditions template.

  If a template is deleted, its alias can be reused and any previous Terms & Conditions log entry
  derived from the template being deleted is fully preserved since log entries always include
  a complete independent copy of the agreement text.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "templateId": "<TEMPLATE ID>",
  }


  response = client.tc_delete_template(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API allows developers to search and sort through terms and conditions log entries.

  The default API call with no parameters will return the last 250 log entries in descending order.

  Optional parameters can be used to filter and query the data set.

  * **transactionId:** If provided, returns only those log entries associated with a specific transactions.  Paging and date filters are ignored if this parameter is used.
  * **maxResults:** The max number of results to return in a single page.  Defaults to 250 and 250 is the maximum value.
  * **startIndex** The zero based start index of results within the full result set to return.  Used to advance pages.  For example, if the page size is 10 and you wish to return the second page of results, send a startIndex of 10.
  * **startDate**: An optional start date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)
  * **endDate**: An optional end date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "logEntryId": "<LOG ENTRY ID>",
  }


  response = client.tc_log(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API returns details for a single terms and conditions log entry.  The `logEntryId` of the record to be returned is the only required parameter.

  The signature image is returned as Base 64 encoded binary in the image format specified by the `sigFormat` field.
  The default format is PNG.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "logEntryId": "<ENTRY ID>",
  }


  response = client.tc_entry(request)

  print("Response: %r" % response)


  ```




  BlockChyp supports saved payments and recurring payments through the use of tokens.  Tokens can be created
  via the Enroll API or the web tokenizer.  Once created, these tokens can be used for subsequent payments
  or associated with customer records as saved payment methods.

  Tokens are limited to a single merchant by default, but can be shared across an organization for multi-location
  merchants by special arrangement with BlockChyp.  Contact your BlockChyp rep to setup token sharing.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to tokenize and enroll a payment method in the token
  vault.  You can also pass in customer information and associate the
  payment method with a customer record.

  A token is returned in the response that can be used in subsequent charge,
  preauth, and refund transactions.

  **Gift Cards and EBT**

  Gift Cards and EBT cards cannot be tokenized.

  **E-Commerce Tokens**

  The tokens returned by the enroll API and the e-commerce web tokenizer
  are the same tokens and can be used interchangeably.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
  }


  response = client.enroll(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API retrieves status and metadata information about a token,
  including any links to customer records.

  This will also return any customer records related to the card
  behind the token.  If the underlying card has been tokenized
  multiple times, all customers related to the card will be returned,
  even if those customer associations are related to other tokens.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
  }


  response = client.token_metadata(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API links a payment token with a customer record.  Usually this would only be needed
  to reverse a previous unlink operation.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
      "customerId": "<CUSTOMER ID>",
  }


  response = client.link_token(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API removes a payment token link from a customer record.

  This will remove links between the customer record and all tokens
  for the same underlying card.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
      "customerId": "<CUSTOMER ID>",
  }


  response = client.unlink_token(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API deletes a payment token from the gateway.  Tokens are automatically deleted if they have not been used
  for a year.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
  }


  response = client.delete_token(request)

  print("Response: %r" % response)


  ```




  These APIs allow developers to create and manage customer records in BlockChyp.  Developers who wish to use
  BlockChyp for tokenized recurring payments can use tokens directly if they have their own customer management
  system.  However, BlockChyp provides additional tools for managing customers and keeping track of a customer's saved
  payment tokens.

  In addition, if customer features are used, BlockChyp can detect a payment method associated with an existing
  customer, and return customer data with payment transactions.  This can be used as a passive method to detect
  repeat customers.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API adds or updates a customer record.

  If you pass in customer information including `firstName`, `lastName`, `email`,
  or `sms` without any Customer ID or Customer Ref, a new record will
  be created.

  If you pass in `customerRef` and `customerId`, the customer record will be updated
  if it exists.

  **Customer Ref**

  The `customerRef` field is optional, but highly recommended as this allows you
  to use your own customer identifiers instead of storing BlockChyp's Customer IDs
  in your systems.

  **Creating Customer Records With Payment Transactions**

  If you have customer information available at the time a payment transaction is
  executed, you can pass all the same customer information directly into a payment transaction.  BlockChyp
  will create a customer record at the same time payment is captured.  The advantage of this approach is
  that the customer's payment card is automatically associated with the customer record in a single step.
  If the customer uses the payment card in the future, the customer data will automatically
  be returned.  You won't need to ask the customer to provide any additional information.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "customer": {
          "id": "<CUSTOMER ID>",
          "customerRef": "Customer reference string",
          "firstName": "FirstName",
          "lastName": "LastName",
          "companyName": "Company Name",
          "emailAddress": "notifications@blockchypteam.m8r.co",
          "smsNumber": "(123) 123-1231",
      },
  }


  response = client.update_customer(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  With this API, you can retrieve detailed information about a customer record, including saved payment
  methods if available.

  Customers can be looked up by `customerId` or `customerRef`.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "customerId": "<CUSTOMER ID>",
  }


  response = client.customer(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API searches the customer database and returns matching results.

  Use `query` to pass in a search string and the system will return all results whose
  first or last names contain the query string.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "query": "(123) 123-1234",
  }


  response = client.customer_search(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API deletes a customer record.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "customerId": "<CUSTOMER ID>",
  }


  response = client.delete_customer(request)

  print("Response: %r" % response)


  ```




  These APIs are used to work with post-transaction surveys and survey data.

  Merchants can optionally configure scaled (1-5) or yes/no questions that can be presented to consumers
  after every approved Charge and Preauth transaction.  Surveys do not require any custom programming and
  merchants can simply configure them without the point-of-sale system needing any additional customization.

  However, these APIs allow point-of-sale or third-party system developers to integrate survey question configuration
  or result visualization into their own systems.







  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API returns all survey questions in the order in which they would be presented on the terminal.

  All questions are returned, whether enabled or disabled.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.survey_questions(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API returns a single survey question with response data.  `questionId` is required.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "questionId": "<QUESTION ID>",
  }


  response = client.survey_question(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API updates or creates survey questions.  `questionText` and `questionType` are required
  fields.  The following values are valid for `questionType`.

  * **yes_no:** Use for simple yes or no questions.
  * **scaled:** Displays the question with buttons that allow the customer to respond with values from 1 through 5.

  Questions are disabled by default.  Pass in `enabled` to enable a question.

  The `ordinal` field is used to control the sequence of questions when multiple questions are enabled.  We recommend keeping
  the number of questions minimal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "id": "<QUESTION ID>",
      "ordinal": 1,
      "questionText": "Would you shop here again?",
      "questionType": "yes_no",
      "enabled": True,
  }


  response = client.update_survey_question(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API deletes a survey question. `questionId` is a required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "questionId": "<QUESTION ID>",
  }


  response = client.delete_survey_question(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API returns survey results for a single question.

  The results returned include the response rate, which is the percentage of transactions after which
  the consumer provided an answer.

  The `responses` array breaks down the results by answer, providing the total number of responses,
  the answer's percentage of the total, and the average transaction amount associated with a specific
  answer.

  By default, all results based on all responses are returned.  However, developers may optionally provide
  `startDate` and `endDate` parameters to return only responses provided between certain dates.

  `startDate` and `endDate` can be provided in MM/DD/YYYY or YYYY-MM-DD format.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "questionId": "<QUESTION ID>",
  }


  response = client.survey_results(request)

  print("Response: %r" % response)


  ```




  BlockChyp has a sophisticated terminal media and branding control platform.  Terminals can be configured to
  display logos, images, videos, and slide shows when a terminal is idle.  Branding assets can be configured
  at the partner, organization, and merchant level with fine-grained hour-by-hour schedules, if desired.

  Conceptually, all branding and media start with the media library.  Merchants, Partners, and Organizations can
  upload images or video and build branding assets from uploaded media.

  Slide shows can combine images from the media library into a timed loop of repeating images.

  Branding Assets can then be used to combine media or slide shows with priority and timing rules to create what
  we call the Terminal Branding Stack.

  We call a group of branding assets the *Terminal Branding Stack* because there are implicit rules about which
  branding assets take priority. For example, a merchant with no branding assets configured will inherit the
  branding rules from any organization to which the merchant may belong.  If the merchant doesn't belong to an organization
  or the organization has no branding rules configured, then the system will defer to branding defaults established
  by the point-of-sale or software partner that owns the merchant.

  This feature enables partners and organizations (multi-store operators and large national chains) to configure branding
  for potentially thousands of terminals from a single interface.

  Terminal Branding can also be configured at the individual terminal level and a merchant's terminal fleet
  can be broken into groups and branding configured at the group level.  Branding configured at the terminal
  level will always override branding from any higher level group.

  The order of priority for the Terminal Branding Stack is given below.

  * Terminal
  * Terminal Group
  * Merchant
  * Organization (Region, Chain, etc)
  * Partner
  * BlockChyp Default Logo







  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns the entire media library associated with the API Credentials (Merchant, Partner, or Organization).  The media library results will include the ID used
  to reference a media asset in slide shows and branding assets along with the full file url and thumbnail.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.media(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API supports media library uploads.  The operation of this API works slightly differently depending
  on the SDK platform.  In all cases, the intent is to allow the file's binary to be passed into the SDK using
  the lowest level I/O primitive possible in order to support situations where developers aren't working
  with literal files.  It might be (and usually is) more convenient to work with buffers, raw bytes, or streams.

  For example, the Go implementation accepts an `io.Reader` and the Java implementation accepts a
  `java.io.InputStream`.  The CLI does accept a literal File URL via the `-file` command line parameter.

  The following file formats are accepted as valid uploads:

  * .png
  * .jpg
  * .jpeg
  * .gif
  * .mov
  * .mpg
  * .mp4
  * .mpeg

  The UploadMetadata object allows developers to pass additional metadata about the upload including
  `fileName`, `fileSize`, and `uploadId`.

  None of these values are required, but providing them can unlock some additional functionality relating to
  media uploads.  `fileName` will be used to record the original file name in the media library.  `fileSize`
  and `uploadId` are used to support upload status tracking, which is especially useful for large video file
  uploads.

  The `fileSize` should be the file's full size in bytes.

  The `uploadId` value can be any random string.  This is the value you'll use to check the status of an upload
  via the Upload Status API.  This API will return information needed to drive progress feedback on uploads and
  return video transcoding information.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "fileName": "aviato.png",
      "fileSize": 18843,
      "uploadId": "<RANDOM ID>",
  }


  f = open("aviato.png", "rb")
  content = f.read()
  response = client.upload_media(request, content)
  f.close()

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns status and progress information about in progress or recently completed uploads.

  Before calling this API, developers must first start a file upload with `fileSize` and `uploadId` parameters.

  The data structure returned will include the file size, number of bytes uploaded, a narrative status
  and flags indicating whether or not the upload is complete or post upload processing is in progress.
  If the upload is completed, the ID assigned to the media asset and a link to the thumbnail image will
  also be returned.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "uploadId": "<UPLOAD ID>",
  }


  response = client.upload_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns a detailed media asset.  The data returned includes the exact same media information returned
  by the full media library endpoint, including fully qualified URLs pointing to the original media file
  and the thumbnail.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "mediaId": "<MEDIA ASSET ID>",
  }


  response = client.media_asset(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API deletes a media asset.  Note that a media asset cannot be deleted if it is in use in a slide
  show or in the terminal branding stack.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "mediaId": "<MEDIA ASSET ID>",
  }


  response = client.delete_media_asset(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns all slide shows.

  Note that slide level data is not returned with this API.   Use the Get Slide Show API to get slide level detail.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.slide_shows(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns a single slide show.  Slide level detail is returned with the fully qualified thumbnail URL
  for each slide.

  `slideShowId` is the only required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "slideShowId": "<SLIDE SHOW ID>",
  }


  response = client.slide_show(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API updates or creates a slide show.  `name`, `delay` and `slides` are required.

  The slides property is an array of slides.  The Slide data structure has ordinal and thumbnail URL fields,
  but these are not required when updating or creating a slide show.  Only the `mediaId` field is required
  when updating or creating a slide show.

  When using the CLI, slides can be specified by sending a comma-separated list of media ids via the `-mediaId`
  parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "name": "Test Slide Show",
      "delay": 5,
      "slides": [
          {
              "mediaId": "<MEDIA ID>",
          },
      ],
  }


  response = client.update_slide_show(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API deletes a slide show  `slideShowId` is the only required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "slideShowId": "<SLIDE SHOW ID>",
  }


  response = client.delete_slide_show(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns the full branding stack for a given API scope in the order of priority.

  Consumers of this API should pay special attention to the `editable` field.  This field indicates whether or
  not a branding asset is read-only from the perspective of a particular API Credential scope.

  The `thumbnail` and `previewImage` attributes can be used to support building user interfaces for
  managing the branding stack. `previewImage` differs from `thumbnail` in that the preview image is
  intended to show how an asset would actually look when displayed on the terminal.

  `activeAsset` returns the asset that is currently visible on the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.terminal_branding(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API updates or creates a single Branding Asset.

  Branding Assets represent a single element of the terminal branding stack.  A Branding Asset can be a video or image,
  in which case a `mediaId` referencing an asset from the media library must be provided.  A Branding Asset can also
  be a slide show, in which case `slideShowId` must be provided.  Branding Assets must have a valid `mediaId` or a valid
  `slideShowId`.  The optional `notes` field can be used to provide short notes and descriptions for a Branding asset.

  **Visibility Flags**

  In order for a Branding Asset to be visible on a terminal, the `enabled` flag must be set to true and the `preview`
  must be turned off.  `preview` is intended to show how a proposed Branding Asset will behave
  without pushing it to live terminals.  The Publish button in the BlockChyp merchant portal effectively turns
  the `preview` setting off.

  **Order and Sequencing**

  The `ordinal` field is used to specify priority for a Branding Asset.  Assets with a higher value for `ordinal`
  will be prioritized first.

  **Padding Images**

  For plain images, it's sometimes helpful to add margins to images.  This is especially helpful with logos
  or any image file rendered without any white space or margins between the image content and edge of the image file.
  Set the `padded` flag to true if you'd like BlockChyp to auto apply margins when displaying an image on
  the terminal.

  **Scheduling**

  By default, a Branding Asset placed on top of the Branding Stack, if it's `enabled` and not in `preview`
  mode, will immediately be displayed on the terminal round the clock.

  Branding Assets can be scheduled with effective start and stop dates for seasonal campaigns.  These assets can
  also be scheduled for specific times of day and specific days of the week.

  * **startDate:** Optional date after which the Branding Asset is eligible for display.  Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
  * **endDate:** Optional date before which the Branding Asset is eligible for display.  Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
  * **startTime** Optional time of day after which the branding asset is eligible for display.  Must be provided in 24 hour time: HH:MM.
  * **endTime** Optional time of day before which the branding asset is eligible for display.  Must be provided in 24 hour time format: HH:MM
  * **daysOfWeek** For branding assets that should only be displayed on certain days of the week, this field is an array of day of the week constants. (Constants vary by SDK platform.)

  **Read Only Fields**

  The Branding Asset data structure has a number of read only fields that are returned when Branding Assets are
  retrieved.  But these fields are ignored when you try to send them as part of an update.  These are derived
  or calculated fields and are helpful for displaying branding assets in a management user interface, but
  cannot be changed via an API call.

  These fields are:

  * ownerId
  * merchantId
  * organizationId
  * partnerId
  * userId
  * userName
  * thumbnail
  * lastModified
  * editable
  * assetType
  * ownerType
  * ownerTypeCaption
  * previewImage
  * narrativeEffectiveDates
  * narrativeDisplayPeriod




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "mediaId": "<MEDIA ID>",
      "padded": True,
      "ordinal": 10,
      "startDate": "01/06/2021",
      "startTime": "14:00",
      "endDate": "11/05/2024",
      "endTime": "16:00",
      "notes": "Test Branding Asset",
      "preview": False,
      "enabled": True,
  }


  response = client.update_branding_asset(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API deletes a Branding Asset from the branding stack.

  Note that deleting a Branding Asset does not delete the underlying media from the media library or slide
  show from the slide show library.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "assetId": "<BRANDING ASSET ID>",
  }


  response = client.delete_branding_asset(request)

  print("Response: %r" % response)


  ```




  These APIs allow partners to manage and configure their merchant portfolios.

  Use of these APIs (other than the Merchant Profile API) requires partner scoped API credentials
  with special roles and permissions that may require a special arrangement with BlockChyp.

  For example, Partners usually can't board merchants directly, but must board merchants using
  the standard underwriting process via offer codes and invitations.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  The API returns detailed metadata about the merchant's configuration, including
  basic identity information, terminal settings, store and forward settings,
  and bank account information for merchants that support split settlement.

  Some of these fields can be updated via the Update Merchant API, but many of these
  fields are controlled by underwriting and cannot be altered outside of the
  underwriting and risk processes.

  **Merchant Descriptive Fields**

  The following fields are basic descriptive fields that can be used to describe and identify merchants.

  * **companyName:** The merchant's official corporate entity name.
  * **dbaName:** The business's DBA (doing business as) name.
  * **contactName:** Name of the merchant's primary control contact.
  * **contactNumber:** Primary control contact's phone number.
  * **locationName:** Optional location name for multi-location operators.
  * **storeNumber:** Optional store number for multi-location operators.
  * **partnerRef:** Optional reference number partners can add to a merchant record.  Usually the partner's own identifier for the merchant.
  * **timeZone:** Unix style local time zone for the merchant. Example: America/New_York.
  * **publicKey:** Read only field.  The merchant's blockchain public key.  Generated and assigned when a merchant account is first created.
  * **billingAddress:** Address for billing and written correspondence.
  * **shippingAddress:** Physical shipping address. Usually the actual street address of the business.
  * **status:** Current status of the merchant account.
  * **tcDisabled:** Disables all terms and conditions features in the merchant dashboard.  Used to hide the feature if a partner has not chosen to support it.
  * **gatewayOnly:** Indicates that a merchant has been boarded in gateway only mode.  Not common.

  **Batch and Terminal Settings**

  The following fields are used to control batch closure and high level terminal configuration.

  * **batchCloseTime:** Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time.  Defaults to 3 AM.
  * **autoBatchClose:** Flag the determines whether or not batches will automatically close.  Defaults to true.
  * **disableBatchEmails:** Flag that optionally turns off automatic batch closure notification emails.
  * **cooldownTimeout:** The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal.  After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
  * **surveyTimeout:** The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
  * **pinEnabled:** Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs.  Will be ignored if terminals are not injected with the proper encryption keys.
  * **pinBypassEnabled:** Enable pin bypass for debit transactions.
  * **cashBackEnabled:** Enables cash back for debit transactions.
  * **cashbackPresets:** An array of four default values for cashback amounts when cashback is enabled.
  * **storeAndForwardEnabled:** Enables automatic store and forward during network outages.  Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
  * **storeAndForwardFloorLimit:** Maximum dollar value of a store and forward transaction.
  * **ebtEnabled:** Enables EBT (SNAP) on BlockChyp terminals.
  * **tipEnabled:** Enables tips entry on the terminal.
  * **promptForTip:** If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
  * **tipDefaults:** An array of exactly three percentages that will be used to calculate default tip amounts.
  * **giftCardsDisabled:** Disables BlockChyp gift cards.  Normally only used if the merchant is using an alternate gift card system.
  * **digitalSignaturesEnabled:** Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
  * **digitalSignatureReversal:** Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
  * **manualEntryEnabled:** Enables manual card entry.
  * **manualEntryPromptZip:** Requires zip code based address verification for manual card entry.
  * **manualEntryPromptStreetNumber:** Requires street/address based verification for manual card entry.

  **Card Brand and Transaction Settings**

  * **freeRangeRefundsEnabled:** Enables direct refunds that do not reference a previous transaction.
  * **partialAuthEnabled:** Indicates that partial authorizations (usually for gift card support) are enabled.
  * **splitBankAccountsEnabled:** Used for law firm merchants only.
  * **contactlessEmv:** Enables contactless/tap transactions on a terminal.  Defaults to true.
  * **visa:** Enables Visa transactions.
  * **masterCard:** Enables MasterCard transactions.
  * **amex:** Enables American Express transactions.
  * **discover:** Enables Discover transactions.
  * **jcb:** Enables JCB (Japan Card Bureau) transactions.
  * **unionPay:** Enables China UnionPay transactions.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.merchant_profile(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner & Organization
  * **Required Role:** Merchant Management

  This is a partner or organization level API that can be used to return the merchant portfolio.

  Live merchants are returned by default.  Use the `test` flag to return only test merchants.  The
  results returned include detailed settings including underwriting controlled flags.

  A maximum of 250 merchants are returned by default.  For large merchant portfolios, the `maxResults`
  and `startIndex` field can be used to reduce the page size and page through multiple pages of results.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
  }


  response = client.get_merchants(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Merchant Management

  This API can be used to update or create merchant accounts.

  Merchant scoped API credentials can be used to update merchant account settings.

  Partner scoped API credentials can be used to update merchants, create new test
  merchants or board new gateway merchants.

  **Merchant Descriptive Fields**

  The following fields are basic descriptive fields that can be used to describe and identify merchants.

  * **companyName:** The merchant's official corporate entity name.
  * **dbaName:** The businesses DBA (doing business as) name.
  * **contactName:** Name of the merchant's primary control contact.
  * **contactNumber:** Primary control contact's phone number.
  * **locationName:** Optional location name for multi location operators.
  * **storeNumber:** Optional store number for multi location operators.
  * **partnerRef:** Optional reference number partners can add to a merchant record.  Usually the partner's own identifier for the merchant.
  * **timeZone:** Unix style local time zone for the merchant. Example: America/New_York.
  * **publicKey:** Read only field.  The merchant's blockchain public key.  Generated and assigned when a merchant account is first created.
  * **billingAddress:** Address for billing and written correspondence.
  * **shippingAddress:** Physical shipping address. Usually the actual street address of the business.
  * **status:** Current status of the merchant account.
  * **tcDisabled:** Disables all terms and conditions features in the merchant dashboard.  Used to hide the feature if a partner has not chosen to support it.
  * **gatewayOnly:** Indicates that a merchant has been boarded in gateway only mode.  Not common.

  **Batch and Terminal Settings**

  The following fields are used to control batch closure and high level terminal configuration.

  * **batchCloseTime:** Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time.  Defaults to 3 AM.
  * **autoBatchClose:** Flag the determines whether or not batches will automatically close.  Defaults to true.
  * **disableBatchEmails:** Flag that optionally turns off automatic batch closure notification emails.
  * **cooldownTimeout:** The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal.  After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
  * **surveyTimeout:** The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
  * **pinEnabled:** Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs.  Will be ignored if terminals are not injected with the proper encryption keys.
  * **pinBypassEnabled:** Enable pin bypass for debit transactions.
  * **cashBackEnabled:** Enables cash back for debit transactions.
  * **cashbackPresets:** An array of four default values for cashback amounts when cashback is enabled.
  * **storeAndForwardEnabled:** Enables automatic store and forward during network outages.  Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
  * **storeAndForwardFloorLimit:** Maximum dollar value of a store and forward transaction.
  * **ebtEnabled:** Enables EBT (SNAP) on BlockChyp terminals.
  * **tipEnabled:** Enables tips entry on the terminal.
  * **promptForTip:** If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
  * **tipDefaults:** An array of exactly three percentages that will be used to calculate default tip amounts.
  * **giftCardsDisabled:** Disables BlockChyp gift cards.  Normally only used if the merchant is using an alternate gift card system.
  * **digitalSignaturesEnabled:** Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
  * **digitalSignatureReversal:** Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
  * **manualEntryEnabled:** Enables manual card entry.
  * **manualEntryPromptZip:** Requires zip code based address verification for manual card entry.
  * **manualEntryPromptStreetNumber:** Requires street/address based verification for manual card entry.

  **Card Brand and Transaction Settings**

  * **freeRangeRefundsEnabled:** Enables direct refunds that do not reference a previous transaction.
  * **partialAuthEnabled:** Indicates that partial authorizations (usually for gift card support) are enabled.
  * **splitBankAccountsEnabled:** Used for law firm merchants only.
  * **contactlessEmv:** Enables contactless/tap transactions on a terminal.  Defaults to true.
  * **visa:** Enables Visa transactions.
  * **masterCard:** Enables MasterCard transactions.
  * **amex:** Enables American Express transactions.
  * **discover:** Enables Discover transactions.
  * **jcb:** Enables JCB (Japan Card Bureau) transactions.
  * **unionPay:** Enables China UnionPay transactions.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "merchantId": "<MERCHANT ID>",
      "test": True,
      "dbaName": "Test Merchant",
      "companyName": "Test Merchant",
      "billingAddress": {
          "address1": "1060 West Addison",
          "city": "Chicago",
          "stateOrProvince": "IL",
          "postalCode": "60613",
      },
  }


  response = client.update_merchant(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner & Organization
  * **Required Role:** Merchant Management

  This API returns all users and pending invites associated with a merchant account including any assigned role codes.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "merchantId": "<MERCHANT ID>",
  }


  response = client.merchant_users(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner & Organization
  * **Required Role:** Merchant Management

  Invites a new user to join a merchant account.  `email`, `firstName`, and `lastName` are required.

  The user will be sent an invite email with steps for creating a BlockChyp account and linking it to
  a merchant account.  If the user already has a BlockChyp user account, the new user signup wil be skipped
  and the existing user account will be linked to the merchant account.

  Developers can optionally restrict the user's access level by sending one or more role codes.
  Otherwise, the user will be given the default merchant user role. (STDMERCHANT)




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "email": "Email address for the invite",
  }


  response = client.invite_merchant_user(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Gateway Boarding

  This is a partner level API that can be used to manually board gateway merchants.  Use this API in conjunction
  with Platform Configuration to instantly board gateway merchants.  Note that most partners don't have
  permission to do this and are unlikely to get it.

  Settings can be changed by using the Update Merchant API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "profile": {
          "dbaName": "DBA Name",
          "companyName": "Corporate Entity Name",
      },
  }


  response = client.add_gateway_merchant(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Merchant Management

  This is a partner level API that can be used to create test merchant accounts.  This creates
  a basic test merchant with default settings.

  Settings can be changed by using the Update Merchant API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "dbaName": "DBA Name",
      "companyName": "Corporate Entity Name",
  }


  response = client.add_test_merchant(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Merchant Management

  This partner API can be used to delete unused test merchant accounts. `merchantId` is a required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "merchantId": "<MERCHANT ID>",
  }


  response = client.delete_test_merchant(request)

  print("Response: %r" % response)


  ```




  These partner only APIs give ISV partners advanced reporting and tools for managing their portfolio.

  Most of the APIs below are for portfolio reporting and range from basic partner commission statements
  to individual statements with all underlying card brand data.

  We also provide a pricing policy API that enables partners to pull down the current pricing rules
  in force for any merchant in their portfolio.

  <aside class="info">
  <b>Currency Data</b>
  <p>
  All partner APIs return currency and percentage values in two formats: floating point and formatted strings.
  </p>
  <p>
  It's recommended that all developers use the formatted string as this will ensure the most precise values.
  Floating point numbers are usually not appropriate for currency or fixed point decimal numbers as
  the underlying binary encoding can lead to errors in precision.  We provide floating point values
  only as a convenience for developers want to save development time and can live with approximated
  values in their use case.
  </p>
  </aside>







  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns the current pricing policy for a merchant.  This API is valid for partner scoped API credentials
  and `merchantId` is a required parameter.  By default this API returns the currently in-force pricing policy for a merchant,
  but other inactive policies can be returned by providing the `id` parameter.

  Buy rates for interchange plus and fixed rate pricing are always returned, but only the pricing related to the
  pricing model type (flat rate or interchange plus) are actually used in fee calculation.

  Each pricing level returns three values: `buyRate`, `current`, and `limit`.  The actual price the merchant will pay is
  given in the `current` field.  The other values reflect the contract minimum (`buyRate`) and maximum (`limit`) range
  the partner can use when changing prices.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.pricing_policy(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns a list of partner residual statements.  By default, all statements are returned with the most recent
  statements listed first.  Optional date parameters (`startDate` and `endDate`) can filter statements to a specific date range.

  The list of statements returns basic information about statements like volume, transaction count, and commissions earned.

  Use the `id` returned with each statement summary with the *Partner Statement Detail* API to pull down full details.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.partner_statements(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns detailed information about a specific partner statement.  Aggregate data is returned along with
  line item level data for each underlying merchant statement.

  Use the merchant invoice id with the *Merchant Statement Detail* API and the *Partner Commission Breakdown* API
  to get the merchant statement and the card brand fee cost breakdown respectively.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.partner_statement_detail(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner or Merchant
  * **Required Role:** Partner API Access or Merchant API

  The API returns a list of merchant statements and invoices.  By default, all invoices are returned with the most recent
  statements listed first.  Optional date parameters (`startDate` and `endDate`) can be used to filter statements by date
  range.

  The `invoiceType` parameter can also be used to filter invoices by type.  Invoices could be conventional invoices, such
  as those generated when ordering terminals or gift cards, or invoices could be merchant statements.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.merchant_invoices(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns detailed information about a specific merchant statement or invoice.

  All line items are returned a topographically sorted tree modeling the nested line item structure of the
  invoice.  Details about any payments posted against the invoice are returned.

  It the invoice is a merchant statement, details about every merchant deposit that occurred during the statement period
  are also returned.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.merchant_invoice_detail(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  This API allows partners to pull down the low level data used to compute a partner commission for a specific merchant statement.

  The `statementId` is required and must be the id of a valid merchant invoice of type `statement`.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.partner_commission_breakdown(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  This API allows partners to generate API credentials for a merchant.

  The `merchantId` is required and must be the id of a valid merchant.

  Credentials are not delete protected by default. Pass in `deleteProtected` to enable delete protection.

  The optional `notes` field will populate the notes in the credentials.

  By default no roles will be assigned unless valid, comma-delimited, role codes are passed in the `roles` field.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.merchant_credential_generation(request)

  print("Response: %r" % response)


  ```







  If you'd like to run the integration tests, create a new file on your system
  called `sdk-itest-config.json` with the API credentials you'll be using as
  shown in the example below.

  ```
  {
   "gatewayHost": "https://api.blockchyp.com",
   "testGatewayHost": "https://test.blockchyp.com",
   "apiKey": "PZZNEFK7HFULCB3HTLA7HRQDJU",
   "bearerToken": "QUJCHIKNXOMSPGQ4QLT2UJX5DI",
   "signingKey": "f88a72d8bc0965f193abc7006bbffa240663c10e4d1dc3ba2f81e0ca10d359f5"
  }
  ```

  This file can be located in a few different places, but is usually located
  at `<USER_HOME>/.config/blockchyp/sdk-itest-config.json`. All BlockChyp SDKs
  use the same configuration file.

  To run the integration test suite via `make`, type the following command:

  `make integration`

  [BlockChyp]: https://www.blockchyp.com



  BlockChyp welcomes contributions from the open source community, but bear in mind
  that this repository has been generated by our internal SDK Generator tool. If
  we choose to accept a PR or contribution, your code will be moved into our SDK
  Generator project, which is a private repository.



  Copyright BlockChyp, Inc., 2019

  Distributed under the terms of the [MIT] license, blockchyp-python is free and open source software.

  [MIT]: https://github.com/blockchyp/blockchyp-python/blob/master/LICENSE



  BlockChyp has officially supported SDKs for eight different development platforms and counting.
  Here's the full list with links to their GitHub repositories.

  [Go SDK](https://github.com/blockchyp/blockchyp-go)

  [Node.js/JavaScript SDK](https://github.com/blockchyp/blockchyp-js)

  [Typescript SDK](https://github.com/blockchyp/blockchyp-ts)

  [Java SDK](https://github.com/blockchyp/blockchyp-java)

  [.net/C# SDK](https://github.com/blockchyp/blockchyp-csharp)

  [Ruby SDK](https://github.com/blockchyp/blockchyp-ruby)

  [PHP SDK](https://github.com/blockchyp/blockchyp-php)

  [Python SDK](https://github.com/blockchyp/blockchyp-python)

  [iOS (Objective-C/Swift) SDK](https://github.com/blockchyp/blockchyp-ios)

  [Rust SDK](https://github.com/blockchyp/blockchyp-rust)


pkgId: 3c119a11c564ac458f9dd3d004ff39844736a2a1ed69117461b1700408b6d333
name: python-blockchyp
arch: src
version: 2.20.1.post1
epoch: 0
release: 1
summary: The official library for accessing the BlockChyp Terminal and Gateway APIs
url: https://github.com/blockchyp/blockchyp-python
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockchyp-2.20.1.post1-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://github.com/blockchyp/blockchyp-python/actions/workflows/main.yml/badge.svg)](https://github.com/blockchyp/blockchyp-python/actions/workflows/main.yml)
  [![PyPI](https://img.shields.io/pypi/v/blockchyp.svg)](https://pypi.org/project/blockchyp/)
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/blockchyp/blockchyp-python/blob/master/LICENSE)

  The official library for accessing the [BlockChyp] Terminal and Gateway APIs
  from Python.



  BlockChyp can be simply installed by running:

  ```sh
  pip install blockchyp
  ```




  Complete documentation can be found on our [Developer Documentation Portal].

  [Developer Documentation Portal]: https://docs.blockchyp.com/



  In order to test your integration with real terminals, you'll need a BlockChyp
  Developer Kit. Our kits include a fully functioning payment terminal with
  test pin encryption keys. Every kit includes a comprehensive set of test
  cards with test cards for every major card brand and entry method, including
  Contactless and Contact EMV and mag stripe cards. Each kit also includes
  test gift cards for our blockchain gift card system.

  Access to BlockChyp's developer program is currently invite only, but you
  can request an invitation by contacting our engineering team at **nerds@blockchyp.com**.

  You can also view a number of long form demos and learn more about us on our [YouTube Channel](https://www.youtube.com/channel/UCE-iIVlJic_XArs_U65ZcJg).



  You don't want to read words. You want examples. Here's a quick rundown of the
  stuff you can do with the BlockChyp Python SDK and a few basic examples.




  These are the core payment APIs used to execute and work with payment transactions in BlockChyp.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Our most popular transaction executes a standard authorization and capture.
  This is the most basic of
  basic payment transactions, typically used in conventional retail.

  Charge transactions can use a payment terminal to capture a payment or
  use a previously enrolled payment token.

  **Terminal Transactions**

  For terminal transactions, make sure you pass in the terminal name using the `terminalName` property.

  **Token Transactions**

  If you have a payment token, omit the `terminalName` property and pass in the token with the `token`
  property instead.

  **Card Numbers and Mag Stripes**

  You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will
  put you in PCI scope and the most common vector for POS breaches is keylogging.
  If you use terminals for manual card entry, you'll bypass any keyloggers that
  might be maliciously running on the point-of-sale system.

  **Common Variations**

  * **Gift Card Redemption**:  There's no special API for gift card redemption in BlockChyp. Simply execute a plain charge transaction and if the customer swipes a gift card, our terminals will identify the gift card and run a gift card redemption. Also note that if for some reason the gift card's original purchase transaction is associated with fraud or a chargeback, the transaction will be rejected.
  * **EBT**: Set the `card_type` field to `blockchyp.CardType.EBT` to process an EBT SNAP transaction. Note that test EBT transactions always assume a balance of $100.00, so test EBT transactions over that amount may be declined.
  * **Cash Back**: To enable cash back for debit transactions, set the `cash_back` field. If the card presented isn't a debit card, the `cash_back` field will be ignored.
  * **Manual Card Entry**: Set the `manual_entry` field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine the `manual_entry` field with the `card_type` field set to `blockchyp.CardType.EBT` for manual EBT card entry.
  * **Inline Tokenization**: You can enroll the payment method in the token vault inline with a charge transaction by setting the `enroll` field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data.
  * **Prompting for Tips**: Set the `prompt_for_tip` field if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other service related scenarios.
  * **Cash Discounting and Surcharging**:  The `surcharge` and `cash_discount` fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
  * **Cryptocurrency** The `cryptocurrency` field can be used to switch the standard present card screen to a cryptocurrency screen.  The field value can be `ANY` to enable any supported cryptocurrency or a single currency code such as `BTC` for Bitcoin.



  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "amount": "55.00",
  }


  response = client.charge(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  A preauthorization puts a hold on funds and must be captured later.  This is used
  in scenarios where the final transaction amount might change.  A common example is
  fine dining, where a tip adjustment is required before final settlement.

  Another use case for preauthorization is e-commerce.  Typically, an online order
  is preauthorized at the time of the order and then captured when the order ships.

  Preauthorizations can use a payment terminal to capture a payment or
  use a previously enrolled payment token.

  **Terminal Transactions**

  For terminal transactions, make sure you pass in the terminal name using the `terminalName` property.

  **Token Transactions**

  If you have a payment token, omit the `terminalName` property and pass in the token with the `token`
  property instead.

  **Card Numbers and Mag Stripes**

  You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will
  put you in PCI scope and the most common vector for POS breaches is key logging.
  If you use terminals for manual card entry, you'll bypass any key loggers that
  might be maliciously running on the point-of-sale system.

  **Cryptocurrency**

  Note that preauths are not supported for cryptocurrency.

  **Common Variations**

  * **Manual Card Entry**: Set the `manual_entry` field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine the `manual_entry` field with `card_type` set to `blockchyp.CardType.EBT` for manual EBT card entry.
  * **Inline Tokenization**: You can enroll the payment method in the token vault in line with a charge transaction by setting the `enroll` field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data.
  * **Prompting for Tips**: Set the `prompt_for_tip` field if you'd like to prompt the customer for a tip before authorization. You can prompt for tips as part of a preauthorization, although it's not a very common approach.
  * **Cash Discounting and Surcharging**: The `surcharge` and `cash_discount` fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "amount": "27.00",
  }


  response = client.preauth(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to capture a previously approved preauthorization.

  You'll need to make sure you pass in the Transaction ID returned by the original preauth transaction
  so we know which transaction we're capturing.  If you want to capture the transaction for the
  exact amount of the preauth, the Transaction ID is all you need to pass in.

  You can adjust the total if you need to by passing in a new `amount`.  We
  also recommend you pass in updated amounts for `tax` and `tip` as it can
  sometimes reduce your interchange fees. (Level II Processing, for example.)




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "transactionId": "<ORIGINAL TRANSACTION ID>",
      "amount": "32.00",
  }


  response = client.capture(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  It's not ideal, but sometimes customers want their money back.

  Our refund API allows you to confront this unpleasant reality by executing refunds in a few different scenarios.

  The most fraud resistent method is to execute refunds in the context of a previous transaction.  You should always keep track of the Transaction ID
  returned in a BlockChyp response.  To refund the full amount of the previous transaction, just pass in the original Transaction ID with the refund requests.

  **Partial Refunds**

  For a partial refund, just pass in an amount along with the Transaction ID.
  The only rule is that the amount must be equal to or less than the original
  transaction.  You can execute multiple partial refunds against the same
  original transaction as long as the total refunded amount doesn't exceed the original amount.

  **Tokenized Refunds**

  You can also use a token to execute a refund.  Pass in a token instead
  of the Transaction ID and the desired refund amount.

  **Free Range Refunds**

  When you execute a refund without referencing a previous transaction, we
  call this a *free range refund*.

  We don't recommend this type of refund, but it is permitted.  If you absolutely insist on
  doing it, pass in a Terminal Name and an amount.

  You can execute a manual or keyed refund by passing the `manual_entry` field
  to a free range refund request.

  **Gift Card Refunds**

  Gift card refunds are allowed in the context of a previous transaction, but
  free range gift card refunds are not allowed.  Use the gift card activation
  API if you need to add more funds to a gift card.

  **Store and Forward Support**

  Refunds are not permitted when a terminal falls back to store and forward mode.

  **Auto Voids**

  If a refund referencing a previous transaction is executed for the full amount
  before the original transaction's batch is closed, the refund is automatically
  converted to a void.  This saves the merchant a little bit of money.

  **Cryptocurrency**

  Note that refunds are not supported for cryptocurrency.  You must refund crypto transactions
  manually from your cryptocurrency wallet.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionId": "<PREVIOUS TRANSACTION ID>",

      
      "amount": "5.00",
  }


  response = client.refund(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Mistakes happen.  If a transaction is made by mistake, you can void it
  with this API.  All that's needed is to pass in a Transaction ID and execute
  the void before the original transaction's batch closes.

  Voids work with EBT and gift card transactions with no additional parameters.

  **Cryptocurrency**

  Note that voids are not supported for cryptocurrency.  You must refund crypto transactions
  manually from your cryptocurrency wallet.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "transactionId": "<PREVIOUS TRANSACTION ID>",
  }


  response = client.void(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to retrieve card metadata.

  Card metadata requests can use a payment terminal to retrieve metadata or
  use a previously enrolled payment token.

  **Terminal Transactions**

  For terminal transactions, make sure you pass in the terminal name using the `terminalName` property.

  **Token Transactions**

  If you have a payment token, omit the `terminalName` property and pass in the token with the `token`
  property instead.

  **Card Numbers and Mag Stripes**

  You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will
  put you in PCI scope and the most common vector for POS breaches is keylogging.
  If you use terminals for manual card entry, you'll bypass any keyloggers that
  might be maliciously running on the point-of-sale system.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
  }


  response = client.card_metadata(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Payment transactions require a stable network to function correctly and
  no network is stable all the time.  Time out reversals are a great line
  of defense against accidentally double charging consumers when payments
  are retried during shaky network conditions.

  We highly recommend developers use this API whenever a charge, preauth, or refund transaction times out.  If you don't receive a definitive response
  from BlockChyp, you can't be certain about whether or not the transaction went through.

  The best practice in this situation is to send a time out reversal request.  Time out reversals check for a transaction and void it if it exists.

  The only caveat is that developers must use the `transactionRef` property (`txRef` for the CLI) when executing charge, preauth, and refund transactions.

  The reason for this requirement is that if a system never receives a definitive
  response for a transaction, the system would never have received the BlockChyp
  generated Transaction ID.  We have to fall back to Transaction Ref to identify
  a transaction.

  **Cryptocurrency**

  Note that refunds are not supported for cryptocurrency.  You must refund crypto transactions
  manually from your cryptocurrency wallet.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionRef": "<LAST TRANSACTION REF>",
  }


  response = client.reverse(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API activates or adds value to BlockChyp gift cards.
  Just pass in the terminal name and the amount to add to the card.
  Once the customer swipes their card, the terminal will use keys
  on the mag stripe to add value to the card.

  You don't need to handle a new gift card activation or a gift card recharge any
  differently.  The terminal firmware will figure out what to do on its
  own while also returning the new balance for the gift card.

  This is the part of the system where BlockChyp's blockchain DNA comes
  closest to the surface.  The BlockChyp gift card system doesn't really
  use gift card numbers.  This means they can't be stolen.

  BlockChyp identifies cards with an elliptic curve public key instead.
  Gift card transactions are actually blocks signed with those keys.
  This means there are no shared secrets sent over the network.
  To keep track of a BlockChyp gift card, hang on to the **public key** returned
  during gift card activation.  That's the gift card's elliptic curve public key.

  We sometimes print numbers on our gift cards, but these are actually
  decimal encoded hashes of a portion of the public key to make our gift
  cards seem *normal* to *normies*.  They can be used
  for balance checks and play a lookup role in online gift card
  authorization, but are of little use beyond that.

  **Voids and Reversals**

  Gift card activations can be voided and reversed just like any other
  BlockChyp transaction.  Use the Transaction ID or Transaction Ref
  to identify the gift activation transaction as you normally would for
  voiding or reversing a conventional payment transaction.

  **Importing Gift Cards**

  BlockChyp does have the ability to import gift card liability from
  conventional gift card platforms.  Unfortunately, BlockChyp does not
  support activating cards on third party systems.  However, you can import
  your outstanding gift cards and customers can swipe them on the
  terminals like BlockChyp's standard gift cards.

  No special coding is required to access this feature.  The gateway and
  terminal firmware handle everything for you.

  **Third Party Gift Card Networks**

  BlockChyp does not currently provide any native support for other gift card
  platforms beyond importing gift card liability.  We do have a white listing system
  that can be used to support your own custom gift card implementations.  We have a security review
  process before we can allow a BIN range to be white listed, so contact
  support@blockchyp.com if you need to white list a BIN range.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "amount": "50.00",
  }


  response = client.gift_activate(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API checks a gift or EBT card balance.

  **Gift Card Balance Checks**

  For gift cards, pass in a terminal name and the customer will be prompted
  to swipe a card on that terminal.  The remaining balance will be displayed
  briefly on the terminal screen and the API response will include the gift card's public key and the remaining balance.

  **EBT Balance Checks**

  All EBT transactions require a PIN, so to check an EBT card balance,
  you need to pass in the `ebt` flag just like you would for a normal EBT
  charge transaction.  The customer will be prompted to swipe their card and
  enter a PIN code.  If everything checks out, the remaining balance on the
  card will be displayed on the terminal for the customer and returned with the API response.

  **Testing Gift Card Balance Checks**

  Test gift card balance checks work no differently than live gift cards.  You
  must activate a test gift card first to test balance checks.  Test
  gift cards are real blockchain cards that live on our parallel test blockchain.

  **Testing EBT Gift Card Balance Checks**

  All test EBT transactions assume a starting balance of $100.00.  As a result,
  test EBT balance checks always return a balance of $100.00.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "cardType": blockchyp.CardType.EBT,
  }


  response = client.balance(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API will close the merchant's batch if it's currently open.

  By default, merchant batches will close automatically at 3 AM in their
  local time zone.  The automatic batch closure time can be changed
  in the Merchant Profile or disabled completely.

  If automatic batch closure is disabled, you'll need to use this API to
  close the batch manually.



  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
  }


  response = client.close_batch(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to send an invoice to a customer and capture payment
  via a BlockChyp hosted payment page.

  If you set the `autoSend` flag, BlockChyp will send a basic invoice email
  to the customer for you that includes the payment link.  If you'd rather have
  more control over the look of the email message, you can omit the `autoSend`
  flag and send the customer email yourself.

  There are a lot of optional parameters for this API, but at a minimum
  you'll need to pass in a total, customer name, and email address. (Unless
  you use the `cashier` flag.)

  **Customer Info**

  Unless you're using the `cashier` flag, you must specify a customer; either by
  creating a new customer record inline or passing in an existing Customer ID or Customer Ref.

  **Line Item Level Data**

  It's not strictly required, but we strongly recommend sending line item level
  detail with every request.  It will make the invoice look more complete
  and the data format for line item level data is the exact same format used
  for terminal line item display, so the same code can be used to support both areas.

  **Descriptions**

  You can also provide a free form description or message to display near
  the bottom of the invoice.  Usually this is some kind of thank you note
  or instruction.

  **Terms and Conditions**

  You can include long form contract language with a request and capture
  terms and conditions accepted at the same time payment is captured.

  The interface is identical to that used for the terminal based Terms and
  Conditions API in that you can pass in content directly via `tcContent` or via
  a preconfigured template via `tcAlias`.  The Terms and Conditions log will also be updated when
  agreement acceptance is incorporated into a send link request.

  **Auto Send**

  BlockChyp does not send the email notification automatically.   This safeguard prevents real
  emails from going out when you may not expect them If you want BlockChyp to send the email
  for you, just add the `autoSend` flag with all requests.

  **Cryptocurrency**

  If the merchant is configured to support cryptocurrency transactions, the payment page will
  display additional UI widgets that allowing customers to switch to a crypto payment method.

  **Tokenization**

  Add the `enroll` flag to a send link request to enroll the payment method
  in the token vault.

  Add the `enrollOnly` flag to enroll the payment method in the token vault without any immediate payment taking place. The payment link will ask the user for their payment information and inform them that they will not be charged immediately, but that their payment may be used for future transactions.

  **Cashier Facing Card Entry**

  BlockChyp can be used to generate internal/cashier facing card entry pages as well.  This is
  designed for situations where you might need to take a phone order and don't
  have an available terminal.

  If you pass in the `cashier` flag, no email will be sent and you'll be able to
  load the link in a browser or iframe for payment entry.  When the `cashier` flag
  is used, the `autoSend` flag will be ignored.

  Note that cryptocurrency is not supported for cashier facing payment entry.

  **Payment Notifications**

  When a customer successfully submits payment, the merchant will receive an email
  notifying them that the payment was received.

  **Real Time Callback Notifications**

  Email notifications are fine, but you may want your system to be informed
  immediately whenever a payment event occurs.  By using the optional `callbackUrl` request
  property, you can specify a URL to which the Authorization Response will be posted
  every time the user submits a payment, whether approved or otherwise.

  The response will be sent as a JSON encoded POST request and will be the exact
  same format as all BlockChyp charge and preauth transaction responses.

  **Status Polling**

  If real time callbacks aren't practical or necessary in your environment, you can
  always use the Payment Link Status API described futher on.

  A common use case for the send link API with status polling is curbside pickup.
  You could have your system check the Payment Link Status when a customer arrives to
  ensure it's been paid without necessarily needing to create background threads
  to constantly poll for status updates.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionRef": "<TX REF>",
      "amount": "199.99",
      "description": "Widget",
      "subject": "Widget invoice",
      "transaction": {
          "subtotal": "195.00",
          "tax": "4.99",
          "total": "199.99",
          "items": [
              {
                  "description": "Widget",
                  "price": "195.00",
                  "quantity": 1,
              },
          ],
      },
      "autoSend": True,
      "customer": {
          "customerRef": "Customer reference string",
          "firstName": "FirstName",
          "lastName": "LastName",
          "companyName": "Company Name",
          "emailAddress": "notifications@blockchypteam.m8r.co",
          "smsNumber": "(123) 123-1231",
      },
  }


  response = client.send_payment_link(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API will resend a previously created payment link.  An error is returned if the payment link is expired, has been
  cancelled, or has already been paid.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "linkCode": "<PAYMENT LINK CODE>",
  }


  response = client.resend_payment_link(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API cancels a payment link.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "linkCode": "<PAYMENT LINK CODE>",
  }


  response = client.cancel_payment_link(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to check on the status of a payment link, including transaction data
  and the full history of attempted transactions.

  This API is the preferred source of truth and best practice when you want to check on the
  status of a payment link (as opposed to Transaction Status). The Transaction Status API is not
  ideal because of ambiguity when there are multiple transactions associated with a single
  payment link.

  You must pass the `linkCode` value associated with the payment link. It is included in the response from BlockChyp when the payment link is originally created.






  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "linkCode": "<PAYMENT LINK CODE>",
  }


  response = client.payment_link_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API returns the current status for any transaction.  You can lookup a transaction
  by its BlockChyp assigned Transaction ID or your own Transaction Ref.

  You should always use globally unique Transaction Ref values, but in the event
  that you duplicate Transaction Refs, the most recent transaction matching your
  Transaction Ref is returned.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "transactionId": "<TRANSACTION ID>",
  }


  response = client.transaction_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API calculates the surcharge, cash discount, and total amounts for cash transactions.

  If you're using BlockChyp's cash discounting features, you can use this endpoint
  to ensure the numbers and receipts for true cash transactions are consistent
  with transactions processed by BlockChyp.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "amount": "100.00",
      "cashDiscount": True,
      "surcharge": True,
  }


  response = client.cash_discount(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint allows developers to query the gateway for the merchant's batch history.
  The data will be returned in descending order of open date with the most recent
  batch returned first.  The results will include basic information about the batch.
  Consider using the Batch Details API for more detail about a specific batch.

  **Limiting Results**

  This API will return a maximum of 250 results.  Use the `maxResults` property to
  limit maximum results even further and use the `startIndex` property to
  page through results that span multiple queries.

  For example, if you want the ten most recent batches, pass in a value of
  `10` for `maxResults`.  Also note that `startIndex` is zero based. Use a value of `0` to
  get the first batch in the dataset.

  **Filtering by Date Range**

  You can also filter results by date.  Use the `startDate` and `endDate`
  properties to return only those batches opened between those dates.
  You can use either `startDate` and `endDate` and you can use date filters
  in conjunction with `maxResults` and `startIndex`




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "maxResults": 250,
      "startIndex": 0,
  }


  response = client.batch_history(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows developers to pull down details for a specific batch,
  including captured volume, gift card activity, expected deposit, and
  captured volume broken down by terminal.

  The only required request parameter is `batchId`.  Batch IDs are returned
  with every transaction response and can be discovered using the Batch
  History API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "batchId": "<BATCH ID>",
  }


  response = client.batch_details(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint provides several different methods to sift through
  transaction history.

  By default with no filtering properties, this endpoint will return the 250
  most recent transactions.

  **Limiting Results**

  This API will return a maximum of 50 results in a single query.  Use the `maxResults` property
  to limit maximum results even further and use the `startIndex` property to
  page through results that span multiple queries.

  For example, if you want the ten most recent batches, pass in a value of
  `10` for `maxResults`.  Also note that `startIndex` is zero based. Use a value of `0` to
  get the first transaction in the dataset.

  **Filtering By Date Range**

  You can also filter results by date.  Use the `startDate` and `endDate`
  properties to return only transactions run between those dates.
  You can use either `startDate` or `endDate` and you can use date filters
  in conjunction with `maxResults` and `startIndex`

  **Filtering By Batch**

  To restrict results to a single batch, pass in the `batchId` parameter.

  **Filtering By Terminal**

  To restrict results to those executed on a single terminal, pass in the terminal name.

  **Combining Filters**

  None of the above filters are mutually exclusive.  You can combine any of the
  above properties in a single request to restrict transaction results to a
  narrower set of results.

  **Searching Transaction History**

  You can search transaction history by passing in search criteria with the
  `query` option.  The search system will match the amount (requested and authorized),
  last four of the card number, cardholder name, and the auth code.

  Note that when search queries are used, terminalName or
  batch id filters are not supported.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "maxResults": 10,
      "batchId": "<BATCH ID>",
  }


  response = client.transaction_history(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Returns a list of transaction refs of transactions queued on a terminal.
  Details about the transactions can be retrieved using the Transaction Status
  API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.list_queued_transactions(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Deletes one or all queued transactions from a terminal. If `*` is passed as
  a transaction ref, then the entire terminal queue will be cleared. An error is
  returned if the passed transaction ref is not queued on the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
      "transactionRef": "*",
  }


  response = client.delete_queued_transaction(request)

  print("Response: %r" % response)


  ```




  These APIs support terminal management functions and additional terminal
  features such as line item display, messages, and interactive prompts.
  These features can be used to extend a point of sale system's functionality.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This simple test transaction helps ensure good communication with a payment terminal
  and is usually the first test you'll run in development.

  It tests communication with the terminal and returns a positive response if everything
  is okay.  It works the same way in local or cloud relay mode.

  If you get a positive response, you've successfully verified all of the following:

  * The terminal is online.
  * There is a valid route to the terminal.
  * The API Credentials are valid.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.ping(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint returns a terminal's routing and location information.

  The result will indicate whether or not the terminal is in cloud relay mode and will
  return the local IP address if the terminal is in local mode.

  The terminal will also return the public key for the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.locate(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API interrupts whatever a terminal may be doing and returns it to the
  idle state.





  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
  }


  response = client.clear(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API returns the current status of a payment terminal.  This is typically used
  as a way to determine if the terminal is busy before sending a new transaction.

  If the terminal is busy, `idle` will be false and the `status` field will return
  a short string that indicates the transaction type currently in progress.  The system
  will also return the timestamp of the last status change in the `since` field.

  The `cardInSlot` field in the response will indicates whether or not a card is currently in the card reader slot.

  If the system is running a payment transaction and you wisely passed in a
  Transaction Ref, this API will also return the Transaction Ref of the in progress
  transaction.

  The table below lists all possible status responses.

  | Status Code          | Description                                                                             |
  |----------------------|-----------------------------------------------------------------------------------------|
  | idle                 | The terminal is idle and ready for transactions.  The default branding is being displayed. |
  | activate             | The terminal is in the process of activating and pairing with the merchant account.     |
  | balance              | A balance check (EBT or Gift Card) is pending on the terminal.                          |
  | boolean-prompt       | A boolean prompt (yes/no) operation is pending on the terminal.                         |
  | signature            | A signature capture is pending.                                                         |
  | crypto               | A cryptocurrency transaction is pending.                                                |
  | enroll               | A token vault enrollment operation is pending.                                          |
  | gift-activate        | A gift card activation operation is in progress.                                        |
  | message              | The terminal is displaying a custom message.                                            |
  | charge               | The terminal is executing a charge transaction.                                         |
  | preauth              | The terminal is executing a preauth transaction.                                        |
  | refund               | The terminal is executing a refund transaction.                                         |
  | survey               | The terminal is displaying post transaction survey questions.                           |
  | terms-and-conditions | The terminal is pending terms and conditions acceptance and signature.                  |
  | text-prompt          | The terminal is awaiting response to a text input prompt.                               |
  | txdisplay            | The terminal is displaying transaction and/or line item level details.                  |




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.terminal_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This endpoint captures a written signature from the terminal and returns the
  image.

  Unlike the Terms & Conditions API, this endpoint performs basic signature
  capture with no agreement display or signature archival.

  Under the hood, signatures are captured in a proprietary vector format and
  must be converted to a common raster format in order to be useful to most
  applications.  At a minimum, you must specify an image format using the
  `sigFormat` parameter.  Currently, JPG and PNG are supported.

  By default, images are returned in the JSON response as hex encoded binary.
  You can redirect the binary image output to a file using the `sigFile`
  parameter.

  You can also scale the output image to your preferred width by
  passing in a `sigWidth` parameter.  The image will be scaled to that
  width, preserving the aspect ratio of the original image.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",

      
      "sigFormat": blockchyp.SignatureFormat.PNG,

      
      "sigWidth": 200,
  }


  response = client.capture_signature(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API sends totals and line item level data to the terminal.

  At a minimum, you should send total information as part of a display request,
  including `total`, `tax`, and `subtotal`.

  You can also send line item level data and each line item can have a `description`,
  `qty`, `price`, and `extended` price.

  If you fail to send an extended price, BlockChyp will multiply the `qty` by the
  `price`.  However, we strongly recommend you precalculate all the fields yourself
  to ensure consistency.  For example, your treatment of floating-point multiplication
  and rounding may differ slightly from BlockChyp's.

  **Discounts**

  You have the option to show discounts on the display as individual line items
  with negative values or you can associate discounts with a specific line item.
  You can apply any number of discounts to an individual line item with a description
  and amount.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "transaction": {
          "subtotal": "60.00",
          "tax": "5.00",
          "total": "65.00",
          "items": [
              {
                  "description": "Leki Trekking Poles",
                  "price": "35.00",
                  "quantity": 2,
                  "extended": "70.00",
                  "discounts": [
                      {
                          "description": "memberDiscount",
                          "amount": "10.00",
                      },
                  ],
              },
          ],
      },
  }


  response = client.new_transaction_display(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  Similar to *New Transaction Display*, this variant allows developers to update
  line item level data currently being displayed on the terminal.

  This feature is designed for situations where you want to update the terminal display as
  items are scanned.  You'll only have to send information to the
  terminal that's changed, which usually means the new line item and updated totals.

  If the terminal is not in line item display mode and you invoke this endpoint,
  the first invocation will behave like a *New Transaction Display* call.

  At a minimum, you should send total information as part of a display request,
  including `total`, `tax`, and `subtotal`.

  You can also send line item level data and each line item can have a `description`,
  `qty`, `price`, and `extended` price.

  If you fail to send an extended price, BlockChyp will multiply the `qty` by the
  `price`.  However, we strongly recommend you precalculate all the fields yourself
  to ensure consistency.  For example, your treatment of floating-point multiplication and rounding
  may differ slightly from BlockChyp's.

  **Discounts**

  You have the option to show discounts on the display as individual line items
  with negative values or you can associate discounts with a specific line item.
  You can apply any number of discounts to an individual line item with a description
  and amount.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "transaction": {
          "subtotal": "60.00",
          "tax": "5.00",
          "total": "65.00",
          "items": [
              {
                  "description": "Leki Trekking Poles",
                  "price": "35.00",
                  "quantity": 2,
                  "extended": "70.00",
                  "discounts": [
                      {
                          "description": "memberDiscount",
                          "amount": "10.00",
                      },
                  ],
              },
          ],
      },
  }


  response = client.update_transaction_display(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API displays a message on the payment terminal.

  Just specify the target terminal and the message using the `message` parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "message": "Thank you for your business.",
  }


  response = client.message(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API prompts the customer to answer a yes or no question.

  You can specify the question or prompt with the `prompt` parameter and
  the response is returned in the `response` field.

  This can be used for a number of use cases including starting a loyalty enrollment
  workflow or customer facing suggestive selling prompts.

  **Custom Captions**

  You can optionally override the "YES" and "NO" button captions by
  using the `yesCaption` and `noCaption` request parameters.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
      "prompt": "Would you like to become a member?",
      "yesCaption": "Yes",
      "noCaption": "No",
  }


  response = client.boolean_prompt(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API prompts the customer to enter numeric or alphanumeric data.

  Due to PCI rules, free-form prompts are not permitted when the response
  could be any valid string.  The reason for this is that a malicious
  developer (not you, of course) could use text prompts to ask the customer to
  input a card number or PIN code.

  This means that instead of providing a prompt, you provide a `promptType` instead.

  The prompt types currently supported are listed below:

  * **phone**: Captures a phone number.
  * **email**: Captures an email address.
  * **first-name**: Captures a first name.
  * **last-name**: Captures a last name.
  * **customer-number**: Captures a customer number.
  * **rewards-number**: Captures a rewards number.

  You can specify the prompt with the `promptType` parameter and
  the response is returned in the `response` field.





  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",

      
      
      "promptType": blockchyp.PromptType.EMAIL,
  }


  response = client.text_prompt(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant & Partner
  * **Required Role:** Terminal Management

  This API returns details about terminals associated with a merchant account.

  Status and resource information is returned for all terminals along with a preview of the
  current branding image displayed on the terminal




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.terminals(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant & Partner
  * **Required Role:** Terminal Management

  This API deactivates a payment terminal.

  If the terminal exists and is currently online, it will be removed from the merchant's
  terminal inventory.  The terminal will be remotely cleared and factory reset.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalId": "<TERMINAL ID>",
  }


  response = client.deactivate_terminal(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant & Partner
  * **Required Role:** Terminal Management

  This API activates a payment terminal.

  If successful, the payment terminal will restart, generate new encryption keys, and download any active
  branding assets for the merchant account it's been added to.

  Activation requests require an activation code and a unique terminal name.  All terminal names must be unique across
  a merchant account.

  Optional Parameters

  * **merchantId:** For partner scoped API credentials, a merchant ID is required.  For merchant scoped API credentials, the merchant ID is implicit and cannot be overridden.
  * **cloudRelay:** Activates the terminal in cloud relay mode.



  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
      "activationCode": "<ACTIVATION CODE>",
  }


  response = client.activate_terminal(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API reboots the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "terminalName": "Test Terminal",
  }


  response = client.reboot(request)

  print("Response: %r" % response)


  ```




  Developers can use BlockChyp to display and capture acceptance of contracts or agreements related to transactions.
  These agreements can be any long-form contract ranging from rental agreements to HIPPA disclosures.

  There are two basic approaches to terms and conditions capture.  Merchants can store contract templates in
  BlockChyp or they can send the full agreement text as part of every API call.  The right approach will largely
  depend on whether or not the system being integrated with BlockChyp already has a mechanism for organizing
  and managing agreements.  For systems that already have this feature built in, it's probably not necessary
  to use Terms and Conditions.

  When agreements are displayed on a terminal, the consumer can scroll through and read the entire agreement,
  and provide a signature.  Results are returned as part of the API response, but BlockChyp also stores a
  record of the agreement including the signature image, timestamp, and the full text of the agreement that was
  agreed to.

  The Terms and Conditions Log APIs can be used to search and retrieve acceptance records.  Those records
  can also be linked to a transaction if a transaction id is provided with the original API request.







  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API allows you to prompt a customer to accept a legal agreement on the terminal
  and (usually) capture their signature.

  Content for the agreement can be specified in two ways.  You can reference a
  previously configured T&C template or pass in the full agreement text with every request.

  **Using Templates**

  If your application doesn't keep track of agreements you can leverage BlockChyp's
  template system.  You can create any number of T&C Templates in the merchant dashboard
  and pass in the `tcAlias` flag to specify which one should display.

  **Raw Content**

  If your system keeps track of the agreement language or executes complicated merging
  and rendering logic, you can bypass our template system and pass in the full text with
  every transaction.  Use `tcName` to pass in the agreement name and `tcContent` to
  pass in the contract text.  Note that only plain text is supported.

  **Bypassing Signatures**

  Signature images are captured by default.  If for some reason this doesn't fit your
  use case and you'd like to capture acceptance without actually capturing a signature image, set
  the `disableSignature` flag in the request.

  **Terms & Conditions Log**

  Every time a user accepts an agreement on the terminal, the signature image (if captured),
  will be uploaded to the gateway.  The image will also be added to the log along with the full text of the
  agreement.  This preserves the historical record in the event that standard agreements
  or templates change over time.

  **Associating Agreements with Transactions**

  To associate a Terms & Conditions log entry with a transaction, just pass in the
  Transaction ID or Transaction Ref for the associated transaction.





  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",

      
      
      "tcAlias": "hippa",

      
      "tcName": "HIPPA Disclosure",

      
      "tcContent": "Full contract text",

      
      "sigFormat": blockchyp.SignatureFormat.PNG,

      
      "sigWidth": 200,

      
      "sigRequired": True,
  }


  response = client.terms_and_conditions(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API returns all terms and conditions templates associated with a merchant account.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.tc_templates(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API returns as single terms and conditions template.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "templateId": "<TEMPLATE ID>",
  }


  response = client.tc_template(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API updates or creates a terms and conditions template.

  Terms and conditions templates are fairly simple and essentially consist of a name, content, and alias.

  The name is the caption that will be displayed at the top of the screen.  The alias is a code or short
  description that will be used in subsequence API calls to refer to the template.

  Content is the full text of the contract or agreement.  Currently, no special formatting or
  merge behavior is supported.  Only plain text is supported.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "alias": "HIPPA",
      "name": "HIPPA Disclosure",
      "content": "Lorem ipsum dolor sit amet.",
  }


  response = client.tc_update_template(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API deletes a terms and conditions template.

  If a template is deleted, its alias can be reused and any previous Terms & Conditions log entry
  derived from the template being deleted is fully preserved since log entries always include
  a complete independent copy of the agreement text.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "templateId": "<TEMPLATE ID>",
  }


  response = client.tc_delete_template(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API allows developers to search and sort through terms and conditions log entries.

  The default API call with no parameters will return the last 250 log entries in descending order.

  Optional parameters can be used to filter and query the data set.

  * **transactionId:** If provided, returns only those log entries associated with a specific transactions.  Paging and date filters are ignored if this parameter is used.
  * **maxResults:** The max number of results to return in a single page.  Defaults to 250 and 250 is the maximum value.
  * **startIndex** The zero based start index of results within the full result set to return.  Used to advance pages.  For example, if the page size is 10 and you wish to return the second page of results, send a startIndex of 10.
  * **startDate**: An optional start date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)
  * **endDate**: An optional end date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "logEntryId": "<LOG ENTRY ID>",
  }


  response = client.tc_log(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Terms & Conditions Management

  This API returns details for a single terms and conditions log entry.  The `logEntryId` of the record to be returned is the only required parameter.

  The signature image is returned as Base 64 encoded binary in the image format specified by the `sigFormat` field.
  The default format is PNG.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "logEntryId": "<ENTRY ID>",
  }


  response = client.tc_entry(request)

  print("Response: %r" % response)


  ```




  BlockChyp supports saved payments and recurring payments through the use of tokens.  Tokens can be created
  via the Enroll API or the web tokenizer.  Once created, these tokens can be used for subsequent payments
  or associated with customer records as saved payment methods.

  Tokens are limited to a single merchant by default, but can be shared across an organization for multi-location
  merchants by special arrangement with BlockChyp.  Contact your BlockChyp rep to setup token sharing.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API allows you to tokenize and enroll a payment method in the token
  vault.  You can also pass in customer information and associate the
  payment method with a customer record.

  A token is returned in the response that can be used in subsequent charge,
  preauth, and refund transactions.

  **Gift Cards and EBT**

  Gift Cards and EBT cards cannot be tokenized.

  **E-Commerce Tokens**

  The tokens returned by the enroll API and the e-commerce web tokenizer
  are the same tokens and can be used interchangeably.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
      "terminalName": "Test Terminal",
  }


  response = client.enroll(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API retrieves status and metadata information about a token,
  including any links to customer records.

  This will also return any customer records related to the card
  behind the token.  If the underlying card has been tokenized
  multiple times, all customers related to the card will be returned,
  even if those customer associations are related to other tokens.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
  }


  response = client.token_metadata(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API links a payment token with a customer record.  Usually this would only be needed
  to reverse a previous unlink operation.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
      "customerId": "<CUSTOMER ID>",
  }


  response = client.link_token(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API removes a payment token link from a customer record.

  This will remove links between the customer record and all tokens
  for the same underlying card.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
      "customerId": "<CUSTOMER ID>",
  }


  response = client.unlink_token(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API deletes a payment token from the gateway.  Tokens are automatically deleted if they have not been used
  for a year.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "token": "<TOKEN>",
  }


  response = client.delete_token(request)

  print("Response: %r" % response)


  ```




  These APIs allow developers to create and manage customer records in BlockChyp.  Developers who wish to use
  BlockChyp for tokenized recurring payments can use tokens directly if they have their own customer management
  system.  However, BlockChyp provides additional tools for managing customers and keeping track of a customer's saved
  payment tokens.

  In addition, if customer features are used, BlockChyp can detect a payment method associated with an existing
  customer, and return customer data with payment transactions.  This can be used as a passive method to detect
  repeat customers.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API adds or updates a customer record.

  If you pass in customer information including `firstName`, `lastName`, `email`,
  or `sms` without any Customer ID or Customer Ref, a new record will
  be created.

  If you pass in `customerRef` and `customerId`, the customer record will be updated
  if it exists.

  **Customer Ref**

  The `customerRef` field is optional, but highly recommended as this allows you
  to use your own customer identifiers instead of storing BlockChyp's Customer IDs
  in your systems.

  **Creating Customer Records With Payment Transactions**

  If you have customer information available at the time a payment transaction is
  executed, you can pass all the same customer information directly into a payment transaction.  BlockChyp
  will create a customer record at the same time payment is captured.  The advantage of this approach is
  that the customer's payment card is automatically associated with the customer record in a single step.
  If the customer uses the payment card in the future, the customer data will automatically
  be returned.  You won't need to ask the customer to provide any additional information.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "customer": {
          "id": "<CUSTOMER ID>",
          "customerRef": "Customer reference string",
          "firstName": "FirstName",
          "lastName": "LastName",
          "companyName": "Company Name",
          "emailAddress": "notifications@blockchypteam.m8r.co",
          "smsNumber": "(123) 123-1231",
      },
  }


  response = client.update_customer(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  With this API, you can retrieve detailed information about a customer record, including saved payment
  methods if available.

  Customers can be looked up by `customerId` or `customerRef`.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "customerId": "<CUSTOMER ID>",
  }


  response = client.customer(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API searches the customer database and returns matching results.

  Use `query` to pass in a search string and the system will return all results whose
  first or last names contain the query string.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "query": "(123) 123-1234",
  }


  response = client.customer_search(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  This API deletes a customer record.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "customerId": "<CUSTOMER ID>",
  }


  response = client.delete_customer(request)

  print("Response: %r" % response)


  ```




  These APIs are used to work with post-transaction surveys and survey data.

  Merchants can optionally configure scaled (1-5) or yes/no questions that can be presented to consumers
  after every approved Charge and Preauth transaction.  Surveys do not require any custom programming and
  merchants can simply configure them without the point-of-sale system needing any additional customization.

  However, these APIs allow point-of-sale or third-party system developers to integrate survey question configuration
  or result visualization into their own systems.







  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API returns all survey questions in the order in which they would be presented on the terminal.

  All questions are returned, whether enabled or disabled.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.survey_questions(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API returns a single survey question with response data.  `questionId` is required.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "questionId": "<QUESTION ID>",
  }


  response = client.survey_question(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API updates or creates survey questions.  `questionText` and `questionType` are required
  fields.  The following values are valid for `questionType`.

  * **yes_no:** Use for simple yes or no questions.
  * **scaled:** Displays the question with buttons that allow the customer to respond with values from 1 through 5.

  Questions are disabled by default.  Pass in `enabled` to enable a question.

  The `ordinal` field is used to control the sequence of questions when multiple questions are enabled.  We recommend keeping
  the number of questions minimal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "id": "<QUESTION ID>",
      "ordinal": 1,
      "questionText": "Would you shop here again?",
      "questionType": "yes_no",
      "enabled": True,
  }


  response = client.update_survey_question(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API deletes a survey question. `questionId` is a required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "questionId": "<QUESTION ID>",
  }


  response = client.delete_survey_question(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant
  * **Required Role:** Survey Management

  This API returns survey results for a single question.

  The results returned include the response rate, which is the percentage of transactions after which
  the consumer provided an answer.

  The `responses` array breaks down the results by answer, providing the total number of responses,
  the answer's percentage of the total, and the average transaction amount associated with a specific
  answer.

  By default, all results based on all responses are returned.  However, developers may optionally provide
  `startDate` and `endDate` parameters to return only responses provided between certain dates.

  `startDate` and `endDate` can be provided in MM/DD/YYYY or YYYY-MM-DD format.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "questionId": "<QUESTION ID>",
  }


  response = client.survey_results(request)

  print("Response: %r" % response)


  ```




  BlockChyp has a sophisticated terminal media and branding control platform.  Terminals can be configured to
  display logos, images, videos, and slide shows when a terminal is idle.  Branding assets can be configured
  at the partner, organization, and merchant level with fine-grained hour-by-hour schedules, if desired.

  Conceptually, all branding and media start with the media library.  Merchants, Partners, and Organizations can
  upload images or video and build branding assets from uploaded media.

  Slide shows can combine images from the media library into a timed loop of repeating images.

  Branding Assets can then be used to combine media or slide shows with priority and timing rules to create what
  we call the Terminal Branding Stack.

  We call a group of branding assets the *Terminal Branding Stack* because there are implicit rules about which
  branding assets take priority. For example, a merchant with no branding assets configured will inherit the
  branding rules from any organization to which the merchant may belong.  If the merchant doesn't belong to an organization
  or the organization has no branding rules configured, then the system will defer to branding defaults established
  by the point-of-sale or software partner that owns the merchant.

  This feature enables partners and organizations (multi-store operators and large national chains) to configure branding
  for potentially thousands of terminals from a single interface.

  Terminal Branding can also be configured at the individual terminal level and a merchant's terminal fleet
  can be broken into groups and branding configured at the group level.  Branding configured at the terminal
  level will always override branding from any higher level group.

  The order of priority for the Terminal Branding Stack is given below.

  * Terminal
  * Terminal Group
  * Merchant
  * Organization (Region, Chain, etc)
  * Partner
  * BlockChyp Default Logo







  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns the entire media library associated with the API Credentials (Merchant, Partner, or Organization).  The media library results will include the ID used
  to reference a media asset in slide shows and branding assets along with the full file url and thumbnail.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.media(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API supports media library uploads.  The operation of this API works slightly differently depending
  on the SDK platform.  In all cases, the intent is to allow the file's binary to be passed into the SDK using
  the lowest level I/O primitive possible in order to support situations where developers aren't working
  with literal files.  It might be (and usually is) more convenient to work with buffers, raw bytes, or streams.

  For example, the Go implementation accepts an `io.Reader` and the Java implementation accepts a
  `java.io.InputStream`.  The CLI does accept a literal File URL via the `-file` command line parameter.

  The following file formats are accepted as valid uploads:

  * .png
  * .jpg
  * .jpeg
  * .gif
  * .mov
  * .mpg
  * .mp4
  * .mpeg

  The UploadMetadata object allows developers to pass additional metadata about the upload including
  `fileName`, `fileSize`, and `uploadId`.

  None of these values are required, but providing them can unlock some additional functionality relating to
  media uploads.  `fileName` will be used to record the original file name in the media library.  `fileSize`
  and `uploadId` are used to support upload status tracking, which is especially useful for large video file
  uploads.

  The `fileSize` should be the file's full size in bytes.

  The `uploadId` value can be any random string.  This is the value you'll use to check the status of an upload
  via the Upload Status API.  This API will return information needed to drive progress feedback on uploads and
  return video transcoding information.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "fileName": "aviato.png",
      "fileSize": 18843,
      "uploadId": "<RANDOM ID>",
  }


  f = open("aviato.png", "rb")
  content = f.read()
  response = client.upload_media(request, content)
  f.close()

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns status and progress information about in progress or recently completed uploads.

  Before calling this API, developers must first start a file upload with `fileSize` and `uploadId` parameters.

  The data structure returned will include the file size, number of bytes uploaded, a narrative status
  and flags indicating whether or not the upload is complete or post upload processing is in progress.
  If the upload is completed, the ID assigned to the media asset and a link to the thumbnail image will
  also be returned.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "uploadId": "<UPLOAD ID>",
  }


  response = client.upload_status(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns a detailed media asset.  The data returned includes the exact same media information returned
  by the full media library endpoint, including fully qualified URLs pointing to the original media file
  and the thumbnail.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "mediaId": "<MEDIA ASSET ID>",
  }


  response = client.media_asset(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API deletes a media asset.  Note that a media asset cannot be deleted if it is in use in a slide
  show or in the terminal branding stack.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "mediaId": "<MEDIA ASSET ID>",
  }


  response = client.delete_media_asset(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns all slide shows.

  Note that slide level data is not returned with this API.   Use the Get Slide Show API to get slide level detail.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.slide_shows(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns a single slide show.  Slide level detail is returned with the fully qualified thumbnail URL
  for each slide.

  `slideShowId` is the only required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "slideShowId": "<SLIDE SHOW ID>",
  }


  response = client.slide_show(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API updates or creates a slide show.  `name`, `delay` and `slides` are required.

  The slides property is an array of slides.  The Slide data structure has ordinal and thumbnail URL fields,
  but these are not required when updating or creating a slide show.  Only the `mediaId` field is required
  when updating or creating a slide show.

  When using the CLI, slides can be specified by sending a comma-separated list of media ids via the `-mediaId`
  parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "name": "Test Slide Show",
      "delay": 5,
      "slides": [
          {
              "mediaId": "<MEDIA ID>",
          },
      ],
  }


  response = client.update_slide_show(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API deletes a slide show  `slideShowId` is the only required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "slideShowId": "<SLIDE SHOW ID>",
  }


  response = client.delete_slide_show(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API returns the full branding stack for a given API scope in the order of priority.

  Consumers of this API should pay special attention to the `editable` field.  This field indicates whether or
  not a branding asset is read-only from the perspective of a particular API Credential scope.

  The `thumbnail` and `previewImage` attributes can be used to support building user interfaces for
  managing the branding stack. `previewImage` differs from `thumbnail` in that the preview image is
  intended to show how an asset would actually look when displayed on the terminal.

  `activeAsset` returns the asset that is currently visible on the terminal.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.terminal_branding(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API updates or creates a single Branding Asset.

  Branding Assets represent a single element of the terminal branding stack.  A Branding Asset can be a video or image,
  in which case a `mediaId` referencing an asset from the media library must be provided.  A Branding Asset can also
  be a slide show, in which case `slideShowId` must be provided.  Branding Assets must have a valid `mediaId` or a valid
  `slideShowId`.  The optional `notes` field can be used to provide short notes and descriptions for a Branding asset.

  **Visibility Flags**

  In order for a Branding Asset to be visible on a terminal, the `enabled` flag must be set to true and the `preview`
  must be turned off.  `preview` is intended to show how a proposed Branding Asset will behave
  without pushing it to live terminals.  The Publish button in the BlockChyp merchant portal effectively turns
  the `preview` setting off.

  **Order and Sequencing**

  The `ordinal` field is used to specify priority for a Branding Asset.  Assets with a higher value for `ordinal`
  will be prioritized first.

  **Padding Images**

  For plain images, it's sometimes helpful to add margins to images.  This is especially helpful with logos
  or any image file rendered without any white space or margins between the image content and edge of the image file.
  Set the `padded` flag to true if you'd like BlockChyp to auto apply margins when displaying an image on
  the terminal.

  **Scheduling**

  By default, a Branding Asset placed on top of the Branding Stack, if it's `enabled` and not in `preview`
  mode, will immediately be displayed on the terminal round the clock.

  Branding Assets can be scheduled with effective start and stop dates for seasonal campaigns.  These assets can
  also be scheduled for specific times of day and specific days of the week.

  * **startDate:** Optional date after which the Branding Asset is eligible for display.  Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
  * **endDate:** Optional date before which the Branding Asset is eligible for display.  Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
  * **startTime** Optional time of day after which the branding asset is eligible for display.  Must be provided in 24 hour time: HH:MM.
  * **endTime** Optional time of day before which the branding asset is eligible for display.  Must be provided in 24 hour time format: HH:MM
  * **daysOfWeek** For branding assets that should only be displayed on certain days of the week, this field is an array of day of the week constants. (Constants vary by SDK platform.)

  **Read Only Fields**

  The Branding Asset data structure has a number of read only fields that are returned when Branding Assets are
  retrieved.  But these fields are ignored when you try to send them as part of an update.  These are derived
  or calculated fields and are helpful for displaying branding assets in a management user interface, but
  cannot be changed via an API call.

  These fields are:

  * ownerId
  * merchantId
  * organizationId
  * partnerId
  * userId
  * userName
  * thumbnail
  * lastModified
  * editable
  * assetType
  * ownerType
  * ownerTypeCaption
  * previewImage
  * narrativeEffectiveDates
  * narrativeDisplayPeriod




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "mediaId": "<MEDIA ID>",
      "padded": True,
      "ordinal": 10,
      "startDate": "01/06/2021",
      "startTime": "14:00",
      "endDate": "11/05/2024",
      "endTime": "16:00",
      "notes": "Test Branding Asset",
      "preview": False,
      "enabled": True,
  }


  response = client.update_branding_asset(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Media Management

  This API deletes a Branding Asset from the branding stack.

  Note that deleting a Branding Asset does not delete the underlying media from the media library or slide
  show from the slide show library.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "assetId": "<BRANDING ASSET ID>",
  }


  response = client.delete_branding_asset(request)

  print("Response: %r" % response)


  ```




  These APIs allow partners to manage and configure their merchant portfolios.

  Use of these APIs (other than the Merchant Profile API) requires partner scoped API credentials
  with special roles and permissions that may require a special arrangement with BlockChyp.

  For example, Partners usually can't board merchants directly, but must board merchants using
  the standard underwriting process via offer codes and invitations.







  * **API Credential Types:** Merchant
  * **Required Role:** Payment API Access

  The API returns detailed metadata about the merchant's configuration, including
  basic identity information, terminal settings, store and forward settings,
  and bank account information for merchants that support split settlement.

  Some of these fields can be updated via the Update Merchant API, but many of these
  fields are controlled by underwriting and cannot be altered outside of the
  underwriting and risk processes.

  **Merchant Descriptive Fields**

  The following fields are basic descriptive fields that can be used to describe and identify merchants.

  * **companyName:** The merchant's official corporate entity name.
  * **dbaName:** The business's DBA (doing business as) name.
  * **contactName:** Name of the merchant's primary control contact.
  * **contactNumber:** Primary control contact's phone number.
  * **locationName:** Optional location name for multi-location operators.
  * **storeNumber:** Optional store number for multi-location operators.
  * **partnerRef:** Optional reference number partners can add to a merchant record.  Usually the partner's own identifier for the merchant.
  * **timeZone:** Unix style local time zone for the merchant. Example: America/New_York.
  * **publicKey:** Read only field.  The merchant's blockchain public key.  Generated and assigned when a merchant account is first created.
  * **billingAddress:** Address for billing and written correspondence.
  * **shippingAddress:** Physical shipping address. Usually the actual street address of the business.
  * **status:** Current status of the merchant account.
  * **tcDisabled:** Disables all terms and conditions features in the merchant dashboard.  Used to hide the feature if a partner has not chosen to support it.
  * **gatewayOnly:** Indicates that a merchant has been boarded in gateway only mode.  Not common.

  **Batch and Terminal Settings**

  The following fields are used to control batch closure and high level terminal configuration.

  * **batchCloseTime:** Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time.  Defaults to 3 AM.
  * **autoBatchClose:** Flag the determines whether or not batches will automatically close.  Defaults to true.
  * **disableBatchEmails:** Flag that optionally turns off automatic batch closure notification emails.
  * **cooldownTimeout:** The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal.  After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
  * **surveyTimeout:** The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
  * **pinEnabled:** Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs.  Will be ignored if terminals are not injected with the proper encryption keys.
  * **pinBypassEnabled:** Enable pin bypass for debit transactions.
  * **cashBackEnabled:** Enables cash back for debit transactions.
  * **cashbackPresets:** An array of four default values for cashback amounts when cashback is enabled.
  * **storeAndForwardEnabled:** Enables automatic store and forward during network outages.  Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
  * **storeAndForwardFloorLimit:** Maximum dollar value of a store and forward transaction.
  * **ebtEnabled:** Enables EBT (SNAP) on BlockChyp terminals.
  * **tipEnabled:** Enables tips entry on the terminal.
  * **promptForTip:** If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
  * **tipDefaults:** An array of exactly three percentages that will be used to calculate default tip amounts.
  * **giftCardsDisabled:** Disables BlockChyp gift cards.  Normally only used if the merchant is using an alternate gift card system.
  * **digitalSignaturesEnabled:** Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
  * **digitalSignatureReversal:** Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
  * **manualEntryEnabled:** Enables manual card entry.
  * **manualEntryPromptZip:** Requires zip code based address verification for manual card entry.
  * **manualEntryPromptStreetNumber:** Requires street/address based verification for manual card entry.

  **Card Brand and Transaction Settings**

  * **freeRangeRefundsEnabled:** Enables direct refunds that do not reference a previous transaction.
  * **partialAuthEnabled:** Indicates that partial authorizations (usually for gift card support) are enabled.
  * **splitBankAccountsEnabled:** Used for law firm merchants only.
  * **contactlessEmv:** Enables contactless/tap transactions on a terminal.  Defaults to true.
  * **visa:** Enables Visa transactions.
  * **masterCard:** Enables MasterCard transactions.
  * **amex:** Enables American Express transactions.
  * **discover:** Enables Discover transactions.
  * **jcb:** Enables JCB (Japan Card Bureau) transactions.
  * **unionPay:** Enables China UnionPay transactions.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.merchant_profile(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner & Organization
  * **Required Role:** Merchant Management

  This is a partner or organization level API that can be used to return the merchant portfolio.

  Live merchants are returned by default.  Use the `test` flag to return only test merchants.  The
  results returned include detailed settings including underwriting controlled flags.

  A maximum of 250 merchants are returned by default.  For large merchant portfolios, the `maxResults`
  and `startIndex` field can be used to reduce the page size and page through multiple pages of results.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "test": True,
  }


  response = client.get_merchants(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Merchant, Partner, & Organization
  * **Required Role:** Merchant Management

  This API can be used to update or create merchant accounts.

  Merchant scoped API credentials can be used to update merchant account settings.

  Partner scoped API credentials can be used to update merchants, create new test
  merchants or board new gateway merchants.

  **Merchant Descriptive Fields**

  The following fields are basic descriptive fields that can be used to describe and identify merchants.

  * **companyName:** The merchant's official corporate entity name.
  * **dbaName:** The businesses DBA (doing business as) name.
  * **contactName:** Name of the merchant's primary control contact.
  * **contactNumber:** Primary control contact's phone number.
  * **locationName:** Optional location name for multi location operators.
  * **storeNumber:** Optional store number for multi location operators.
  * **partnerRef:** Optional reference number partners can add to a merchant record.  Usually the partner's own identifier for the merchant.
  * **timeZone:** Unix style local time zone for the merchant. Example: America/New_York.
  * **publicKey:** Read only field.  The merchant's blockchain public key.  Generated and assigned when a merchant account is first created.
  * **billingAddress:** Address for billing and written correspondence.
  * **shippingAddress:** Physical shipping address. Usually the actual street address of the business.
  * **status:** Current status of the merchant account.
  * **tcDisabled:** Disables all terms and conditions features in the merchant dashboard.  Used to hide the feature if a partner has not chosen to support it.
  * **gatewayOnly:** Indicates that a merchant has been boarded in gateway only mode.  Not common.

  **Batch and Terminal Settings**

  The following fields are used to control batch closure and high level terminal configuration.

  * **batchCloseTime:** Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time.  Defaults to 3 AM.
  * **autoBatchClose:** Flag the determines whether or not batches will automatically close.  Defaults to true.
  * **disableBatchEmails:** Flag that optionally turns off automatic batch closure notification emails.
  * **cooldownTimeout:** The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal.  After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
  * **surveyTimeout:** The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
  * **pinEnabled:** Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs.  Will be ignored if terminals are not injected with the proper encryption keys.
  * **pinBypassEnabled:** Enable pin bypass for debit transactions.
  * **cashBackEnabled:** Enables cash back for debit transactions.
  * **cashbackPresets:** An array of four default values for cashback amounts when cashback is enabled.
  * **storeAndForwardEnabled:** Enables automatic store and forward during network outages.  Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
  * **storeAndForwardFloorLimit:** Maximum dollar value of a store and forward transaction.
  * **ebtEnabled:** Enables EBT (SNAP) on BlockChyp terminals.
  * **tipEnabled:** Enables tips entry on the terminal.
  * **promptForTip:** If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
  * **tipDefaults:** An array of exactly three percentages that will be used to calculate default tip amounts.
  * **giftCardsDisabled:** Disables BlockChyp gift cards.  Normally only used if the merchant is using an alternate gift card system.
  * **digitalSignaturesEnabled:** Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
  * **digitalSignatureReversal:** Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
  * **manualEntryEnabled:** Enables manual card entry.
  * **manualEntryPromptZip:** Requires zip code based address verification for manual card entry.
  * **manualEntryPromptStreetNumber:** Requires street/address based verification for manual card entry.

  **Card Brand and Transaction Settings**

  * **freeRangeRefundsEnabled:** Enables direct refunds that do not reference a previous transaction.
  * **partialAuthEnabled:** Indicates that partial authorizations (usually for gift card support) are enabled.
  * **splitBankAccountsEnabled:** Used for law firm merchants only.
  * **contactlessEmv:** Enables contactless/tap transactions on a terminal.  Defaults to true.
  * **visa:** Enables Visa transactions.
  * **masterCard:** Enables MasterCard transactions.
  * **amex:** Enables American Express transactions.
  * **discover:** Enables Discover transactions.
  * **jcb:** Enables JCB (Japan Card Bureau) transactions.
  * **unionPay:** Enables China UnionPay transactions.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "merchantId": "<MERCHANT ID>",
      "test": True,
      "dbaName": "Test Merchant",
      "companyName": "Test Merchant",
      "billingAddress": {
          "address1": "1060 West Addison",
          "city": "Chicago",
          "stateOrProvince": "IL",
          "postalCode": "60613",
      },
  }


  response = client.update_merchant(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner & Organization
  * **Required Role:** Merchant Management

  This API returns all users and pending invites associated with a merchant account including any assigned role codes.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "merchantId": "<MERCHANT ID>",
  }


  response = client.merchant_users(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner & Organization
  * **Required Role:** Merchant Management

  Invites a new user to join a merchant account.  `email`, `firstName`, and `lastName` are required.

  The user will be sent an invite email with steps for creating a BlockChyp account and linking it to
  a merchant account.  If the user already has a BlockChyp user account, the new user signup wil be skipped
  and the existing user account will be linked to the merchant account.

  Developers can optionally restrict the user's access level by sending one or more role codes.
  Otherwise, the user will be given the default merchant user role. (STDMERCHANT)




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "email": "Email address for the invite",
  }


  response = client.invite_merchant_user(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Gateway Boarding

  This is a partner level API that can be used to manually board gateway merchants.  Use this API in conjunction
  with Platform Configuration to instantly board gateway merchants.  Note that most partners don't have
  permission to do this and are unlikely to get it.

  Settings can be changed by using the Update Merchant API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "profile": {
          "dbaName": "DBA Name",
          "companyName": "Corporate Entity Name",
      },
  }


  response = client.add_gateway_merchant(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Merchant Management

  This is a partner level API that can be used to create test merchant accounts.  This creates
  a basic test merchant with default settings.

  Settings can be changed by using the Update Merchant API.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "dbaName": "DBA Name",
      "companyName": "Corporate Entity Name",
  }


  response = client.add_test_merchant(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Merchant Management

  This partner API can be used to delete unused test merchant accounts. `merchantId` is a required parameter.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "merchantId": "<MERCHANT ID>",
  }


  response = client.delete_test_merchant(request)

  print("Response: %r" % response)


  ```




  These partner only APIs give ISV partners advanced reporting and tools for managing their portfolio.

  Most of the APIs below are for portfolio reporting and range from basic partner commission statements
  to individual statements with all underlying card brand data.

  We also provide a pricing policy API that enables partners to pull down the current pricing rules
  in force for any merchant in their portfolio.

  <aside class="info">
  <b>Currency Data</b>
  <p>
  All partner APIs return currency and percentage values in two formats: floating point and formatted strings.
  </p>
  <p>
  It's recommended that all developers use the formatted string as this will ensure the most precise values.
  Floating point numbers are usually not appropriate for currency or fixed point decimal numbers as
  the underlying binary encoding can lead to errors in precision.  We provide floating point values
  only as a convenience for developers want to save development time and can live with approximated
  values in their use case.
  </p>
  </aside>







  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns the current pricing policy for a merchant.  This API is valid for partner scoped API credentials
  and `merchantId` is a required parameter.  By default this API returns the currently in-force pricing policy for a merchant,
  but other inactive policies can be returned by providing the `id` parameter.

  Buy rates for interchange plus and fixed rate pricing are always returned, but only the pricing related to the
  pricing model type (flat rate or interchange plus) are actually used in fee calculation.

  Each pricing level returns three values: `buyRate`, `current`, and `limit`.  The actual price the merchant will pay is
  given in the `current` field.  The other values reflect the contract minimum (`buyRate`) and maximum (`limit`) range
  the partner can use when changing prices.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.pricing_policy(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns a list of partner residual statements.  By default, all statements are returned with the most recent
  statements listed first.  Optional date parameters (`startDate` and `endDate`) can filter statements to a specific date range.

  The list of statements returns basic information about statements like volume, transaction count, and commissions earned.

  Use the `id` returned with each statement summary with the *Partner Statement Detail* API to pull down full details.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.partner_statements(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns detailed information about a specific partner statement.  Aggregate data is returned along with
  line item level data for each underlying merchant statement.

  Use the merchant invoice id with the *Merchant Statement Detail* API and the *Partner Commission Breakdown* API
  to get the merchant statement and the card brand fee cost breakdown respectively.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.partner_statement_detail(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner or Merchant
  * **Required Role:** Partner API Access or Merchant API

  The API returns a list of merchant statements and invoices.  By default, all invoices are returned with the most recent
  statements listed first.  Optional date parameters (`startDate` and `endDate`) can be used to filter statements by date
  range.

  The `invoiceType` parameter can also be used to filter invoices by type.  Invoices could be conventional invoices, such
  as those generated when ordering terminals or gift cards, or invoices could be merchant statements.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.merchant_invoices(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  The API returns detailed information about a specific merchant statement or invoice.

  All line items are returned a topographically sorted tree modeling the nested line item structure of the
  invoice.  Details about any payments posted against the invoice are returned.

  It the invoice is a merchant statement, details about every merchant deposit that occurred during the statement period
  are also returned.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.merchant_invoice_detail(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  This API allows partners to pull down the low level data used to compute a partner commission for a specific merchant statement.

  The `statementId` is required and must be the id of a valid merchant invoice of type `statement`.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.partner_commission_breakdown(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** Partner API Access

  This API allows partners to generate API credentials for a merchant.

  The `merchantId` is required and must be the id of a valid merchant.

  Credentials are not delete protected by default. Pass in `deleteProtected` to enable delete protection.

  The optional `notes` field will populate the notes in the credentials.

  By default no roles will be assigned unless valid, comma-delimited, role codes are passed in the `roles` field.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
      "merchantId": "<MERCHANT ID>",
  }


  response = client.merchant_credential_generation(request)

  print("Response: %r" % response)


  ```





  * **API Credential Types:** Partner
  * **Required Role:** INVITE MERCHANT

  This is a partner level API that can be used to submit applications to add new merchant accounts. The application requires a significant amount of detailed information about the merchant and their business. Rather than providing an exhaustive list of required fields, we recommend submitting as much information as possible in your initial request.

  If any required fields are missing or if there are any validation errors, the API will return specific error messages indicating which fields need to be addressed. Simply review these validation errors, fill in the missing information or correct any errors, and resubmit the application.

  Key areas of information include:
  - Business details (name, type, tax information)
  - Contact information
  - Address information (physical and mailing)
  - Owner details
  - Bank account information
  - Transaction volume estimates
  - Operational settings (timezone, batch close time, etc.)

  **Note:** Some fields may be conditionally required based on the values of other fields. The validation process will guide you through ensuring all necessary information is provided.




  ```python
  import os

  import blockchyp


  client = blockchyp.Client(
      api_key=os.environ["BC_API_KEY"],
      bearer_token=os.environ["BC_BEARER_TOKEN"],
      signing_key=os.environ["BC_SIGNING_KEY"],
  )


  request = {
  }


  response = client.submit_application(request)

  print("Response: %r" % response)


  ```







  If you'd like to run the integration tests, create a new file on your system
  called `sdk-itest-config.json` with the API credentials you'll be using as
  shown in the example below.

  ```
  {
   "gatewayHost": "https://api.blockchyp.com",
   "testGatewayHost": "https://test.blockchyp.com",
   "apiKey": "PZZNEFK7HFULCB3HTLA7HRQDJU",
   "bearerToken": "QUJCHIKNXOMSPGQ4QLT2UJX5DI",
   "signingKey": "f88a72d8bc0965f193abc7006bbffa240663c10e4d1dc3ba2f81e0ca10d359f5"
  }
  ```

  This file can be located in a few different places, but is usually located
  at `<USER_HOME>/.config/blockchyp/sdk-itest-config.json`. All BlockChyp SDKs
  use the same configuration file.

  To run the integration test suite via `make`, type the following command:

  `make integration`

  [BlockChyp]: https://www.blockchyp.com



  BlockChyp welcomes contributions from the open source community, but bear in mind
  that this repository has been generated by our internal SDK Generator tool. If
  we choose to accept a PR or contribution, your code will be moved into our SDK
  Generator project, which is a private repository.



  Copyright BlockChyp, Inc., 2019

  Distributed under the terms of the [MIT] license, blockchyp-python is free and open source software.

  [MIT]: https://github.com/blockchyp/blockchyp-python/blob/master/LICENSE



  BlockChyp has officially supported SDKs for eight different development platforms and counting.
  Here's the full list with links to their GitHub repositories.

  [Go SDK](https://github.com/blockchyp/blockchyp-go)

  [Node.js/JavaScript SDK](https://github.com/blockchyp/blockchyp-js)

  [Typescript SDK](https://github.com/blockchyp/blockchyp-ts)

  [Java SDK](https://github.com/blockchyp/blockchyp-java)

  [.net/C# SDK](https://github.com/blockchyp/blockchyp-csharp)

  [Ruby SDK](https://github.com/blockchyp/blockchyp-ruby)

  [PHP SDK](https://github.com/blockchyp/blockchyp-php)

  [Python SDK](https://github.com/blockchyp/blockchyp-python)

  [iOS (Objective-C/Swift) SDK](https://github.com/blockchyp/blockchyp-ios)

  [Rust SDK](https://github.com/blockchyp/blockchyp-rust)


pkgId: da0eb39b90b6f9b6bcef66d885c83bda1a3d5c79062791b3095c085d2a376b2a
name: python-blockcypher
arch: src
version: 1.0.93
epoch: 0
release: 1
summary: BlockCypher Python Library
url: https://github.com/blockcypher/blockcypher-python/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockcypher-1.0.93-1.src.rpm
checksum_type: sha256
description:
  Official python library for BlockCypher web services. Easily query the blockchain without writing any code. Fast, reliable, and packed with powerful features you won't find in other block explorers. Currently supports bitcoin (including main and testnet), Litecoin, Dogecoin, Dash, URO and the blockcypher testnet.
  Designed to be used without having to RTFM.
  More features and support for more endpoints coming soon. Should support python 2.6+ and python3.x, but hasn't been thoroughly tested on 2.6+. Native support for datetime conversions. Issues and pull requests much appreciated!
  ![](https://github.com/blockcypher/blockcypher-python/workflows/Continuous%20Integration/badge.svg)

  Use pip with
  ```
  $ pip3 install blockcypher
  ```
  (for python 2.x use `pip` instead of `pip3`)
  You can of course install it the old fashioned way like this:
  ```
  $ python setup.py install
  ```

  ```
  >>> import blockcypher
  ```
  Note: to keep your code clean we recommend `from blockcypher import foo` where `foo` is the method you want to use, but for simplicity all examples below are instead written as `blockcypher.foo('bar')`
  How much bitcoin (in satoshis) is currently sitting in the Bitcoin Foundation Address:
  ```
  >>> blockcypher.get_total_balance('1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW')  # BTC unless specified otherwise
  5850576658
  ```
  Satoshis are a bit hard to inuit. How much is that in BTC?
  ```
  >>> blockcypher.from_base_unit(5850576658, 'btc')
  58.50576658
  ```
  ~58.5 BTC, not bad.
  How many transactions did it take to accumulate that much BTC?
  ```
  >>> blockcypher.get_total_num_transactions('1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW')  # BTC unless specified otherwise
  901
  ```
  We could break that down with `get_num_confirmed_transactions()` and `get_num_unconfirmed_transactions()` if we wanted.
  What's the current block height?
  ```
  >>> blockcypher.get_latest_block_height()  # BTC unless specified otherwise
  330545
  ```
  We could get that as a block hash if we prefer:
  ```
  >>> blockcypher.get_latest_block_hash()  # BTC unless specified otherwise
  '0000000000000000126fc62619701b8c3da59424755e9de409053524620b114d'
  ```
  We can also convert between block hashes and block heights
  ```
  >>> blockcypher.get_block_height('0000000000000000126fc62619701b8c3da59424755e9de409053524620b114d')  # BTC unless specified otherwise
  330545
  ```
  Use `get_block_hash()` to convert back.
  We can also find the previous block hash:
  ```
  >>> blockcypher.get_prev_block_hash('0000000000000000126fc62619701b8c3da59424755e9de409053524620b114d')  # BTC unless specified otherwise
  '000000000000000008573d8ac6eb85ea50fc164c2339dffeeb768423b72f5eeb'
  ```

  Payment forwarding is really hard to setup yourself and trivial with blockcypher.
  ```
  >>> blockcypher.get_forwarding_address('16uKw7GsQSzfMaVTcT7tpFQkd7Rh9qcXWX', api_key='your key here')  # BTC unless specified otherwise
  '1Am4RUsCoiC3LfVC53kxVyfPkB4gEdRtkg'
  ```
  Now any funds sent to `1Am4RUsCoiC3LfVC53kxVyfPkB4gEdRtkg` will instantly forward to `16uKw7GsQSzfMaVTcT7tpFQkd7Rh9qcXWX`.
  You can check on your payments like this:
  ```
  >>> blockcypher.list_forwarding_addresses(api_key='your key here', coin_symbol='btc')
  [{'token': '8d99...',
    'id': '60ad7de3-ce81-40a2-ac92-6c74ab85bb72',
    'txs': ['f7750e98af49d12b2c63835399d4a96e1b5fd76f897d020f6c6bf8a7c13cdae1'],
    'input_address': '162r...',
    'callback_url': 'http://requestb.in/...',
    'destination': '1BaJ...'},
  ]
  ```
  And you can delete one like this:
  ```
  >>> blockcypher.delete_forwarding_address(payment_id='60ad7de3-ce81-40a2-ac92-6c74ab85bb72')  # BTC unless specified otherwise
  ```

  Want to know about an address generally?
  ```
  >>> blockcypher.get_address_details('1PTUHs5ivGAN5aHTY7UQk5RcCE8a67mUT4')  # BTC unless specified otherwise
  {'unconfirmed_balance': 0,
   'final_balance': 6444,
   'address': '1PTUHs5ivGAN5aHTY7UQk5RcCE8a67mUT4',
   'tx_url': 'https://api.blockcypher.com/v1/btc/main/txs/',
   'unconfirmed_n_tx': 0,
   'unconfirmed_txrefs': [],
   'n_tx': 1,
   'final_n_tx': 1,
   'balance': 6444,
   'txrefs': [{'confirmations': 216,
     'tx_input_n': -1,
     'block_height': 330554,
     'tx_hash': '608cbc04cbda960e5b8481013030ff6cc6e4b92eeddf42d8dd15d42715c886f2',
     'double_spend': False,
     'value': 6444,
     'tx_output_n': 0,
     'confirmed': datetime.datetime(2014, 11, 18, 9, 39, 56, tzinfo=tzutc()),
     'spent': False}]}
  ```
  Want to know about a transaction generally?
  ```
  >>> blockcypher.get_transaction_details('fd1dc97a826eb93b485b6bada84a807ee81181f7ab2720cefb5fa96729363157')  # BTC unless specified otherwise
  {'confirmations': 318425,
   'lock_time': 0,
   'vout_sz': 1,
   'preference': 'low',
   'block_hash': '00000000b8980ec1fe96bc1b4425788ddc88dd36699521a448ebca2020b38699',
   'block_height': 12345,
   'total': 5000000000,
   'confirmed': datetime.datetime(2014, 5, 19, 19, 39, 12, 207000, tzinfo=tzutc()),
   'vin_sz': 1,
   'relayed_by': '',
   'received': datetime.datetime(2014, 5, 19, 19, 39, 12, 207000, tzinfo=tzutc()),
   'fees': 0,
   'outputs': [{'value': 5000000000,
     'script': '4104c5d62274610e82819939c3341a4addc72634664d73b11ba761de42839aa3496f93b3b3ee80e497eb5a68439b02f04e9aeb1604fbcaa074aa82f0f7574f9f110dac',
     'script_type': 'pay-to-pubkey',
     'addresses': ['18x6rfvHEgH1iTbkJTjRpYJrfSAhWdUiQM'],
     'spent_by': ''}],
   'addresses': ['18x6rfvHEgH1iTbkJTjRpYJrfSAhWdUiQM'],
   'ver': 1,
   'double_spend': False,
   'inputs': [{'script_type': 'empty',
     'script': '04ffff001d02aa06',
     'output_index': -1,
     'output_value': 5000000000,
     'addresses': []}],
   'hash': 'fd1dc97a826eb93b485b6bada84a807ee81181f7ab2720cefb5fa96729363157'}
  ```
  Some great transaction methods that take a transaction hash and return exactly what they sound like:
  - ```get_num_confirmations()```
  - ```get_satoshis_transacted()```
  - ```get_satoshis_in_fees()```
  - ```get_confidence()```, ```get_miner_preference()``` and ```get_receive_count()``` are powerful methods that use blockcypher's unique transaction confirmation prediction abilities.
  You can also get a list of broadcast transactions that haven't made it into a block yet:
  ```
  >>> blockcypher.get_broadcast_transaction_hashes(limit=5)
  ['4d6e75ed639fc7fe63f57b5578fd01e6712d22f1f307dc1bf720fddc59b4d586',
   'daae0f0849148b512fb909d57444a9f41300f188c9583ff93e71c8b97546ebd6',
   '899d1e1dd41baacf7b766fc643156e40d2438d780dd00ec651c9312693e3fe16',
   '313dfba9bd69d406176e5b305146a3136f40eda4589f06e1d770d6bfacaf5b52',
   'c3e0a3a702a4b8cd6f72618fd13e87b7f2b55a215fd78c35ca13a2d2bbd89088']
  ```
  For more details on those transactions, use `blockcypher.get_broadcast_transactions()`
  Want more info about a block?
  ```
  >>> blockcypher.get_block_overview(12345)  # BTC unless specified otherwise
  {'txids': ['fd1dc97a826eb93b485b6bada84a807ee81181f7ab2720cefb5fa96729363157'],
   'mrkl_root': 'fd1dc97a826eb93b485b6bada84a807ee81181f7ab2720cefb5fa96729363157',
   'height': 12345,
   'prev_block': '0000000076876082384460fb5a231cc5a5e874b9762e15a4e7b1fc068f749cdf',
   'total': 0,
   'time': datetime.datetime(2009, 4, 26, 22, 25, 32, tzinfo=tzutc()),
   'nonce': 784807199,
   'bits': 486604799,
   'fees': 0,
   'received_time': datetime.datetime(2014, 5, 19, 19, 39, 12, 207000, tzinfo=tzutc()),
   'depth': 318424,
   'prev_block_url': 'https://api.blockcypher.com/v1/btc/main/blocks/0000000076876082384460fb5a231cc5a5e874b9762e15a4e7b1fc068f749cdf',
   'chain': 'BTC.main',
   'ver': 1,
   'n_tx': 1,
   'hash': '00000000b8980ec1fe96bc1b4425788ddc88dd36699521a448ebca2020b38699',
   'tx_url': 'https://api.blockcypher.com/v1/btc/main/txs/'}
  ```
  We can also get details on its transaction(s):
  ```
  >>> blockcypher.get_block_details(12345)  # BTC unless specified otherwise
  {'txids': [{'confirmations': 318425,
     'lock_time': 0,
     'vout_sz': 1,
     'preference': 'low',
     'block_hash': '00000000b8980ec1fe96bc1b4425788ddc88dd36699521a448ebca2020b38699',
     'block_height': 12345,
     'total': 5000000000,
     'confirmed': datetime.datetime(2014, 5, 19, 19, 39, 12, 207000, tzinfo=tzutc()),
     'vin_sz': 1,
     'relayed_by': '',
     'received': datetime.datetime(2014, 5, 19, 19, 39, 12, 207000, tzinfo=tzutc()),
     'fees': 0,
     'outputs': [{'value': 5000000000,
       'script': '4104c5d62274610e82819939c3341a4addc72634664d73b11ba761de42839aa3496f93b3b3ee80e497eb5a68439b02f04e9aeb1604fbcaa074aa82f0f7574f9f110dac',
       'script_type': 'pay-to-pubkey',
       'addresses': ['18x6rfvHEgH1iTbkJTjRpYJrfSAhWdUiQM'],
       'spent_by': ''}],
     'addresses': ['18x6rfvHEgH1iTbkJTjRpYJrfSAhWdUiQM'],
     'ver': 1,
     'double_spend': False,
     'inputs': [{'script_type': 'empty',
       'script': '04ffff001d02aa06',
       'output_index': -1,
       'output_value': 5000000000,
       'addresses': []}],
     'hash': 'fd1dc97a826eb93b485b6bada84a807ee81181f7ab2720cefb5fa96729363157'}],
   'mrkl_root': 'fd1dc97a826eb93b485b6bada84a807ee81181f7ab2720cefb5fa96729363157',
   'height': 12345,
   'prev_block': '0000000076876082384460fb5a231cc5a5e874b9762e15a4e7b1fc068f749cdf',
   'total': 0,
   'time': datetime.datetime(2009, 4, 26, 22, 25, 32, tzinfo=tzutc()),
   'nonce': 784807199,
   'bits': 486604799,
   'fees': 0,
   'received_time': datetime.datetime(2014, 5, 19, 19, 39, 12, 207000, tzinfo=tzutc()),
   'depth': 318424,
   'prev_block_url': 'https://api.blockcypher.com/v1/btc/main/blocks/0000000076876082384460fb5a231cc5a5e874b9762e15a4e7b1fc068f749cdf',
   'chain': 'BTC.main',
   'ver': 1,
   'n_tx': 1,
   'hash': '00000000b8980ec1fe96bc1b4425788ddc88dd36699521a448ebca2020b38699',
   'tx_url': 'https://api.blockcypher.com/v1/btc/main/txs/'}
  ```
  Another cool feature is that we can generate a new address keypair server-side, but you should really do this client-side:
  ```
  >>> blockcypher.generate_new_address()
  {'public': '03c87d1bba027204670c975d01e813d4a20ba4f79500802ba0d51ce3393fb86c1f',
   'private': '6a16a2b20e56b7ab8fa366023787730ded6ee9cbd6d37d3e3af5a6bed551b721',
   'address': '12TiM15S5MFgYLfphaou2VZkmgyMDrfH8V'}
  ```
  (If you use this exact bitcoin address, expect to lose your money instantly!)

  ```
  >>> from blockcypher import constants
  >>> constants.COIN_SYMBOL_LIST
  ['btc', 'btc-testnet', 'ltc', 'doge', 'dash', 'bcy']
  ```
  `btc` will always be assumed if nothing else is specified, but all methods support swapping in any of the previous `coin_symbol` entries. Just pass `coin_symbol='foo'` as a keyword argument to the function.
  For example, here's the latest Litecoin block height.
  ```
  >>> blockcypher.get_latest_block_height(coin_symbol='ltc')
  678686
  ```

  See the official blockcypher docs at https://blockcypher.com/dev/bitcoin?python#

  Please note that all PRs require test coverage in `test_blockcypher.py`.


pkgId: e2c3e3240be602b295d896eca5b1dc71b056ca145539826bc36228a68b664371
name: python-blockdiag
arch: src
version: 3.0.0
epoch: 0
release: 1
summary: blockdiag generates block-diagram image from text
url: http://blockdiag.com/
rpm_license: Apache License 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockdiag-3.0.0-1.src.rpm
checksum_type: sha256
description:
  * Generate block-diagram from dot like text (basic feature).
  * Multilingualization for node-label (utf-8 only).
  You can get some examples and generated images on
  `blockdiag.com <http://blockdiag.com/en/blockdiag/examples.html>`_ .


pkgId: ecb820a658afc3cc3e12b917a129d6482970aa3acb5828b74835bea764e5ecd2
name: python-blocked-matrix-utils
arch: src
version: 1.0.9
epoch: 0
release: 1
summary: NumPy wrappers for blocked matrices
url: https://github.com/vahtras/util
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blocked-matrix-utils-1.0.9-1.src.rpm
checksum_type: sha256
description:
  [![CircleCI](https://circleci.com/gh/vahtras/util.svg?style=svg)](https://circleci.com/gh/vahtras/util)
  [![Build Status](https://travis-ci.org/vahtras/util.svg?branch=master)](https://travis-ci.org/vahtras/util)
  [![Coverage Status](https://coveralls.io/repos/github/vahtras/util/badge.svg?branch=master)](https://coveralls.io/github/vahtras/util?branch=master)
  ![Python package](https://github.com/vahtras/util/workflows/Python%20package/badge.svg)





  This package contains utilities for handling numpy arrays with subblocking.



  The latest release versions can be installed from either pypi or conda-forge

  ~~~
      $ pip install blocked-matrix-utils
  ~~~

  ~~~
      $ conda install -c conda-forge blocked-matrix-utils
  ~~~

  Alternatively the latest development version is available on github

  ~~~
      $ pip install git+https://github.com/vahtras/util.git@master
  ~~~


pkgId: d36c68f2450da101e545fac4d4eeb05ada5e60beab55873d336481bbfe7783d2
name: python-blockfrost-python
arch: src
version: 0.6.0
epoch: 0
release: 1
summary: The official Python SDK for Blockfrost API v0.1.37
url: https://github.com/blockfrost/blockfrost-python
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockfrost-python-0.6.0-1.src.rpm
checksum_type: sha256
description:
  [![Package Test](https://img.shields.io/github/actions/workflow/status/blockfrost/blockfrost-python/package-test.yml?logo=GitHub&label=package%20test)](https://github.com/blockfrost/blockfrost-python/actions/workflows/package-test.yml)
  [![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg?logo=pypi&label=pypi%20latest)](https://pypi.org/project/blockfrost-python/)
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/blockfrost-python?logo=pypi&label=pypi%20downloads)](https://pypistats.org/packages/blockfrost-python)
  [![Package Status](https://img.shields.io/pypi/status/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)
  [![License](https://img.shields.io/pypi/l/blockfrost-python.svg)](https://github.com/blockfrost/blockfrost-python/blob/master/LICENSE)
  [![Made by Five Binaries](https://img.shields.io/badge/made%20by-Five%20Binaries-darkviolet.svg)](https://fivebinaries.com/)
  [![Maintained by Mathias Frohlich](https://img.shields.io/badge/maintained%20by-Mathias%20Frohlich-blue.svg)](https://github.com/mathiasfrohlich)

  <img src="https://blockfrost.io/images/logo.svg" width="250" align="right" height="90">



  <br/>

  <p align="center">A Python SDK for Blockfrost.io API.</p>
  <p align="center">
    <a href="#getting-started">Getting started</a> •
    <a href="#installation">Installation</a> •
    <a href="#usage">Usage</a>
  </p>
  <br>



  To use this SDK, you first need login into to [blockfrost.io](https://blockfrost.io) create your project to retrieve
  your API key.

  <img src="https://i.imgur.com/smY12ro.png">

  <br/>



  [![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)

  ```console
  $ pip install blockfrost-python
  ```

  <br/>



  Using the SDK is pretty straight-forward as you can see from the following examples.



  ```python
  from blockfrost import BlockFrostApi, ApiError, ApiUrls

  api = BlockFrostApi(
      project_id='YOUR API KEY HERE',  # or export environment variable BLOCKFROST_PROJECT_ID
      
      base_url=ApiUrls.testnet.value,
  )
  try:
      health = api.health()
      print(health)   # prints object:    HealthResponse(is_healthy=True)
      health = api.health(return_type='json') # Can be useful if python wrapper is behind api version
      print(health)   # prints json:      {"is_healthy":True}
      health = api.health(return_type='pandas')
      print(health)   # prints Dataframe:         is_healthy
                      


      account_rewards = api.account_rewards(
          stake_address='stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7',
          count=20,
      )
      print(account_rewards[0].epoch)  # prints 221
      print(len(account_rewards))  # prints 20

      account_rewards = api.account_rewards(
          stake_address='stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7',
          count=20,
          gather_pages=True, # will collect all pages
      )
      print(account_rewards[0].epoch)  # prints 221
      print(len(account_rewards))  # prints 57

      address = api.address(
          address='addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz')
      print(address.type)  # prints 'shelley'
      for amount in address.amount:
          print(amount.unit)  # prints 'lovelace'

  except ApiError as e:
      print(e)
  ```



  ```python
  from blockfrost import BlockFrostIPFS, ApiError

  ipfs = BlockFrostIPFS(
      project_id='YOUR API KEY HERE'  # or export environment variable BLOCKFROST_PROJECT_ID
  )
  file_hash = None
  try:
      ipfs_object = ipfs.add('./README.md')
      file_hash = ipfs_object.ipfs_hash
      print(file_hash)
  except ApiError as e:
      print(e)

  try:
      with open('./README_downloaded.md', 'w') as file:
          file_data = ipfs.gateway(IPFS_path=file_hash).text
          file.write(file_data)
  except ApiError as e:
      print(e)
  ```



  Webhooks enable Blockfrost to push real-time notifications to your application. In order to prevent malicious actor from pretending to be Blockfrost every webhook request is signed. The signature is included in a request's `Blockfrost-Signature` header. This allows you to verify that the events were sent by Blockfrost, not by a third party.
  To learn more about Secure Webhooks, see [Secure Webhooks Docs](https://blockfrost.dev/docs/start-building/webhooks/).

  You can verify the signature using `verifyWebhookSignature` function.

  Example:

  ```python


  from flask import Flask, request, json
  from blockfrost import verify_webhook_signature, SignatureVerificationError

  SECRET_AUTH_TOKEN = "SECRET-WEBHOOK-AUTH-TOKEN"

  app = Flask(__name__)

  @app.route('/webhook', methods=['POST'])
  def webhook():
      if request.method == 'POST':
          
          request_bytes = request.get_data()
          try:
              verify_webhook_signature(
                  request_bytes, request.headers['Blockfrost-Signature'], SECRET_AUTH_TOKEN)
          except SignatureVerificationError as e:
              
              print('Webhook signature is invalid.', e)
              return 'Invalid signature', 403

          
          event = request.json

          print('Received request id {}, webhook_id: {}'.format(
              event['id'], event['webhook_id']))

          if event['type'] == "block":
              
              print('Received block hash {}'.format(event['payload']['hash']))
          elif event['type'] == "...":
              
          else:
              
              print('Unexpected event type {}'.format(event['type']))

          return 'Webhook received', 200
      else:
          return 'POST Method not supported', 405



  if __name__ == "__main__":
      app.run(host='0.0.0.0', port=6666)
  ```



  Install dependencies

  ```
  pip install -r requirements.txt
  pip install -r rest-requirements.txt
  ```

  Install package

  ```
   pip install .
  ```

  Run integration and unit tests:

  ```
  pytest
  ```

  _For integration tests you need to set env variable `BLOCKFROST_PROJECT_ID_MAINNET`_



  To release the package create a new release via GitHub releases.
  This action triggers the automated release workflow that packages and uploads the distribution to PyPI.


pkgId: 789a9cc89989677994deeba0f2bbd9baa1c5608d446abae63c24cd269c00cc96
name: python-blockingpy
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: Blocking records for record linkage and data deduplication based on ANN algorithms.
url: https://github.com/T-Strojny/BlockingPy
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockingpy-0.1.1-1.src.rpm
checksum_type: sha256
description:
  [![License](https://img.shields.io/github/license/T-Strojny/BlockingPy)](https://github.com/T-Strojny/BlockingPy/blob/main/LICENSE)

  Unfinished python port of [R's blocking package](https://github.com/ncn-foreigners/blocking) for blocking records for record linkage and data deduplication based on ANN algorithms.


pkgId: f280db6c3bdfcc19f289e92721538ca2745f681693f8265774fed6c87bde59ca
name: python-blockkit
arch: src
version: 1.9.2
epoch: 0
release: 1
summary: A fast way to build Block Kit interfaces in Python.
url: https://github.com/imryche/blockkit
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockkit-1.9.2-1.src.rpm
checksum_type: sha256
description:
  Blockkit is a Python library for building UI interfaces for Slack apps. It allows you to compose the interface from Python classes, so you type less, and your code becomes more maintainable.
  Blockkit performs validation at runtime and provides user-friendly errors when data is invalid.

  You don't even need to write code yourself. Go to [https://blockkit.botsignals.co](https://blockkit.botsignals.co) paste your JSON payload from [Block Kit Builder](https://api.slack.com/tools/block-kit-builder) and get corresponding Python code!
  ![Screenshot](https://github.com/imryche/blockkit/raw/master/images/generator.png)

  ```bash
  pip install blockkit
  ```

  Start with one of the `Home`, `Modal`, or `Message` surface classes and follow the structure as you would follow it in JSON.
  The library supports all types of [surfaces](https://api.slack.com/surfaces), [blocks](https://api.slack.com/block-kit), [block elements](https://api.slack.com/block-kit), and [composition objects](https://api.slack.com/block-kit) Slack provides.
  Once UI is ready, call the `build()` method to render components to dictionary:
  ```python
  from blockkit import Section, MarkdownText
  Section(text=MarkdownText(text="hello world")).build()
  {"type": "section", "text": {"text": "hello world", "type": "mrkdwn"}}
  ```
  Here's the list of types of components and corresponding classes:

  | Type          | Class        |
  | ------------- | ------------ |
  | home          | Home         |
  | modal         | Modal        |
  |               | Message      |
  | workflow_step | WorkflowStep |

  | Type      | Class      |
  | --------- | ---------- |
  | actions   | Actions    |
  | context   | Context    |
  | divider   | Divider    |
  | header    | Header     |
  | image     | ImageBlock |
  | input     | Input      |
  | rich_text | RichText   |
  | section   | Section    |

  | Type                       | Class                    |
  | -------------------------- | ------------------------ |
  | button                     | Button                   |
  | checkboxes                 | Checkboxes               |
  | datepicker                 | DatePicker               |
  | datetimepicker             | DatetimePicker           |
  | type                       | Image                    |
  | multi_static_select        | MultiStaticSelect        |
  | multi_users_select         | MultiUsersSelect         |
  | multi_channels_select      | MultiChannelsSelect      |
  | multi_conversations_select | MultiConversationsSelect |
  | multi_external_select      | MultiExternalSelect      |
  | overflow                   | Overflow                 |
  | plain_text_input           | PlainTextInput           |
  | radio_buttons              | RadioButtons             |
  | static_select              | StaticSelect             |
  | users_select               | UsersSelect              |
  | channels_select            | ChannelsSelect           |
  | conversations_select       | ConversationsSelect      |
  | external_select            | ExternalSelect           |
  | timepicker                 | TimePicker               |
  | rich_text_list             | RichTextList             |
  | rich_text_preformatted     | RichTextPreformatted     |
  | rich_text_quote            | RichTextQuote            |
  | rich_text_section          | RichTextSection          |
  | file_input                 | FileInput                |

  | Type       | Class                |
  | ---------- | -------------------- |
  | plain_text | PlainText            |
  | mrkdwn     | MarkdownText         |
  | text       | Text                 |
  | emoji      | Emoji                |
  |            | Style                |
  |            | Confirm              |
  |            | PlainOption          |
  |            | MarkdownOption       |
  |            | OptionGroup          |
  |            | Filter               |
  |            | DispatchActionConfig |

  Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
  Please make sure to update tests as appropriate.

  [MIT](https://choosealicense.com/licenses/mit/)


pkgId: c89bb2ef66435128a1e70e158531b7fc1a37706c372f9f7ee255a8a59e0fd88b
name: python-blocklib
arch: src
version: 0.1.11
epoch: 0
release: 1
summary: A library for blocking in record linkage
url: https://github.com/data61/blocklib
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blocklib-0.1.11-1.src.rpm
checksum_type: sha256
description:
  [![codecov](https://codecov.io/gh/data61/blocklib/branch/master/graph/badge.svg)](https://codecov.io/gh/data61/blocklib)
  [![Documentation Status](https://readthedocs.org/projects/blocklib/badge/?version=latest)](http://blocklib.readthedocs.io/en/latest/?badge=latest)
  [![Typechecking](https://github.com/data61/blocklib/actions/workflows/typechecking.yml/badge.svg)](https://github.com/data61/blocklib/actions/workflows/typechecking.yml)
  [![Testing](https://github.com/data61/blocklib/actions/workflows/python-test.yml/badge.svg)](https://github.com/data61/blocklib/actions/workflows/python-test.yml)
  [![Downloads](https://pepy.tech/badge/blocklib)](https://pepy.tech/project/blocklib)





  Python implementations of record linkage blocking techniques. Blocking is a technique that makes
  record linkage scalable. It is achieved by partitioning datasets into groups, called blocks and only
  comparing records in corresponding blocks. This can reduce the number of comparisons that need to be
  conducted to find which pairs of records should be linked.

  `blocklib` is part of the **Anonlink** project for privacy preserving record linkage.




  Install with pip:

      pip install blocklib



  You can find comprehensive documentation and tutorials in [readthedocs](http://blocklib.readthedocs.io/en/latest)



  Run unit tests with `pytest`::

      $ pytest




  If you run into bugs, you can file them in our [issue tracker](https://github.com/data61/blocklib/issues)
  on GitHub.

  There is also an [anonlink mailing list](https://groups.google.com/forum/#!forum/anonlink)
  for development discussion and release announcements.

  Wherever we interact, we strive to follow the [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)




  `blocklib` is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO).

  Licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.


pkgId: dc2cc6b6c706708f20059b347e41ad9e315334f2021f60f82f42749335248ee9
name: python-blocklist-aggregator
arch: src
version: 1.3.1
epoch: 0
release: 1
summary: Domains blocklist aggregator
url: https://github.com/dmachard/blocklist-aggregator
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blocklist-aggregator-1.3.1-1.src.rpm
checksum_type: sha256
description:
  ![Testing](https://github.com/dmachard/blocklist-aggregator/workflows/Testing/badge.svg) ![Build](https://github.com/dmachard/blocklist-aggregator/workflows/Build/badge.svg) ![Publish](https://github.com/dmachard/blocklist-aggregator/workflows/Publish/badge.svg)



  This python module does the aggregation of several ads/tracking/malware lists, and merges them into a unified list with duplicates removed.
  Create your own list from several sources.

  See the **[blocklist-domains](https://github.com/dmachard/blocklist-domains)** repository for an implementation.

  Default sources are defined on the [configuration file](../main/blocklist_aggregator/blocklist.conf)



  * [Installation](#installation)
  * [Get Started](#get-started)
  * [Custom Configuration](#custom-configuration)
  * [Fetch and save-it to files](#fetch-and-save-it-to-files)



  ![python 3.12.x](https://img.shields.io/badge/python%203.12.x-tested-blue) ![python 3.11.x](https://img.shields.io/badge/python%203.11.x-tested-blue) ![python 3.10.x](https://img.shields.io/badge/python%203.10.x-tested-blue) ![python 3.9.x](https://img.shields.io/badge/python%203.9.x-tested-blue) ![python 3.8.x](https://img.shields.io/badge/python%203.8.x-tested-blue)

  If you want to generate your own unified blocklist,
  install this module with the pip command.

  ```python
  pip install blocklist_aggregator
  ```



  This basic example enable to get a unified list of domains.
  You can save-it in a file or do what you want.

  ```python
  import blocklist_aggregator

  unified = blocklist_aggregator.fetch()
  print(unified)
  [ "doubleclick.net", ..., "telemetry.dropbox.com" ]

  print(len(unified))
  152978
  ```



  See the default [configuration file](../main/blocklist_aggregator/blocklist.conf)

  The configuration contains:

  * the ads/tracking/malware URL lists with the pattern (regex) to use
  * the domains list to exclude (whitelist)
  * additionnal domains list to block (blacklist)

  The configuration can be overwritten at runtime.

  ```python
  cfg_yaml = "verbose: true"
  unified = blocklist_aggregator.fetch(cfg_update=cfg_yaml)
  ```

  or loaded from external config file

  ```python
  unified = blocklist_aggregator.fetch(cfg_filename="/home/custom-blocklist.conf")
  ```



  This module can be used to export the list in several format:

  * text
  * hosts
  * CDB (key/value database)

  ```python
  import blocklist_aggregator


  unified = blocklist_aggregator.fetch()


  blocklist_aggregator.save_raw(filename="/tmp/unified_list.txt")


  blocklist_aggregator.save_hosts(filename="/tmp/unified_hosts.txt", ip="0.0.0.0")


  blocklist_aggregator.save_cdb(filename="/tmp/unified_domains.cdb")
  ```



  Run test units

  ```bash
  python3 -m unittest discover tests/ -v
  ```


pkgId: bf589d7dc59ddf4666c8ac281b6544d05273952cd3b9ffaa1ff0e7a174f794cd
name: python-blockmango
arch: src
version: 1.5.1
epoch: 0
release: 1
summary: Blockman Go API package
url: https://github.com/darkkpy/blockmango
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blockmango-1.5.1-1.src.rpm
checksum_type: sha256
description:
   ![logo](https://i.ibb.co/mHCXSC3/images-28.jpg)

  This Python package provides a convenient way to interact with the Blockmango API.



  You can install the package via pip:

  ```bash
  pip install blockmango
  ```



  For detailed usage instructions and examples, please refer to the documentation in the `docs` folder.

  For more information on available methods and parameters, contact me on discord, darkk.py.



  This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.


pkgId: cf717e1342f54d0bc2795fab264f7e869ca1eb5ec1b3116065cede7f5a3d94e0
name: python-blocksciencelabs
arch: src
version: 0.1.21
epoch: 0
release: 1
summary: BlockScience Labs Python SDK
url: https://github.com/blockscience-labs/labs-sdk
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blocksciencelabs-0.1.21-1.src.rpm
checksum_type: sha256
description:
  - Make changes
  - Test
  - Update version in setup.cfg

  Build:
  ```bash
  python3 -m build
  ```

  Publish:
  ```bash
  python3 -m twine upload dist/*
  ```


pkgId: ca486c30cd3de9b98e8669077cd38943968b6f4961b0d5224d825aa37679f1f3
name: python-blofin
arch: src
version: 0.4.5
epoch: 0
release: 1
summary: BloFin API SDK
url: https://github.com/nomeida/blofin-python
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blofin-0.4.5-1.src.rpm
checksum_type: sha256
description:
  A Python SDK for the BloFin API, providing easy access to BloFin's trading platform functionalities.



  You can install the BloFin API SDK using pip:

  ```bash
  pip install blofin
  ```



  Here's a quick example of how to use the BloFin API SDK:

  ```python
  from blofin import BloFinClient


  client = BloFinClient(
      api_key='your_api_key',
      api_secret='your_api_secret',
      passphrase='your_passphrase',
      use_server_time=False, #Default: False - If you want to use BloFin's server time for requests
  )



  ```



  The SDK provides access to various APIs:



  The Public API allows you to access public market data without authentication.

  ```python

  instruments = client.public.get_instruments(inst_type='SWAP')


  tickers = client.public.get_tickers(inst_id='BTC-USDT')


  order_book = client.public.get_order_book(inst_id='BTC-USDT', size=20)


  candles = client.public.get_candlesticks(inst_id='BTC-USDT', bar='1m', limit=100)
  ```



  The Account API allows you to manage your account information and perform account-related operations.

  ```python

  balance = client.account.get_balance(account_type='futures')


  transfer = client.account.funds_transfer(
      currency='USDT',
      amount=100,
      from_account='funding',
      to_account='futures'
  )


  deposits = client.account.get_deposit_history(currency='USDT', limit=10)
  ```



  The Trading API allows you to place and manage orders, as well as retrieve trading-related information.

  ```python

  order = client.trading.place_order(
      inst_id='BTC-USDT',
      margin_mode='cross',
      position_side='long',
      side='buy',
      order_type='limit',
      price=30000,
      size=0.01
  )


  positions = client.trading.get_positions(inst_id='BTC-USDT')


  cancel = client.trading.cancel_order(inst_id='BTC-USDT', order_id='123456')


  history = client.trading.get_order_history(inst_id='BTC-USDT', limit=50)
  ```



  1. **API Credentials**: To use authenticated endpoints, you need to provide your BloFin API credentials (API key, API secret, and passphrase) when initializing the client.

  2. **Rate Limiting**: Be aware of BloFin's rate limits for API requests. Exceeding these limits may result in temporary blocks or account suspension.

  3. **Error Handling**: The SDK uses custom exceptions to handle various error scenarios. Always wrap your API calls in try-except blocks to handle potential errors gracefully.

  4. **Pagination**: Some methods that return lists of items (e.g., order history) support pagination. Use the `before`, `after`, and `limit` parameters to navigate through large result sets.

  5. **Server Time**: If you experience timestamp-related issues, you can initialize the client with `use_server_time=True` to use BloFin's server time for requests.



  Contributions to the BloFin API SDK are welcome! Please refer to the project's GitHub repository for information on how to contribute, report issues, or request features.



  - Websocket support



  This project is licensed under the MIT License. See the LICENSE file for details.



  This SDK is not officially associated with BloFin.


pkgId: ec54fa832b6cae2297fab13a62e1379a21adc12a25aae8f4cac6b0396c858903
name: python-blog-app
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: A simple blog application with Flask backend
url: https://gitlab.com/y.karzal/2024_assignment2_blogpss
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blog-app-0.1.0-1.src.rpm
checksum_type: sha256
description:
  A simple blog application built with Flask and HTML/JavaScript.



  - View all blog posts
  - Add new posts
  - Automatic timestamps for each post



  1. Clone the repository
  ```bash
  git https://gitlab.com/y.karzal/2024_assignment2_blogpss
  cd 2024_assignment2_blogpss
  ```

  2. Set up the backend
  ```bash
  cd backend
  python -m venv venv
  source venv/bin/activate  # On Windows use: venv\Scripts\activate
  pip install -r requirements.txt
  ```

  3. Run the application
  ```bash
  python app.py
  ```

  4. Open the frontend
  - Open `frontend/index.html` in your browser
  - The API will be available at `http://localhost:5000`



  ```
  blog-app/
  ├── backend/
  │   ├── app.py
  │   ├── database.py
  │   ├── requirements.txt
  │   └── tests/
  └── frontend/
      ├── index.html
      ├── css/
      └── js/
  ```



  Run backend tests:
  ```bash
  cd backend
  pytest tests/
  ```


pkgId: e49d6d5df0afff2ac8cdcc9c3011500a2b5aa6df96a9e108675e5f3fede8d547
name: python-blog-coeur
arch: src
version: 0.0.12
epoch: 0
release: 1
summary: Coeur - static site management
url: https://github.com/sr2ds/coeur
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blog-coeur-0.0.12-1.src.rpm
checksum_type: sha256
description:
  Coeur is being made based on [Typer](https://typer.tiangolo.com/) (Thanks @tiangolo).



  "cœur" is a French word for "core" or "heart".

  This tool is called Coeur for two personal reasons: 1. it will be the core of my blog-farm; 2. one of my favorite places is the Sacre ***Cœur*** in Paris.



  I'm bringing Coeur to the world to solve some specific problems that I'm dealing with when trying to manage big blogs as static sites. By big, I mean more than 100.000 post files.

  Imagine the following scenario: You have a set of blogs with a lot of content, they can be within WordPress or any tool of this kind. The more content and traffic your blog has, the more you'll need to worry about your infrastructure.

  Some time ago, I migrated my blog projects to SSG, which means only static content generated with the contents, and I can keep all of them hosted for free using GitHub Pages or Netlify.

  The problem is that the SSG tools available today are not optimized for this amount of content, and with artificial intelligence, it is very practical to generate quality content on a large scale.

  So, Coeur will solve this. It will be a tool that will allow me to build larger blogs and continue to maintain them for free, allowing me to explore other content niches and generate more and more content for my users.

  This tool is being built based on several years of experience I have with creating blogs/sites using various tools, including WordPress, VuePress, VitePress, Zola, and probably some others that were less relevant in my tests.

  If I were to summarize Coeur in a single sentence, considering the end of the project where we will have all modules ready and not just the SSG, I would say:

  The complete tool for building blogs with over a million posts and hosting them for free.



  Coeur is a common python package, you can install from pypi:

  ```sh
  pip install --user blog-coeur
  ```

  The command to be used is `blog-coeur` and get `help` to start to use:

  ```sh
  blog-coeur --help
  ```



  The first module of `coeur` is the `ssg` to be possible to build a complete static website from a `sqlite` database and also the base feature to import from markdown to database.





  To start your project, you can run the `create` command with your new project name, this command will to create the new folder with the basic stuff to work:

  ```sh
  blog-coeur ssg create my-blog
  ```



  To build the blog we need some local server to simplify or life, you can run this command inside of coeur project to use a simple locally server:

  ```sh
  blog-coeur ssg server --max-posts=1000 --port=8081
  ```

  The param `max-posts` will be useful when you post has some much posts, this way the build will be more fast in development time.



  To build your blog, you can run the `build` command inside the blog directory:

  ```sh
  blog-coeur ssg build
  ```

  The blog will be generated inside the directory "public".



  If you are using the `Zola Framework` and want to migrate to Coeur, you can import your markdown files into the Coeur database.

  Considering that you are inside the Coeur Blog repository, copy the posts directory here and run the command replacing "./content" for your posts directory.

  ```sh
  blog-coeur ssg markdown-to-db "./content"
  ```



   * Import markdown files from Zola Framework
   * Basic template for blog usage, based on zolarwind (thanks for @thomasweitzel)
   * HTML Minify
   * Sitemap Generation with pagination
   * Hot reload

   

  - [ ] Custom templates (themes)
      - [ ] Documentation about templates
  - [ ] Allow to manage the posts from SQLAlchemyAdmin dashboard
  - [ ] Support to use post Tags
  - [ ] Hot reload v2 - add websocket to auto-refresh the html in the browser



  The CMP module was designed to simplify content creation powered by the OpenAI API.



  The content will be created as posts inside the blog's SQLite database, which is generated by the ssg module. It's important to start your project using the ssg command.

  Assuming you already have the blog created with Coeur, you need to setting up your open-ai key in the `.env` file and then you can use the cmp module as follows:

  ```
  blog-coeur cmp title-to-post "Aguas de Lindóia" --custom-prompt="Create a full article about the city, need to be funny and talking in positive way about the place"

  ```

  The first parameter is required and will be the title of the post.

  It is highly recommended to use a custom-prompt to enhance your experience and get better results. This prompt can be in any language.

  You can also set the img-url parameter to include an image in the post. This needs to be a valid image URL, such as one hosted on S3.




  This module will help us to automatically publish the blog posts in the social midias.



  My initial goal was to be able to build my project without exploding my RAM memory as happened with all the frameworks I tried and used throughout the growth of my blog, these benchmark numbers below are the real numbers for the same blog that consumes 12GB to be built with Zola.

  It is possible that I can optimize the build time to make it faster, however, it will consume a little more RAM memory. For now it's acceptable.


  Importing 103594 posts from Zola markdowns from command `blog-coeur ssg markdown-to-db ./content`:

  ```sh
  Processed: 103594 | Duration: 00:02:11.162591
  Debug: RSS: 934.58 MB | VMS: 957.69 MB | Data: 925.75 MB | USS: 922.11 MB | PSS: 923.16 MB | CPU: 71.00%
  ```

  This is the final debug line, spending around 934.58 MB to do all importation in 02 minutes.

  Remembering that you need do it only one time.



  The current build is taking 05 minutes and consuming around 362 MB of RSS, with the `minify=false`:

  ```sh
  Processed: 103594 | Duration: 00:05:19.639324
  Debug: RSS: 362.93 MB | VMS: 629.91 MB | Data: 388.62 MB | USS: 350.16 MB | PSS: 351.26 MB | Processed: 103594 | CPU: 99.40%
  ```




  This is an open-source project, and I need help to make it better.

  If you are a developer, feel free to contact me to work on items from my personal roadmap, or you can suggest something new. Be free, let's do it together.

  If you are a company, contact me to support the growth of my project. I'm open to improve it for specifics new use-cases.


pkgId: 4d30aaa3a37bc20a162f2705d4471d3398a5f38aabba9a795b2d37a08cd17e45
name: python-blog-coeur
arch: src
version: 0.0.14
epoch: 0
release: 1
summary: Coeur - static site management
url: https://github.com/sr2ds/coeur
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blog-coeur-0.0.14-1.src.rpm
checksum_type: sha256
description:
  Coeur is just another Python tool to generate static sites with thousands of pages, with a bit of extra power.



  "cœur" is a French word for "core" or "heart".

  This tool is called Coeur for two personal reasons: 1. it will be the core of my blog-farm; 2. one of my favorite places is the Sacre ***Cœur*** in Paris.



  Coeur is a common python package, you can install from pypi:

  ```sh
  pip install --user blog-coeur
  ```

  The command to be used is `blog-coeur` and get `help` to start to use:

  ```sh
  blog-coeur --help
  ```



  The `ssg` module in **Coeur** allows you to create a static website from a `sqlite` database and import content from markdown files.





  To start a new project, run the `create` command:

  ```
  blog-coeur ssg create my-blog
  ```



  Run a simple local server to build your blog:

  ```
  blog-coeur ssg server --max-posts=1000 --port=8081
  ```



  Manage your blog’s posts through a simple web interface:

  ```
  blog-coeur ssg admin
  ```

  Go to: `http://localhost:8000/admin`



  Build your blog with the `build` command:

  ```
  blog-coeur ssg build
  ```

  The blog will be generated in the `public` folder.



  To import your markdown files from Zola Framework to Coeur:

  ```
  blog-coeur ssg markdown-to-db "./content"
  ```



  - Import markdown files from Zola Framework
  - Basic blog template based on Zolarwind
  - HTML Minification
  - Sitemap generation with pagination
  - Hot reload
  - Post management via SQLAlchemyAdmin dashboard (partial)

   

  - [ ] Custom templates (themes)
      - [ ] Documentation about templates
  - [ ] Support to use post Tags
  - [ ] Hot reload v2 - add websocket to auto-refresh the html in the browser
  - [ ] Manage posts - fixes for multiple databases




  The CMP module was designed to simplify content creation powered by the OpenAI API.



  The content will be created as posts inside the blog's SQLite database, which is generated by the ssg module. It's important to start your project using the ssg command.

  Assuming you already have the blog created with Coeur, you need to set up your OpenAI key in the `.env` file and then you can use the cmp module as follows:

  ```
  blog-coeur cmp title-to-post "Aguas de Lindóia" --custom-prompt="Create a full article about the city, need to be funny and talking in a positive way about the place"
  ```

  The first parameter is required and will be the title of the post.

  It is highly recommended to use a custom-prompt to enhance your experience and get better results. This prompt can be in any language.

  You can also set the `img-url` parameter to include an image in the post. This needs to be a valid image URL, such as one hosted on S3.




  This module will help us to automatically publish the blog posts on social media.

  ```
  blog-coeur pds publish [OPTIONS] CHANNELS:{instagram}...
  ```



  This is an open-source project, and I need help to make it better.

  If you are a developer, feel free to contact me to work on items from my personal roadmap, or you can suggest something new. Be free, let's do it together.

  If you are a company, contact me to support the growth of my project. I'm open to improve it for specifics new use-cases.


pkgId: 05572874149533369548457d121b239e297265b02432ff1d661e5b2672a792ba
name: python-blognajd
arch: src
version: 1.1.1
epoch: 0
release: 1
summary: Simple django blogging application
url: http://pypi.python.org/pypi/blognajd/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blognajd-1.1.1-1.src.rpm
checksum_type: sha256
description:
  A simple pluggable well maintained django blogging application, tested and fully compatible with Django 1.8 and Python 3.4.


pkgId: 0081eb3ee58db1250e179cbc811f4ec3fa62985649c936de8c7f22321e95dc01
name: python-blogspotapi
arch: src
version: 1.0.2
epoch: 0
release: 1
summary: Python Blogspot API Wrapper
url: https://github.com/diegoami/blogspotapi/
rpm_license: BSD License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blogspotapi-1.0.2-1.src.rpm
checksum_type: sha256
description:
  Blogspot API



  * client_secrets_yt.json (youtube)
  * client_secrets.json (blogger)

  * amara/amara_env.py (use amara_env_template.py as example)


pkgId: 5c4ada3bfce8a982206bd9de6a79202c3555d267321c846036a88feaa5497672
name: python-blok
arch: src
version: 0.0.20
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://pypi.org/project/blok/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-blok-0.0.20-1.src.rpm
checksum_type: sha256
description:
  Blok is designed to be intergrated into existing projects that want to programmatically created docker compose projects, suitable
  for development and production environments. The main goal is to allow the user to create a project with a high level of configurability
  and reusability.
  blok is following the principles of depencency injection and inversion of control to create a project
  from various "bloks" (i.e configurable services).




  ```bash
  pip install blok
  ```



  Create a new python file `my_cli.py` and add the following code:

  ```python my_cli
  from blok import blok, ExecutionContext, Option, service
  from blok.cli import create_cli
  from typing import Protocol


  @service("io.blok.minio")
  class MinioService(Protocol):

      def register_bucket(self, bucket: str):
          ...

  @blok(MinioService, options=[Option("port", type=int, default=9000)])
  class MinioBlok:
      buckets: list[str]

      def preflight(self, port: int):
          self.buckets = []
          self.port = port

      def register_bucket(self, bucket: str):
          self.buckets.append(bucket)
          return bucket

      def build(self, context: ExecutionContext):
          service = {
              "image": "minio/minio",
              "command": ["server", "/data"],
              "volumes": [],
          }

          for bucket in self.buckets:
              context.file_tree.set_nested("mounts", bucket, {})
              service["command"].append(f"/data/{bucket}")
              service["volumes"].append(f"./mounts/{bucket}:/data/{bucket}")

          context.docker_compose.set_nested("services", "minio", service)


  @blok("io.blok.data", options=[Option("port", type=int, default=8080)])
  class DataBlok:
      port: int


      def preflight(self, minio: MinioBlok, port: int):
          self.port = port
          minio.register_bucket("data")
          minio.register_bucket("logs")

      def build(self, context: ExecutionContext):
          image = {
              "image": "dependend",
              "command": ["web-service", "--port", self.port],
          }
          context.docker_compose.set_nested("services", "data", image)


  cli = create_cli(MinioBlok(), DataBlok())

  if __name__ == "__main__":
      cli()

  ```

  And now you can run the script to generate the docker-compose file

  ```bash
  python my_cli.py build data .
  ```

  This will starting from the data blok, resolve all dependencies and build the docker-compose setup
  in the directory creating a `docker-compose.yml` file and the necessary mounts.


  ```tree
  - my_cli.py
  - docker-compose.yml
  - mounts
      - data
      - logs
  ```




  All bloks can register options that can be passed to the blok via the cli (or in the future other renderers). The options are passed to the blok by prepending the blok name (or the blok class name) with `--` and the option name. For example to pass the port to the data blok you can run:

  ```bash

  python my_cli.py build data --data-port 8080
  ```



  The blok project is designed to be diffable. This means that you can run the script multiple times and the output will be the same. This is achieved by using a file tree to store the state of the project and only writing the changes to the file system once you confirm it. Also
  if you run the script with one argument it will only show the changes that will be made to the project.

  ```bash
  python my_cli.py build data --data-port 8080
  ```

  Wil Resulst in:

  ```
  Differences
  ├── Will Modify: /docker-compose.yml/services/data/command/2/a
  │     Old: 7000
  │     New: 8080
  └── Will Modify: /__blok__.yml/data_port
        Old: 7000
        New: 8080
  ```
  You can then choose to apply the changes.



  Bloks can define dependencies on other bloks by adding them as arguments to the `preflight` method. The blok will then be resolved and passed to the blok. For example the `DataBlok` has a dependency on the `MinioService` and can access it via the `minio` argument in the `preflight` method.



  One of the core ideas is that services that bloks can depend on
  have various implementations. For example you could create a custom implemention of the MinioService and other bloks that depend on the MinioService could on dependency resolution choose the custom implementation.

  You can force a specific blok by passing the `-b` flag to the cli. For example to force the MinioService

  ```
  python my_cli.py build data -b minio
  ````


pkgId: 98c108273ee1103c5187009bf61c6c8bd2f25154e7a59419245629d7245b907f
name: python-bloodyAD
arch: src
version: 2.0.7
epoch: 0
release: 1
summary: AD Privesc Swiss Army Knife
url: https://github.com/CravateRouge/bloodyAD
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bloodyAD-2.0.7-1.src.rpm
checksum_type: sha256
description:
  > :warning: autobloody has been moved to its own [repo](https://github.com/CravateRouge/autobloody)



  `bloodyAD` is an Active Directory privilege escalation swiss army knife



  This tool can perform specific LDAP calls to a domain controller in order to perform AD privesc.

  `bloodyAD` supports authentication using cleartext passwords, pass-the-hash, pass-the-ticket or certificates and binds to LDAP services of a domain controller to perform AD privesc.

  Exchange of sensitive information without LDAPS is supported.

  It is also designed to be used transparently with a SOCKS proxy.


  Simple usage:

  ```ps1
  bloodyAD --host 172.16.1.15 -d bloody.local -u jane.doe -p :70016778cb0524c799ac25b439bd6a31 set password john.doe 'Password123!'
  ```

  See the [wiki](https://github.com/CravateRouge/bloodyAD/wiki) for more.


  Like this project? Donations are greatly appreciated :relaxed: [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/CravateRouge)

  Need personalized support? send me an [email](mailto:baptiste.crepin@ntymail.com) for trainings or custom features.


  - Thanks to [@skelsec](https://github.com/skelsec) for his amazing libraries especially [MSLDAP](https://github.com/skelsec/msldap) which is now the engine on which bloodyAD is running.
  - Thanks to [impacket](https://github.com/fortra/impacket) contributors. [Structures](https://github.com/fortra/impacket/blob/master/impacket/structure.py) and several [LDAP attacks](https://github.com/fortra/impacket/blob/master/impacket/examples/ntlmrelayx/attacks/ldapattack.py) are based on their work.
  - Thanks to [@PowerShellMafia](https://github.com/PowerShellMafia) team ([PowerView.ps1](https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1)) and their work on AD which inspired this tool.
  - Thanks to [@dirkjanm](https://github.com/dirkjanm) ([adidnsdump.py](https://github.com/dirkjanm/adidnsdump)) and ([@Kevin-Robertson](https://github.com/Kevin-Robertson))([Invoke-DNSUpdate.ps1](https://github.com/Kevin-Robertson/Powermad/blob/master/Invoke-DNSUpdate.ps1)) for their work on AD DNS which inspired DNS functionnalities.
  - Thanks to [@p0dalirius](https://github.com/p0dalirius/) and his [pydsinternals](https://github.com/p0dalirius/pydsinternals) module which helped to build the shadow credential attack


pkgId: 2436659f017758616cf15ce8d802db6822e3cc1361f4dd53f590b6898bd6173f
name: python-bloodyAD
arch: src
version: 2.0.8
epoch: 0
release: 1
summary: AD Privesc Swiss Army Knife
url: https://github.com/CravateRouge/bloodyAD
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bloodyAD-2.0.8-1.src.rpm
checksum_type: sha256
description:
  > :warning: autobloody has been moved to its own [repo](https://github.com/CravateRouge/autobloody)



  `bloodyAD` is an Active Directory privilege escalation swiss army knife



  This tool can perform specific LDAP calls to a domain controller in order to perform AD privesc.

  `bloodyAD` supports authentication using cleartext passwords, pass-the-hash, pass-the-ticket or certificates and binds to LDAP services of a domain controller to perform AD privesc.

  Exchange of sensitive information without LDAPS is supported.

  It is also designed to be used transparently with a SOCKS proxy.


  Simple usage:

  ```ps1
  bloodyAD --host 172.16.1.15 -d bloody.local -u jane.doe -p :70016778cb0524c799ac25b439bd6a31 set password john.doe 'Password123!'
  ```

  See the [wiki](https://github.com/CravateRouge/bloodyAD/wiki) for more.


  Like this project? Donations are greatly appreciated :relaxed: [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/CravateRouge)

  Need personalized support? send us an [email](mailto:contact@cravaterouge.com) or check our website [cravaterouge.com](https://cravaterouge.com/?utm_source=bloodyad_readme) to see all our cybersecurity services.


  - Thanks to [@skelsec](https://github.com/skelsec) for his amazing libraries especially [MSLDAP](https://github.com/skelsec/msldap) which is now the engine on which bloodyAD is running.
  - Thanks to [impacket](https://github.com/fortra/impacket) contributors. [Structures](https://github.com/fortra/impacket/blob/master/impacket/structure.py) and several [LDAP attacks](https://github.com/fortra/impacket/blob/master/impacket/examples/ntlmrelayx/attacks/ldapattack.py) are based on their work.
  - Thanks to [@PowerShellMafia](https://github.com/PowerShellMafia) team ([PowerView.ps1](https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1)) and their work on AD which inspired this tool.
  - Thanks to [@dirkjanm](https://github.com/dirkjanm) ([adidnsdump.py](https://github.com/dirkjanm/adidnsdump)) and ([@Kevin-Robertson](https://github.com/Kevin-Robertson))([Invoke-DNSUpdate.ps1](https://github.com/Kevin-Robertson/Powermad/blob/master/Invoke-DNSUpdate.ps1)) for their work on AD DNS which inspired DNS functionnalities.
  - Thanks to [@p0dalirius](https://github.com/p0dalirius/) and his [pydsinternals](https://github.com/p0dalirius/pydsinternals) module which helped to build the shadow credential attack


pkgId: 053bb1e5b177d5f29f15ba56da370c74d4d7a2c434c9e0b96ec67fbe5fc8931d
name: python-bloom
arch: src
version: 0.12.0
epoch: 0
release: 1
summary: Bloom is a release automation tool.
url: http://www.ros.org/wiki/bloom
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bloom-0.12.0-1.src.rpm
checksum_type: sha256
description:
  Bloom provides tools for releasing software on top of a git repository and leverages tools and patterns from git-buildpackage. Additionally, bloom leverages meta and build information from catkin (https://github.com/ros/catkin) to automate release branching and the generation of platform specific source packages, like debian's src-debs.


pkgId: 4a46f3e42d3cad5d56f3b0702632dec320d1a8c7c8f8e738d94e7c4a8d8be0d7
name: python-bloom-filter
arch: src
version: 1.3.3
epoch: 0
release: 1
summary: Pure Python Bloom Filter module
url: https://github.com/hiway/python-bloom-filter
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bloom-filter-1.3.3-1.src.rpm
checksum_type: sha256
description:
  Note: This project has gone unmaintained for a while,
  please use the more up-to-date project at:
  - https://github.com/remram44/python-bloom-filter
  - https://pypi.org/project/bloom-filter2/

  A pure python bloom filter (low storage requirement, probabilistic
  set datastructure) is provided.  It is known to work on CPython 2.x,
  CPython 3.x, Pypy and Jython.

  Includes mmap, in-memory and disk-seek backends.

  The user specifies the desired maximum number of elements and the
  desired maximum false positive probability, and the module
  calculates the rest.

  Usage:

  ::

      from bloom_filter import BloomFilter

      
      
      
      
      
      bloom = BloomFilter(max_elements=10000, error_rate=0.1)

      
      assert "test-key" in bloom is False

      
      bloom.add("test-key")

      
      assert "test-key" in bloom is True


pkgId: 205325c32b7b94a90bb32b9ac992034e9dc905575db9867a63b6a89604a8ab9f
name: python-bloomfilter-py
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Yet another bloomfilter implementation in Python
url: https://github.com/OldPanda/bloomfilter-py
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bloomfilter-py-1.1.0-1.src.rpm
checksum_type: sha256
description:
  ![](https://img.shields.io/pypi/v/bloomfilter-py.svg)
  ![](https://img.shields.io/pypi/pyversions/bloomfilter-py.svg)
  [![codecov](https://codecov.io/gh/OldPanda/bloomfilter-py/branch/master/graph/badge.svg?token=RBX1JK7P7O)](https://codecov.io/gh/OldPanda/bloomfilter-py)
  [![Downloads](https://pepy.tech/badge/bloomfilter-py)](https://pepy.tech/project/bloomfilter-py)


  Yet another Bloomfilter implementation in Python, compatible with Java's Guava library.

  I was looking for a Python library which is capable of reading what Bloomfilter of Java's Guava library serializes and is also able to output byte array which is recognizable by Java. But unfortunately failed. Hence I developed this library by borrowing how Guava implements Bloomfilter serialization/deserialization a lot to deal with Bloomfilters on both Python and Java sides.

  As for Bloomfilter usage in Java world, please refer to [this post](https://www.baeldung.com/guava-bloom-filter).

  Here's a brief [introduction](https://en.wikipedia.org/wiki/Bloom_filter) to Bloomfilter.


  * Python 3.8+


  ```
  pip install bloomfilter-py
  ```




  ```Python
  >>> from bloomfilter import BloomFilter
  >>> bloom_filter = BloomFilter(expected_insertions=500, err_rate=0.01)
  >>> for i in range(100):
  ...     bloom_filter.put(i)
  ...
  >>> 1 in bloom_filter
  True
  >>> 100 in bloom_filter
  False
  >>>
  ```


  You can easily serialize `BloomFilter` instance to a byte array
  ```Python
  >>> dumps = bloom_filter.dumps()
  >>> with open("dumps.out", "wb") as f:
  ...     f.write(dumps)
  ...
  >>>
  ```

  or to a hex string
  ```Python
  >>> hex_str = bloom_filter.dumps_to_hex()
  ```

  or to a base64 encoded bytes
  ```Python
  base64_bytes = bloom_filter.dumps_to_base64()
  ```


  And you can easily initialize a `BloomFilter` instance from a byte array
  ```Python
  >>> with open("dumps.out", "rb") as f:
  ...     bf = BloomFilter.loads(f.read())
  ...
  >>> 1 in bf
  True
  >>> 100 in bf
  False
  >>>
  ```

  or from a hex string
  ```Python
  >>> bf = BloomFilter.loads_from_hex(hex_str)
  >>> 1 in bf
  True
  >>> 100 in bf
  False
  ```

  or from a base64 encoded bytes
  ```Python
  >>> bf = BloomFilter.loads_from_base64(base64_bytes)
  >>> 100 in bf
  False
  >>> 200 in bf
  False
  >>> 1 in bf
  True
  >>> 99 in bf
  True
  ```

rpm_license:
  MIT License  Copyright (c) 2020 OldPanda  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


