# packages

pkgId: 5fa13a6c8b4eae390a460b99e9ed92cb8856d3600124698922665dbc291a444c
name: python-ckanext-saml
arch: src
version: 0.3.4.post1
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://github.com/DataShades/ckanext-saml
rpm_license: AGPL
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckanext-saml-0.3.4.post1-1.src.rpm
checksum_type: sha256
description:
  Adds an ability to login from other source (known as
  [IdP](https://en.wikipedia.org/wiki/Identity_provider_(SAML))) using
  [SAML2](https://en.wikipedia.org/wiki/SAML_2.0) standard. Your instance is
  presented as the [SP](https://en.wikipedia.org/wiki/Service_provider_(SAML)).


  ``ckanext-saml`` uses ``python3-saml`` library in order to make requests to the
  IdP and return responses from it. Github repository can be found
  [here](https://github.com/onelogin/python3-saml). There you can also find
  examples of fields that can be used in ``settings.json`` and
  ``advanced_settings.json``.



  To install ``ckanext-saml``:

  1. Install additional packages (example is shown for CentOS):

  		yum install python3-devel xmlsec1-devel libtool-ltdl-devel

  1.  Install extension:

  		pip install ckanext-saml

  1. Add ``saml`` to the ``ckan.plugins`` setting in your CKAN config file.

  1. Initialize new table (if you previously used
     [ckanext-saml2](https://github.com/datashades/ckanext-saml2), you can skip
     this step or make sure that you have saml2_user table in your DB):

  		ckan db upgrade -p saml

  If error that mentioned below appears on CentOS, you might need to install
  additional packages - ``yum install libxml2-devel xmlsec1-devel
  xmlsec1-openssl-devel libtool-ltdl-devel``:

  		import xmlsec
  		SystemError: null argument to internal routine



  Before start configuring, make sure that the config setting
  ``ckan.saml_custom_base_path`` is set if your config file is not stored at
  ``/etc/ckan/default`` directory.

  Copy the ``saml`` folder from ``ckanext-saml`` into the directory where your
  CKAN config file is placed:

  		cp -R saml_example/saml YOUR_CONFIG_DIRECTORY/saml

  Open the ``settings.json`` file that is in your copied ``saml`` folder in order
  to modify it.

  **Configure main settings file**

  The main sections that should be updated within the file are ``sp`` and ``idp``

  In order to make it more clear lets start from configuring ``idp``:

  1. Modify ``entityId`` by filling it with the ``entityID`` that should be
     present in the ``idp_metadata.xml`` file (name of the file can be different)
     that is been sent to you by the IdP.

  2. Modify ``url`` in ``singleSignOnService``. You can find this ``url`` in
     ``idp_metadata.xml`` at ``SingleSignOnService`` section, it should have
     ``Location`` attribute where the url is specified.

  3. Modify ``x509cert`` by filling it with the`` X509Certificate`` that should
     be present in ``idp_metadata.xml``. Make sure the this set as a **single
     line string**.

  **Note**:  ``singleLogoutService`` is not implemented.

  Modifications for ``sp`` (CKAN):

  1. Modify ``entityId`` with the domain name of your portal.

  2. Modify ``url`` in ``assertionConsumerService`` with the domain name of your
     portal plus adding ``/saml/`` at the end. This is the URL where IdP will
     send back the reponse with User Data. Make sure the the slash is present in
     the end of the URL.

  ``advanced_settings.json`` is used for additional configurations such as
  security.  It also needed to modify the ``contactPerson`` and ``organization``
  sections in it if your are going to provide your SP data to your IdP.

  After updating all mentioned values in ``settings.json``, at
  ``DOMAIN_NAME/saml/metadata URL`` you can find the ``sp.xml`` generated, which
  you can provide to the IdP for configuration on their side.

  The main infomation that is needed for the IdP is the
  ``AssertionConsumerService``(ACS) which is should be set on their APP for
  SAML. ``AssertionConsumerService`` should match to what you have in your
  settings.json and IdP APP, otherwise errors might appear.




  - ``ckan.saml_use_https`` - Used to send data while **https**, set ``on`` to
    enable it. By **default** is set to ``off`` and uses **http**.

  - ``ckan.saml_use_nameid_as_email`` - Set to ``true`` if you want to use NameID
    as an email for the User in order not to claim it additionally from the
    IdP. Default is set to ``false``.

  - ``ckan.saml_login_button_text`` - Provides an ability to customize login
    button text. By **default** set to ``SAML Login``.

  - ``ckan.saml_custom_base_path`` - Provides custom path where saml
    files/folders will be searched. By **default** set to
    ``/etc/ckan/default/saml``.

  - ``ckan.saml_custom_attr_map`` - Used to modify mapper filename. By
    **default** searches for ``mapper.py``.

  - ``ckan.saml_use_root_path`` - This needs to be set to ``true`` if you run
    your portal using the ``ckan.root_path``. By **default** set to ``false``.

  - ``ckan.saml_relaystate`` - Set a custom RelayState ``path``. By **default**
    set to ``/dashboard``.



  As mentioned above, you can find SP metadata at ``DOMAIN_NAME/saml/metadata
  URL`` after configuring ``advanced_settings.json``.  This **URL** is accessible
  only to ``sysadmins`` and presented in **XML** format.  Additional tab on
  ``/ckan-admin/`` is added, that leads to this page.



  In order to encrypt the coming data from the IdP use ``advanced_settings.json``
  file. In ``security`` section, you can enable encryption for NAMEID and all
  other data that will be returned to the SP.

  If you enable one of
  ``authnRequestsSigned``,``logoutRequestSigned``,``logoutResponseSigned``,``wantAssertionsEncrypted``,
  ``wantNameIdEncrypted`` (you can find description of earch option
  [here](https://github.com/onelogin/python3-saml#how-it-works)), you will have
  to create [x509 certificate](https://en.wikipedia.org/wiki/X.509) in you
  SP. Cerificate should be created in ``certs`` folder, files should be named as
  ``sp.crt`` and ``sp.key`` (private key). After creating it, your ``sp.xml``
  will show you public key ``ds:X509Certificate`` that should be delivered to
  your IdP in order to configure encryption.



  ckanext-saml has interface ``ICKANSAML`` which has two hooks that can be used
  for User data modificaiton and Organization memberships logic while login.

  - ``after_mapping`` - Used after Users data is being mapped, but before the
    User is being created.

  - ``roles_and_organizations`` - Used for adding custom logic for Organization
    membeship that is going to be applied to the User. There is no default logic
    for this, so should be added in your custom extension using this hook.


pkgId: 90827d4c83b0a12e2e774059bc6a06bd3660b510c746fb7fca3c2aa7562a1a80
name: python-ckanext-statistics
arch: src
version: 3.1.13
epoch: 0
release: 1
summary: A CKAN extension for accessing instance statistics.
url: https://pypi.org/project/ckanext-statistics/
rpm_license: GPL-3.0-or-later
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckanext-statistics-3.1.13-1.src.rpm
checksum_type: sha256
description:
  <!--header-start-->
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://data.nhm.ac.uk/images/nhm_logo.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://data.nhm.ac.uk/images/nhm_logo_black.svg">
    <img alt="The Natural History Museum logo." src="https://data.nhm.ac.uk/images/nhm_logo_black.svg" align="left" width="150px" height="100px" hspace="40">
  </picture>



  [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-statistics/tests.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-statistics/actions/workflows/tests.yml)
  [![Coveralls](https://img.shields.io/coveralls/github/NaturalHistoryMuseum/ckanext-statistics/main?style=flat-square)](https://coveralls.io/github/NaturalHistoryMuseum/ckanext-statistics)
  [![CKAN](https://img.shields.io/badge/ckan-2.9.7-orange.svg?style=flat-square)](https://github.com/ckan/ckan)
  [![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg?style=flat-square)](https://www.python.org/)
  [![Docs](https://img.shields.io/readthedocs/ckanext-statistics?style=flat-square)](https://ckanext-statistics.readthedocs.io)

  _A CKAN extension for accessing instance statistics._

  <!--header-end-->



  <!--overview-start-->
  Shows statistics for datasets and downloads on the CKAN instance.

  **NB**: This extension currently only works with the Natural History Museum's theme extension [ckanext-nhm](https://github.com/NaturalHistoryMuseum/ckanext-nhm).

  <!--overview-end-->



  <!--installation-start-->
  Path variables used below:
  - `$INSTALL_FOLDER` (i.e. where CKAN is installed), e.g. `/usr/lib/ckan/default`
  - `$CONFIG_FILE`, e.g. `/etc/ckan/default/development.ini`



  ```shell
  pip install ckanext-statistics
  ```



  1. Clone the repository into the `src` folder:
     ```shell
     cd $INSTALL_FOLDER/src
     git clone https://github.com/NaturalHistoryMuseum/ckanext-statistics.git
     ```

  2. Activate the virtual env:
     ```shell
     . $INSTALL_FOLDER/bin/activate
     ```

  3. Install via pip:
     ```shell
     pip install $INSTALL_FOLDER/src/ckanext-statistics
     ```



  Installing from a `pyproject.toml` in editable mode (i.e. `pip install -e`) requires `setuptools>=64`; however, CKAN 2.9 requires `setuptools==44.1.0`. See [our CKAN fork](https://github.com/NaturalHistoryMuseum/ckan) for a version of v2.9 that uses an updated setuptools if this functionality is something you need.



  1. Add 'statistics' to the list of plugins in your `$CONFIG_FILE`:
     ```ini
     ckan.plugins = ... statistics
     ```

  <!--installation-end-->



  <!--configuration-start-->
  These are no configuration options for this extension.

  <!--configuration-end-->



  <!--usage-start-->



  Statistics for downloads of datasets from the instance.

  ```python
  from ckan.plugins import toolkit


  data_dict = {
                  'resource_id': RESOURCE_ID,
                  'year': YEAR,
                  'month': MONTH
              }

  toolkit.get_action('download_statistics')(
      context,
      data_dict
  )
  ```


  Statistics for dataset records.

  ```python
  from ckan.plugins import toolkit


  data_dict = {
                  'resource_id': RESOURCE_ID,
              }

  toolkit.get_action('dataset_statistics')(
      context,
      data_dict
  )
  ```





  1. `initdb`: initialise the database model
     ```bash
      ckan -c $CONFIG_FILE statistics initdb
     ```

  2. `gbif`: retrieve download statistics from [GBIF](https://gbif.org).
      ```bash
      ckan -c $CONFIG_FILE statistics gbif
      ```

  <!--usage-end-->



  <!--testing-start-->
  There is a Docker compose configuration available in this repository to make it easier to run tests. The ckan image uses the Dockerfile in the `docker/` folder.

  To run the tests against ckan 2.9.x on Python3:

  1. Build the required images:
     ```shell
     docker compose build
     ```

  2. Then run the tests.
     The root of the repository is mounted into the ckan container as a volume by the Docker compose
     configuration, so you should only need to rebuild the ckan image if you change the extension's
     dependencies.
     ```shell
     docker compose run ckan
     ```

  <!--testing-end-->


pkgId: 73d387e74b99e10b4bda087773568b027e14abf83482fe03600213cbf232f8cb
name: python-ckanext-status
arch: src
version: 2.4.3
epoch: 0
release: 1
summary: A CKAN extension that adds a 'status' bar to the top of the page.
url: https://pypi.org/project/ckanext-status/
rpm_license: GPL-3.0-or-later
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckanext-status-2.4.3-1.src.rpm
checksum_type: sha256
description:
  <!--header-start-->
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://data.nhm.ac.uk/images/nhm_logo.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://data.nhm.ac.uk/images/nhm_logo_black.svg">
    <img alt="The Natural History Museum logo." src="https://data.nhm.ac.uk/images/nhm_logo_black.svg" align="left" width="150px" height="100px" hspace="40">
  </picture>



  [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-status/tests.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-status/actions/workflows/tests.yml)
  [![Coveralls](https://img.shields.io/coveralls/github/NaturalHistoryMuseum/ckanext-status/main?style=flat-square)](https://coveralls.io/github/NaturalHistoryMuseum/ckanext-status)
  [![CKAN](https://img.shields.io/badge/ckan-2.9.7-orange.svg?style=flat-square)](https://github.com/ckan/ckan)
  [![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg?style=flat-square)](https://www.python.org/)
  [![Docs](https://img.shields.io/readthedocs/ckanext-status?style=flat-square)](https://ckanext-status.readthedocs.io)

  _A CKAN extension that adds a 'status' bar and an extensible system status page._

  <!--header-end-->



  <!--overview-start-->
  This extension allows maintainers to add a simple static message to the top of every page by setting a single configuration option.
  For example, it can be used to notify users of planned downtime, unexpected issues with the site, or new features.

  It also adds a status page giving an overview of the health of various systems. By default this has very few items, but it is easily extensible by other CKAN extensions.

  <!--overview-end-->



  <!--installation-start-->
  Path variables used below:
  - `$INSTALL_FOLDER` (i.e. where CKAN is installed), e.g. `/usr/lib/ckan/default`
  - `$CONFIG_FILE`, e.g. `/etc/ckan/default/development.ini`



  ```shell
  pip install ckanext-status
  ```



  1. Clone the repository into the `src` folder:
     ```shell
     cd $INSTALL_FOLDER/src
     git clone https://github.com/NaturalHistoryMuseum/ckanext-status.git
     ```

  2. Activate the virtual env:
     ```shell
     . $INSTALL_FOLDER/bin/activate
     ```

  3. Install via pip:
     ```shell
     pip install $INSTALL_FOLDER/src/ckanext-status
     ```



  Installing from a `pyproject.toml` in editable mode (i.e. `pip install -e`) requires `setuptools>=64`; however, CKAN 2.9 requires `setuptools==44.1.0`. See [our CKAN fork](https://github.com/NaturalHistoryMuseum/ckan) for a version of v2.9 that uses an updated setuptools if this functionality is something you need.



  1. Add 'status' to the list of plugins in your `$CONFIG_FILE`:
     ```ini
     ckan.plugins = ... status
     ```

  2. Install `lessc` globally:
     ```shell
     npm install -g "less@~4.1"
     ```

  <!--installation-end-->



  <!--configuration-start-->


  <!--configuration-end-->



  <!--usage-start-->


  To turn the status bar on, login as a sysadmin and head to the system configuration page.
  There, just set the `ckanext.status.message` config option.
  To deactivate it, just remove the contents of the text box.

  This extension adds content to the `{% block skip %}` section of `page.html`. To add it elsewhere:

  ```html+jinja
  {% if h.status_get_message() %}
      {% resource 'ckanext-status/main' %}
      <p id="status-bar">{{ h.status_get_message() }}</p>
  {% endif %}
  ```



  The status page can be found at `/status`, or the JSON response can be accessed from the API at `/api/3/action/status_list`. By default it only contains one status report: the number of queues with pending items. Additional status report items come from other CKAN extensions implementing the `IStatus` interface.

  To add status report items in another extension, add the `modify_status_reports` method of the `IStatus` interface in `plugin.py`:
  ```python
  from ckan.plugins import SingletonPlugin, implements
  from ckanext.status.interfaces import IStatus

  class ExamplePlugin(SingletonPlugin):
      implements(IStatus)

      def modify_status_reports(self, status_reports):
          status_reports.append({
              'label': 'Example status',
              'value': 'connected',
              'group': 'Examples',  # can be omitted
              'help': 'A description of what this means',
              'state': 'good'  # valid values: good, ok, bad, neutral
          })

          return status_reports
  ```

  <!--usage-end-->



  <!--testing-start-->
  There is a Docker compose configuration available in this repository to make it easier to run tests. The ckan image uses the Dockerfile in the `docker/` folder.

  To run the tests against ckan 2.9.x on Python3:

  1. Build the required images:
     ```shell
     docker compose build
     ```

  2. Then run the tests.
     The root of the repository is mounted into the ckan container as a volume by the Docker compose
     configuration, so you should only need to rebuild the ckan image if you change the extension's
     dependencies.
     ```shell
     docker compose run ckan
     ```

  <!--testing-end-->


pkgId: 0f4a3e1dcb75047ead77cc668c2068f0d7506e8f02a0f34ca996cc1e4561a511
name: python-ckanext-usmetadata
arch: src
version: 0.3.2
epoch: 0
release: 1
summary: US Metadata Plugin for CKAN
url: https://github.com/GSA/ckanext-usmetadata
rpm_license: Public Domain
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckanext-usmetadata-0.3.2-1.src.rpm
checksum_type: sha256
description:
  <=2.9        | no
  2.10         | yes

  You may also install by cloning the git repo, then running ''python setup.py develop'' from the root of your source
  directory, which will install an egg link so that you can modify the code and see results [localhost:5000](http://localhost:5000/).
  Clean up any containers and volumes.
      $ make down
  Open a shell to run commands in the container.
      $ docker-compose exec ckan bash
  If you're unfamiliar with docker-compose, see our
  [cheatsheet](https://github.com/GSA/datagov-deploy/wiki/Docker-Best-Practices#cheatsheet)
  and the [official docs](https://docs.docker.com/compose/reference/).
  For additional make targets, see the help.
      $ make help

  They follow the guidelines for [testing CKAN
  extensions](https://docs.ckan.org/en/2.9/extensions/testing-extensions.html#testing-extensions).
  To run the extension tests, start the containers with `make up`, then:
      $ make test
  Lint the code.
      $ make lint

  In order to support multiple versions of CKAN, or even upgrade to new versions
  of CKAN, we support development and testing through the `CKAN_VERSION`
  environment variable.
      $ make CKAN_VERSION=2.9 test

  Credit to the original owner of the repo.  Everything here is built on top of the original foundation.


pkgId: dc8c95006add414fd1edc2120eef9aae9400913af98ba9aee25d57b2a634e2c7
name: python-ckanext-versioned-tiledmap
arch: src
version: 2.3.3
epoch: 0
release: 1
summary: A CKAN extension with a map view for versioned-datastore backed resources.
url: https://pypi.org/project/ckanext-versioned-tiledmap/
rpm_license: GPL-3.0-or-later
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckanext-versioned-tiledmap-2.3.3-1.src.rpm
checksum_type: sha256
description:
  <!--header-start-->
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://data.nhm.ac.uk/images/nhm_logo.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://data.nhm.ac.uk/images/nhm_logo_black.svg">
    <img alt="The Natural History Museum logo." src="https://data.nhm.ac.uk/images/nhm_logo_black.svg" align="left" width="150px" height="100px" hspace="40">
  </picture>



  [![Tests](https://img.shields.io/github/actions/workflow/status/NaturalHistoryMuseum/ckanext-versioned-tiledmap/tests.yml?style=flat-square)](https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap/actions/workflows/tests.yml)
  [![Coveralls](https://img.shields.io/coveralls/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap/main?style=flat-square)](https://coveralls.io/github/NaturalHistoryMuseum/ckanext-versioned-tiledmap)
  [![CKAN](https://img.shields.io/badge/ckan-2.9.7-orange.svg?style=flat-square)](https://github.com/ckan/ckan)
  [![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg?style=flat-square)](https://www.python.org/)
  [![Docs](https://img.shields.io/readthedocs/ckanext-versioned-tiledmap?style=flat-square)](https://ckanext-versioned-tiledmap.readthedocs.io)

  _A CKAN extension with a map view for versioned-datastore backed resources._

  <!--header-end-->



  <!--overview-start-->
  A CKAN plugin with a map view for versioned-datastore backed resources allowing for map visualizations of large resources with millions of data points.

  This repository is a fork* of [ckanext-map](https://github.com/NaturalHistoryMuseum/ckanext-map).

  _*you can't fork repositories within the same organisation, so this repository is a duplicate of ckanext-map._

  <!--overview-end-->



  <!--installation-start-->
  Path variables used below:
  - `$INSTALL_FOLDER` (i.e. where CKAN is installed), e.g. `/usr/lib/ckan/default`
  - `$CONFIG_FILE`, e.g. `/etc/ckan/default/development.ini`



  This extension depends on the following projects, which must be installed _first_:
  - [versioned-datastore-tile-server](https://github.com/NaturalHistoryMuseum/versioned-datastore-tile-server)



  ```shell
  pip install ckanext-versioned-tiledmap
  ```



  1. Clone the repository into the `src` folder:
     ```shell
     cd $INSTALL_FOLDER/src
     git clone https://github.com/NaturalHistoryMuseum/ckanext-versioned-tiledmap.git
     ```

  2. Activate the virtual env:
     ```shell
     . $INSTALL_FOLDER/bin/activate
     ```

  3. Install via pip:
     ```shell
     pip install $INSTALL_FOLDER/src/ckanext-versioned-tiledmap
     ```



  Installing from a `pyproject.toml` in editable mode (i.e. `pip install -e`) requires `setuptools>=64`; however, CKAN 2.9 requires `setuptools==44.1.0`. See [our CKAN fork](https://github.com/NaturalHistoryMuseum/ckan) for a version of v2.9 that uses an updated setuptools if this functionality is something you need.



  1. Add 'versioned_tiledmap' to the list of plugins in your `$CONFIG_FILE`:
     ```ini
     ckan.plugins = ... versioned_tiledmap
     ```

  2. Install `lessc` globally:
     ```shell
     npm install -g "less@~4.1"
     ```

  3. Add latitude and longitude fields for the resources you want to use this view for.

  <!--installation-end-->



  <!--configuration-start-->
  These are the options that can be specified in your .ini config file.

  | Name                                              | Description                                                                                                                                                                                                        | Default                                                            |
  |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
  | `versioned_tilemap.tile_layer.url`                | The URL to use for the base world tiles                                                                                                                                                                            | `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`               |
  | `versioned_tilemap.tile_layer.attribution`        | The attribution text to show for this layer (can be HTML)                                                                                                                                                          | `Base tiles provided by OpenStreetMap. <a href="openstreetmap.org/copyright">View copyright information</a>`                                                                   |
  | `versioned_tilemap.tile_layer.opacity`            | The opacity for the tile layer                                                                                                                                                                                     | `0.8`                                                              |
  | `versioned_tilemap.zoom_bounds.min`               | Minimum zoom level for initial display of the resource's data                                                                                                                                                      | `3`                                                                |
  | `versioned_tilemap.zoom_bounds.max`               | Maximum zoom level for initial display of the resource's data                                                                                                                                                      | `18`                                                               |
  | `versioned_tilemap.style.plot.point_radius`       | The integer radius of the rendered points (including the border)                                                                                                                                                   | `4`                                                                |
  | `versioned_tilemap.style.plot.point_colour`       | The hex value to render the points in                                                                                                                                                                              | `#ee0000` ![#ee0000](https://placehold.it/15/ee0000/000000?text=+) |
  | `versioned_tilemap.style.plot.border_width`       | The integer border width of the rendered points                                                                                                                                                                    | `1`                                                                |
  | `versioned_tilemap.style.plot.border_colour`      | The hex value to render the borders of the points in                                                                                                                                                               | `#ffffff` ![#ffffff](https://placehold.it/15/ffffff/000000?text=+) |
  | `versioned_tilemap.style.plot.grid_resolution`    | The integer size of the cells in the grid that each tile is split into for the UTFGrid. The default of `4` produces a 64x64 grid within each tile                                                                  | `4`                                                                |
  | `versioned_tilemap.style.gridded.cold_colour`     | The hex value to be used to render the points with the lowest counts                                                                                                                                               | `#f4f11a` ![#f4f11a](https://placehold.it/15/f4f11a/000000?text=+) |
  | `versioned_tilemap.style.gridded.hot_colour`      | The hex value to be used to render the points with the highest counts                                                                                                                                              | `#f02323` ![#f02323](https://placehold.it/15/f02323/000000?text=+) |
  | `versioned_tilemap.style.gridded.range_size`      | This many colours will be used to render the points dependant on their counts                                                                                                                                      | `12`                                                               |
  | `versioned_tilemap.style.gridded.resize_factor`   | A resize value to use when smoothing the tile. This value will be used to scale the tile and then down (with anti-aliasing) to produce a smoother output. Increasing this value will negatively impact performance | `4`                                                                |
  | `versioned_tilemap.style.gridded.grid_resolution` | The integer size of the cells in the grid that each tile is split into. The default of `8` produces a 32x32 grid within each tile and therefore matches the default `grid.json` setting too                        | `8`                                                                |
  | `versioned_tilemap.style.heatmap.point_radius`    | The integer radius of the rendered points (including the border)                                                                                                                                                   | `8`                                                                |
  | `versioned_tilemap.style.heatmap.cold_colour`     | The hex value to be used to render the points with the lowest counts                                                                                                                                               | `#0000ee` ![#0000ee](https://placehold.it/15/0000ee/000000?text=+) |
  | `versioned_tilemap.style.heatmap.hot_colour`      | The hex value to be used to render the points with the highest counts                                                                                                                                              | `#ee0000` ![#ee0000](https://placehold.it/15/ee0000/000000?text=+) |
  | `versioned_tilemap.style.heatmap.intensity`       | The decimal intensity (between 0 and 1) to render the tile with                                                                                                                                                    | `0.5`                                                              |
  | `versioned_tilemap.info_template`                 | The name of the template to use when a point is clicked                                                                                                                                                            | `point_detail`                                                     |
  | `versioned_tilemap.quick_info_template`           | The name of the template to use when a point is hovered over                                                                                                                                                       | `point_detail_hover`                                               |

  <!--configuration-end-->



  <!--usage-start-->
  After enabling this extension in the list of plugins, the Map view should become available for resources with latitude and longitude values.

  <!--usage-end-->



  <!--testing-start-->
  There is a Docker compose configuration available in this repository to make it easier to run tests. The ckan image uses the Dockerfile in the `docker/` folder.

  To run the tests against ckan 2.9.x on Python3:

  1. Build the required images:
     ```shell
     docker compose build
     ```

  2. Then run the tests.
     The root of the repository is mounted into the ckan container as a volume by the Docker compose
     configuration, so you should only need to rebuild the ckan image if you change the extension's
     dependencies.
     ```shell
     docker compose run ckan
     ```

  <!--testing-end-->


pkgId: 89241f72e3dcdb559da1dd7bc658d012e0502026fb4558ea544ebc4bcbedeb06
name: python-ckanext-vip-portal
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://github.com/DataShades/ckanext-vip-portal
rpm_license: AGPL
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckanext-vip-portal-0.2.5-1.src.rpm
checksum_type: sha256
description:
  [![Tests](https://github.com/DataShades/ckanext-vip-portal/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/DataShades/ckanext-vip-portal/actions/workflows/test.yml)



  Generic access restrictions for anonymous user.

  Configure the set or endpoints/URLs that are available for the anonymous user,
  and redirect to the login page if he attempts to visit non-whitelisted page.



  Compatibility with core CKAN versions:

  | CKAN version | Compatible? |
  |--------------|-------------|
  | 2.9          | yes         |
  | 2.10         | yes         |
  | 2.11(master) | yes         |




  To install `ckanext-vip-portal`:

  2. Install it using pip
     ```sh
     pip install ckanext-vip-portal
     ```

  3. Add `vip_portal` to the `ckan.plugins` setting in your CKAN
     config file.




  ```ini


  ckanext.vip_portal.login_endpoint = auth_ext.login




  ckanext.vip_portal.free_anonymous_access = true



  ckanext.vip_portal.free_authenticated_access = false





  ckanext.vip_portal.free_access_by_default = true



  ckanext.vip_portal.allow_login = false



  ckanext.vip_portal.allow_password_reset = false



  ckanext.vip_portal.allow_registration = false



  ckanext.vip_portal.allow_api = false



  ckanext.vip_portal.extra_allowed_endpoints = home.index home.about dataset.search



  ckanext.vip_portal.extra_allowed_paths = / /about /dataset




  ckanext.vip_portal.extra_allowed_prefixes = /dataset /organization /group /static




  ckanext.vip_portal.extra_allowed_suffixes = .svg .html .css





  ckan.auth.route_after_login = dataset.search

  ```



  For more specific scenarios, implement
  `ckanext.vip_portal.interfaces.IVipPortal`

  ```python
  class IVipPortal(Interface):
      def check_vip_access_for_endpoint(
          self,
          endpoint: Union[tuple[str, str], tuple[None, None]],
          user: Optional[str],
      ) -> Access:
          """Check if user allowed to visit the endpoint.

          Return `ckanext.vip_portal.interfaces.Access` enum member from this
          method:

          * Access.allowed: user is allowed to see the endpoint
          * Access.forbidden: user is not allowed to see the endpoint
          * Access.unknown: use default logic that depends on settings

          Use `forbidden` only when you explicitly want to disallow access to the
          ednpoint. Otherwise use `unknown`: it will check configuration of the
          extension and other plugins first and only then allow/disallow visiting
          the page.

          """
          return Access.unknown

      def check_vip_access_for_path(
          self, path: str, user: Optional[str]
      ) -> Access:
          """Check if user allowed to visit the endpoint.

          See IVipPortal.check_vip_access_for_endpoint
          """
          return Access.unknown

      def make_vip_rejection_response(
          self, user: Optional[str]
      ) -> Optional[Response]:
          """Create a response for forbiddent page.

          By default, authenticated user sees 403 page and anonymous user is
          redirected to login page.

          """
          return None

      def alter_vip_rejection_response(
          self, resp: Response, user: Optional[str]
      ) -> Response:
          """Modify rejection response before it's sent to user.

          Here you can add additional headers to the rejection response. For
          anything more complex consider using
          IVipPortal.make_vip_rejection_response.

          """
          return resp
  ```



  To install `ckanext-vip-portal` for development, activate your CKAN virtualenv and
  do:

      git clone https://github.com/DataShades/ckanext-vip-portal.git
      cd ckanext-vip-portal
      pip install -e '.[dev]'




  [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)


pkgId: 83f8044159a2d61f7ff59d168ea4ada41be846d0bdc6ebfda4da25ef15b28053
name: python-ckanext-ytp-comments
arch: src
version: 2.5.0
epoch: 0
release: 1
summary: Adds commenting on datasets and data requests
url: https://github.com/qld-gov-au/ckanext-ytp-comments
rpm_license: AGPL
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckanext-ytp-comments-2.5.0-1.src.rpm
checksum_type: sha256
description:
  A custom CKAN extension for Data.Qld
  [![Tests](https://github.com/qld-gov-au/ckanext-ytp-comments/actions/workflows/test.yml/badge.svg)](https://github.com/qld-gov-au/ckanext-ytp-comments/actions/workflows/test.yml)
  [![CircleCI](https://circleci.com/gh/qld-gov-au/ckanext-ytp-comments/tree/develop.svg?style=shield)](https://circleci.com/gh/qld-gov-au/ckanext-ytp-comments/tree/develop)

  - Make sure that you have latest versions of all required software installed:
    - [Docker](https://www.docker.com/)
    - [Pygmy](https://pygmy.readthedocs.io/)
    - [Ahoy](https://github.com/ahoy-cli/ahoy)
  - Make sure that all local web development services are shut down (Apache/Nginx, Mysql, MAMP etc).
  - Checkout project repository (in one of the [supported Docker directories](https://docs.docker.com/docker-for-mac/osxfs/#access-control)).
  - `pygmy up`
  - `ahoy build`
  - You may need to use sudo on linux
  Building on Ubuntu (optional: behind proxy)
  - composer from compose
    - sudo pip install docker-compose
  - sudo apt-get install composer
  - ensure /etc/gemrc has the following
    ``http_proxy: http://localhost:3128
      https_proxy: http://localhost:3128``
  - if squid proxy is in use on your machine ensure that ``acl localnet src 172.17.0.0/16``  #  allows your public ip for loopback
  - https://docs.docker.com/network/proxy/
    ~/.docker/config.json
    ``
  {
   "proxies":
    {
    "default":
     {
       "httpProxy": "http://hostexternalip:3128",
       "httpsProxy": "http://hostexternalip:3128",
       "noProxy": ""
     }
    }
  }
  ``
    - https://docs.docker.com/config/daemon/systemd/
      sudo mkdir -p /etc/systemd/system/docker.service.d
      sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
      ``[Service]
        Environment="HTTP_PROXY=http://localhost:3128/"``
      sudo vi /etc/systemd/system/docker.service.d/https-proxy.conf
      ``[Service]
        Environment="HTTPS_PROXY=http://localhost:3128/"``
      sudo systemctl daemon-reload
      sudo systemctl restart docker
  Use `admin`/`password` to login to CKAN.

  Run each command as `ahoy <command>`.
    ```
     build        Build or rebuild project.
     clean        Remove containers and all build files.
     cli          Start a shell inside CLI container or run a command.
     doctor       Find problems with current project setup.
     down         Stop Docker containers and remove container, images, volumes and networks.
     flush-redis  Flush Redis cache.
     info         Print information about this project.
     install-site Install a site.
     lint         Lint code.
     logs         Show Docker logs.
     pull         Pull latest docker images.
     reset        Reset environment: remove containers, all build, manually created and Drupal-Dev files.
     restart      Restart all stopped and running Docker containers.
     start        Start existing Docker containers.
     stop         Stop running Docker containers.
     test-bdd     Run BDD tests.
     test-unit    Run unit tests.
     up           Build and start Docker containers.
    ```

  Python code linting uses [flake8](https://github.com/PyCQA/flake8) with configuration captured in `.flake8` file.
  Set `ALLOW_LINT_FAIL=1` in `.env` to allow lint failures.

  `ahoy test-unit`
  Set `ALLOW_UNIT_FAIL=1` in `.env` to allow unit test failures.

  `ahoy test-bdd`
  Set `ALLOW_BDD_FAIL=1` in `.env` to allow BDD test failures.

  We are using [Behave](https://github.com/behave/behave) BDD _framework_ with additional _step definitions_ provided by [Behaving](https://github.com/ggozad/behaving) library.
  Custom steps described in `test/features/steps/steps.py`.
  Test scenarios located in `test/features/*.feature` files.
  Test environment configuration is located in `test/features/environment.py` and is setup to connect to a remote Chrome
  instance running in a separate Docker container.
  During the test, Behaving passes connection information to [Splinter](https://github.com/cobrateam/splinter) which
  instantiates WebDriver object and establishes connection with Chrome instance. All further communications with Chrome
  are handled through this driver, but in a developer-friendly way.
  For a list of supported step-definitions, see https://github.com/ggozad/behaving#behavingweb-supported-matcherssteps.

  In software engineering, continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day.
  Before feature changes can be merged into a shared mainline, a complete build must run and pass all tests on CI server.
  This project uses [GitHub Actions](https://github.com/features/actions) as a CI server: it imports production backups into fully built codebase and runs code linting and tests. When tests pass, a deployment process is triggered for nominated branches (usually, `master` and `develop`).

  Comment notifications (via email) are managed by opt-in, i.e. without opting in to receive comment notifications at the content item or thread level,
  only authors or organisation admins will receive email notifications.
  This feature allows users to following or mute comments at the content item level or for a specific comment thread on the content item.
  When a user follows comments on a content item or content item thread they will receive email notifications when new comments or replies are posted.

  Comments are checked using the [profanityfilter](https://github.com/areebbeigh/profanityfilter) Python module; any comments containing profanity are blocked.
  'profanityfilter' has a built-in blacklist of words. Additional banned words are contained in `ckanext/ytp/comments/bad_words.txt` by default.
  You can point to another word list by setting `ckan.comments.bad_words_file` in your config.
  Any words from the built-in list that you do *not* wish to block are contained in `ckanext/ytp/comments/good_words.txt` by default.
  You can point to another word list by setting `ckan.comments.good_words_file` in your config.

  1. Initialise the comment notification recipients database table, e.g.
          cd /usr/lib/ckan/default/src/ckanext-ytp-comments  # Your PATH may vary
          ckan -c /etc/ckan/default/development.ini initdb  # Use YOUR path and relevant CKAN .ini file
          ckan -c /etc/ckan/default/development.ini updatedb  # Use YOUR path and relevant CKAN .ini file
          ckan -c /etc/ckan/default/development.ini init_notifications_db  # Use YOUR path and relevant CKAN .ini file
      This will create a new table in the CKAN database named `comment_notification_recipient` that holds the status of individual user's follow or mute preferences.
      *Note:* if your deployment process does not run `python setup.py develop` after deploying code changes for extensions, you may need to run this in order for 'ckan' to recognise the `init_notifications_db` command:
          python setup.py develop
  2. Add the following config settings to your CKAN `.ini` file:
          ckan.comments.follow_mute_enabled = True
          
          ckan.comments.bad_words_file = /path/to/blacklist_words.txt
          ckan.comments.good_words_file = /path/to/whitelist_words.txt
          
          ckan.comments.show_comments_tab_page = True # Defaults to False
  3. Restart CKAN


pkgId: b4e3c3760fadc29fed82436804cfc495f42bef6b842201dd53b6764508351902
name: python-ckantools
arch: src
version: 0.4.1
epoch: 0
release: 1
summary: Utilities for ckan extensions.
url: https://pypi.org/project/ckantools/
rpm_license: GPL-3.0-or-later
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckantools-0.4.1-1.src.rpm
checksum_type: sha256
description:
  <!--header-start-->
  <img src="https://data.nhm.ac.uk/images/nhm_logo.svg" align="left" width="150px" height="100px" hspace="40"/>



  [![CKAN](https://img.shields.io/badge/ckan-2.9.5-orange.svg?style=flat-square)](https://github.com/ckan/ckan)
  [![Python](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg?style=flat-square)](https://www.python.org/)

  _Utilities and common methods for CKAN extensions._

  <!--header-end-->



  <!--overview-start-->
  A collection of methods, decorators, and anything else that might be useful.

  _ckantools is still very much in development, and is prone to frequent changes that may or may not work._

  <!--overview-end-->



  <!--installation-start-->
  ```shell
  pip install ckantools
  ```

  <!--installation-end-->



  See the full usage docs on [readthedocs.io](https://ckantools.readthedocs.io).

  <!--usage-start-->


  Use the `@action` decorator to add actions:
  ```python


  from ckantools.decorators import action

  @action(schema, helptext, get=False, *other_decorators)
  def example_action(parameter_1, parameter_2):
      
  ```

  Or the `@basic_action` decorator if you want to load the action but don't want any of the other features (schema loading, auto auth, etc):
  ```python
  from ckantools.decorators import basic_action

  @basic_action
  def example_action(context, data_dict):
      
  ```

  And then load the action(s) in `plugin.py`:
  ```python


  from .logic.actions import module_name
  from ckantools.loaders import create_actions
  from ckan.plugins import implements, interfaces, SingletonPlugin

  class ExamplePlugin(SingletonPlugin):
      implements(interfaces.IActions)

      
      def get_actions(self):
          return create_actions(module_name)
  ```



  Loading auth functions is similar to actions, i.e. use the `@auth` decorator.

  ```python


  from ckantools.decorators import auth

  @auth(anon=True)
  def example_action(context, data_dict):
      return {'success': True}

  @auth('example_action')
  def other_action(context, data_dict):
      
      return {'success': True}
  ```

  The auth functions can then be loaded in `plugin.py`:
  ```python


  from .logic.auth import module_name
  from ckantools.loaders import create_auth
  from ckan.plugins import implements, interfaces, SingletonPlugin

  class ExamplePlugin(SingletonPlugin):
      implements(interfaces.IActions)

      
      def get_auth_functions(self):
          return create_auth(module_name)
  ```

  <!--usage-end-->


pkgId: 382fefe76b8141bdb3198aef0ce7010009b2d074b5c2a177074a230b48278995
name: python-ckcc-protocol
arch: src
version: 1.4.0
epoch: 0
release: 1
summary: Communicate with your Coldcard using Python
url: https://github.com/Coldcard/ckcc-protocol
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckcc-protocol-1.4.0-1.src.rpm
checksum_type: sha256
description:
  Coldcard is a Cheap, Ultra-secure & Opensource Hardware Wallet for #Bitcoin.

  Get yours at [ColdcardWallet.com](http://coldcard.com)

  This is the python code and command-line utilities you need to communicate with it over USB.



  - `pip install 'ckcc-protocol[cli]'`

  This installs a single helpful command line program: `ckcc`

  If you just want the python library, use:

  - `pip install ckcc-protocol`




  - do a git checkout
  - probably make a fresh virtual env
  - run:

  ```
  pip install -r requirements.txt
  pip install --editable '.[cli]'
  ```



  - python 3.6 or higher
  - `hidapi` for USB HID access in a portable way.
  - see `requirements.txt` file for more details.






  ```
  % ckcc
  Usage: ckcc [OPTIONS] COMMAND [ARGS]...

  Options:
    -s, --serial HEX  Operate on specific unit (default: first found)
    -x, --simulator   Connect to the simulator via Unix socket
    -P, --plaintext   Disable USB link-layer encryption
    --help            Show this message and exit.

  Commands:
    addr        Show the human version of an address
    auth        Indicate specific user is present (for HSM).
    backup      Creates 7z encrypted backup file after...
    bag         Factory: set or read bag number -- single use...
    chain       Get which blockchain (Bitcoin/Testnet) is...
    convert2cc  Convert existing Electrum wallet file into...
    debug       Start interactive (local) debug session
    eval        Simulator only: eval a python statement
    exec        Simulator only: exec a python script
    get-locker  Get the value held in the Storage Locker (not...
    hsm         Get current status of HSM feature.
    hsm-start   Enable Hardware Security Module (HSM) mode.
    list        List all attached Coldcard devices
    local-conf  Generate the 6-digit code needed for a...
    logout      Securely logout of device (will require...
    msg         Sign a short text message
    multisig    Create a skeleton file which defines a...
    p2sh        Show a multisig payment address on-screen.
    pass        Provide a BIP39 passphrase
    pubkey      Get the public key for a derivation path Dump...
    reboot      Reboot coldcard, force relogin and start over
    sign        Approve a spending transaction by signing it...
    test        Test USB connection (debug/dev)
    upgrade     Send firmware file (.dfu) and trigger upgrade...
    upload      Send file to Coldcard (PSBT transaction or...
    user        Create a new user on the Coldcard for HSM...
    version     Get the version of the firmware installed
    xfp         Get the fingerprint for this wallet (master...
    xpub        Get the XPUB for this wallet (master level,...
  ```




  ```
  % ckcc msg --help
  Usage: ckcc msg [OPTIONS] MESSAGE

    Sign a short text message

  Options:
    -p, --path DERIVATION  Derivation for key to use [default: m/44'/0'/0'/0/0]
    -v, --verbose          Include fancy ascii armour
    -j, --just-sig         Just the signature itself, nothing more
    -s, --segwit           Address in segwit native (p2wpkh, bech32)
    -w, --wrap             Address in segwit wrapped in P2SH (p2wpkh)
    --help                 Show this message and exit.

  % ckcc msg "Hello Coldcard" -p m/34/23/33
  Waiting for OK on the Coldcard...
  Hello Coldcard
  1KSXaNHh3G4sfTMsp9q8CmACeqsJn46drd
  H4mTuwMUdnu3MyMA+6aJ3hiAF4L0WBDZFseTEno511hNN8/THIeM4GW4SnrcJJhS3WxMZEWFdEIZDSP+H5aIcao=
  ```



  ```
  % ckcc sign --help
  Usage: ckcc sign [OPTIONS] PSBT_IN [PSBT_OUT]

    Approve a spending transaction by signing it on Coldcard

  Options:
    -v, --verbose    Show more details
    -f, --finalize   Show final signed transaction, ready for transmission
    -z, --visualize  Show text of Coldcard's interpretation of the transaction
                     (does not create transaction, no interaction needed)
    -s, --signed     Include a signature over visualization text
    -x, --hex        Write out (signed) PSBT in hexidecimal
    -6, --base64     Write out (signed) PSBT encoded in base64
    --help           Show this message and exit.

  % (... acquire PSBT file for what you want to do ...)

  % ckcc sign example.psbt out.psbt
  5071 bytes (start @ 0) to send from 'example.psbt'
  Uploading  [####################################]  100%
  Waiting for OK on the Coldcard...
  Ok! Downloading result (5119 bytes)

  %  hexdump -C out.psbt | head -3
  00000000  70 73 62 74 ff 01 00 fd  22 04 02 00 00 00 04 3f  |psbt...."......?|
  00000010  ee 16 30 9d 14 82 36 dd  c8 3e 9e 4f 94 47 83 00  |..0...6..>.O.G..|
  00000020  c2 23 e1 06 22 1b 02 0e  bd c8 1c 71 79 7d 3c 02  |.#.."......qy}<.|
  00000030  00 00 00 00 fe ff ff ff  4c 85 a0 2c 80 cb 2c 01  |........L..,..,.|

  ```


pkgId: 82d46760627ac8f30c93d87762073923b9d73b04adf0e3e4f7f9fbc7290c10bc
name: python-ckipnlp
arch: src
version: 1.0.3
epoch: 0
release: 1
summary: CKIP CoreNLP
url: https://ckipnlp.readthedocs.io
rpm_license: GPL-3.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckipnlp-1.0.3-1.src.rpm
checksum_type: sha256
description:
  Features
  ^^^^^^^^
  - Sentence Segmentation
  - Word Segmentation
  - Part-of-Speech Tagging
  - Named-Entity Recognition
  - Constituency Parsing
  - Coreference Resolution
  Git
  ^^^
  https://github.com/ckiplab/ckipnlp
  |GitHub Version| |GitHub Release| |GitHub Issues|
  PyPI
  ^^^^
  https://pypi.org/project/ckipnlp
  |PyPI Version| |PyPI License| |PyPI Downloads| |PyPI Python| |PyPI Implementation| |PyPI Status|
  Documentation
  ^^^^^^^^^^^^^
  https://ckipnlp.readthedocs.io/
  |ReadTheDocs Home|
  Online Demo
  ^^^^^^^^^^^
  https://ckip.iis.sinica.edu.tw/service/corenlp
  Contributers
  ^^^^^^^^^^^^
  * `Mu Yang <https://muyang.pro>`__ at `CKIP <https://ckip.iis.sinica.edu.tw>`__ (Author & Maintainer)
  * `Wei-Yun Ma <https://www.iis.sinica.edu.tw/pages/ma/>`__ at `CKIP <https://ckip.iis.sinica.edu.tw>`__ (Maintainer)
  * `DouglasWu <dgrey1116@gmail.com>`__


pkgId: 42b0a3a6bf4a33ea1b4de3e2aaa5ea330a69a98b99bcaad6151f2599025cc078
name: python-ckms
arch: src
version: 0.65.0
epoch: 0
release: 1
summary: Enter a description for this Unimatrix package
url: https://gitlab.com/unimatrixone
rpm_license: Other/Proprietary License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckms-0.65.0-1.src.rpm
checksum_type: sha256
description:
  - SWIG




  - On Apple Mac M1 processors, the YubIHSM may have issues detecting the
    USB library. Point the `usb` library to the proper location by setting
    an environment variable:

    `export DYLD_LIBRARY_PATH=/opt/homebrew/lib`

    (or the proper path on your system).


pkgId: 0cf9c09688069915fb9d18b256135c97994796b57b31c068ab02a89d1e58addf
name: python-ckplotlib
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: Add-on library of Matplotlib for publication quality plots
url: https://pypi.org/project/ckplotlib/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ckplotlib-1.0.0-1.src.rpm
checksum_type: sha256
description:
  ckplotlib is the add-on library of Matplotlib for publication quality plots.

  README: [https://github.com/mchizaki/ckplotlib](https://github.com/mchizaki/ckplotlib)

rpm_license:
  MIT License  Copyright (c) 2024 Masaya Chizaki  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: 743628f9b58e071016ac98e2e339dbbfb24c5ee0cdaed70930db05957b7d747a
name: python-cl-timer
arch: src
version: 1.1.4
epoch: 0
release: 1
summary: A Cubing Timer for the Terminal
url: https://github.com/lol-cubes/cl-timer
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cl-timer-1.1.4-1.src.rpm
checksum_type: sha256
description:
  *A cubing timer for the terminal*

  Installation instructions and command documentation: https://lol-cubes.github.io/cl-timer

  pypi: https://pypi.org/project/cl-timer



  Feel free to submit pull requests.



  This currently only works on macOS, though once a level of functionality on par with popular web-based timers such as cs-timer or qq-timer (the latter likely more feasible) is reached, I will consider working first on ubuntu support, and later windows.

  Once that aforementioned work is done on adapting this to other OSes, I will have exact instructions on how to make this work on each system.

  As of right now, any modern version of python3 should be good for this, but it is being developed on python3.8.0, so I may use some features that will throw syntax errors in any older versions.


pkgId: 93a4fab2416d52985ebe7e2ac41c18a59f039d0e8e0335a4bfc5053403ecb686
name: python-cl4py
arch: src
version: 1.8.1
epoch: 0
release: 1
summary: Common Lisp for Python
url: https://github.com/marcoheisig/cl4py
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cl4py-1.8.1-1.src.rpm
checksum_type: sha256
description:
  The library cl4py (pronounce as *clappy*) allows Python programs to call
  Common Lisp libraries.  Its official mascot is the cl4py-bird:


pkgId: 0933620667eb53e31c1f5e9430be64bca6be67065499025f328f1a651e39c895
name: python-clabe
arch: src
version: 1.2.15
epoch: 0
release: 1
summary: Validate and generate the control digit of a CLABE in Mexico
url: https://github.com/cuenca-mx/clabe
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clabe-1.2.15-1.src.rpm
checksum_type: sha256
description:
  [![test](https://github.com/cuenca-mx/clabe-python/workflows/test/badge.svg)](https://github.com/cuenca-mx/clabe-python/actions?query=workflow%3Atest)
  [![codecov](https://codecov.io/gh/cuenca-mx/clabe-python/branch/main/graph/badge.svg)](https://codecov.io/gh/cuenca-mx/clabe-python)
  [![PyPI](https://img.shields.io/pypi/v/clabe.svg)](https://pypi.org/project/clabe/)
  [![Downloads](https://pepy.tech/badge/clabe)](https://pepy.tech/project/clabe)

  Librería para validar y calcular un número CLABE basado en
  https://es.wikipedia.org/wiki/CLABE



  Python 3.6 o superior.



  Se puede instalar desde Pypi usando

  ```
  pip install clabe
  ```



  Para ejecutar las pruebas

  ```
  $ make test
  ```



  Obtener el dígito de control de un número CLABE

  ```python
  import clabe
  clabe.compute_control_digit('00200000000000000')
  ```

  Para validar si un número CLABE es válido

  ```python
  import clabe
  clabe.validate_clabe('002000000000000008')
  ```

  Para obtener el banco a partir de 3 dígitos

  ```python
  import clabe
  clabe.get_bank_name('002')
  ```

  Para generar nuevo válido CLABES

  ```python
  import clabe
  clabe.generate_new_clabes(10, '002123456')
  ```


pkgId: ce41a7716aa3e8815b76e0ad127b7e1d2eb629400b6487eddc0be853c9429715
name: python-clage-homeserver
arch: src
version: 0.1.14
epoch: 0
release: 1
url: https://github.com/klacol/clage_homeserver
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clage-homeserver-0.1.14-1.src.rpm
checksum_type: sha256
summary:
  A Python API for accessing and managing an electrical CLAGE continuous waterheater (e.g. DSX Touch) via the CLAGE Homeserver REST API

description:
  [![Python application](https://github.com/klacol/clage_homerserver/actions/workflows/pythonapp.yml/badge.svg)](https://github.com/klacol/clage_homerserver/actions/workflows/pythonapp.yml) [![PyPI](https://img.shields.io/pypi/v/clage-homeserver)](https://pypi.org/project/clage-homeserver/)


  Python client for accessing the Clage Waterheater via the local https-Rest-API-Endpoint of the clage Homeserver

  Tested with the "[Clage DSX Touch](https://www.clage.de/de/produkte/e-komfortdurchlauferhitzer/DSX-Touch)" with an integrated Homeserver.

  Based on the [API documentation version 1.3.4](https://github.com/klacol/clage-homerserver-api/blob/master/api-docs/CLAGE%20HomeServer%20API%20v1.3.4.pdf).


  This is the first version of the API so there are still breaking chnages possible eg. output parameter names or values.


  [Project Homepage](https://github.com/klacol/clage_homeserver)

  [PyPi Package](https://pypi.org/project/clage_homeserver)

  [Openapi Document](https://app.swaggerhub.com/apis/klacol/ClageHomeServer/1.0.0)

  [Product Homepage](https://www.clage.de/de/produkte/e-komfortdurchlauferhitzer/DSX-Touch)

  All rights of CLAGE GmbH remain unaffected.


  - Query the status of the homeserver & water heater
  - Query the setup values of the homeserver & water heater
  - Query the consumption values for water (Liter) and energy (kWh)
  - Set the setpoint temperature for the heater



  ```
  pip install clage_homeserver
  ```



  ```python
  from clage_homeserver import ClageHomeServer
  clageHomeServer = ClageHomeServer('192.168.0.78','Your Homeserver ID','Your Heater ID')

   
  print (clageHomeServer.requestStatus())

   
  print (clageHomeServer.requestSetup())

   
  print (clageHomeServer.GetConsumptionTotals())


  clageHomeServer.setTemperature(45.6)
  ```


pkgId: 582863455159e8d5b6852e2a9d7001df042c549e5e97edecec163aedf22cc34a
name: python-clamav-client
arch: src
version: 0.6.2
epoch: 0
release: 1
summary: Python client library for the ClamAV antivirus.
url: https://pypi.org/project/clamav-client/
rpm_license: GPL-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clamav-client-0.6.2-1.src.rpm
checksum_type: sha256
description:
  [![PyPI version](https://badge.fury.io/py/clamav-client.svg)](https://badge.fury.io/py/clamav-client)
  [![GitHub CI](https://github.com/artefactual-labs/clamav-client/actions/workflows/test.yml/badge.svg)](https://github.com/artefactual-labs/clamav-client/actions/workflows/test.yml)
  [![codecov](https://codecov.io/gh/artefactual-labs/clamav-client/branch/main/graph/badge.svg?token=ldznzhNTG0)](https://app.codecov.io/gh/artefactual-labs/clamav-client/tree/main)

  `clamav-client` is a portable Python module to use the ClamAV anti-virus engine
  on Windows, Linux, MacOSX and other platforms. It requires a running instance
  of the `clamd` daemon.

  This is a fork of [clamd] ([5c5e33b2]) created by Thomas Grainger. It introduces
  type hints and tests exclusively against supported Python versions.



  The `clamav_client.clamd` module offers a client for the `clamd` daemon,
  supporting both TCP and Unix sockets.

  The `clamav_client.scanner` module provides a high-level file scanner that works
  with both `clamd` and `clamscan`. Use `clamav_client.get_scanner()` to configure
  it.


  [clamd]: https://github.com/graingert/python-clamd
  [5c5e33b2]: https://github.com/graingert/python-clamd/commit/5c5e33b2dfd0499470e15abeb83efb6531ef9ab7


pkgId: 0b38626aefb2da60306e4917bc7f0ed5f5f5ef79bae3a024910201998c9b9f27
name: python-clamdpy
arch: src
version: 0.1.0.post1
epoch: 0
release: 1
summary: A Python wrapper around clamd, the ClamAV daemon
url: https://github.com/Viicos/clamdpy
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clamdpy-0.1.0.post1-1.src.rpm
checksum_type: sha256
description:
  A Python wrapper around `clamd`, the [ClamAV](https://www.clamav.net/) daemon.

  This is a maintained and updated fork of https://github.com/graingert/python-clamd/, credit goes to the original developer(s).

  [![Python versions](https://img.shields.io/pypi/pyversions/clamdpy.svg)](https://www.python.org/downloads/)
  [![PyPI version](https://img.shields.io/pypi/v/clamdpy.svg)](https://pypi.org/project/clamdpy/)
  [![Code style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://black.readthedocs.io/en/stable/)
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)



  Using `pip`:

  ```sh
  pip install clamdpy
  ```



  ```python
  from io import BytesIO

  from clamdpy import ClamdNetworkSocket

  clamd = ClamdNetworkSocket(
      host="127.0.0.1",
      port=3310,
      timeout=15,
  )

  clamd.ping()


  clamd.version()



  clamd.version(raw=True)


  clamd.instream(BytesIO(b"data"))

  ```

  Most of the [clamd commands](https://github.com/Cisco-Talos/clamav/blob/main/docs/man/clamd.8.in) are implemented (a couple ones are missing and should be implemented sooner or later).

  It is possible to use [UNIX sockets](https://docs.python.org/3/library/socket.html#socket.AF_UNIX) as well:

  ```python
  from clamdpy import ClamdUnixSocket

  clamd = ClamdUnixSocket(path="/var/run/clamav/clamd.ctl")
  ```



  By default, `\n` will be used to terminate lines. Clamd also supports `NULL` characters:

  ```python
  from clamdpy import ClamdNetworkSocket

  clamd = ClamdNetworkSocket(line_terminator="z")
  ```

  > [!WARNING]\
  > Support for the `NULL` character isn't tested and may not work as it doesn't play well with Python. Use with caution.

rpm_license:
  MIT License  Copyright (c) 2023 Viicos  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: 39b9f432fa9d5d2dee5f8b9ddd50edc463a5b55cfcee1b6c3f8b20a6c42cf51a
name: python-clamnibs
arch: src
version: 0.1.11
epoch: 0
release: 1
summary: Analysis of closed-loop amplitude-modulated non-invasive brain stimulation experiments
url: https://github.com/davidhaslacher/clam-nibs
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clamnibs-0.1.11-1.src.rpm
checksum_type: sha256
description:
  This toolbox contains all software required to implement closed-loop amplitude-modulated non-invasive brain stimulation (CLAM-NIBS) and evaluate the resulting electroencephalography (EEG) or magnetoencephalography (MEG) data.


pkgId: 3ccf8d2f35babcb29f3f03d04e5cd32015fa8f348b73121dc5bff103e0587793
name: python-clams-python
arch: src
version: 1.3.1
epoch: 0
release: 1
summary: A collection of APIs to develop CLAMS app for python
url: https://clams.ai
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clams-python-1.3.1-1.src.rpm
checksum_type: sha256
description:
  [CLAMS project](https://clams.ai) aims at free and open-source software platform for computational analysis and metadata generation applications for multimedia material. We believe free and open AI-based multimedia processing platform can bring many benefits of technical advancement to libraries, archives, and museums. To achieve interoperability between various computational applications developed be different vendors, which is absolutely necessary for using applications together supported by user-friendly workflow engines, we are also developing JSON-based MultiMedia Interchange Format ([MMIF](https://mmif.clams.ai))


  `clams-python` is a Python implementation of the CLAMS SDK. `clams-python` provides CLAMS app developers with the following assistance ;

  1. handling MMIF files for input and output specification for CLAMS apps
  1. a base Python class to start developing a CLAMS app
  1. a flask-based wrapper to run a Python CLAMS app as an HTTP web app
  1. cookie-cutter shell command that sets up everything and starts a new CLAMS app project




  * [Version history and patch notes](https://github.com/clamsproject/clams-python/blob/main/CHANGELOG.md)
  * [CLAMS Python API documentation](https://clamsproject.github.io/clams-python/modules.html)
  * [MMIF-specific Python API documentation](https://clamsproject.github.io/mmif-python)
  * [Public CLAMS App Directory](https://clamsproject.github.io/apps)


pkgId: d425490d3ef1ac584844bad23437bd41ef81e26c1e2d0db34ccb930f1427f17c
name: python-clana
arch: src
version: 0.4.1
epoch: 0
release: 1
summary: CLANA is a toolkit for classifier analysis.
url: https://github.com/MartinThoma/clana
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clana-0.4.1-1.src.rpm
checksum_type: sha256
description:
  [![DOI](https://zenodo.org/badge/102892750.svg)](https://zenodo.org/badge/latestdoi/102892750)
  [![PyPI version](https://badge.fury.io/py/clana.svg)](https://badge.fury.io/py/clana)
  [![Python Support](https://img.shields.io/pypi/pyversions/clana.svg)](https://pypi.org/project/clana/)
  [![Documentation Status](https://readthedocs.org/projects/clana/badge/?version=latest)](http://clana.readthedocs.io/en/latest/?badge=latest)
  [![Build Status](https://travis-ci.org/MartinThoma/clana.svg?branch=master)](https://travis-ci.org/MartinThoma/clana)
  [![Coverage Status](https://coveralls.io/repos/github/MartinThoma/clana/badge.svg?branch=master)](https://coveralls.io/github/MartinThoma/clana?branch=master)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
  ![GitHub last commit](https://img.shields.io/github/last-commit/MartinThoma/clana)
  ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/MartinThoma/clana/0.4.0)
  [![CodeFactor](https://www.codefactor.io/repository/github/martinthoma/clana/badge/master)](https://www.codefactor.io/repository/github/martinthoma/clana/overview/master)



  `clana` is a library and command line application to visualize confusion matrices of
  classifiers with lots of classes. The two key contribution of clana are
  Confusion Matrix Ordering (CMO) as explained in chapter 5 of [Analysis and Optimization of Convolutional Neural Network Architectures](https://arxiv.org/abs/1707.09725) and an optimization
  algorithm to to achieve it. The CMO technique can be applied to any multi-class
  classifier and helps to understand which groups of classes are most similar.




  The recommended way to install clana is:

  ```
  $ pip install clana --user --upgrade
  ```

  If you want the latest version:

  ```
  $ git clone https://github.com/MartinThoma/clana.git; cd clana
  $ pip install -e . --user
  ```



  ```
  $ clana --help
  Usage: clana [OPTIONS] COMMAND [ARGS]...

    Clana is a toolkit for classifier analysis.

    See https://arxiv.org/abs/1707.09725, Chapter 4.

  Options:
    --version  Show the version and exit.
    --help     Show this message and exit.

  Commands:
    distribution   Get the distribution of classes in a dataset.
    get-cm         Generate a confusion matrix from predictions and ground...
    get-cm-simple  Generate a confusion matrix.
    visualize      Optimize and visualize a confusion matrix.

  ```

  The visualize command gives you images like this:

  ![Confusion Matrix after Confusion Matrix Ordering of the WiLI-2018 dataset](https://raw.githubusercontent.com/MartinThoma/clana/master/docs/cm-wili-2018.png)



  ```
  $ cd docs/
  $ python mnist_example.py  # creates `train-pred.csv` and `test-pred.csv`
  $ clana get-cm --gt gt-train.csv  --predictions train-pred.csv --n 10
  2019-09-14 09:47:30,655 - root - INFO - cm was written to 'cm.json'
  $ clana visualize --cm cm.json --zero_diagonal
  Score: 13475
  2019-09-14 09:49:41,593 - root - INFO - n=10
  2019-09-14 09:49:41,593 - root - INFO - ## Starting Score: 13475.00
  2019-09-14 09:49:41,594 - root - INFO - Current: 13060.00 (best: 13060.00, hot_prob_thresh=100.0000%, step=0, swap=False)
  [...]
  2019-09-14 09:49:41,606 - root - INFO - Current: 9339.00 (best: 9339.00, hot_prob_thresh=100.0000%, step=238, swap=False)
  Score: 9339
  Perm: [0, 6, 5, 8, 3, 2, 1, 7, 9, 4]
  2019-09-14 09:49:41,639 - root - INFO - Classes: [0, 6, 5, 8, 3, 2, 1, 7, 9, 4]
  Accuracy: 93.99%
  2019-09-14 09:49:41,725 - root - INFO - Save figure at '/home/moose/confusion_matrix.tmp.pdf'
  2019-09-14 09:49:41,876 - root - INFO - Found threshold for local connection: 398
  2019-09-14 09:49:41,876 - root - INFO - Found 9 clusters
  2019-09-14 09:49:41,877 - root - INFO - silhouette_score=-0.012313948323292875
      1: [0]
      1: [6]
      1: [5]
      1: [8]
      1: [3]
      1: [2]
      1: [1]
      2: [7, 9]
      1: [4]
  ```

  This gives

  ![](https://raw.githubusercontent.com/MartinThoma/clana/master/docs/mnist_confusion_matrix.png)



  Prepare a `labels.csv` which **has to have a header row**:

  ```
  $ clana visualize --cm cm.json --zero_diagonal --labels mnist/labels.csv
  ```

  ![](https://raw.githubusercontent.com/MartinThoma/clana/master/docs/mnist_confusion_matrix_labels.png)




  ```
  $ clana distribution --gt gt.csv --labels labels.csv [--out out/] [--long]
  ```

  prints one line per label, e.g.

  ```
  60% cat (56789 elements)
  20% dog (12345 elements)
   5% mouse (1337 elements)
   1% tux (314 elements)
  ```

  If `--out` is specified, it creates a horizontal bar chart. The first bar is
  the most common class, the second bar is the second most common class, ...

  It uses the short labels, except `--long` is added to the command.




  See [visualizations](docs/visualizations.md)



  ```
  >>> import numpy as np
  >>> arr = np.array([[9, 4, 7, 3, 8, 5, 2, 8, 7, 6],
                      [4, 9, 2, 8, 5, 8, 7, 3, 6, 7],
                      [7, 2, 9, 1, 6, 3, 0, 8, 5, 4],
                      [3, 8, 1, 9, 4, 7, 8, 2, 5, 6],
                      [8, 5, 6, 4, 9, 6, 3, 7, 8, 7],
                      [5, 8, 3, 7, 6, 9, 6, 4, 7, 8],
                      [2, 7, 0, 8, 3, 6, 9, 1, 4, 5],
                      [8, 3, 8, 2, 7, 4, 1, 9, 6, 5],
                      [7, 6, 5, 5, 8, 7, 4, 6, 9, 8],
                      [6, 7, 4, 6, 7, 8, 5, 5, 8, 9]])
  >>> from clana.optimize import simulated_annealing
  >>> result = simulated_annealing(arr)
  >>> result.cm
  array([[9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
         [8, 9, 8, 7, 6, 5, 4, 3, 2, 1],
         [7, 8, 9, 8, 7, 6, 5, 4, 3, 2],
         [6, 7, 8, 9, 8, 7, 6, 5, 4, 3],
         [5, 6, 7, 8, 9, 8, 7, 6, 5, 4],
         [4, 5, 6, 7, 8, 9, 8, 7, 6, 5],
         [3, 4, 5, 6, 7, 8, 9, 8, 7, 6],
         [2, 3, 4, 5, 6, 7, 8, 9, 8, 7],
         [1, 2, 3, 4, 5, 6, 7, 8, 9, 8],
         [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]])
  >>> result.perm
  array([2, 7, 0, 4, 8, 9, 5, 1, 3, 6])
  ```

  You can visualize the `result.cm` and use the `result.perm` to get your labels
  in the same order:

  ```


  >>> labels = [str(el) for el in range(11)]
  >>> np.array(labels)[result.perm]
  array(['2', '7', '0', '4', '8', '9', '5', '1', '3', '6'], dtype='<U2')
  ```


pkgId: 729f836c93b622471bee88d7249125f68b591889887642589a11259c37c60f0b
name: python-clang
arch: src
version: 17.0.6
epoch: 0
release: 1
summary: libclang python bindings
url: http://clang.llvm.org/
rpm_license: Apache-2.0 with LLVM exception
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clang-17.0.6-1.src.rpm
checksum_type: sha256
description:
  This is the python bindings subdir of llvm clang repository.
  https://github.com/llvm/llvm-project/tree/main/clang/bindings/python

  This is a non-official packaging directly from the debian packages for the purpose of creating a pypi package.

  Build repository at https://github.com/trolldbois/python-clang/

  Install with
      pip install clang
      pip install clang==14

  You will need to install llvm libclang libraries, which are not packaged with this package.


pkgId: dab1ca68a649c961a7ce7171fe01a47e7e0278e2f26ecda6bb2c8de0a3758fba
name: python-clang-format-docs
arch: src
version: 0.2.2
epoch: 0
release: 1
summary: Run `clang-format` on C++ code blocks in documentation files
url: https://github.com/finsberg/clang-format-docs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clang-format-docs-0.2.2-1.src.rpm
checksum_type: sha256
description:
  Run `clang-format` on C++ code blocks in documentation files.
  This project is derivative work of [`blacken-docs`](https://github.com/adamchainz/blacken-docs). License from `blacken-docs` is included in [LICENSE_blacken_docs](LICENSE_blacken_docs)

  ```bash
  pip install clang-format-docs
  ```

  `clang-format-docs` will take markdown files and search for C++ code blocks e.g
  ```markdown
      ```c++
      void hello(){
          std::cout << "Hello world\n"
      }
      ```
  ```
  and format them using `clang-format`, i.e
  ```bash
  clang-format-docs file.md
  ```
  will rewrite the file with clang-format applied. Also note that you can pass in a different format style using
  ```
  clang-format-docs --style=LLVM file.md
  ```
  or using a clang-format config file
  ```
  clang-format-docs -style=file:my_clang_format.txt file.md
  ```

  See [pre-commit](https://pre-commit.com) for instructions
  Sample `.pre-commit-config.yaml`:
  ```yaml
  -   repo: https://github.com/finsberg/clang-format-docs
      rev: v0.2.1
      hooks:
      -   id: clang-format-docs
          additional_dependencies: [clang-format==14.0.6]
  ```


pkgId: f81e65c7e25ff8c390c8ea4c8415519f30b10bb37eccde5dd781f3640fd48e6f
name: python-clang-tidier
arch: src
version: 0.4.0
epoch: 0
release: 1
summary: A simple runner for clang-tidy.
url: https://pypi.org/project/clang-tidier/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clang-tidier-0.4.0-1.src.rpm
checksum_type: sha256
description:
  A simple `clang-tidy` runner for C and C++ projects.



  `clang-tidier` requires Python 3.8 or higher, as well as some version of `clang-tidy` visible on the system PATH.

  ```
  pip3 install clang-tidier
  ```



  `clang-tidier` is a command-line application

  ```
  usage: clang-tidier [-h] [--version] [--include <regex> [<regex> ...]] [--exclude <regex> [<regex> ...]]
                      [--werror] [--threads <num>] [--session | --no-session] [compile_db]

  clang-tidy runner for C and C++ projects.

  positional arguments:
    compile_db            path to compile_commands.json, or a directory containing it (default: discover automatically)

  options:
    -h, --help            show this help message and exit
    --version             print the version and exit
    --include <regex> [<regex> ...]
                          regular expression to select source files.
    --exclude <regex> [<regex> ...]
                          regular expression to exclude source files.
    --werror              stop on the first file that emits warnings
    --threads <num>       number of threads to use.
    --session, --no-session
                          saves run information so subsequent re-runs may avoid re-scanning files. (default: True)

  v0.3.0 - github.com/marzer/clang-tidier
  ```



  | Value                                | Meaning                |
  | :----------------------------------- | :--------------------- |
  | 0                                    | No issues were found   |
  | `N`, where `N` is a positive integer | `N` issues were found  |
  | -1                                   | A fatal error occurred |






  -   Fixed sessions not restarting if `.clang-tidy` is modified
  -   Added `--labels-only`
  -   Minor performance improvements



  -   Added `--no-session`
  -   Added use of sessions by default



  -   Added `--session`



  -   Fixed build-generated translation causing 'did not exist or was not a file' errors
  -   Improved performance of TU enumeration step



  -   Fixed issues with older clang-tidy versions trying to use `--use-color`



  -   First public release 🎉&#xFE0F;


pkgId: 552809e979e7478c0d3fbc9dad65752168754ffbfe1eb21b45699f9dc409fbeb
name: python-clang-tidier
arch: src
version: 0.4.1
epoch: 0
release: 1
summary: A simple runner for clang-tidy.
url: https://pypi.org/project/clang-tidier/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clang-tidier-0.4.1-1.src.rpm
checksum_type: sha256
description:
  A simple `clang-tidy` runner for C and C++ projects.



  `clang-tidier` requires Python 3.8 or higher, as well as some version of `clang-tidy` visible on the system PATH.

  ```
  pip3 install clang-tidier
  ```



  `clang-tidier` is a command-line application

  ```
  usage: clang-tidier [-h] [--version] [--include <regex> [<regex> ...]] [--exclude <regex> [<regex> ...]]
                      [--werror] [--threads <num>] [--session | --no-session] [compile_db]

  clang-tidy runner for C and C++ projects.

  positional arguments:
    compile_db            path to compile_commands.json, or a directory containing it (default: discover automatically)

  options:
    -h, --help            show this help message and exit
    --version             print the version and exit
    --include <regex> [<regex> ...]
                          regular expression to select source files.
    --exclude <regex> [<regex> ...]
                          regular expression to exclude source files.
    --werror              stop on the first file that emits warnings
    --threads <num>       number of threads to use.
    --session, --no-session
                          saves run information so subsequent re-runs may avoid re-scanning files. (default: True)

  v0.3.0 - github.com/marzer/clang-tidier
  ```



  | Value                                | Meaning                |
  | :----------------------------------- | :--------------------- |
  | 0                                    | No issues were found   |
  | `N`, where `N` is a positive integer | `N` issues were found  |
  | -1                                   | A fatal error occurred |






  - Fixed precompiled headers breaking runs in some circumstances
  - Improved wording of session restart message



  - Fixed sessions not restarting if `.clang-tidy` is modified
  - Added `--labels-only`
  - Minor performance improvements



  - Added `--no-session`
  - Added use of sessions by default



  - Added `--session`



  - Fixed build-generated translation causing 'did not exist or was not a file' errors
  - Improved performance of TU enumeration step



  - Fixed issues with older clang-tidy versions trying to use `--use-color`



  - First public release 🎉&#xFE0F;


pkgId: 4eb9428c8f67dfb65b78d7ceca013486beb54bca8c1253d6e63aa2300d4ca289
name: python-clang-tools
arch: src
version: 0.13.1
epoch: 0
release: 1
summary: Install clang-tools (clang-format, clang-tidy) with pip
url: https://pypi.org/project/clang-tools/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clang-tools-0.13.1-1.src.rpm
checksum_type: sha256
description:
  **Install clang-format, clang-tidy, clang-query, and clang-apply-replacements binaries with clang-tools CLI.**
  |latest-version| |python-test| |codecov-badge| |sonar-badge| |platfrom-badge| |pypi-badge|
      This package only manages binary executables (& corresponding symbolic links) that
      are installed using this package's executable script. It does not intend to change or
      modify any binary executable installed from other sources (like LLVM releases).


pkgId: f7f1c7305e05144ea52ae8b25b75b4645eee1d30c51a5a1796bb8033b4206b55
name: python-clannotation
arch: src
version: 0.0.18
epoch: 0
release: 1
summary: The Crossref Labs annotation tool.
url: https://gitlab.com/crossref/labs/annotator
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clannotation-0.0.18-1.src.rpm
checksum_type: sha256
description:
  CLAnnotator is the module that Crossref Labs uses to decorate the experimental API.

  ![license](https://img.shields.io/gitlab/license/crossref/labs/clannotation) ![activity](https://img.shields.io/gitlab/last-commit/crossref/labs/clannotation)

  ![AWS](https://img.shields.io/badge/AWS-%23FF9900.svg?style=for-the-badge&logo=amazon-aws&logoColor=white) ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)

  This is a prototype Crossref Labs system. It is not guaranteed to be stable and the metadata schema and behaviour may be subject to change at any time.



  To install the CLAnnatator module, simply use the following pip command:

      pip install clannatator


  ISSN identifiers are normalized to remove hyphens and to capitalize the final X where it occurs.


  CLAnnotator is released under the [MIT License](https://opensource.org/licenses/MIT).

  &copy; Crossref 2023

rpm_license:
  Copyright &copy; 2023 Crossref  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: 456123140108433e974e70585b17797207cf3e6b30ce638c88d99c7dde0973a6
name: python-clap-python
arch: src
version: 0.2.1
epoch: 0
release: 1
summary: Rust Clap inspired command line argument parser.
url: https://github.com/maxWiklund/clap-python
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clap-python-0.2.1-1.src.rpm
checksum_type: sha256
description:
  > **Command Line Argument Parser for Python**

  [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](LICENSE-APACHE)
  ![PyPi](https://img.shields.io/pypi/v/clap_python)

  Licensed under [Apache 2.0](LICENSE-APACHE).



  A full-featured, fast Command Line Argument Parser for Python

  For more details, see:
  - [docs](https://clap-python.readthedocs.io/en/latest/)
  - [examples](examples/)


  ```bash
  pip install clap_python
  ```

  ```python
  from clap_python import App, Arg

  app = (
      App()
      .version("0.1.0")  # Version of the app.
      .arg_required_else_help(True)  # If no args passed show help message.
      .arg(Arg("--name", "-n").help("Name of the person to greet").required(True))
      .arg(
          Arg("--count", "-c")
          .help("Number of times to greet")
          .default(1)
          .value_parser(int)  # tell the parser to cast arg to int.
      )
  )

  if __name__ == "__main__":
      args = app.parse_args()
      for _ in range(args["count"]):
          print(f"Hello {args['name']}!")

  ```



  ```python
  from clap_python import App, Arg

  if __name__ == "__main__":
      args = App().arg(Arg("names").multiple_values(True)).parse_args()
      print(f"names: {args['names']}")
  ```


  ```python
  from clap_python import App, Arg
  from clap_python.complete import autocomplete

  app = App().arg(Arg("-c")).arg(Arg("--files").multiple_values(True))
  autocomplete(app) # Enable autocompletion
  args = app.parse_args() # Parse arguments
  print(args)
  ```
  You can read more at [docs](https://clap-python.readthedocs.io/en/latest/usage.html)

rpm_license:
[cell repeats an earlier one in this file: 10254 characters]


pkgId: 6d467ff1661e211af2abc00a4be84bd3060b598cabcb7493447df0196f33c646
name: python-clappform
arch: src
version: 4.1.0
epoch: 0
release: 1
summary: Clappform Python API wrapper
url: https://pypi.org/project/clappform/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clappform-4.1.0-1.src.rpm
checksum_type: sha256
description:
  **Clappform** is a wrapper for a Clappform B.V. API written in Python.

  ```python
  >>> from clappform import Clappform
  >>> import clappform.dataclasses as r
  >>> c = Clappform("https://app.clappform.com", "j.doe@clappform.com", "S3cr3tP4ssw0rd!")
  >>> apps = c.get(r.App())
  >>> for app in apps:
  ...     print(app.name)
  'Clappform'
  'Default'
  ```

  Clappform allows you to interact with the Clappform API for a given domain. For many of the resources that the Clappform API provides the simple ``get``, ``create``, ``update`` and ``delete`` methods can be used. Authentication is done transparently, so there is no need to manually authenticate.


pkgId: 4b0f44343f98e96166ffc9bc08affbbe6cb19ef592ffe237b20050f88ef4bdbe
name: python-clappform-integrations
arch: src
version: 1.0.31
epoch: 0
release: 1
summary: Clappform Python API wrapper
url: https://pypi.org/project/clappform-integrations/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clappform-integrations-1.0.31-1.src.rpm
checksum_type: sha256
description:
  git pull --recurse-submodules
  git submodule update --recursive --remote



  The Itris API wrapper facilitates interaction with the Itris system through both REST and SOAP protocols. It allows users to fetch data from various endpoints and handle cases efficiently.



  First, you need to download the Python package via pip::

  ```bash
  $ pip install clappform_integrations==1.0.26
  ```


  ```python
  from clappform_integrations import Itris
  import pandas as pd
  ```





  To initialize the REST part of the wrapper:

  ```python

  BASEURL_REST = "https://acc-webservices.itris.net/services/acc-istl-vip"
  CLIENT_ID_REST = ""
  CLIENT_SECRET_REST = ""
  USERNAME_REST = ""
  PASSWORD_REST = ""
  headers_rest = {
      'accept': 'application/json',
      'Authorization': '',
  }
  timeout_rest = 600

  itrisrest = Itris.ItrisREST(
      BASEURL_REST,
      CLIENT_ID_REST,
      CLIENT_SECRET_REST,
      USERNAME_REST,
      PASSWORD_REST,
      headers_rest,
      timeout_rest
  )
  ```




  Similarly for the SOAP part of the API, initialize the ItrisSOAP object with the following parameters:

  ```python

  BASEURL_LOGIN_SOAP= 'https://acc-webservices.itris.net/services/acc-istl-soap?WSDL'
  BASEURL_SOAP= 'https://acc-webservices.itris.net/services/acc-istl-cad'
  PASSWORD_SOAP= ''
  PLAINPASSWD_SOAP= ''
  SOAPUSERID_SOAP= ''
  USERNAME_SOAP= ''
  headers_soap= {
  'Content-Type' : 'text/xml'
  },
  timeout_soap= 600

  itrissoap = Itris.ItrisSOAP(
      BASEURL_LOGIN_SOAP,
      BASEURL_SOAP,
      USERNAME_SOAP,
      PASSWORD_SOAP,
      SOAPUSERID_SOAP,
      PLAINPASSWD_SOAP,
      headers_soap,
      timeout_soap
  )
  ```





  - To retrieve data in JSON format, use `fetch_data_from_endpoint`.
  - To retrieve data in DataFrame format, use `fetch_data_as_dataframe`.



  Call the desired endpoint directly using `call_endpoint`. It will return the data in XML format.



  When fetching data from the REST API, several filters can be applied:

  - `$expand`: Retrieve related data along with the main data.
  - `$skip`: Pagination for fetching data in chunks or pages.





  The wrapper includes predefined endpoints such as:

  - `FetchRentalObjectsWithHierarchy` is utilized alongside the "$expand" filter, pertaining to the hierarchy of rental objects. Within this hierarchy, we retrieve both the units and the complexes they correspond to.

  For example:

  ```python
  qParams = { "$expand": "Hierarchie_verhuurbare_objecten", "$skip":0}
  unit_df = itrisrest.fetch_data_as_dataframe("FetchRentalObjectsWithHierarchy", qParams)
  ```


  Users can interact with endpoints not explicitly defined by providing the endpoint's identifier.

  For example the Contracten endpoint is a new endpoint:

  ```python
  qParams = { }
  contracts = itrisrest.fetch_data_as_dataframe("Contracten", qParams)
  ```



  Predefined SOAP endpoints include:

  - GetCaseTypeDefinitions
  - GetCases
  - GetCaseStartState

  For example to get the complaints from the SOAP part you can use:

  ```python
  qParams = { }
  response_GetCaseTypeDefinitions = itrissoap.call_endpoint("GetCaseTypeDefinitions", qParams)
  ```


pkgId: db1ef7e60273a99afb3afb6716f56651a88b2f36682d5998ee76938721b2b5b1
name: python-claranet-tfwrapper
arch: src
version: 13.2.3
epoch: 0
release: 1
url: https://github.com/claranet/tfwrapper
rpm_license: Mozilla Public License Version 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claranet-tfwrapper-13.2.3-1.src.rpm
checksum_type: sha256
summary:
  Claranet's `tfwrapper` is a wrapper for [Terraform](https://www.terraform.io/) implemented in python which aims to simplify Terraform usage and enforce best practices

description:
  always_trigger_init: False # Always trigger `terraform init` first when launching `plan` or `apply` commands
  pipe_plan_command: "cat" # Default command used when you're invoking tfwrapper with `--pipe-plan`
  use_local_azure_session_directory: False # Use the current user's Azure configuration in `~/.azure`. By default, the wrapper uses a local `azure-cli` session and configuration in the local `.run` directory.
  ```

  Stacks configuration files use the following naming convention:
  ```bash
  conf/${account}_${environment}_${region}_${stack}.yml
  ```
  Here is an example for an AWS stack configuration:


pkgId: 2f6dc0fc8d2bfc28ce70e008c7b86b1f9589203312dd681c8526dbecd2fe43c4
name: python-clargs
arch: src
version: 0.9.0
epoch: 0
release: 1
summary: Easily generate commandline apps from your functions, based on type hints
url: https://pypi.org/project/clargs/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clargs-0.9.0-1.src.rpm
checksum_type: sha256
description:
  The goal of the `clargs` package is to create command-line interfaces from function signatures.
  - **Hit the ground running**: With a single line, an existing function is turned into a command line program
  - **Extensible**: It is flexible enough to do everything that `argparse` does, and keeps you in control
  - **No magic**: All the extension does is call commands in `argparse`; you can log and see these commands
  - **Safe**: The built-in python `argparse` module does all the work, so safety guarantees from that module apply
  - **Typing**: Parameter types are set as [PEP 484][2] type hints (e.g. `def foo(bar: int)`)
  - **Standard**: By using `argparse`, you get standard behaviour such as long/short parameters, combine flags, help function
  - **Don't repeat yourself**: Every parameter is defined (changed, added, removed) in one spot and only one spot, the function definition
  - **Rich parameter types**: Support for `str`, `int`, `float`, `bool`, `pathlib.Path` and `typing.Literal` (multiple-choice values)
  - **Richer parameter types**: In addition, lists of these parameters are allowed, default values, boolean-flags (`--foo/--no-foo`), counts
  - **Simple**: Pure python, no dependencies
  - **Documentation**: Function's docstring creates `--help` documentation. Support for `Sphynx`, `GoogleDoc`, `NumpyDoc`, `EpyText`

  Check out the [list of examples][3] to see the package in action
  A quick example (just to get you excited):
  ```python
  import clargs
  def count(
      singular: str,
      plural: str,
      maxitems: int = 10,
      *,
      shout: bool = False,
  ):
      """
      Counts from 1 to given number (default = 10)
      This text should not appear
      @param singular: The singular form of the thing to count
      @param plural: The plural form of the thing to count
      @param maxitems: The number to count to
      @param shout: If True, will convert all expressions to capitals
      """
      for i in range(maxitems):
          text = f"{i + 1} {singular if i == 0 else plural}"
          if shout:
              text = text.upper()
          print(text)
  if __name__ == "__main__":
      clargs.create_parser_and_run(count)
  ```
  ```console
  > python main.py --help
  usage: main.py [-h] [--shout [SHOUT]] singular plural [maxitems]
  Counts from 1 to given number (default = 10)
  positional arguments:
    singular              The singular form of the thing to count
    plural                The plural form of the thing to count
    maxitems              The number to count to
  options:
    -h, --help            show this help message and exit
    --shout [SHOUT], -s [SHOUT]
                          If True, will convert all expressions to capitals> python main.py bottle bottles
  1 bottle
  2 bottles
  3 bottles
  4 bottles
  5 bottles
  6 bottles
  7 bottles
  8 bottles
  9 bottles
  10 bottles
  > python main.py bottle bottles 5 --shout=yes
  1 BOTTLE
  2 BOTTLES
  3 BOTTLES
  4 BOTTLES
  5 BOTTLES
  ```

  The type of the parameter (given through a type-hint) determines what the input is parsed at.
  If no type-hint is given, `str` is assumed.

  These types just call the constructor on the string (e.g. `python main.py --input-file /tmp/myfile.txt --repeat 5` will assign `pathlib.Path("/tmp/myfile.txt")` to `input_file` and `int("5")` to `repeat` (assuming a function signature like: `def run(*, input_file: pathlib.Path, repeat: int)`).

  Booleans need some special work internally (since `bool("False") == True`). Any parameter of type `bool` will accept `Yes`, `No`, `True` and `False` (case-insensitive) as values.
  Booleans can also be made `Flag`s, see below under "Extra Types".

  Using `typing.Literal` parameters can be made that can only have certain values.
  The type of the parameters can be any of the types above

  Lists of items is supported (for all pf the above types). For instance a signature of `def sum(*, terms: typing.List[float]) -> float` means you can use `python sum.py --terms 1.2 4 -5`

  `typing.Optional` or a union with `None` is ignored, so this won't affect the command line signature.

  In addition to normal types, the `clargs` package defines some special types.

  Is an alias for `bool` (should be recognised by static type-checkers).
  Creates `--foo/--no-foo` parameter pair to control booleans

  Is an alias for `int` (should be recognised by static type-checkers).
  Counts how often a parameter is present (mostly used in `--verbose --verbose --verbose` parameters)

  Is an alias for `pathlib.Path` (should be recognised by static type-checkers).
  It adds validation to confirm that the path is existing, and is a directory.

  Is an alias for `pathlib.Path` (should be recognised by static type-checkers).
  It adds validation to confirm that the path is existing, and is a file.

  TODO: Describe how to make custom functions.

  Experimental support for validation is added, see [this example][6].
  There is no clean way yet to give a proper custom error message in case of an
  exception.

  Using subparsers it's possible to add multiple functions to your cli. See [an example here][4]

  `clargs` uses python's `logging` module to log to `DEBUG` level exactly what is being added to `argparse`'s `add_argument()` function.
  By making the logger output this to screen, you can debug what's going on.
  See [an example here][5]

  You can control settings on how `clargs` works, by using the `clargs.Clargs` class to call your functions.
  ```
  myclargs = clargs.Clargs(clargs.Settings(...))
  myclargs.create_parser_and_run(func)
  ```
  You can use the following settings (as keyword arguments to `Settings`)

  If you want another flag prefix (e.g. `++` or `/` for windows-like flags), set this here.
  If you provide your own parser (i.e. you don't use `create_parser()` on the `Clargs` object), you need to make sure you set `prefix_chars` correctly on the parser.

  Same but for the short flags

  If true, short flags are generated (so you can use `-f` instead of `--foo`.
  Note that the short flag is only generated for the first parameter starting with a certain letter.

  Python functions can have positional-only arguments (anything before `/`), keyword-only arguments (anything after `*`), and arguments that can be used both positionally and as keywords (default).
  Positional-only arguments always become positional commandline arguments. Keyword-only arguments always become keyword commandline arguments (flags).
  This parameter determines what to do with arguments that can be both positional and keyword.
  - `positional` those arguments are rendered as positional commandline arguments
  - `flag` those arguments are rendered as keyword commandline arguments (flags)
  - `flag_if_default` those arguments are rendered as flags if they have a default value, else as positional commandline arguments.

  If false, underscores are not replaced with dashes for the commandline arguments.
  In the default behaviour, a function parameter `foo_bar` will become a flag `--foo-bar`. If this parameter is false, it becomes `--foo_bar`.
  This only affects keyword parameters (flags), and subparser commands (so if a subparser is created for the function `count_down`, then the commandline command will be `count-down`.

  There are many other solutions to create command line interfaces from functions.
  I don't think it makes sense to create a comparison list of features now, only to have it be not up to date anymore tomorrow.
  The reasons that I developed `clargs` is because I could not find any solution that made me happy (based on the features and properties I describe above).
  [2]: https://peps.python.org/pep-0484/
  [3]: https://github.com/reinhrst/clargs/tree/main/examples/
  [4]: https://github.com/reinhrst/clargs/tree/main/examples/4_parse_groups.py
  [5]: https://github.com/reinhrst/clargs/tree/main/examples/5_logging.py
  [6]: https://github.com/reinhrst/clargs/tree/main/examples/6_validation.py

  `clargs` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.


pkgId: 37713831e274421b530a1589f7395e8cd60154056e4f9ef3a26d656b34ec5599
name: python-clarifai
arch: src
version: 10.10.0
epoch: 0
release: 1
summary: Clarifai Python SDK
url: https://github.com/Clarifai/clarifai-python
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarifai-10.10.0-1.src.rpm
checksum_type: sha256
description:
  * **[Installation](#rocket-installation)**
  * **[Getting Started](#memo-getting-started)**
  * **[Interacting with Datasets](#floppy_disk-interacting-with-datasets)**
  * **[Interacting with Inputs](#floppy_disk-interacting-with-inputs)**
    * [Input Upload](#input-upload)
    * [Input Listing](#input-listing)
  * **[Interacting with Models](#brain-interacting-with-models)**
    * [Model Predict](#model-predict)
    * [Model Training](#model-training)
    * [Model Listing](#models-listing)
  * **[Interacting with Workflows](#fire-interacting-with-workflows)**
    * [Workflow Predict](#workflow-predict)
    * [Workflow Listing](#workflows-listing)
    * [Workflow Create](#workflow-create)
    * [Workflow Export](#workflow-export)
  * **[Search](#mag-search)**
    * [Smart Image Search](#smart-image-search)
    * [Smart Text Search](#smart-text-search)
    * [Filters](#filters)
    * [Pagination](#pagination)
  * **[Retrieval Augmented Generation (RAG)](#retrieval-augmented-generation-rag)**
  * **[More Examples](#pushpin-more-examples)**

  Install from PyPi:
  ```bash
  pip install -U clarifai
  ```
  Install from Source:
  ```bash
  git clone https://github.com/Clarifai/clarifai-python.git
  cd clarifai-python
  python3 -m venv .venv
  source .venv/bin/activate
  pip install -r requirements.txt
  python setup.py install
  ```

  Clarifai uses **Personal Access Tokens(PATs)** to validate requests. You can create and manage PATs under your Clarifai account security settings.
  * 🔗 [Create PAT:](https://docs.clarifai.com/clarifai-basics/authentication/personal-access-tokens/) ***Log into Portal &rarr; Profile Icon &rarr; Security Settings &rarr; Create Personal Access Token &rarr; Set the scopes &rarr; Confirm***
  * 🔗 [Get User ID:](https://help.clarifai.com/hc/en-us/articles/4408131912727-How-do-I-find-my-user-id-app-id-and-PAT-) ***Log into Portal &rarr; Profile Icon &rarr; Account &rarr; Profile &rarr; User-ID***
  Export your PAT as an environment variable. Then, import and initialize the API Client.
  Set PAT as environment variable through terminal:
  ```cmd
  export CLARIFAI_PAT={your personal access token}
  ```
  ```python

  from clarifai.client.user import User
  client = User(user_id="user_id")

  apps_generator = client.list_apps()
  apps = list(apps_generator)
  ```
  OR <br>
  PAT can be passed as constructor argument
  ```python
  from clarifai.client.user import User
  client = User(user_id="user_id", pat="your personal access token")
  ```

  Clarifai datasets help in managing datasets used for model training and evaluation. It provides functionalities like creating datasets,uploading datasets, retrying failed uploads from logs and exporting datasets as .zip files.
  ```python


  app = client.create_app(app_id="demo_app", base_workflow="Universal")
  dataset = app.create_dataset(dataset_id="demo_dataset")

  from clarifai.datasets.upload.loaders.coco_detection import COCODetectionDataLoader
  coco_dataloader = COCODetectionDataLoader("images_dir", "coco_annotation_filepath")
  dataset.upload_dataset(dataloader=coco_dataloader, get_upload_status=True)

  from clarifai.datasets.upload.utils import load_module_dataloader
  cifar_dataloader = load_module_dataloader('./image_classification/cifar10')
  dataset.upload_dataset(dataloader=cifar_dataloader,
                         get_upload_status=True,
                         log_warnings =True)


  dataset.retry_upload_from_logs(dataloader=cifar_dataloader, log_file_path='log_file.log',
                                 retry_duplicates=True,
                                 log_warnings=True)

  dataset.upload_from_csv(csv_path='csv_path', input_type='text', csv_type='raw', labels=True)

  dataset.upload_from_folder(folder_path='folder_path', input_type='text', labels=True)

  dataset.export(save_path='output.zip')
  ```

  You can use ***inputs()*** for adding and interacting with input data. Inputs can be uploaded directly from a URL or a file. You can also view input annotations and concepts.

  ```python

  from clarifai.client.user import User
  app = User(user_id="user_id").app(app_id="app_id")
  input_obj = app.inputs()

  input_obj.upload_from_url(input_id = 'demo', image_url='https://samples.clarifai.com/metro-north.jpg')

  input_obj.upload_from_file(input_id = 'demo', video_file='demo.mp4')

  input_obj.upload_text(input_id = 'demo', raw_text = 'This is a test')
  ```

  ```python

  input_generator = input_obj.list_inputs(page_no=1,per_page=10,input_type='image')
  inputs_list = list(input_generator)

  annotation_generator = input_obj.list_annotations(batch_input=inputs_list)
  annotations_list = list(annotation_generator)

  all_concepts = list(app.list_concepts())
  ```

  ```python

  input_generator = input_obj.list_inputs(page_no=1,per_page=1,input_type='image')
  inputs_list = list(input_generator)

  input_bytes = input_obj.download_inputs(inputs_list)
  with open('demo.jpg','wb') as f:
    f.write(input_bytes[0])
  ```

  The **Model** Class allows you to perform predictions using Clarifai models. You can specify which model to use by providing the model URL or ID. This gives you flexibility in choosing models. The **App** Class also allows listing of all available Clarifai models for discovery.
  For greater control over model predictions, you can pass in an `output_config` to modify the model output as demonstrated below.

  ```python

  from clarifai.client.model import Model
  """
  Get Model information on details of model(description, usecases..etc) and info on training or

  """
  gpt_4_model = Model("https://clarifai.com/openai/chat-completion/models/GPT-4")
  print(gpt_4_model)

  model_prediction = Model("https://clarifai.com/anthropic/completion/models/claude-v2").predict_by_bytes(b"Write a tweet on future of AI")

  model_prediction = gpt_4_model.predict_by_bytes(b"Write a tweet on future of AI", inference_params=dict(temperature=str(0.7), max_tokens=30))

  model_prediction = model.predict_by_filepath(filepath="local_filepath", output_config={"min_value": 0.98}) # Supports image, text, audio, video

  model_prediction = model.predict_by_url(url="url") # Supports image, text, audio, video

  video_input_proto = [input_obj.get_input_from_url("Input_id", video_url=BEER_VIDEO_URL)]
  model_prediction = model.predict(video_input_proto, output_config={"sample_ms": 2000})
  ```

  ```python

  from clarifai.client.app import App
  from clarifai.client.model import Model
  """
  Create model with trainable model_type
  """
  app = App(user_id="user_id", app_id="app_id")
  model = app.create_model(model_id="model_id", model_type_id="visual-classifier")
                 (or)
  model = Model('url')
  """
  List training templates for the model_type
  """
  templates = model.list_training_templates()
  print(templates)
  """
  Get parameters for the model.
  """
  params = model.get_params(template='classification_basemodel_v1', save_to='model_params.yaml')
  """
  Update the model params yaml and pass it to model.train()
  """
  model_version_id = model.train('model_params.yaml')
  """
  Training status and saving logs
  """
  status = model.training_status(version_id=model_version_id,training_logs=True)
  print(status)
  ```

  Model Export feature enables you to package your trained model into a `model.tar` file. This file enables deploying your model within a Triton Inference Server deployment.
  ```python
  from clarifai.client.model import Model
  model = Model('url')
  model.export('output/folder/')
  ```

  When your model is trained and ready, you can evaluate by the following code
  ```python
  from clarifai.client.model import Model
  model = Model('url')
  model.evaluate(dataset_id='your-dataset-id')
  ```
  Compare the evaluation results of your models.
  ```python
  from clarifai.client.model import Model
  from clarifai.client.dataset import Dataset
  from clarifai.utils.evaluation import EvalResultCompare
  models = ['model url1', 'model url2'] # or [Model(url1), Model(url2)]
  dataset = 'dataset url' # or Dataset(dataset_url)
  compare = EvalResultCompare(
    models=models,
    datasets=dataset,
    attempt_evaluate=True # attempt evaluate when the model is not evaluated with the dataset
    )
  compare.all('output/folder/')
  ```

  ```python


  all_model_versions = list(model.list_versions())

  model_v1 = client.app("app_id").model(model_id="model_id", model_version_id="model_version_id")

  all_models = list(app.list_models())

  all_llm_community_models = App().list_models(filter_by={"query": "LLM",
                                                          "model_type_id": "text-to-text"}, only_in_app=False)
  all_llm_community_models = list(all_llm_community_models)
  ```

  Workflows offer a versatile framework for constructing the inference pipeline, simplifying the integration of diverse models. You can use the **Workflow** class to create and manage workflows using **YAML** configuration.
  For starting or making quick adjustments to existing Clarifai community workflows using an initial YAML configuration, the SDK provides an export feature.

  ```python

  from clarifai.client.workflow import Workflow

  workflow = Workflow("workflow_url") # Example: https://clarifai.com/clarifai/main/workflows/Face-Sentiment
  workflow_prediction = workflow.predict_by_url(url="url") # Supports image, text, audio, video

  workflow = Workflow(user_id="user_id", app_id="app_id", workflow_id="workflow_id",
                    output_config={"min_value": 0.98}) # Return predictions having prediction confidence > 0.98
  workflow_prediction = workflow.predict_by_filepath(filepath="local_filepath") # Supports image, text, audio, video
  ```

  ```python


  all_workflow_versions = list(workflow.list_versions())

  workflow_v1 = Workflow(workflow_id="workflow_id", workflow_version=dict(id="workflow_version_id"), app_id="app_id", user_id="user_id")

  all_workflow = list(app.list_workflow())

  all_face_community_workflows = App().list_workflows(filter_by={"query": "face"}, only_in_app=False) # Get all face related workflows
  all_face_community_workflows = list(all_face_community_workflows)
  ```

  Create a new workflow specified by a yaml config file.
  ```python

  from clarifai.client.app import App
  app = App(app_id="app_id", user_id="user_id")
  workflow = app.create_workflow(config_filepath="config.yml")
  ```

  Export an existing workflow from Clarifai as a local yaml file.
  ```python

  from clarifai.client.workflow import Workflow
  workflow = Workflow("https://clarifai.com/clarifai/main/workflows/Demographics")
  workflow.export('demographics_workflow.yml')
  ```


  Clarifai's Smart Search feature leverages vector search capabilities to power the search experience. Vector search is a type of search engine that uses vectors to search and retrieve text, images, and videos.
  Instead of traditional keyword-based search, where exact matches are sought, vector search allows for searching based on visual and/or semantic similarity by calculating distances between vector embedding representations of the data.
  Here is an example of how to use vector search to find similar images:
  ```python

  from clarifai.client.search import Search
  search = Search(user_id="user_id", app_id="app_id", top_k=1, metric="cosine")

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}])
  for data in results:
    print(data.hits[0].input.data.image.url)
  ```

  Smart Text Search is our proprietary feature that uses deep learning techniques to sort, rank, and retrieve text data based on their content and semantic similarity.
  Here is an example of how to use Smart Text Search to find similar text:
  ```python


  results = search.query(ranks=[{"text_raw": "I love my dog"}])
  ```

  You can use filters to narrow down your search results. Filters can be used to filter by concepts, metadata, and Geo Point.
  It is possible to add together multiple search parameters to expand your search. You can even combine negated search terms for more advanced tasks.
  For example, you can combine two concepts as below.
  ```python

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}],
                          filters=[{"concepts": [{"name": "deer", "value":1},
                                                {"name": "dog", "value":1}]}])

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}],
                          filters=[{"concepts": [{"name": "deer", "value":1}],
                                    "concepts": [{"name": "dog", "value":1}]}])
  ```
  Input filters allows to filter by input_type, status of inputs and by inputs_dataset_id
  ```python
  results = search.query(filters=[{'input_types': ['image', 'text']}])
  ```

  Below is an example of using Search with Pagination.
  ```python

  from clarifai.client.search import Search
  search = Search(user_id="user_id", app_id="app_id", metric="cosine", pagination=True)

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}],page_no=2,per_page=5)
  for data in results:
    print(data.hits[0].input.data.image.url)
  ```

  You can setup and start your RAG pipeline in 4 lines of code. The setup method automatically creates a new app and the necessary components under the hood. By default it uses the [mistral-7B-Instruct](https://clarifai.com/mistralai/completion/models/mistral-7B-Instruct) model.
  ```python
  from clarifai.rag import RAG
  rag_agent = RAG.setup(user_id="USER_ID")
  rag_agent.upload(folder_path="~/docs")
  rag_agent.chat(messages=[{"role":"human", "content":"What is Clarifai"}])
  ```
  If you have previously run the setup method, you can instantiate the RAG class with the prompter workflow URL:
  ```python
  from clarifai.rag import RAG
  rag_agent = RAG(workflow_url="WORKFLOW_URL")
  ```

  See many more code examples in this [repo](https://github.com/Clarifai/examples).
  Also see the official [Python SDK docs](https://clarifai-python.readthedocs.io/en/latest/index.html)


pkgId: fd85c3cb61b7b2f5809f52f236bb98ad2b2a64cac4d9a8f163f2f3294145f77c
name: python-clarifai
arch: src
version: 10.8.2
epoch: 0
release: 1
summary: Clarifai Python SDK
url: https://github.com/Clarifai/clarifai-python
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarifai-10.8.2-1.src.rpm
checksum_type: sha256
description:
  * **[Installation](#rocket-installation)**
  * **[Getting Started](#memo-getting-started)**
  * **[Interacting with Datasets](#floppy_disk-interacting-with-datasets)**
  * **[Interacting with Inputs](#floppy_disk-interacting-with-inputs)**
    * [Input Upload](#input-upload)
    * [Input Listing](#input-listing)
  * **[Interacting with Models](#brain-interacting-with-models)**
    * [Model Predict](#model-predict)
    * [Model Training](#model-training)
    * [Model Listing](#models-listing)
  * **[Interacting with Workflows](#fire-interacting-with-workflows)**
    * [Workflow Predict](#workflow-predict)
    * [Workflow Listing](#workflows-listing)
    * [Workflow Create](#workflow-create)
    * [Workflow Export](#workflow-export)
  * **[Search](#mag-search)**
    * [Smart Image Search](#smart-image-search)
    * [Smart Text Search](#smart-text-search)
    * [Filters](#filters)
    * [Pagination](#pagination)
  * **[Retrieval Augmented Generation (RAG)](#retrieval-augmented-generation-rag)**
  * **[More Examples](#pushpin-more-examples)**

  Install from PyPi:
  ```bash
  pip install -U clarifai
  ```
  Install from Source:
  ```bash
  git clone https://github.com/Clarifai/clarifai-python.git
  cd clarifai-python
  python3 -m venv .venv
  source .venv/bin/activate
  pip install -r requirements.txt
  python setup.py install
  ```

  Clarifai uses **Personal Access Tokens(PATs)** to validate requests. You can create and manage PATs under your Clarifai account security settings.
  * 🔗 [Create PAT:](https://docs.clarifai.com/clarifai-basics/authentication/personal-access-tokens/) ***Log into Portal &rarr; Profile Icon &rarr; Security Settings &rarr; Create Personal Access Token &rarr; Set the scopes &rarr; Confirm***
  * 🔗 [Get User ID:](https://help.clarifai.com/hc/en-us/articles/4408131912727-How-do-I-find-my-user-id-app-id-and-PAT-) ***Log into Portal &rarr; Profile Icon &rarr; Account &rarr; Profile &rarr; User-ID***
  Export your PAT as an environment variable. Then, import and initialize the API Client.
  Set PAT as environment variable through terminal:
  ```cmd
  export CLARIFAI_PAT={your personal access token}
  ```
  ```python

  from clarifai.client.user import User
  client = User(user_id="user_id")

  apps_generator = client.list_apps()
  apps = list(apps_generator)
  ```
  OR <br>
  PAT can be passed as constructor argument
  ```python
  from clarifai.client.user import User
  client = User(user_id="user_id", pat="your personal access token")
  ```

  Clarifai datasets help in managing datasets used for model training and evaluation. It provides functionalities like creating datasets,uploading datasets, retrying failed uploads from logs and exporting datasets as .zip files.
  ```python


  app = client.create_app(app_id="demo_app", base_workflow="Universal")
  dataset = app.create_dataset(dataset_id="demo_dataset")

  from clarifai.datasets.upload.loaders.coco_detection import COCODetectionDataLoader
  coco_dataloader = COCODetectionDataLoader("images_dir", "coco_annotation_filepath")
  dataset.upload_dataset(dataloader=coco_dataloader, get_upload_status=True)

  from clarifai.datasets.upload.utils import load_module_dataloader
  cifar_dataloader = load_module_dataloader('./image_classification/cifar10')
  dataset.upload_dataset(dataloader=cifar_dataloader,
                         get_upload_status=True,
                         log_warnings =True)


  dataset.retry_upload_from_logs(dataloader=cifar_dataloader, log_file_path='log_file.log',
                                 retry_duplicates=True,
                                 log_warnings=True)

  dataset.upload_from_csv(csv_path='csv_path', input_type='text', csv_type='raw', labels=True)

  dataset.upload_from_folder(folder_path='folder_path', input_type='text', labels=True)

  dataset.export(save_path='output.zip')
  ```

  You can use ***inputs()*** for adding and interacting with input data. Inputs can be uploaded directly from a URL or a file. You can also view input annotations and concepts.

  ```python

  from clarifai.client.user import User
  app = User(user_id="user_id").app(app_id="app_id")
  input_obj = app.inputs()

  input_obj.upload_from_url(input_id = 'demo', image_url='https://samples.clarifai.com/metro-north.jpg')

  input_obj.upload_from_file(input_id = 'demo', video_file='demo.mp4')

  input_obj.upload_text(input_id = 'demo', raw_text = 'This is a test')
  ```

  ```python

  input_generator = input_obj.list_inputs(page_no=1,per_page=10,input_type='image')
  inputs_list = list(input_generator)

  annotation_generator = input_obj.list_annotations(batch_input=inputs_list)
  annotations_list = list(annotation_generator)

  all_concepts = list(app.list_concepts())
  ```

  ```python

  input_generator = input_obj.list_inputs(page_no=1,per_page=1,input_type='image')
  inputs_list = list(input_generator)

  input_bytes = input_obj.download_inputs(inputs_list)
  with open('demo.jpg','wb') as f:
    f.write(input_bytes[0])
  ```

  The **Model** Class allows you to perform predictions using Clarifai models. You can specify which model to use by providing the model URL or ID. This gives you flexibility in choosing models. The **App** Class also allows listing of all available Clarifai models for discovery.
  For greater control over model predictions, you can pass in an `output_config` to modify the model output as demonstrated below.

  ```python

  from clarifai.client.model import Model
  """
  Get Model information on details of model(description, usecases..etc) and info on training or

  """
  gpt_4_model = Model("https://clarifai.com/openai/chat-completion/models/GPT-4")
  print(gpt_4_model)

  model_prediction = Model("https://clarifai.com/anthropic/completion/models/claude-v2").predict_by_bytes(b"Write a tweet on future of AI", input_type="text")

  model_prediction = gpt_4_model.predict_by_bytes(b"Write a tweet on future of AI", "text", inference_params=dict(temperature=str(0.7), max_tokens=30))

  model_prediction = model.predict_by_filepath(filepath="local_filepath", input_type, output_config={"min_value": 0.98}) # Supports image, text, audio, video

  model_prediction = model.predict_by_url(url="url", input_type) # Supports image, text, audio, video

  video_input_proto = [input_obj.get_input_from_url("Input_id", video_url=BEER_VIDEO_URL)]
  model_prediction = model.predict(video_input_proto, input_type="video", output_config={"sample_ms": 2000})
  ```

  ```python

  from clarifai.client.app import App
  from clarifai.client.model import Model
  """
  Create model with trainable model_type
  """
  app = App(user_id="user_id", app_id="app_id")
  model = app.create_model(model_id="model_id", model_type_id="visual-classifier")
                 (or)
  model = Model('url')
  """
  List training templates for the model_type
  """
  templates = model.list_training_templates()
  print(templates)
  """
  Get parameters for the model.
  """
  params = model.get_params(template='classification_basemodel_v1', save_to='model_params.yaml')
  """
  Update the model params yaml and pass it to model.train()
  """
  model_version_id = model.train('model_params.yaml')
  """
  Training status and saving logs
  """
  status = model.training_status(version_id=model_version_id,training_logs=True)
  print(status)
  ```

  Model Export feature enables you to package your trained model into a `model.tar` file. This file enables deploying your model within a Triton Inference Server deployment.
  ```python
  from clarifai.client.model import Model
  model = Model('url')
  model.export('output/folder/')
  ```

  When your model is trained and ready, you can evaluate by the following code
  ```python
  from clarifai.client.model import Model
  model = Model('url')
  model.evaluate(dataset_id='your-dataset-id')
  ```
  Compare the evaluation results of your models.
  ```python
  from clarifai.client.model import Model
  from clarifai.client.dataset import Dataset
  from clarifai.utils.evaluation import EvalResultCompare
  models = ['model url1', 'model url2'] # or [Model(url1), Model(url2)]
  dataset = 'dataset url' # or Dataset(dataset_url)
  compare = EvalResultCompare(
    models=models,
    datasets=dataset,
    attempt_evaluate=True # attempt evaluate when the model is not evaluated with the dataset
    )
  compare.all('output/folder/')
  ```

  ```python


  all_model_versions = list(model.list_versions())

  model_v1 = client.app("app_id").model(model_id="model_id", model_version_id="model_version_id")

  all_models = list(app.list_models())

  all_llm_community_models = App().list_models(filter_by={"query": "LLM",
                                                          "model_type_id": "text-to-text"}, only_in_app=False)
  all_llm_community_models = list(all_llm_community_models)
  ```

  Workflows offer a versatile framework for constructing the inference pipeline, simplifying the integration of diverse models. You can use the **Workflow** class to create and manage workflows using **YAML** configuration.
  For starting or making quick adjustments to existing Clarifai community workflows using an initial YAML configuration, the SDK provides an export feature.

  ```python

  from clarifai.client.workflow import Workflow

  workflow = Workflow("workflow_url") # Example: https://clarifai.com/clarifai/main/workflows/Face-Sentiment
  workflow_prediction = workflow.predict_by_url(url="url", input_type="image") # Supports image, text, audio, video

  workflow = Workflow(user_id="user_id", app_id="app_id", workflow_id="workflow_id",
                    output_config={"min_value": 0.98}) # Return predictions having prediction confidence > 0.98
  workflow_prediction = workflow.predict_by_filepath(filepath="local_filepath", input_type="text") # Supports image, text, audio, video
  ```

  ```python


  all_workflow_versions = list(workflow.list_versions())

  workflow_v1 = Workflow(workflow_id="workflow_id", workflow_version=dict(id="workflow_version_id"), app_id="app_id", user_id="user_id")

  all_workflow = list(app.list_workflow())

  all_face_community_workflows = App().list_workflows(filter_by={"query": "face"}, only_in_app=False) # Get all face related workflows
  all_face_community_workflows = list(all_face_community_workflows)
  ```

  Create a new workflow specified by a yaml config file.
  ```python

  from clarifai.client.app import App
  app = App(app_id="app_id", user_id="user_id")
  workflow = app.create_workflow(config_filepath="config.yml")
  ```

  Export an existing workflow from Clarifai as a local yaml file.
  ```python

  from clarifai.client.workflow import Workflow
  workflow = Workflow("https://clarifai.com/clarifai/main/workflows/Demographics")
  workflow.export('demographics_workflow.yml')
  ```


  Clarifai's Smart Search feature leverages vector search capabilities to power the search experience. Vector search is a type of search engine that uses vectors to search and retrieve text, images, and videos.
  Instead of traditional keyword-based search, where exact matches are sought, vector search allows for searching based on visual and/or semantic similarity by calculating distances between vector embedding representations of the data.
  Here is an example of how to use vector search to find similar images:
  ```python

  from clarifai.client.search import Search
  search = Search(user_id="user_id", app_id="app_id", top_k=1, metric="cosine")

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}])
  for data in results:
    print(data.hits[0].input.data.image.url)
  ```

  Smart Text Search is our proprietary feature that uses deep learning techniques to sort, rank, and retrieve text data based on their content and semantic similarity.
  Here is an example of how to use Smart Text Search to find similar text:
  ```python


  results = search.query(ranks=[{"text_raw": "I love my dog"}])
  ```

  You can use filters to narrow down your search results. Filters can be used to filter by concepts, metadata, and Geo Point.
  It is possible to add together multiple search parameters to expand your search. You can even combine negated search terms for more advanced tasks.
  For example, you can combine two concepts as below.
  ```python

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}],
                          filters=[{"concepts": [{"name": "deer", "value":1},
                                                {"name": "dog", "value":1}]}])

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}],
                          filters=[{"concepts": [{"name": "deer", "value":1}],
                                    "concepts": [{"name": "dog", "value":1}]}])
  ```
  Input filters allows to filter by input_type, status of inputs and by inputs_dataset_id
  ```python
  results = search.query(filters=[{'input_types': ['image', 'text']}])
  ```

  Below is an example of using Search with Pagination.
  ```python

  from clarifai.client.search import Search
  search = Search(user_id="user_id", app_id="app_id", metric="cosine", pagination=True)

  results = search.query(ranks=[{"image_url": "https://samples.clarifai.com/metro-north.jpg"}],page_no=2,per_page=5)
  for data in results:
    print(data.hits[0].input.data.image.url)
  ```

  You can setup and start your RAG pipeline in 4 lines of code. The setup method automatically creates a new app and the necessary components under the hood. By default it uses the [mistral-7B-Instruct](https://clarifai.com/mistralai/completion/models/mistral-7B-Instruct) model.
  ```python
  from clarifai.rag import RAG
  rag_agent = RAG.setup(user_id="USER_ID")
  rag_agent.upload(folder_path="~/docs")
  rag_agent.chat(messages=[{"role":"human", "content":"What is Clarifai"}])
  ```
  If you have previously run the setup method, you can instantiate the RAG class with the prompter workflow URL:
  ```python
  from clarifai.rag import RAG
  rag_agent = RAG(workflow_url="WORKFLOW_URL")
  ```

  See many more code examples in this [repo](https://github.com/Clarifai/examples).
  Also see the official [Python SDK docs](https://clarifai-python.readthedocs.io/en/latest/index.html)


pkgId: 2ce1fb133613a25451b1894cca3da71c2df218ce74210bc1106b9ccb90c2f3f1
name: python-clarifai-grpc
arch: src
version: 10.10.0
epoch: 0
release: 1
summary: Clarifai gRPC API Client
url: https://github.com/Clarifai/clarifai-python-grpc
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarifai-grpc-10.10.0-1.src.rpm
checksum_type: sha256
description:
  ![image](https://github.com/user-attachments/assets/e52874e7-9246-4d55-ad9d-18b1f44aee1a)




  This is the official Clarifai gRPC Python client for interacting with our powerful recognition
  [API](https://docs.clarifai.com).
  Clarifai provides a platform for data scientists, developers, researchers and enterprises to master the entire
  artificial intelligence lifecycle. Gather valuable business insights from images, video and text using computer vision
  and natural language processing.

  * Try the Clarifai demo at: https://clarifai.com/demo
  * Sign up for a free account at: https://portal.clarifai.com/signup
  * Read the documentation at: https://docs.clarifai.com/


  [![PyPI version](https://pypip.in/v/clarifai-grpc/badge.png)](https://pypi.python.org/pypi/clarifai-grpc)
  [![Build](https://github.com/Clarifai/clarifai-python-grpc/workflows/Run%20tests/badge.svg)](https://github.com/Clarifai/clarifai-python-grpc/actions)



  ```cmd
  python -m pip install clarifai-grpc
  ```



  This library doesn't use semantic versioning. The first two version numbers (`X.Y` out of `X.Y.Z`) follow the API (backend) versioning, and
  whenever the API gets updated, this library follows it.

  The third version number (`Z` out of `X.Y.Z`) is used by this library for any independent releases of library-specific improvements and bug fixes.



  Construct the `V2Stub` object using which you'll access all the Clarifai API functionality:

  ```python
  from clarifai_grpc.channel.clarifai_channel import ClarifaiChannel
  from clarifai_grpc.grpc.api import service_pb2_grpc

  stub = service_pb2_grpc.V2Stub(ClarifaiChannel.get_grpc_channel())
  ```

  > Alternatives to the encrypted gRPC channel (`ClarifaiChannel.get_grpc_channel()`) are:
  > - the HTTPS+JSON channel (`ClarifaiChannel.get_json_channel()`), and
  > - the unencrypted gRPC channel (`ClarifaiChannel.get_insecure_grpc_channel()`).
  >
  > We only recommend them in special cases.

  Predict concepts in an image:

  ```python
  from clarifai_grpc.grpc.api import service_pb2, resources_pb2
  from clarifai_grpc.grpc.api.status import status_code_pb2

  YOUR_CLARIFAI_API_KEY = "???"
  YOUR_APPLICATION_ID = "???"
  SAMPLE_URL = "https://samples.clarifai.com/metro-north.jpg"


  metadata = (("authorization", f"Key {YOUR_CLARIFAI_API_KEY}"),)

  request = service_pb2.PostModelOutputsRequest(
      
      model_id="general-image-recognition",
      user_app_id=resources_pb2.UserAppIDSet(app_id=YOUR_APPLICATION_ID),
      inputs=[
          resources_pb2.Input(
              data=resources_pb2.Data(image=resources_pb2.Image(url=SAMPLE_URL))
          )
      ],
  )
  response = stub.PostModelOutputs(request, metadata=metadata)

  if response.status.code != status_code_pb2.SUCCESS:
      print(response)
      raise Exception(f"Request failed, status code: {response.status}")

  for concept in response.outputs[0].data.concepts:
      print("%12s: %.2f" % (concept.name, concept.value))
  ```

  See [the Clarifai API documentation](https://docs.clarifai.com/) for all available functionality.





  Try upgrading **setuptools** to a version `40.7.1` or higher.
  ```
  pip install --upgrade setuptools
  ```
  Source: https://github.com/grpc/grpc/issues/17829


pkgId: 69a2c0eb28f5e5457b604afb84b4deb1650041ee4eeee1fa733480770b87123f
name: python-clarifai-grpc
arch: src
version: 10.8.6
epoch: 0
release: 1
summary: Clarifai gRPC API Client
url: https://github.com/Clarifai/clarifai-python-grpc
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarifai-grpc-10.8.6-1.src.rpm
checksum_type: sha256
description:
  ![Clarifai logo](docs/logo.png)



  This is the official Clarifai gRPC Python client for interacting with our powerful recognition
  [API](https://docs.clarifai.com).
  Clarifai provides a platform for data scientists, developers, researchers and enterprises to master the entire
  artificial intelligence lifecycle. Gather valuable business insights from images, video and text using computer vision
  and natural language processing.

  * Try the Clarifai demo at: https://clarifai.com/demo
  * Sign up for a free account at: https://portal.clarifai.com/signup
  * Read the documentation at: https://docs.clarifai.com/


  [![PyPI version](https://pypip.in/v/clarifai-grpc/badge.png)](https://pypi.python.org/pypi/clarifai-grpc)
  [![Build](https://github.com/Clarifai/clarifai-python-grpc/workflows/Run%20tests/badge.svg)](https://github.com/Clarifai/clarifai-python-grpc/actions)



  ```cmd
  python -m pip install clarifai-grpc
  ```



  This library doesn't use semantic versioning. The first two version numbers (`X.Y` out of `X.Y.Z`) follow the API (backend) versioning, and
  whenever the API gets updated, this library follows it.

  The third version number (`Z` out of `X.Y.Z`) is used by this library for any independent releases of library-specific improvements and bug fixes.



  Construct the `V2Stub` object using which you'll access all the Clarifai API functionality:

  ```python
  from clarifai_grpc.channel.clarifai_channel import ClarifaiChannel
  from clarifai_grpc.grpc.api import service_pb2_grpc

  stub = service_pb2_grpc.V2Stub(ClarifaiChannel.get_grpc_channel())
  ```

  > Alternatives to the encrypted gRPC channel (`ClarifaiChannel.get_grpc_channel()`) are:
  > - the HTTPS+JSON channel (`ClarifaiChannel.get_json_channel()`), and
  > - the unencrypted gRPC channel (`ClarifaiChannel.get_insecure_grpc_channel()`).
  >
  > We only recommend them in special cases.

  Predict concepts in an image:

  ```python
  from clarifai_grpc.grpc.api import service_pb2, resources_pb2
  from clarifai_grpc.grpc.api.status import status_code_pb2

  YOUR_CLARIFAI_API_KEY = "???"
  YOUR_APPLICATION_ID = "???"
  SAMPLE_URL = "https://samples.clarifai.com/metro-north.jpg"


  metadata = (("authorization", f"Key {YOUR_CLARIFAI_API_KEY}"),)

  request = service_pb2.PostModelOutputsRequest(
      
      model_id="general-image-recognition",
      user_app_id=resources_pb2.UserAppIDSet(app_id=YOUR_APPLICATION_ID),
      inputs=[
          resources_pb2.Input(
              data=resources_pb2.Data(image=resources_pb2.Image(url=SAMPLE_URL))
          )
      ],
  )
  response = stub.PostModelOutputs(request, metadata=metadata)

  if response.status.code != status_code_pb2.SUCCESS:
      print(response)
      raise Exception(f"Request failed, status code: {response.status}")

  for concept in response.outputs[0].data.concepts:
      print("%12s: %.2f" % (concept.name, concept.value))
  ```

  See [the Clarifai API documentation](https://docs.clarifai.com/) for all available functionality.





  Try upgrading **setuptools** to a version `40.7.1` or higher.
  ```
  pip install --upgrade setuptools
  ```
  Source: https://github.com/grpc/grpc/issues/17829


pkgId: f783381c13317edfc36ae344b788bae04ec4b8f9425c88da64e88d9b1732ed99
name: python-clarify-assets
arch: src
version: 0.0.10
epoch: 0
release: 1
summary: Populate Clarify metadata through asset models.
url: https://github.com/clarify/clarify-assets
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarify-assets-0.0.10-1.src.rpm
checksum_type: sha256
description:
  Populate Clarify metadata through asset models.



  ```python
  from clarify_assets import Asset, Attribute, AssetBroker
  from pyclarify import Item


  enterprise = Asset(
      labels = [{"enterprise": "OG Inc"}]
  )

  station = Asset(
      labels = [{"station": "work"}]
  )

  temperature = Attribute(
      meta=Item(
          name="Temperature",
          labels={
              "medium": ["Air"]
          }
      ),
      filter = {"name": "Temperature"}
  )

  climate = Asset(
      labels=[{"cell": "climate"}],
      attributes=[temperature]
  )

  station.append(climate)
  enterprise.append(station)

  enterprise.pretty_print(debug=True)

  AB = AssetBroker(
      credentials="credentials.json",
      integrations=["integration1"]
  )

  AB.flush_and_build_db()

  AB.assign_signals(enterprise)

  enterprise.pretty_print(minimal=True)

  AB.publish_asset(enterprise)
  ```



  ```python
  from clarify_assets import Attribute
  from dataclasses import dataclass

  def get_value_or_none(key, asset):
    return list(filter(lambda x: x,
              list(map(lambda x: x[key] if key in x.keys() else None,
                       asset.labels)
                  )
    ))

  def get_line_number(string):
    return string.lower().replace(" ", "").split("line")[-1]


  @dataclass
  class FishtalkAttribute(Attribute):
    def __post_init__(self):
      super().__post_init__()
      self.independent = True
      if self.meta:
        i = self.meta.dict()
        i["labels"]["data-source"] = ["Fishtalk"]
        self.meta = Item(**i)
      if self.labels:

        area_label = get_value_or_none("area", self)
        line_label = get_value_or_none("line", self)
        if area_label and line_label:
          line_no =  get_line_number(line_label)
          if len(line_no) == 1:
            line_no = "0" + line_no

          unit_label = area_label + "-" + line_no

          self.filter = merge_filters(self.filter, {"labels.unit": [unit_label]})



  @dataclass
  class FishtalkBiomassCount(FishtalkAttribute):
    meta: Item = Item(
          name = "Biomasse antall",
          engUnit = "stk",
          visible = True,
    )
    def __post_init__(self):
          self.filter = merge_filters(self.filter, {"name": "fishtalkparser.Closing Count"})
          super().__post_init__()
  ```



  ```python
  @dataclass
  class ValveAeration(ScadaAttribute):
    meta: Item = Item(
          name = "Valve X",
          engUnit = "",
          valueType="enum",
          enumValues={
              "0": "Closed",
              "1": "Open"
          },
          visible = True,
    )
    def __post_init__(self):
      self.filter = merge_filters(self.filter, {"name": "Value"})
      super().__post_init__()



  valve_aeration_list = [
      ValveAeration(name = f"Valve {i}", filter = {"labels.folder-3": [f"Valve_Aeriation_{i}"]})
      for i in range(1,9)
  ]
  ```



  ```python
  va = ValveAeration()

  house = Asset(
      labels=[{"site":"home"}],
      attributes=[
          va.copy(
              name="Aeration Kitchen",
              add_filter={
                  "labels.room": "Kitchen"
              }
          ),
          va.copy(
              name="Aeration Living room",
              add_filter={
                  "labels.room": "Living room"
              }
          )
      ]
  )
  ```


pkgId: 84c517287c1094871a0e330f4c19cc416f252fa5fe1a4feb974f13fece9459ee
name: python-clarin-spf
arch: src
version: 0.1.0
epoch: 0
release: 1
url: https://pypi.org/project/clarin-spf/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarin-spf-0.1.0-1.src.rpm
checksum_type: sha256
summary:
  A Python package to interact with the CLARIN SPF API to retrieve the 'logged in' cookies necessary to potentially interact with APIs of services that require the authentication.

description:
  Utility package to login to CLARIN's SPF and then collect the required session cookies for the login. These cookies can then be used to call the APIs of services that require authorization. Note that the pop-up login occurs in an isolated browser environment so no personal information or cookies are ever collected or used or even read.




  You can install the package from PyPI but you will also have to install the necessary browser utilities via playwright.

  ```shell
  pip install clarin-spf
  playwright install
  ```

  For development:

  ```shell
  git clone https://github.com/BramVanroy/clarin-spf
  cd clarin-spf
  pip install -e .[dev]

  playwright install
  ```



  ```python
  from clarin_spf import clarin_login
  import requests



  interface_url = "https://url.to.an.interface.com"

  api_url = "https://url.to.your.com/api/endpoint"

  cookies = clarin_login(interface_url)
  response = requests.get(api_url, cookies=cookies).json()
  ```

  See example usages in [examples/](examples/).

rpm_license:
  Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.  "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  Copyright 2024 Bram Vanroy  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 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: 5f7b925ec0b7c8416a5fb453600399020b7bd73a974d78a5167d7d97bf2587bb
name: python-clarin-spf
arch: src
version: 0.1.1
epoch: 0
release: 1
url: https://pypi.org/project/clarin-spf/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarin-spf-0.1.1-1.src.rpm
checksum_type: sha256
summary:
  A Python package to interact with the CLARIN SPF API to retrieve the 'logged in' cookies necessary to potentially interact with APIs of services that require the authentication.

description:
  Utility package to login to CLARIN's SPF and then collect the required session cookies for the login. These cookies can then be used to call the APIs of services that require authorization. Note that the pop-up login occurs in an isolated browser environment so no personal information or cookies are ever collected or used or even read.




  You can install the package from PyPI but you will also have to install the necessary browser utilities via playwright.

  ```shell
  pip install clarin-spf
  playwright install
  ```

  For development:

  ```shell
  git clone https://github.com/BramVanroy/clarin-spf
  cd clarin-spf
  pip install -e .[dev]

  playwright install chromium --with-deps
  ```



  ```python
  from clarin_spf import ClarinCredentials
  import requests

  base_url = "https://portal.clarin.ivdnt.org/galahad"


  cookies = ClarinCredentials(service_url=base_url, overwrite=True).cookies


  user_resp = requests.get(f"{base_url}/api/user", cookies=cookies).json()
  print(user_resp)
  ```

  See example usages in [examples/](examples/).




  - [ ] Investigate feasibility of using a headless browser
  - [ ] Investigate feasibility of running in notebooks
  - [ ] Investigate feasibility of running in CI/CD
  - [ ] Improve handling of cookies: when they expire, the `requests.get` call will fail and just return HTML for
  the CLARIN discovery login. Incorporate common operations such as `get`, `post`, `put`, `delete` in the
  `ClarinCredentials` class, and when a json parse occurs, trigger a re-login request?

rpm_license:
  Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.  "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  Copyright 2024 Bram Vanroy  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 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: f5441d8279e8312391dcd7bf717143d3d88cbceaf069bbbd427017841b037dea
name: python-claripy
arch: src
version: 9.2.123
epoch: 0
release: 1
summary: An abstraction layer for constraint solvers
url: https://github.com/angr/claripy
rpm_license: BSD-2-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claripy-9.2.123-1.src.rpm
checksum_type: sha256
description:
  [![Latest Release](https://img.shields.io/pypi/v/claripy.svg)](https://pypi.python.org/pypi/claripy/)
  [![Python Version](https://img.shields.io/pypi/pyversions/claripy)](https://pypi.python.org/pypi/claripy/)
  [![PyPI Statistics](https://img.shields.io/pypi/dm/claripy.svg)](https://pypistats.org/packages/claripy)
  [![License](https://img.shields.io/github/license/angr/claripy.svg)](https://github.com/angr/claripy/blob/master/LICENSE)

  Claripy is an abstracted constraint-solving wrapper.


  Project repository: https://github.com/angr/claripy

  Documentation: https://api.angr.io/projects/claripy/en/latest/



  It is usable!

  General usage is similar to Z3:

  ```python
  >>> import claripy
  >>> a = claripy.BVV(3, 32)
  >>> b = claripy.BVS('var_b', 32)
  >>> s = claripy.Solver()
  >>> s.add(b > a)
  >>> print(s.eval(b, 1)[0])
  ```


pkgId: 15248735f7645dc1f4989c2f6eef35490557a67b806a24f4150c5cd3381ee96a
name: python-clarku-youtube-crawler
arch: src
version: 2.1.3
epoch: 0
release: 1
summary: Clark University, Package for YouTube crawler and cleaning data
url: https://github.com/ClarkUniversity-NiuLab/clarku-youtube-crawler
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clarku-youtube-crawler-2.1.3-1.src.rpm
checksum_type: sha256
description:
  Clark University YouTube crawler and JSON decoder for YouTube json. Please read documentation in ``DOCS``

  Pypi page: "https://pypi.org/project/clarku-youtube-crawler/"


  To install,

  ``pip install clarku-youtube-crawler``

  The crawler needs multiple other packages to function.
  If missing requirements (I already include all dependencies so it shouldn't happen), download <a href="https://github.com/ClarkUniversity-NiuLab/clarku-youtube-crawler/blob/master/requirements.txt">``requirements.txt`` </a> .
  Navigate to the folder where it contains requirements.txt and run

  ``pip install -r requirements.txt``



  To upgrade

  ``pip install clarku-youtube-crawler --upgrade``

  Go to the project folder, delete config.ini if it is already there.


  - Go to https://cloud.google.com/, click console, and create a project. Under Credentials, copy the API key.
  - In your project folder, create a "DEVELOPER_KEY.txt" file (must be this file name) and paste your API key.
  - You can use multiple API keys by putting them on different lines in DEVELOPER_KEY.txt.
  - The crawler will use up all quotas of one key and try next one, until all quotas are used up.




  Case 1: crawl videos by keywords,
  ```
  import clarku_youtube_crawler as cu


  crawler = cu.RawCrawler()
  crawler.build("low visibility")
  crawler.crawl("low visibility", start_date=14, start_month=12, start_year=2020, day_count=5)
  crawler.crawl("blind", start_date=14, start_month=12, start_year=2020, day_count=5)
  crawler.merge_to_workfile()
  crawler.crawl_videos_in_list(comment_page_count=1)
  crawler.merge_all(save_to='low visibility/all_videos.json')


  decoder = cu.JSONDecoder()
  decoder.json_to_csv(data_file='low visibility/all_videos.json')



  subtitleCrawler = cu.SubtitleCrawler()
  subtitleCrawler.build("low visibility")
  subtitleCrawler.crawl_csv(
      videos_to_collect="low visibility/videos_to_collect.csv",
      video_id="videoId",
      sub_title_dir="low visibility/subtitles/"
  )

  ```

  Case 2: crawl a videos by a list of ids specified by videoId column in an input CSV
  ```
  import clarku_youtube_crawler as cu

  crawler = cu.RawCrawler()
  work_dir = "blind"
  crawler.build(work_dir)




  crawler.crawl_videos_in_list(video_list_workfile="videos_to_collect.csv",
                               comment_page_count=1,
                               search_key="blind",
                               video_id="videoId"
                               )
  crawler.merge_all(save_to='all_raw_data.json')
  decoder = cu.JSONDecoder()
  decoder.json_to_csv(data_file='all_raw_data.json')



  subtitleCrawler = cu.SubtitleCrawler()
  subtitleCrawler.build(work_dir)
  subtitleCrawler.crawl_csv(
      videos_to_collect="videos_to_collect.csv",
      video_id="videoId",
      sub_title_dir=f"YouTube_CSV/subtitles/"
  )

  ```

  Case 3: Search a list of channels by search keys, then crawl all videos belonging to those channels.
  ```
  import clarku_youtube_crawler as cu

  chCrawler = cu.ChannelCrawler()
  work_dir = "low visibility"
  chCrawler.build(work_dir)

  chCrawler.search_channel("low visibility")
  chCrawler.search_channel("blind")
  chCrawler.merge_to_workfile()
  chCrawler.crawl()


  crawler = cu.RawCrawler()
  crawler.build(work_dir)
  crawler.merge_to_workfile(file_dir=work_dir + "/video_search_list/")
  crawler.crawl_videos_in_list(comment_page_count=1)
  crawler.merge_all()


  decoder = cu.JSONDecoder()
  decoder.json_to_csv(data_file=work_dir + '/all_videos_visibility.json')



  subtitleCrawler = cu.SubtitleCrawler()
  subtitleCrawler.build(work_dir)
  subtitleCrawler.crawl_csv(
      videos_to_collect=work_dir+"/videos_to_collect.csv",
      video_id="videoId",
      sub_title_dir=work_dir+"/subtitles/"
  )
  ```

  Case 4: You already have a list of channels. You want to crawl all videos of the channels in the list:
  ```
  import clarku_youtube_crawler as cu

  work_dir = 'disability'
  chCrawler = cu.ChannelCrawler()
  chCrawler.build(work_dir)

  chCrawler.crawl(filename='mturk_test.csv', channel_header="Input.channelId")


  crawler = cu.RawCrawler()
  crawler.build(work_dir)
  crawler.merge_to_workfile(file_dir=work_dir + "/video_search_list/")
  crawler.crawl_videos_in_list(comment_page_count=10)  # 100 comments per page, 10 page will crawl 1000 comments

  crawler.merge_all()


  decoder = cu.JSONDecoder()
  decoder.json_to_csv(data_file=work_dir + '/all_videos.json')


  subtitleCrawler = cu.SubtitleCrawler()
  subtitleCrawler.build(work_dir)
  subtitleCrawler.crawl_csv(
      videos_to_collect=work_dir + "/videos_to_collect.csv",
      video_id="videoId",
      sub_title_dir=work_dir + "/subtitles/"
  )
  ```


pkgId: 7f074de399012108b4845c23a002b301bdd0c0c9d1f9dfeed8d6a0d5eca7112f
name: python-clashai
arch: src
version: 1.0.5
epoch: 0
release: 1
summary: An API wrapper for the ClashAI API
url: https://pypi.org/project/clashai/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clashai-1.0.5-1.src.rpm
checksum_type: sha256
description:
  ![ClashAI Wide-Banner](https://i.ibb.co/xMHXC9M/Clash-AI-Wide-Banner-No-Background.png)

  **ClashAI Python Package for easy API integration!**


  ```python
  pip install clashai
  ```


  ```python
  import clashai

  client = clashai.Client(api_key="[YOUR API KEY]")
  completion = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Hello, World!",
          }
      ]
  )

  print(completion['choices'][0]['message']['content'])
  ```


pkgId: 6a9f911f58a325c5e193fe64dec4ab4602b967e0d2081d51f38228bde56d8b10
name: python-clashroyale
arch: src
version: 4.0.1
epoch: 0
release: 1
summary: An (a)sync wrapper for royaleapi.com
url: https://pypi.org/project/clashroyale/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clashroyale-4.0.1-1.src.rpm
checksum_type: sha256
description:
  This library is currently an (a)sync wrapper for
  https://royaleapi.com and the official Clash Royale API with
  great functionality.


pkgId: c6c1105bba617b7cc5d8d45093e42c32c3d4e2b8e51ffe427b76ff8932e9f99c
name: python-class-cache
arch: src
version: 0.10.1
epoch: 0
release: 1
summary: Caching for class based generators
url: https://pypi.org/project/class-cache/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-class-cache-0.10.1-1.src.rpm
checksum_type: sha256
description:
  ![tests](https://github.com/Rizhiy/class-cache/actions/workflows/test_and_version.yml/badge.svg)
  [![codecov](https://codecov.io/gh/Rizhiy/class-cache/graph/badge.svg?token=7CAJG2EBLG)](https://codecov.io/gh/Rizhiy/class-cache)
  ![publish](https://github.com/Rizhiy/class-cache/actions/workflows/publish.yml/badge.svg)
  ![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FRizhiy%2Fclass-cache%2Fmaster%2Fpyproject.toml)
  [![PyPI - Version](https://img.shields.io/pypi/v/class-cache)](https://pypi.org/project/class-cache/)
  [![Code Style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)



  Recommended installation with pip:

  ```bash
  pip install class-cache
  ```



  - Basic usage:

    ```python
    from class_cache import Cache

    
    cache = Cache()
    
    
    cache["foo"] = "bar"
    
    cache.write()

    
    del cache
    cache2 = Cache()
    assert cache2["foo"] == "bar"
    ```

  - Use multiple caches:

    ```python
    cache1 = Cache(1)
    cache2 = Cache(2)

    cache1["foo"] = "bar"
    cache2["foo"] = "zar"

    assert cache1["foo"] != cache2["foo"]
    ```

  - Use cache with default factory:

    ```python
    from class_cache import CacheWithDefault

    class MyCache(CacheWithDefault[str, str]):
        NON_HASH_ATTRIBUTES = frozenset({*CacheWithDefault.NON_HASH_ATTRIBUTES, "_misc"})
        def __init__(self, name: str):
            
            
            self._name = name
            super().__init__()
            
            self._misc = "foo"

        
        def _get_data(self, key: str) -> str:
            return f"{self._name}_{key}"

    cache = MyCache("first")
    assert cache["foo"] == "first_foo"
    ```

  - Compress data before storing:

    ```python
    from class_cache.wrappers import BrotliCompressWrapper
    from class_cache import Cache

    cache = BrotliCompressWrapper(Cache())
    
    ```

    This wrapper uses [`brotli`](https://github.com/google/brotli) algorithm for compression,
    which optimises read-time at expense of write-time.
    This will generally lead to less space being used and potentially faster reads if your data is compressible,
    e.g. text.



  - Install dev dependencies: `pip install -e ".[dev]"`
  - For linting and basic fixes [ruff](https://docs.astral.sh/ruff/) is used: `ruff check . --fix`
  - This repository follows strict formatting style which will be checked by the CI.
    - To format the code, use the [black](https://black.readthedocs.io) format: `black .`
    - To sort the imports, user [isort](https://pycqa.github.io/isort/) utility: `isort .`
  - To test code, use [pytest](https://pytest.org): `pytest .`
  - This repository follows semantic-release, which means all commit messages have to follow a [style](https://python-semantic-release.readthedocs.io/en/latest/commit-parsing.html).
    You can use tools like [commitizen](https://github.com/commitizen-tools/commitizen) to write your commits.
  - You can also use [pre-commit](https://pre-commit.com/) to help verify that all changes are valid.
    Multiple hooks are used, so use the following commands to install:

    ```bash
    pre-commit install
    pre-commit install --hook-type commit-msg
    ```


pkgId: 1a99b5bc998d52ab20d0858566cb445c7f7d4215fb8e13dc9be08f5ae1670355
name: python-class-doc
arch: src
version: 0.2.6
epoch: 0
release: 1
summary: Extract attributes docstrings defined in various ways
url: https://github.com/danields761/class-doc
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-class-doc-0.2.6-1.src.rpm
checksum_type: sha256
description:
  Small set of helpers aimed to extract class attributes documentation from the class definition. This stuff tries to mimic [sphinx-autodoc behaviour](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoattribute) as closely as possible (except instance attributes defined inside `__init__` function).

  The main advantage of this project over [sphinx-autodoc] is that it is lightweight single-purpose dependency, while *autodoc* just a small part of really heavy project.



  This package is available on [PyPI]

  ```bash
  pip install class-doc
  ```



  Shamely stolen from [sphinx-autodoc] docs

  ```python
  class Foo:
      """Docstring for class Foo."""

      
      
      bar = 1

      flox = 1.5   #: Doc comment for Foo.flox. One line only.

      baz = 2
      """Docstring for class attribute Foo.baz."""

      baf = 3
      """
      Even
      multiline
      docstrings
      handled
      properly
      """



  import class_doc
  assert class_doc.extract_docs_from_cls_obj(Foo) == {
      "bar": ["Doc comment for class attribute Foo.bar.", "It can have multiple lines."],
      "flox": ["Doc comment for Foo.flox. One line only."],
      "baz": ["Docstring for class attribute Foo.baz."],
      "baf": ["Even", "multiline", "docstrings", "handled", "properly"]
  }
  ```



  Project requires [Poetry] for development setup.

  * If you aren't have it already

  ```sh
  pip install poetry
  ```

  * Install project dependencies

  ```sh
  poetry install
  ```

  * Run tests

  ```sh
  poetry run pytest .
  ```

  * Great, all works!

  <!-- Links -->
  [PyPI]: http://pypi.org
  [Poetry]: https://poetry.eustace.io/
  [sphinx-autodoc]: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoattribute


pkgId: f6e37513062707f1f2813e4ecacd63de4e58810fbb80d5515a4594909c674243
name: python-class-resolver
arch: src
version: 0.5.4
epoch: 0
release: 1
summary: Lookup and instantiate classes with style.
url: https://github.com/cthoyt/class-resolver
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-class-resolver-0.5.4-1.src.rpm
checksum_type: sha256
description:
  <!--
  <p align="center">
    <img src="docs/source/logo.png" height="150">
  </p>
  -->

  <h1 align="center">
    Class Resolver
  </h1>

  <p align="center">
      <a href="https://github.com/cthoyt/class-resolver/actions?query=workflow%3ATests">
          <img alt="Tests" src="https://github.com/cthoyt/class-resolver/workflows/Tests/badge.svg" />
      </a>
      <a href="https://github.com/cthoyt/cookiecutter-python-package">
          <img alt="Cookiecutter template from @cthoyt" src="https://img.shields.io/badge/Cookiecutter-snekpack-blue" />
      </a>
      <a href="https://pypi.org/project/class_resolver">
          <img alt="PyPI" src="https://img.shields.io/pypi/v/class_resolver" />
      </a>
      <a href="https://pypi.org/project/class_resolver">
          <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/class_resolver" />
      </a>
      <a href="https://github.com/cthoyt/class-resolver/blob/main/LICENSE">
          <img alt="PyPI - License" src="https://img.shields.io/pypi/l/class-resolver" />
      </a>
      <a href='https://class_resolver.readthedocs.io/en/latest/?badge=latest'>
          <img src='https://readthedocs.org/projects/class_resolver/badge/?version=latest' alt='Documentation Status' />
      </a>
      <a href="https://codecov.io/gh/cthoyt/class-resolver/branch/main">
          <img src="https://codecov.io/gh/cthoyt/class-resolver/branch/main/graph/badge.svg" alt="Codecov status" />
      </a>
      <a href="https://zenodo.org/badge/latestdoi/343741010">
          <img src="https://zenodo.org/badge/343741010.svg" alt="DOI">
      </a>
      <a href="https://github.com/psf/black">
          <img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" />
      </a>
  </p>

  Lookup and instantiate classes with style.



  ```python
  from class_resolver import ClassResolver
  from dataclasses import dataclass

  class Base: pass

  @dataclass
  class A(Base):
     name: str

  @dataclass
  class B(Base):
     name: str


  resolver = ClassResolver([A, B], base=Base)


  assert A == resolver.lookup('A')


  assert A(name='hi') == resolver.make('A', {'name': 'hi'})


  assert A(name='hi') == resolver.make('A', name='hi')


  assert A(name='hi') == resolver.make(A(name='hi'))
  ```



  Assume you've implemented a simple multi-layer perceptron in PyTorch:

  ```python
  from itertools import chain

  from more_itertools import pairwise
  from torch import nn

  class MLP(nn.Sequential):
      def __init__(self, dims: list[int]):
          super().__init__(chain.from_iterable(
              (
                  nn.Linear(in_features, out_features),
                  nn.ReLU(),
              )
              for in_features, out_features in pairwise(dims)
          ))
  ```

  This MLP uses a hard-coded rectified linear unit as the non-linear activation
  function between layers. We can generalize this MLP to use a variety of
  non-linear activation functions by adding an argument to its
  `__init__()` function like in:

  ```python
  from itertools import chain

  from more_itertools import pairwise
  from torch import nn

  class MLP(nn.Sequential):
      def __init__(self, dims: list[int], activation: str = "relu"):
          if activation == "relu":
              activation = nn.ReLU()
          elif activation == "tanh":
              activation = nn.Tanh()
          elif activation == "hardtanh":
              activation = nn.Hardtanh()
          else:
              raise KeyError(f"Unsupported activation: {activation}")
          super().__init__(chain.from_iterable(
              (
                  nn.Linear(in_features, out_features),
                  activation,
              )
              for in_features, out_features in pairwise(dims)
          ))
  ```

  The first issue with this implementation is it relies on a hard-coded set of
  conditional statements and is therefore hard to extend. It can be improved
  by using a dictionary lookup:

  ```python
  from itertools import chain

  from more_itertools import pairwise
  from torch import nn

  activation_lookup: dict[str, nn.Module] = {
     "relu": nn.ReLU(),
     "tanh": nn.Tanh(),
     "hardtanh": nn.Hardtanh(),
  }

  class MLP(nn.Sequential):
      def __init__(self, dims: list[int], activation: str = "relu"):
          activation = activation_lookup[activation]
          super().__init__(chain.from_iterable(
              (
                  nn.Linear(in_features, out_features),
                  activation,
              )
              for in_features, out_features in pairwise(dims)
          ))
  ```

  This approach is rigid because it requires pre-instantiation of the activations.
  If we needed to vary the arguments to the `nn.HardTanh` class, the previous
  approach wouldn't work. We can change the implementation to lookup on the
  class *before instantiation* then optionally pass some arguments:

  ```python
  from itertools import chain

  from more_itertools import pairwise
  from torch import nn

  activation_lookup: dict[str, type[nn.Module]] = {
     "relu": nn.ReLU,
     "tanh": nn.Tanh,
     "hardtanh": nn.Hardtanh,
  }

  class MLP(nn.Sequential):
      def __init__(
          self,
          dims: list[int],
          activation: str = "relu",
          activation_kwargs: None | dict[str, any] = None,
      ):
          activation_cls = activation_lookup[activation]
          activation = activation_cls(**(activation_kwargs or {}))
          super().__init__(chain.from_iterable(
              (
                  nn.Linear(in_features, out_features),
                  activation,
              )
              for in_features, out_features in pairwise(dims)
          ))
  ```

  This is pretty good, but it still has a few issues:
  1. you have to manually maintain the `activation_lookup` dictionary,
  2. you can't pass an instance or class through the `activation` keyword
  3. you have to get the casing just right
  4. the default is hard-coded as a string, which means this has to get copied
     (error-prone) in any place that creates an MLP
  5. you have to re-write this logic for all of your classes

  Enter the `class_resolver` package, which takes care of all of these
  things using the following:

  ```python
  from itertools import chain

  from class_resolver import ClassResolver, Hint
  from more_itertools import pairwise
  from torch import nn

  activation_resolver = ClassResolver(
      [nn.ReLU, nn.Tanh, nn.Hardtanh],
      base=nn.Module,
      default=nn.ReLU,
  )

  class MLP(nn.Sequential):
      def __init__(
          self,
          dims: list[int],
          activation: Hint[nn.Module] = None,  # Hint = Union[None, str, nn.Module, type[nn.Module]]
          activation_kwargs: None | dict[str, any] = None,
      ):
          super().__init__(chain.from_iterable(
              (
                  nn.Linear(in_features, out_features),
                  activation_resolver.make(activation, activation_kwargs),
              )
              for in_features, out_features in pairwise(dims)
          ))
  ```

  Because this is such a common pattern, we've made it available through contrib
  module in `class_resolver.contrib.torch`:

  ```python
  from itertools import chain

  from class_resolver import Hint
  from class_resolver.contrib.torch import activation_resolver
  from more_itertools import pairwise
  from torch import nn

  class MLP(nn.Sequential):
      def __init__(
          self,
          dims: list[int],
          activation: Hint[nn.Module] = None,
          activation_kwargs: None | dict[str, any] = None,
      ):
          super().__init__(chain.from_iterable(
              (
                  nn.Linear(in_features, out_features),
                  activation_resolver.make(activation, activation_kwargs),
              )
              for in_features, out_features in pairwise(dims)
          ))
  ```

  Now, you can instantiate the MLP with any of the following:

  ```python
  MLP(dims=[10, 200, 40])  # uses default, which is ReLU
  MLP(dims=[10, 200, 40], activation="relu")  # uses lowercase
  MLP(dims=[10, 200, 40], activation="ReLU")  # uses stylized
  MLP(dims=[10, 200, 40], activation=nn.ReLU)  # uses class
  MLP(dims=[10, 200, 40], activation=nn.ReLU())  # uses instance

  MLP(dims=[10, 200, 40], activation="hardtanh", activation_kwargs={"min_val": 0.0, "max_value": 6.0})  # uses kwargs
  MLP(dims=[10, 200, 40], activation=nn.HardTanh, activation_kwargs={"min_val": 0.0, "max_value": 6.0})  # uses kwargs
  MLP(dims=[10, 200, 40], activation=nn.HardTanh(0.0, 6.0))  # uses instance
  ```

  In practice, it makes sense to stick to using the strings in combination with
  hyper-parameter optimization libraries like [Optuna](https://optuna.org/).



  The most recent release can be installed from
  [PyPI](https://pypi.org/project/class_resolver/) with:

  ```bash
  $ pip install class_resolver
  ```

  The most recent code and data can be installed directly from GitHub with:

  ```bash
  $ pip install git+https://github.com/cthoyt/class-resolver.git
  ```

  To install in development mode, use the following:

  ```bash
  $ git clone git+https://github.com/cthoyt/class-resolver.git
  $ cd class-resolver
  $ pip install -e .
  ```



  Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See
  [CONTRIBUTING.rst](https://github.com/cthoyt/class-resolver/blob/master/CONTRIBUTING.rst) for more
  information on getting involved.





  The code in this package is licensed under the MIT License.



  This package was created with [@audreyfeldroy](https://github.com/audreyfeldroy)'s
  [cookiecutter](https://github.com/cookiecutter/cookiecutter) package using [@cthoyt](https://github.com/cthoyt)'s
  [cookiecutter-snekpack](https://github.com/cthoyt/cookiecutter-snekpack) template.



  <details>
    <summary>See developer instructions</summary>


  The final section of the README is for if you want to get involved by making a code contribution.



  After cloning the repository and installing `tox` with `pip install tox`, the unit tests in the `tests/` folder can be
  run reproducibly with:

  ```shell
  $ tox
  ```

  Additionally, these tests are automatically re-run with each commit in a [GitHub Action](https://github.com/{{cookiecutter.github_organization_name}}/{{cookiecutter.github_repository_name}}/actions?query=workflow%3ATests).



  After installing the package in development mode and installing
  `tox` with `pip install tox`, the commands for making a new release are contained within the `finish` environment
  in `tox.ini`. Run the following from the shell:

  ```shell
  $ tox -e finish
  ```

  This script does the following:

  1. Uses BumpVersion to switch the version number in the `setup.cfg` and
     `src/{{cookiecutter.package_name}}/version.py` to not have the `-dev` suffix
  2. Packages the code in both a tar archive and a wheel
  3. Uploads to PyPI using `twine`. Be sure to have a `.pypirc` file configured to avoid the need for manual input at this
     step
  4. Push to GitHub. You'll need to make a release going with the commit where the version was bumped.
  5. Bump the version to the next patch. If you made big changes and want to bump the version by minor, you can
     use `tox -e bumpversion minor` after.
  </details>

rpm_license:
  MIT License  Copyright (c) 2022 Charles Tapley Hoyt  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: 4042437c7572d6d65ab9cf806014be34fa6f100e112a85fb7fde66dbdf9d9bbc
name: python-classcard-dataclient
arch: src
version: 1.2.2
epoch: 0
release: 1
summary: data client of class card server
url: http://gitlab.h3c.com/edtech/openconnection
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classcard-dataclient-1.2.2-1.src.rpm
checksum_type: sha256
description:
  this is a tool which save data to class card server




  ```bash
  pip install classcard-dataclient
  ```


  ```python

  client = DataClient()

  client.set_config_module("config")
  ```


  ```python
  data = Model(**{
      "xxx": "xxx"
  })
  code, msg = client.create_section(data)
  ```

  **Notice:**
  * when data is model instance , code is integer, msg is string,
  * when data is instance list, the code is list, msg is also list.


pkgId: 2a82143fc95ee5de9f0f1e7dbab8375e8626a532407f7f53feb88c9c7838bf19
name: python-classdiff
arch: src
version: 0.5.0
epoch: 0
release: 1
summary: Utility to diff classes
url: https://pypi.org/project/classdiff/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classdiff-0.5.0-1.src.rpm
checksum_type: sha256
description:
  + SomeResource(
  +   dangerous = True
  +   name = my-data
  +   not_changed = OtherClass(
  +     name = Same
  +   )
  +   other = OtherClass(
  +     name = OA
  +   )
  +   price = 2.3
  +   quantity = 4
  + )


pkgId: 1987e62c71d03e4508bfa91d3df35dd8c16d7930669726bc7ce80fa72edd39ff
name: python-classes
arch: src
version: 0.4.1
epoch: 0
release: 1
summary: Smart, pythonic, ad-hoc, typed polymorphism for Python
url: https://classes.readthedocs.io
rpm_license: BSD-2-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classes-0.4.1-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://travis-ci.org/dry-python/classes.svg?branch=master)](https://travis-ci.org/dry-python/classes)
  [![codecov](https://codecov.io/gh/dry-python/classes/branch/master/graph/badge.svg)](https://codecov.io/gh/dry-python/classes)
  [![Documentation Status](https://readthedocs.org/projects/classes/badge/?version=latest)](https://classes.readthedocs.io/en/latest/?badge=latest)
  [![Python Version](https://img.shields.io/pypi/pyversions/classes.svg)](https://pypi.org/project/classes/)
  [![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)


pkgId: b5e7377c859e365f138e4c0597cd925acada6acf490b9e7395731491a6356c95
name: python-classic-db-pool
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Provides connections pool for work with database
url: https://github.com/variasov/classic-db-pool
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classic-db-pool-1.1.0-1.src.rpm
checksum_type: sha256
description:
  `classic-db-pool` — это библиотека для управления соединениями с базой данных
  эффективным способом. Она позволяет создавать пул соединений с базой данных,
  который может использоваться несколькими запросами или процессами одновременно.
  Это гарантирует, что ваше приложение всегда имеет доступ к готовому
  к использованию соединению без необходимости ожидания первоначальной
  настройки соединения каждый раз.



  Этот проект является форком проекта [Embrace](https://hg.sr.ht/~olly/embrace-sql).



  Для установки classic-db-pool вы можете использовать pip:

  ```bash
  pip install classic-db-pool
  ```



  Вот несколько примеров использования classic-db-pool.

  ```python
  from classic.db_pool import ConnectionPool
  import pymssql


  pool = ConnectionPool(
      lambda: pymssql.connect(
          server='server',
          database='database',
          user='user',
          password='password',
      ),
      limit=1,
  )


  with pool.connect() as conn:
      conn.cursor().execute('SQL query')
  ```


pkgId: cce1208dc99f39cbe611ded958dbddad41c384cceed5ccb317b8c525c839b06d
name: python-classic-migrations
arch: src
version: 0.0.3
epoch: 0
release: 1
summary: Database migrations with SQL
url: https://github.com/variasov/classic-migrations
rpm_license: Apache
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classic-migrations-0.0.3-1.src.rpm
checksum_type: sha256
description:
  This project is fork from yoyo-migrations
  https://ollycope.com/software/yoyo/latest/


  .env file:
      SOURCE=./migrations
      BATCH_MODE=on|off(default)
      VERBOSITY=0|1|2|3
      EDITOR=
      POST_CREATE_COMMAND=
      PREFIX=

      DB_DRIVER=pymssql
      DB_USER=
      DB_PASSWORD=
      DB_HOST=
      DB_PORT=
      DB_NAME=
      VERSION_TABLE=


  Launch Commands:
      migrations  list
                  new --sql -m 'example of a comment appended to a file name'
                  apply
                  rollback


  You can add a comment to the migration in sql format migration files.
  The comment will be saved in the migration history table.

  -- comment: comment text...


pkgId: 1826c2adbe5e626421e17ebdce312048b635613a9fadd585b241dd329a793701
name: python-classical-doa
arch: src
version: 1.3.2
epoch: 0
release: 1
summary: Classical DOA estimation algorithms implemented in Python
url: https://github.com/zhiim/classical_doa
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classical-doa-1.3.2-1.src.rpm
checksum_type: sha256
description:
  Classical DOA Estimation algorithms implemented in Python.





  ```bash
  pip install classical_doa
  ```

  or install from source

  ```bash
  git clone https://github.com/zhiim/classical_doa.git
  cd classical_doa
  pip install .
  ```



  A sample example of DOA estimation using MUSIC algorithm.

  ```python
  import numpy as np

  from classical_doa import arrays, signals
  from classical_doa.algorithm import music
  from classical_doa.plot import plot_spatial_spectrum


  ula = arrays.UniformLinearArray(m=8, dd=0.5)

  source = signals.ComplexStochasticSignal(fc=3e8)


  received_data = ula.received_signal(
      signal=source, snr=0, nsamples=1000, angle_incidence=np.array([0, 30]), unit="deg"
  )


  angle_grids = np.arange(-90, 90, 1)
  spectrum = music(
      received_data=received_data,
      num_signal=2,
      array=ula,
      signal_fre=3e8,
      angle_grids=angle_grids,
      unit="deg",
  )


  plot_spatial_spectrum(
      spectrum=spectrum,
      ground_truth=np.array([0, 30]),
      angle_grids=angle_grids,
      num_signal=2,
  )
  ```

  You will a get a figure like this:
  ![music_spectrum](https://github.com/zhiim/classical_doa/blob/master/pics/music_spectrum.svg)

  Check `examples` for more examples.





  - Uniform Linear Array (ULA)
  - Uniform Rectangular Array (URA, to be implemented)
  - Uniform Circular Array (UCA)



  - Narrowband
    ComplexStochasticSignal
  - Broadband
    ChirpSignal
    MultiCarrierSignal



  - ULA
    - [x] MUSIC
    - [x] ESPRIT
    - [x] Root-MUSIC
    - [x] OMP
    - [x] l1-SVD
  - URA
    - [ ] URA-MUSIC
    - [ ] URA-ESPRIT
  - UCA
    - [x] UCA-RB-MUSIC
    - [x] UCA-ESPRIT
  - Broadband
    - [x] ISSM
    - [x] CSSM
    - [x] TOPS



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


pkgId: 357750d1c0ef0eb0416a56a2dba5986b519f51f72f7b2537a915fc7ca2d368a9
name: python-classification-pipeline
arch: src
version: 0.432
epoch: 0
release: 1
summary: Declaratively configured pipeline for image classification
url: https://github.com/musket-ml/classification_training_pipeline
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classification-pipeline-0.432-1.src.rpm
checksum_type: sha256
description:
  ![Build status](https://travis-ci.com/musket-ml/classification_training_pipeline.svg?branch=master)

  My puny attempt to build reusable training pipeline for image classification

    * [Motivation](#motivation)
    * [Installation](#installation)
    * [Usage guide](#usage-guide)
      + [Training a model](#training-a-model)
        - [Image/Mask Augmentations](#image-and-mask-augmentations)
        - [Freezing/Unfreezing encoder](#freezing-and-unfreezing-encoder)
        - [Custom datasets](#custom-datasets)
        - [Balancing your data](#balancing-your-data)
        - [Multistage training](#multistage-training)
        - [Composite losses](#composite-losses)
        - [Cyclical learning rates](#cyclical-learning-rates)
        - [LR Finder](#lr-finder)
        - [Background Augmenter](#background-augmenter)
        - [Training on crops](#training-on-crops)
      + [Using trained model](#using-trained-model)
        - [Ensembling predictions and test time augmentation](#ensembling-predictions)
      + [Custom evaluation code](#custom-evaluation-code)
      + [Accessing model](#accessing-model)
    * [Analyzing Experiments Results](#analyzing-experiments-results)
    * [What is supported?](#what-is-supported-)
    * [Custom architectures, callbacks, metrics](#custom-architectures--callbacks--metrics)
    * [Examples](#examples)
    * [Faq](#faq)




  Idea for this project came from my first attempts to participate in Kaggle competitions. My programmers heart was painfully damaged by looking on my own code as well as on other people kernels. Code was highly repetitive, suffering from numerous reimplementations of same or almost same things through the kernels, model/experiment configuration was often mixed with models code, in other words - from programmer perspective it all looked horrible.

  So I decided to extract repetitive things into framework that will work at least for me and will follow these statements:
   - experiment configurations should be cleanly separated from model definitions;
   - experiment configuration files should be easy to compare and should fully describe experiment that is being performed except for the dataset;
  - common blocks like an architecture, callbacks, storing model metrics, visualizing network predictions, should be written once and be a part of common library




  ```
  pip install classification_pipeline
  ```
  *Note: this package requires python 3.6*





  Let's start from a simple example of classification. Suppose, your data are structured as follows: a .cvs file with images ids and their labels and a folder with all these images. For training a neural network to classify these images all you need are few lines of python code:

  ```python
  import musket_core
  from classification_pipeline import classification
  class ProteinDataGenerator:

      def __init__(self, paths, labels):
          self.paths, self.labels = paths, labels


      def __len__(self):
          return len(self.paths)

      def __getitem__(self, idx):
          X,y = self.__load_image(self.paths[idx]),self.labels[idx]
          return PredictionItem(self.paths[idx],X, y)

      def __load_image(self, path):
          R = Image.open(path + '_red.png')
          G = Image.open(path + '_green.png')
          B = Image.open(path + '_blue.png')


          im = np.stack((
              np.array(R),
              np.array(G),
              np.array(B),
          ), -1)
          return im
  dataset = ProteinDataGenerator(paths,labels)
  cfg = classification.parse("config.yaml")
  cfg.fit(dataset)
  ```

  Looks simple, but there is a `config.yaml` file in the code, and probably it is the place where everything actually happens.

  ```yaml
  architecture: DenseNet201 #pre-trained model we are going to use
  pooling: avg
  augmentation: #define some minimal augmentations on images
   Fliplr: 0.5
   Flipud: 0.5
  classes: 28 #define the number of classes
  activation: sigmoid #as we have multilabel classification, the activation for last layer is sigmoid
  weights: imagenet #we would like to start from network pretrained on imagenet dataset
  shape: [224, 224, 3] #our desired input image size, everything will be resized to fit
  optimizer: Adam #Adam optimizer is a good default choice
  batch: 16 #our batch size will be 16
  lr: 0.005
  copyWeights: true
  metrics: #we would like to track some metrics
    - binary_accuracy
    - macro_f1
  primary_metric: val_binary_accuracy #the most interesting metric is val_binary_accuracy
  primary_metric_mode: max
  callbacks: #configure some minimal callbacks
    EarlyStopping:
      patience: 3
      monitor: val_macro_f1
      mode: max
      verbose: 1
    ReduceLROnPlateau:
      patience: 2
      factor: 0.3
      monitor: val_binary_accuracy
      mode: max
      cooldown: 1
      verbose: 1
  loss: binary_crossentropy #we use binary_crossentropy loss
  stages:
    - epochs: 10 #let's go for 100 epochs
  ```

  So as you see, we have decomposed our task in two parts, *code that actually trains the model* and *experiment configuration*,
  which determines the model and how it should be trained from the set of predefined building blocks.

  What does this code actually do behind the scenes?

  -  it splits your data into 5 folds, and trains one model per fold;
  -  it takes care of model checkpointing, generates example image/label tuples, collects training metrics. All this data will
     be stored in the folders just near your `config.yaml`;
  -  All your folds are initialized from fixed default seed, so different experiments will use exactly the same train/validation splits.



  Framework uses awesome [imgaug](https://github.com/aleju/imgaug) library for augmentation, so you only need to configure your augmentation process in declarative way like in the following example:

  ```yaml
  augmentation:
    Fliplr: 0.5
    Flipud: 0.5
    Affine:
      scale: [0.8, 1.5] #random scalings
      translate_percent:
        x: [-0.2,0.2] #random shifts
        y: [-0.2,0.2]
      rotate: [-16, 16] #random rotations on -16,16 degrees
      shear: [-16, 16] #random shears on -16,16 degrees
  ```




  Freezing encoder is often used with transfer learning. If you want to start with frozen encoder just add

  ```yaml
  freeze_encoder: true
  stages:
    - epochs: 10 #Let's go for 10 epochs with frozen encoder

    - epochs: 100 #Now let's go for 100 epochs with trainable encoder
      unfreeze_encoder: true
  ```

  in your experiments configuration, then on some stage configuration just add

  ```yaml
  unfreeze_encoder: true
  ```
  to stage settings.


  *Note: This option is not supported for DeeplabV3 architecture.*



  You can declare your own dataset class as in this example:

  ```python
  from musket_core.datasets import PredictionItem
  import os
  import imageio
  import pandas as pd
  import numpy as np
  import cv2

  class Classification:

      def __init__(self,imgPath):
          self.species = ['Black-grass', 'Charlock', 'Cleavers', 'Common Chickweed', 'Common wheat',
             'Fat Hen', 'Loose Silky-bent', 'Maize', 'Scentless Mayweed',
             'Shepherds Purse', 'Small-flowered Cranesbill', 'Sugar beet']
          self.data = []
          self.targets = []
          self.ids = []
          for s_id, s in enumerate(self.species):
              s_folder = os.path.join(imgPath,s)
              for file in os.listdir(s_folder):
                  self.data.append(os.path.join(s_folder, file))
                  self.targets.append(s_id)
                  self.ids.append(file)


      def __len__(self):
          return len(self.data)


      def __getitem__(self, item):
          item_file = self.data[item]
          target = self.targets[item]
          t = np.zeros(len(self.species))
          t[target] = 1.0
          image = self.read_image(item_file, (224,224))
          return PredictionItem(self.ids[item], image, t)

      def read_image(self, filepath, target_size=None):
          img = cv2.imread(filepath, cv2.IMREAD_COLOR)
          img = cv2.resize(img.copy(), target_size, interpolation = cv2.INTER_AREA)
          return img

  ```



  Sometimes you need to create network that performs several classification tasks at the same moment, in this situation
  you need to declare `classes` , `activation` and `loss` as the lists of class counts, activation functions and losses
  like in the following snippet:

  ```yaml
  classes: [ 4, 4 ] #define the number of classes
  activation: [sigmoid,sigmoid]
  loss:
    - binary_crossentropy
    - binary_crossentropy
  primary_metric: val_loss #the most interesting metric is val_binary_accuracy
  primary_metric_mode: min
  ```

  it is also very likely that you need to change primary metric to `val_loss`




  One common case is the situation when part of your images does not contain any objects of interest, like in
  [Airbus ship detection challenge](https://www.kaggle.com/c/airbus-ship-detection/overview). More over your data may
  be to heavily inbalanced, so you may want to rebalance it. Alternatively you may want to inject some additional
  images that do not contain objects of interest to decrease amount of false positives that will be produced by the framework.

  These scenarios are supported by `negatives` and `validation_negatives` settings of training stage configuration,
  these settings accept following values:

  - none - exclude negative examples from the data
  - real - include all negative examples
  - integer number(1 or 2 or anything), how many negative examples should be included per one positive example

  if you are using this setting your dataset class must support `isPositive` method which returns true for indexes
  which contain positive examples:

  ```python
      def isPositive(self, item):
          pixels=self.ddd.get_group(self.ids[item])["EncodedPixels"]
          for mask in pixels:
              if isinstance(mask, str):
                  return True;
          return False
  ```




  Sometimes you need to split your training into several stages. You can easily do it by adding several stage entries
  in your experiment configuration file like in the following example:

  ```yaml
  stages:
    - epochs: 6 #Train for 6 epochs
      negatives: none #do not include negative examples in your training set
      validation_negatives: real #validation should contain all negative examples

    - lr: 0.0001 #let's use different starting learning rate
      epochs: 6
      negatives: real
      validation_negatives: real

    - loss: lovasz_loss #let's override loss function
      lr: 0.00001
      epochs: 6
      initial_weights: ./fpn-resnext2/weights/best-0.1.weights #let's load weights from this file
  ```

  Stage entries allow you to configure custom learning rate, balance of negative examples, callbacks, loss function
  and even initial weights which should be used on a particular stage.



  Framework supports composing loss as a weighted sum of predefined loss functions. For example, following construction
  ```yaml
  loss: binary_crossentropy+0.1*dice_loss
  ```
  will result in loss function which is composed from `binary_crossentropy` and  `dice_loss` functions.



  ![Example](https://github.com/bckenstler/CLR/blob/master/images/triangularDiag.png?raw=true)

  As told in [Cyclical learning rates for training neural networks](https://arxiv.org/abs/1506.01186) CLR policies can provide quicker converge for some neural network tasks and architectures.

  ![Example2](https://github.com/bckenstler/CLR/raw/master/images/cifar.png)

  We support them by adopting Brad Kenstler [CLR callback](https://github.com/bckenstler/CLR) for Keras.

  If you want to use them, just add `CyclicLR` in your experiment configuration file as shown below:

  ```yaml
  callbacks:
    EarlyStopping:
      patience: 40
      monitor: val_binary_accuracy
      verbose: 1
    CyclicLR:
       base_lr: 0.0001
       max_lr: 0.01
       mode: triangular2
       step_size: 300
  ```



  [Estimating optimal learning rate for your model](https://arxiv.org/abs/1506.01186) is an important thing, we support this by using slightly changed
  version of [Pavel Surmenok - Keras LR Finder](https://github.com/surmenok/keras_lr_finder)

  ```python
  cfg = classification.parse(config.yaml)
  ds = SimplePNGMaskDataSet("./train","./train_mask") - ???????????????????
  finder=cfg.lr_find(ds,start_lr=0.00001,end_lr=1,epochs=5)
  finder.plot_loss(n_skip_beginning=20, n_skip_end=5)
  plt.show()
  finder.plot_loss_change(sma=20, n_skip_beginning=20, n_skip_end=5, y_lim=(-0.01, 0.01))
  plt.show()
  ```
  will result in this couple of helpful images:

  ![image](https://camo.githubusercontent.com/b41aeaff00fb7b214b5eb2e5c151e7e353a7263e/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a48566a5f344c57656d6a764f57762d63514f397939672e706e67)

  ![image](https://camo.githubusercontent.com/834996d32bbd2edf7435c5e105b53a6b447ef083/68747470733a2f2f63646e2d696d616765732d312e6d656469756d2e636f6d2f6d61782f313630302f312a38376d4b715f586f6d59794a4532396c39314b3064772e706e67)



  Your images can be too large to train model on them. In this case you probably want to train model on crops. All
  that you need to do is to specify number of splits per axis. For example, following lines in config

  ```yaml
  shape: [768, 768, 3]
  crops: 3
  ```
  will lead to splitting each image into 9 cells (3 horizontal splits and 3 vertical splits) and training model on these splits.
  Augmentations will be run separately on each cell.

  During prediction time, your images will be split into these cells, prediction will be executed on each cell, and then results
  will be assembled in single final mask. Thus the whole process of cropping will be invisible from a consumer perspective.



  Okey, our model is trained, now we need to actually do image classification. Let's say, we need to run image classification on
  images in the directory and store results in csv file:

  ```python

  predictions = []
  images = []


  preds = cfg.predict_all_to_array(dataset_test, 0, 0)
  for i, item in enumerate(dataset_test):
      images.append(dataset_test.get_id(i))
      p = np.argmax(preds[i])
      predictions.append(dataset_test.get_label(p))


  df = pd.DataFrame.from_dict({'file': images, 'species': predictions})
  df.to_csv('submission.csv', index=False)
  ```



  And what if you want to ensemble models from several folds? Just pass a list of fold numbers to
  `predict_all_to_array` like in the following example:

  ```python
   cfg.predict_all_to_array(dataset_test, [0,1,2,3,4], 0)
  ```
  Another supported option is to ensemble results from extra test time augmentation (flips) by adding keyword arg `ttflips=True`.



  Sometimes you need to run custom evaluation code. In such case you may use: `evaluateAll` method, which provides an iterator
  on the batches containing original images, training masks and predicted masks

  ```python
  for batch in cfg.evaluateAll(ds,2):
      for i in range(len(batch.predicted_maps_aug)):
          masks = ds.get_masks(batch.data[i])
          for d in range(1,20):
              cur_seg = binary_opening(batch.predicted_maps_aug[i].arr > d/20, np.expand_dims(disk(2), -1))
              cm = rle.masks_as_images(rle.multi_rle_encode(cur_seg))
              pr = f2(masks, cm);
              total[d]=total[d]+pr
  ```


  You may get trained keras model by calling: ```cfg.load_model(fold, stage)```.



  Okey, we have done a lot of experiments and now we need to compare the results and understand what works better. This repository
  contains [script](segmentation_pipeline/analize.py) which may be used to analyze folder containing sub folders
  with experiment configurations and results. This script gathers all configurations, diffs them by doing structural diff, then
  for each configuration it averages metrics for all folds and  generates csv file containing metrics and parameters that
  was actually changed in your experiment like in the following [example](report.csv)

  This script accepts following arguments:

   - inputFolder - root folder to search for experiments configurations and results
   - output - file to store aggregated metrics
   - onlyMetric - if you specify this option all other metrics will not be written in the report file
   - sortBy - metric that should be used to sort results

  Example:
  ```commandline
  python analize.py --inputFolder ./experiments --output ./result.py
  ```



  At this moment classification pipeline supports following pre-trained models:
    - [Resnet](https://arxiv.org/abs/1512.03385)
      - ResNet18
      - ResNet34
      - ResNet50
      - ResNet101
      - ResNet152
      - ResNeXt50
      - ResNeXt101
    - [VGG](https://arxiv.org/abs/1409.1556):
       - VGG16
       - VGG19
    - [InceptionV3](https://arxiv.org/abs/1512.00567)
    - [InceptionResNetV2](https://arxiv.org/abs/1602.07261)
    - [Xception](https://arxiv.org/abs/1610.02357)
    - [MobileNet](https://arxiv.org/pdf/1704.04861.pdf)
    - [MobileNetV2](https://arxiv.org/abs/1801.04381)
    - [DenseNet](https://arxiv.org/abs/1608.06993):
      - DenseNet121
      - DenseNet169
      - DenseNet201
    - [NasNet](https://arxiv.org/abs/1707.07012):
      - NASNetMobile
      - NASNetLarge


  Each architecture also supports some specific options, list of options is documented in [segmentation RAML library](segmentation_pipeline/schemas/segmentation.raml#L166).

  Supported augmentations are documented in [augmentation RAML library](segmentation_pipeline/schemas/augmenters.raml).

  Callbacks are documented in [callbacks RAML library](segmentation_pipeline/schemas/callbacks.raml).



  Classification pipeline uses keras custom objects registry to find entities, so if you need to use
  custom loss function, activation or metric all that you need to do is to register it in Keras as:

  ```python
  keras.utils.get_custom_objects()["my_loss"]= my_loss
  ```

  If you want to inject new architecture, you should register it in `classification.custom_models` dictionary.

  For example:
  ```python
  classification.custom.models['MyUnet']=MyUnet
  ```
  where `MyUnet` is a function that accepts architecture parameters as arguments and returns an instance
  of keras model.


pkgId: ab1aa743ed8c0c0da12735eaaf5fe86951892a184bccd3115fa4d9faa644c88c
name: python-classifier-anshp
arch: src
version: 0.30.9
epoch: 0
release: 1
summary: A linear classifier built using tensorflow.
url: https://github.com/ANSHPG/pypi-pkg-clsfr
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classifier-anshp-0.30.9-1.src.rpm
checksum_type: sha256
description:
  `classifier-anshp` is a powerful linear classifier built using TensorFlow. This package features a customizable linear model for binary classification and includes tools for hyperparameter tuning, making it suitable for various machine learning tasks.



  - **Customizable Linear Classifier**: Modify input features, learning rate, and number of steps to train a linear model for binary classification.

  - **Hyperparameter Tuner**: The `hyper_tunner` function enables efficient tuning of model parameters to optimize performance across different settings. It supports various optimizers and loss functions, allowing users to find the best configuration for their datasets.

  - **Predefined Datasets**: The package includes three sample datasets for quick testing:
    - **Dataset 1**: Generates a synthetic dataset using multivariate Gaussian distributions.
    - **Dataset 2**: Logical operations (AND, OR, XOR, XNOR) for testing the classifier.
    - **Dataset 3**: IMDB movie reviews dataset for sentiment analysis, providing a real-world binary classification task.

  - **TensorFlow Backend**: Leverages TensorFlow for handling large-scale computations and efficient gradient-based optimization.



  You can install the package directly from PyPI:

  ```bash
  pip install classifier-anshp
  ```





  The `clsfr` function allows you to train a linear classifier on your dataset.

  ```python
  from classifier_anshp import clsfr
  import numpy as np


  inputs = np.array([[1.0, 2.0], [1.5, 1.8], [5.0, 8.0], [8.0, 8.0]])
  val_true = np.array([0, 0, 1, 1])


  val_pred, weights, bias = clsfr(inputs, val_true, lrn_rt=0.01, steps=50)


  print(f'Predictions: {val_pred}')
  print(f'Weights: {weights}')
  print(f'Bias: {bias}')
  ```



  The `hyper_tunner` function is designed to optimize the model's performance by adjusting various parameters.

  ```python
  from classifier_anshp import hyper_tunner


  optimal_epoch = hyper_tunner(x_train, y_train, x_test, y_test, epoch=50, mode=0)
  print(f'Optimal Epoch: {optimal_epoch}')
  ```



  You can quickly test the classifier using the predefined datasets. The package provides three functions for generating data:

  - **Dataset 1**: Generates a random binary classification dataset using multivariate normal distribution.
  - **Dataset 2**: Logical operations like AND, OR, XOR, and XNOR.
  - **Dataset 3**: IMDB dataset for sentiment analysis.

  ```python
  from classifier_anshp import dataset_1, dataset_2, dataset_3


  inputs, val_true = dataset_1(sample_size=100)


  inputs, val_true = dataset_2(num=2)  # 1 for AND, 2 for OR, 3 for XOR, 4 for XNOR


  partial_x_train, partial_y_train, x_val, y_val, x_test, y_test = dataset_3()
  ```



  After installing the package, you can run the classifier or dataset generation directly from the command line.



  ```bash
  classifier-anshp --inputs [[1,2],[3,4]] --val_true [0,1] --lrn_rt 0.01 --steps 50
  ```



  ```bash
  dataset-1 --sample_size 100
  ```



  ```bash
  dataset-2 --num 2
  ```



  ```bash
  dataset-3
  ```



  1. **TensorFlow-Based**: While `scikit-learn` provides efficient linear models, `classifier-anshp` is built using TensorFlow, allowing for more customization and seamless integration with larger deep learning frameworks.

  2. **Gradient-Based Optimization**: The package uses TensorFlowâ€™s gradient-based optimization, making it easy to modify and extend for more complex models beyond linear classifiers.

  3. **Dataset Flexibility**: In addition to custom datasets, `classifier-anshp` comes with logical operation datasets and the IMDB dataset, making it easier to test and experiment with common machine learning tasks.

  4. **Custom Training Intervals**: The classifier provides detailed control over training steps, ensuring outputs are printed at regular intervals.



  - Primarily designed for binary classification tasks.
  - Requires basic knowledge of TensorFlow to fully customize the model.



  This project is licensed under the MIT License.


  Anshuman Pattnaik
  Email: helloanshu04@gmail.com

  For more details, visit the [GitHub Repository](https://github.com/ANSHPG/pypi-pkg-clsfr).


pkgId: e675249560cc5a2a08ca048a6897cebc94438bd7e053791f32579fe5e58d42a2
name: python-classifier-pipeline
arch: src
version: 0.0.17
epoch: 0
release: 1
summary: Classifier Pipeline
url: https://github.com/TheCacophonyProject/classifier-pipeline
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classifier-pipeline-0.0.17-1.src.rpm
checksum_type: sha256
description:
  This pacakge will install the cacophony pipeline tracking onto a RPI

  You will also need to install these system packages in order to run the package
  `sudo apt install python3-opencv libglib2.0-dev libgirepository1.0-dev libcairo2-dev libcairo2  python3-dbus build-essential libdbus-glib-1-dev libgirepository1.0-dev`

  Once installed the tracking can be run using `pi_classifier`

  The default config is installed with this package if you would like to override the config you can create a config file at
  `/etc/cacophony/classifier.yaml`


pkgId: 954ef5e1f96256b9819d61591c8f08265a1bce20e65c797bbca24dc317edf311
name: python-classifier-toolkit
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://pypi.org/project/classifier-toolkit/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classifier-toolkit-0.2.0-1.src.rpm
checksum_type: sha256
description:
  <!-- [[_TOC_]] -->
  1. [Installation](#installation)
  2. [Usage](#usage)
  3. [Modules Overview](#modules-overview)
  4. [Future Work](#future-work)

  This library is published in the PyPI directory. To install, users can run pip install 'classifier_toolkit' command.

  This library automates binary classification tasks in the finance domain, specifically for default and fraud labeling. It includes several packages designed to address the main steps in any machine learning/data science task:
  1. EDA: which is accessible by EDA_Toolkit. This package provides the EDA and feature engineering functionality alongside with all the necessary visualizations.
  2. Feature Selection: To be implemented.
  3. Model fitting and hyperparameter tuning: To be implemented.
  4. Evaluation and reporting: To be implemented.
  In the future, the package architectures will be included here. However, for now please consult the docstrings in the specific methods in the relevant modules.
  **Note**: that this library does not contain data wrangling steps (although it contains feature engineering), it's an intermediate step between EDA and feature engineering where users should fix any data quality related issues. Therefore, conducting the EDA is crucial to mitigate any issues before moving onto the feature engineering and the subsequent steps.

  - **EDA Toolkit**: This module includes classes and methods for performing comprehensive exploratory data analysis. It provides automated warnings for data quality issues, univariate and bivariate analysis, and various data visualizations to help understand the dataset.
  - **Univariate Analysis**: This class focuses on the analysis of individual variables. It includes methods for calculating statistical measures, visualizing distributions, and assessing relationships between variables and a target through techniques like Cramer's V and Information Value. This helps in understanding the significance and distribution of each feature independently.
  - **Bivariate Analysis**: This class deals with the analysis of two variables to understand their relationship. It includes functionalities for generating correlation heatmaps, performing ANOVA tests between numerical and categorical variables, and computing pairwise Cramer's V for categorical features. This aids in identifying patterns and correlations between pairs of variables, which is crucial for feature selection and engineering.
  - **Feature Engineering**: This module assists in transforming features, handling missing values, encoding categorical variables, and more. It aims to enhance the dataset's quality for better model performance.
  - **Visualizations**: This module offers a wide range of plotting capabilities to visually analyze data distributions, relationships, and other crucial aspects of the dataset.
  - **Automated Warnings**: A utility to automatically check the dataset for common issues such as missing or duplicate values, outliers, and more, providing warnings to guide data cleaning efforts.
  - **Feature Selection**: This module provides various feature selection techniques:
    - **Embedded Methods**: Includes ElasticNet for regularization-based feature selection.
    - **Wrapper Methods**:
      - Recursive Feature Elimination (RFE) with support for various ensemble methods (Random Forest, XGBoost, LightGBM, CatBoost).
      - Sequential Feature Selection (forward, backward, floating, and bidirectional).
    - **Meta Selector**: Combines multiple feature selection methods to provide a robust selection.
    - **Utility Functions**: Includes scoring functions and plotting utilities for feature importance visualization.

  The next planned improvements and additions to the library include:
  * Adding model fitting and hyperparameter tuning functionalities.
  * Developing comprehensive evaluation and reporting tools to assist with model assessment.
  * Expanding documentation to include architecture diagrams and detailed usage examples.


pkgId: 9842716c7f4480d87017a07590bbd1085dd7835b2ce8dbe0bc89dd7e12571a7c
name: python-classifier_trains
arch: src
version: 1.1.2
epoch: 0
release: 1
summary: A PyTorch-based deep learning classifier training framework.
url: https://github.com/wyhwong/classifier-trains
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classifier_trains-1.1.2-1.src.rpm
checksum_type: sha256
description:
  For project details, please see [README.md](https://github.com/wyhwong/classifier-trains)


  ```bash
  pip3 install classifier-trains
  ```



  ```bash

  make help
  ```



  For example of pipeline configuration, please see [pipeline_config_only_train.yml](https://github.com/wyhwong/classifier-trains/blob/main/src/tests/test_data/pipeline_config_only_train.yml), [pipeline_config_only_eval.yml](https://github.com/wyhwong/classifier-trains/blob/main/src/tests/test_data/pipeline_config_only_eval.yml), [full_pipeline_config.yml](https://github.com/wyhwong/classifier-trains/blob/main/src/tests/test_data/full_pipeline_config.yml).

  ```bash

  python3 -m classifier_trains run --config <path to yml config> --output_dir <output_dir>


  python3 -m classifier_trains profile --config <path to yml config> --output_dir <output_dir>


  python3 -m classifier_trains compute-mean-and-std --dir-path <path to dataset>


  python3 -m classifier_trains get-output-mapping --dir-path <path to dataset>
  ```


  ```
  Dataset Directory
  ├── train
  │   ├── <class1>
  │   │   ├── <image1>
  │   │   └── ...
  │   └── <class2>
  │       ├── <image1>
  │       └── ...
  ├── val
  │   ├── <class1>
  │   │   ├── <image1>
  │   │   └── ...
  │   └── <class2>
  │       ├── <image1>
  │       └── ...
  └── eval
      ├── <class1>
      │   ├── <image1>
      │   └── ...
      └── <class2>
          ├── <image1>
          └── ...
  ```





  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | enable_training | Enable training | bool | False | True, False |
  | enable_evaluation | Enable evaluation | bool | False | True, False |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | model | Model architecture to use | str | / | resnet18, resnet34, resnet50, resnet152, vgg11, vgg11_bn, vgg13, vgg13_bn, vgg16, vgg16_bn, vgg19, vgg19_bn, squeezenet1_0, squeezenet1_1, densenet121, densenet161, densenet169, densenet201, inception_v3 |
  | num_classes | Number of classes | int | / | Any positive integer |
  | weights | Pretrained weights | str | DEFAULT | Check PyTorch Documentation |
  | checkpoint_path | Path to checkpoint | Optional[str] | None | Self defined path |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | batch_size | Batch size | int | / | Any positive integer |
  | num_workers | Number of workers | int | 0 | Any non negative integer |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | width | Width of resized image | int | / | Any positive integer |
  | height | Height of resized image | int | / | Any positive integer |
  | interpolation | Interpolation method | str | bicubic | nearest, nearest_exact, bilinear, bicubic |
  | padding | Padding | Optional[str] | None | top_left, top_right, bottom_left, bottom_right, center |
  | maintain_aspect_ratio | Maintain aspect ratio | bool | False | True, False |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | hflip_prob | Horizontal flip probability | float | / | Any float between 0 and 1 |
  | vflip_prob | Vertical flip probability | float | / | Any float between 0 and 1 |
  | max_rotate_in_degree | Maximum rotation in degree | float | 0.0 | Any non negative float |
  | allow_center_crop | Allow center crop | bool | False | True, False |
  | allow_random_crop | Allow random crop | bool | False | True, False |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | allow_gray_scale | Allow gray scale | bool | False | True, False |
  | allow_random_color | Allow random color | bool | False | True, False |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | mean | Mean of dataset | List[float] | / | Any list of floats |
  | std | Standard deviation of dataset | List[float] | / | Any list of floats |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | name | Optimizer to use | str | / | sgd, adam, rmsprop, adamw |
  | lr | Learning rate | float | / | Any positive float |
  | weight_decay | Weight decay | float | 0.0 | Any non negative float |
  | momentum | Momentum | Optional[float] | None | Any non negative float |
  | alpha | Alpha | Optional[float] | None | Any non negative float |
  | betas | Betas | Optional[Tuple[float, float]] | None | Any tuple of non negative floats |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | name | Scheduler to use | str | / | step, consine |
  | lr_min | Minimum learning rate | Optional[float] | None | Any non negative float |
  | step_size | Step size | Optional[int] | None | Any positive integer |
  | gamma | Gamma | Optional[float] | None | Any non negative float |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | name | Name of the experiment | str | / | Any string |
  | num_epochs | Number of epochs | int | / | Any positive integer |
  | trainset_dir | Path to training dataset | str | / | Any string |
  | valset_dir | Path to validation dataset | str | / | Any string |
  | testset_dir | Path to testing dataset | Optional[str] | None | Any string |
  | device | Device to use | str | cuda | cpu, cuda, etc. |
  | max_num_hrs | Maximum number of hours to run | Optional[float] | None | Any non negative float |
  | criterion | What criterion to use for best model | str | loss | loss, accuracy |
  | validate_every | Validate every n epochs | int | 1 | Any positive integer |
  | save_every | Save model every n epochs | int | 3 | Any positive integer |
  | patience | Patience for early stopping | int | 5 | Any positive integer |
  | random_seed | Random seed | int | 42 | Any positive integer |
  | precision | Precision | int | 64 | 16, 32, 64 |
  | export_last_as_onnx | Export last model as ONNX | bool | False | True, False |
  | export_best_as_onnx | Export best model as ONNX | bool | False | True, False |



  | Parameter | Description | Type | Default | Choices |
  | --- | --- | --- | --- | --- |
  | name | Name of the experiment | str | / | Any string |
  | evalset_dir | Path to evaluation dataset | str | / | Any string |
  | device | Device to use | str | cuda | cpu, cuda, etc. |
  | precision | Precision | int | 64 | 16, 32, 64 |
  | random_seed | Random seed | int | 42 | Any positive integer |


pkgId: a6ce736de89b4bd87efc50816ae6b0736d9a1e3d633176eb209a69daa74dafdd
name: python-classio
arch: src
version: 0.0.1
epoch: 0
release: 1
summary: IO tools for python classes.
url: https://pypi.org/project/classio/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classio-0.0.1-1.src.rpm
checksum_type: sha256
description:
  IO tools for python classes, [on pypi](https://pypi.org/project/classio/), so `pip install classio`.

  This project makes it as easy as possible to set up IO methods while following these principles:
  - Cross-platform/version compatibility matters → avoid pickle.
  - A single file is simpler to manage than a directory → keep a 1-1 relationship between classes and files. We use [packio](https://github.com/zkurtz/packio) to achieve this.
  - Users should not need to write boilerplate IO methods → we rely on [dummio](https://github.com/zkurtz/dummio) for a standardized interface to numerous IO methods.




  Create and activate a virtual env for dev ops:
  ```
  git clone git@github.com:zkurtz/classio.git
  cd classio
  pip install uv
  uv sync
  source .venv/bin/activate
  pre-commit install
  ```


pkgId: f494f4dfc42e2a6baa37b84d069ffa25e3f8f2278eae5c6d22edc262e24b44f4
name: python-classla
arch: src
version: 2.1.1
epoch: 0
release: 1
summary: Adapted Stanford NLP Python Library with improvements for specific languages.
url: https://github.com/clarinsi/classla-stanfordnlp.git
rpm_license: Apache License 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classla-2.1.1-1.src.rpm
checksum_type: sha256
description:
  This pipeline allows for processing of standard Slovenian, Croatian, Serbian and Bulgarian on the levels of

  - tokenization and sentence splitting
  - part-of-speech tagging
  - lemmatization
  - dependency parsing
  - named entity recognition

  It also allows for processing of standard Macedonian on the levels of

  - tokenization and sentence splitting
  - part-of-speech tagging
  - lemmatization

  Finally, it allows for processing of non-standard (Internet) Slovenian, Croatian and Serbian on the same levels as standard language (all models are tailored to non-standard language except for dependency parsing where the standard module is used).



  The differences of this pipeline to the original Stanza pipeline are the following:

  - usage of language-specific rule-based tokenizers and sentence splitters, [obeliks](https://pypi.org/project/obeliks/) for standard Slovenian and [reldi-tokeniser](https://pypi.org/project/reldi-tokeniser/) for the remaining varieties and languages (Stanza uses inferior machine-learning-based tokenization and sentence splitting trained on UD data)
  - default pre-tagging and pre-lemmatization on the level of tokenizers for the following phenomena: punctuation, symbol, e-mail, URL, mention, hashtag, emoticon, emoji (usage documented [here](https://github.com/clarinsi/classla/blob/master/README.superuser.md#usage-of-tagging-control-via-the-tokenizer))
  - optional control of the tagger for Slovenian via an inflectional lexicon on the levels of XPOS, UPOS, FEATS (usage documented [here](https://github.com/clarinsi/classla/blob/master/README.superuser.md#usage-of-inflectional-lexicon))
  - closed class handling depending on the usage of the options described in the last two bullets, as documented [here](https://github.com/clarinsi/classla/blob/master/README.closed_classes.md)
  - usage of external inflectional lexicons for lookup lemmatization, seq2seq being used very infrequently on OOVs only (Stanza uses only UD training data for lookup lemmatization)
  - morphosyntactic tagging models based on larger quantities of training data than is available in UD (training data that are morphosyntactically tagged, but not UD-parsed)
  - lemmatization models based on larger quantities of training data than is available in UD (training data that are lemmatized, but not UD-parsed)
  - optional JOS-project-based parsing of Slovenian (usage documented [here](https://github.com/clarinsi/classla/blob/master/README.superuser.md#jos-dependency-parsing-system))
  - named entity recognition models for all languages except Macedonian (Stanza does not cover named entity recognition for any of the languages supported by classla)
  - Macedonian models (Macedonian is not available in UD yet)
  - non-standard models for Croatian, Slovenian, Serbian (there is no UD data for these varieties)

  The above modifications led to some important improvements in the tool's performance in comparison to original Stanza. For standard Slovenian, comparing the CLASSLA-Stanza tool with Stanza on the [SloBENCH benchmark](https://slobench.cjvt.si/leaderboard/view/11), shows relative error reduction (part of the error removed by moving from Stanza to CLASSLA-Stanza) on sentence segmentation to be 98%, on token segmentation 50%, on lemmatization 69%, on morphosyntactic XPOS tagging 65%, and on dependency parsing 34%.



  If you use this tool, please cite the following papers:

  ```
  @inproceedings{ljubesic-dobrovoljc-2019-neural,
      title = "What does Neural Bring? Analysing Improvements in Morphosyntactic Annotation and Lemmatisation of {S}lovenian, {C}roatian and {S}erbian",
      author = "Ljube{\v{s}}i{\'c}, Nikola  and
        Dobrovoljc, Kaja",
      booktitle = "Proceedings of the 7th Workshop on Balto-Slavic Natural Language Processing",
      month = aug,
      year = "2019",
      address = "Florence, Italy",
      publisher = "Association for Computational Linguistics",
      url = "https://www.aclweb.org/anthology/W19-3704",
      doi = "10.18653/v1/W19-3704",
      pages = "29--34"
      }
  @misc{terčon2023classlastanza,
        title={CLASSLA-Stanza: The Next Step for Linguistic Processing of South Slavic Languages},
        author={Luka Terčon and Nikola Ljubešić},
        year={2023},
        eprint={2308.04255},
        archivePrefix={arXiv},
        primaryClass={cs.CL}
  }

  ```




  We recommend that you install CLASSLA via pip, the Python package manager. To install, run:
  ```bash
  pip install classla
  ```
  This will also resolve all dependencies.

  __NOTE TO EXISTING USERS__: Once you install this classla version, you will HAVE TO re-download the models. All previously downloaded models will not be used anymore. We suggest you delete the old models. Their default location is at `~/classla_resources`.





  To run the CLASSLA pipeline for the first time on processing standard Slovenian, follow these steps:

  ```
  >>> import classla
  >>> classla.download('sl')                            # download standard models for Slovenian, use hr for Croatian, sr for Serbian, bg for Bulgarian, mk for Macedonian
  >>> nlp = classla.Pipeline('sl')                      # initialize the default Slovenian pipeline, use hr for Croatian, sr for Serbian, bg for Bulgarian, mk for Macedonian
  >>> doc = nlp("France Prešeren je rojen v Vrbi.")     # run the pipeline
  >>> print(doc.to_conll())                             # print the output in CoNLL-U format



  1	France	France	PROPN	Npmsn	Case=Nom|Gender=Masc|Number=Sing	4	nsubj	_	NER=B-PER
  2	Prešeren	Prešeren	PROPN	Npmsn	Case=Nom|Gender=Masc|Number=Sing	1	flat:name	_	NER=I-PER
  3	je	biti	AUX	Va-r3s-n	Mood=Ind|Number=Sing|Person=3|Polarity=Pos|Tense=Pres|VerbForm=Fin	4	cop	_	NER=O
  4	rojen	rojen	ADJ	Appmsnn	Case=Nom|Definite=Ind|Degree=Pos|Gender=Masc|Number=Sing|VerbForm=Part	0	root	_	NER=O
  5	v	v	ADP	Sl	Case=Loc	6	case	_	NER=O
  6	Vrbi	Vrba	PROPN	Npfsl	Case=Loc|Gender=Fem|Number=Sing	4	obl	_	NER=B-LOC|SpaceAfter=No
  7	.	.	PUNCT	Z	_	4	punct	_	NER=O

  ```
  You can find examples of standard language processing for [Croatian](#example-of-standard-croatian), [Serbian](#example-of-standard-serbian), [Macedonian](#example-of-standard-macedonian) and [Bulgarian](#example-of-standard-bulgarian) at the end of this document.



  Processing non-standard Slovenian differs to the above standard example just by an additional argument ```type="nonstandard"```:

  ```
  >>> import classla
  >>> classla.download('sl', type='nonstandard')        # download non-standard models for Slovenian, use hr for Croatian and sr for Serbian
  >>> nlp = classla.Pipeline('sl', type='nonstandard')  # initialize the default non-standard Slovenian pipeline, use hr for Croatian and sr for Serbian
  >>> doc = nlp("kva smo mi zurali zadnje leto v zagrebu...")     # run the pipeline
  >>> print(doc.to_conll())                             # print the output in CoNLL-U format



  1	kva	kaj	PRON	Pq-nsa	Case=Acc|Gender=Neut|Number=Sing|PronType=Int	4	obj	_	NER=O
  2	smo	biti	AUX	Va-r1p-n	Mood=Ind|Number=Plur|Person=1|Polarity=Pos|Tense=Pres|VerbForm=Fin	4	aux	_	NER=O
  3	mi	jaz	PRON	Pp1mpn	Case=Nom|Gender=Masc|Number=Plur|Person=1|PronType=Prs	4	nsubj	_	NER=O
  4	zurali	zurati	VERB	Vmpp-pm	Aspect=Imp|Gender=Masc|Number=Plur|VerbForm=Part	0	root	_	NER=O
  5	zadnje	zadnji	ADJ	Agpnsa	Case=Acc|Degree=Pos|Gender=Neut|Number=Sing	6	amod	_	NER=O
  6	leto	leto	NOUN	Ncnsa	Case=Acc|Gender=Neut|Number=Sing	4	obl	_	NER=O
  7	v	v	ADP	Sl	Case=Loc	8	case	_	NER=O
  8	zagrebu	Zagreb	PROPN	Npmsl	Case=Loc|Gender=Masc|Number=Sing	4	obl	_	NER=B-LOC|SpaceAfter=No
  9	...	...	PUNCT	Z	_	4	punct	_	NER=O

  ```

  You can find examples of non-standard language processing for [Croatian](#example-of-non-standard-croatian) and [Serbian](#example-of-non-standard-serbian)  at the end of this document.

  For additional usage examples you can also consult the ```pipeline_demo.py``` file.



  A special web processing mode for processing texts obtained from the internet can be activated with the ```type="web"``` argument:

  ```
  >>> import classla
  >>> classla.download('sl', type='web')        # download web models for Slovenian, use hr for Croatian and sr for Serbian
  >>> nlp = classla.Pipeline('sl', type='web')  # initialize the default Slovenian web pipeline, use hr for Croatian and sr for Serbian
  >>> doc = nlp("Kdor hoce prenesti preko racunalnika http://t.co/LwWyzs0cA0")     # run the pipeline
  >>> print(doc.to_conll())                             # print the output in CoNLL-U format



  1	Kdor	kdor	PRON	Pr-msn	Case=Nom|Gender=Masc|Number=Sing|PronType=Rel	2	nsubj	_	NER=O
  2	hoce	hoteti	VERB	Vmpr3s-n	Aspect=Imp|Mood=Ind|Number=Sing|Person=3|Polarity=Pos|Tense=Pres|VerbForm=Fin	0	root	_	NER=O
  3	prenesti	prenesti	VERB	Vmen	Aspect=Perf|VerbForm=Inf	2	xcomp	_	NER=O
  4	preko	preko	ADP	Sg	Case=Gen	5	case	_	NER=O
  5	racunalnika	računalnik	NOUN	Ncmsg	Case=Gen|Gender=Masc|Number=Sing	3	obl	_	NER=O
  6	http://t.co/LwWyzs0cA0	http://t.co/LwWyzs0cA0	SYM	Xw	_	5	nmod	_	NER=O
  ```



  The CLASSLA pipeline is built from multiple units. These units are called processors. By default CLASSLA runs the ```tokenize```, ```ner```, ```pos```, ```lemma``` and ```depparse``` processors.

  You can specify which processors CLASSLA should run, via the ```processors``` attribute as in the following example, performing tokenization, named entity recognition, part-of-speech tagging and lemmatization.

  ```python
  >>> nlp = classla.Pipeline('sl', processors='tokenize,ner,pos,lemma')
  ```

  Another popular option might be to perform tokenization, part-of-speech tagging, lemmatization and dependency parsing.

  ```python
  >>> nlp = classla.Pipeline('sl', processors='tokenize,pos,lemma,depparse')
  ```



  The tokenization and sentence splitting processor ```tokenize``` is the first processor and is required for any further processing.

  In case you already have tokenized text, you should separate tokens via spaces and pass the attribute ```tokenize_pretokenized=True```.

  By default CLASSLA uses a rule-based tokenizer - [obeliks](https://github.com/clarinsi/obeliks) for Slovenian standard language pipeline. In other cases we use [reldi-tokeniser](https://github.com/clarinsi/reldi-tokeniser).

  <!--Most important attributes:
  ```
  tokenize_pretokenized   - [boolean]     ignores tokenizer
  ```-->



  The POS tagging processor ```pos``` will general output that contains morphosyntactic description following the [MULTEXT-East standard](http://nl.ijs.si/ME/V6/msd/html/msd.lang-specific.html) and universal part-of-speech tags and universal features following the [Universal Dependencies standard](https://universaldependencies.org). This processing requires the usage of the ```tokenize``` processor.

  <!--Most important attributes:
  ```
  pos_model_path          - [str]         alternative path to model file
  pos_pretrain_path       - [str]         alternative path to pretrain file
  ```-->



  The lemmatization processor ```lemma``` will produce lemmas (basic forms) for each token in the input. It requires the usage of both the ```tokenize``` and ```pos``` processors.



  The dependency parsing processor ```depparse``` performs syntactic dependency parsing of sentences following the [Universal Dependencies formalism](https://universaldependencies.org/introduction.html#:~:text=Universal%20Dependencies%20(UD)%20is%20a,from%20a%20language%20typology%20perspective.). It requires the ```tokenize``` and ```pos``` processors.



  The named entity recognition processor ```ner``` identifies named entities in text following the [IOB2](https://en.wikipedia.org/wiki/Inside–outside–beginning_(tagging)) format. It requires only the ```tokenize``` processor.





  ```
  >>> import classla
  >>> nlp = classla.Pipeline('hr') # run classla.download('hr') beforehand if necessary
  >>> doc = nlp("Ante Starčević rođen je u Velikom Žitniku.")
  >>> print(doc.to_conll())



  1	Ante	Ante	PROPN	Npmsn	Case=Nom|Gender=Masc|Number=Sing	3	nsubj	_	NER=B-PER
  2	Starčević	Starčević	PROPN	Npmsn	Case=Nom|Gender=Masc|Number=Sing	1	flat	_	NER=I-PER
  3	rođen	roditi	ADJ	Appmsnn	Case=Nom|Definite=Ind|Degree=Pos|Gender=Masc|Number=Sing|VerbForm=Part|Voice=Pass	0	root	_	NER=O
  4	je	biti	AUX	Var3s	Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin	3	aux	_	NER=O
  5	u	u	ADP	Sl	Case=Loc	7	case	_	NER=O
  6	Velikom	velik	ADJ	Agpmsly	Case=Loc|Definite=Def|Degree=Pos|Gender=Masc|Number=Sing	7	amod	_	NER=B-LOC
  7	Žitniku	Žitnik	PROPN	Npmsl	Case=Loc|Gender=Masc|Number=Sing	3	obl	_	NER=I-LOC|SpaceAfter=No
  8	.	.	PUNCT	Z	_	3	punct	_	NER=O

  ```


  ```
  >>> import classla
  >>> nlp = classla.Pipeline('hr', type='nonstandard') # run classla.download('hr', type='nonstandard') beforehand if necessary
  >>> doc = nlp("kaj sam ja tulumaril jucer u ljubljani...")
  >>> print(doc.to_conll())



  1	kaj	što	PRON	Pq3n-a	Case=Acc|Gender=Neut|PronType=Int,Rel	4	obj	_	NER=O
  2	sam	biti	AUX	Var1s	Mood=Ind|Number=Sing|Person=1|Tense=Pres|VerbForm=Fin	4	aux	_	NER=O
  3	ja	ja	PRON	Pp1-sn	Case=Nom|Number=Sing|Person=1|PronType=Prs	4	nsubj	_	NER=O
  4	tulumaril	tulumariti	VERB	Vmp-sm	Gender=Masc|Number=Sing|Tense=Past|VerbForm=Part|Voice=Act	0	root	_	NER=O
  5	jucer	jučer	ADV	Rgp	Degree=Pos	4	advmod	_	NER=O
  6	u	u	ADP	Sl	Case=Loc	7	case	_	NER=O
  7	ljubljani	Ljubljana	PROPN	Npfsl	Case=Loc|Gender=Fem|Number=Sing	4	obl	_	NER=B-LOC|SpaceAfter=No
  8	...	...	PUNCT	Z	_	4	punct	_	NER=O

  ```





  ```
  >>> import classla
  >>> nlp = classla.Pipeline('sr') # run classla.download('sr') beforehand if necessary
  >>> doc = nlp("Slobodan Jovanović rođen je u Novom Sadu.")
  >>> print(doc.to_conll())



  1	Slobodan	Slobodan	PROPN	Npmsn	Case=Nom|Gender=Masc|Number=Sing	3	nsubj	_	NER=B-PER
  2	Jovanović	Jovanović	PROPN	Npmsn	Case=Nom|Gender=Masc|Number=Sing	1	flat	_	NER=I-PER
  3	rođen	roditi	ADJ	Appmsnn	Case=Nom|Definite=Ind|Degree=Pos|Gender=Masc|Number=Sing|VerbForm=Part|Voice=Pass	0	root	_	NER=O
  4	je	biti	AUX	Var3s	Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin	3	aux	_	NER=O
  5	u	u	ADP	Sl	Case=Loc	7	case	_	NER=O
  6	Novom	nov	ADJ	Agpmsly	Case=Loc|Definite=Def|Degree=Pos|Gender=Masc|Number=Sing	7	amod	_	NER=B-LOC
  7	Sadu	Sad	PROPN	Npmsl	Case=Loc|Gender=Masc|Number=Sing	3	obl	_	NER=I-LOC|SpaceAfter=No
  8	.	.	PUNCT	Z	_	3	punct	_	NER=O

  ```



  ```
  >>> import classla
  >>> nlp = classla.Pipeline('sr', type='nonstandard') # run classla.download('sr', type='nonstandard') beforehand if necessary
  >>> doc = nlp("ne mogu da verujem kakvo je zezanje bilo prosle godine u zagrebu...")
  >>> print(doc.to_conll())



  1	ne	ne	PART	Qz	Polarity=Neg	2	advmod	_	NER=O
  2	mogu	moći	VERB	Vmr1s	Mood=Ind|Number=Sing|Person=1|Tense=Pres|VerbForm=Fin	0	root	_	NER=O
  3	da	da	SCONJ	Cs	_	4	mark	_	NER=O
  4	verujem	verovati	VERB	Vmr1s	Mood=Ind|Number=Sing|Person=1|Tense=Pres|VerbForm=Fin	2	xcomp	_	NER=O
  5	kakvo	kakav	DET	Pi-nsn	Case=Nom|Gender=Neut|Number=Sing|PronType=Int,Rel	4	ccomp	_	NER=O
  6	je	biti	AUX	Var3s	Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin	5	aux	_	NER=O
  7	zezanje	zezanje	NOUN	Ncnsn	Case=Nom|Gender=Neut|Number=Sing	8	nsubj	_	NER=O
  8	bilo	biti	AUX	Vap-sn	Gender=Neut|Number=Sing|Tense=Past|VerbForm=Part|Voice=Act	5	cop	_	NER=O
  9	prosle	prošli	ADJ	Agpfsgy	Case=Gen|Definite=Def|Degree=Pos|Gender=Fem|Number=Sing	10	amod	_	NER=O
  10	godine	godina	NOUN	Ncfsg	Case=Gen|Gender=Fem|Number=Sing	8	obl	_	NER=O
  11	u	u	ADP	Sl	Case=Loc	12	case	_	NER=O
  12	zagrebu	Zagreb	PROPN	Npmsl	Case=Loc|Gender=Masc|Number=Sing	8	obl	_	NER=B-LOC|SpaceAfter=No
  13	...	...	PUNCT	Z	_	2	punct	_	NER=O

  ```





  ```
  >>> import classla
  >>> nlp = classla.Pipeline('bg') # run classla.download('bg') beforehand if necessary
  >>> doc = nlp("Алеко Константинов е роден в Свищов.")
  >>> print(doc.to_conll())



  1	Алеко	алеко	PROPN	Npmsi	Definite=Ind|Gender=Masc|Number=Sing	4	nsubj:pass	_	NER=B-PER
  2	Константинов	константинов	PROPN	Hmsi	Definite=Ind|Gender=Masc|Number=Sing	1	flat	_	NER=I-PER
  3	е	съм	AUX	Vxitf-r3s	Aspect=Imp|Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin|Voice=Act	4	aux:pass	_	NER=O
  4	роден	родя-(се)	VERB	Vpptcv--smi	Aspect=Perf|Definite=Ind|Gender=Masc|Number=Sing|VerbForm=Part|Voice=Pass	0	root	_	NER=O
  5	в	в	ADP	R	_	6	case	_	NER=O
  6	Свищов	свищов	PROPN	Npmsi	Definite=Ind|Gender=Masc|Number=Sing	4	iobj	_	NER=B-LOC|SpaceAfter=No
  7	.	.	PUNCT	punct	_	4	punct	_	NER=O

  ```





  ```
  >>> import classla
  >>> nlp = classla.Pipeline('mk') # run classla.download('mk') beforehand if necessary
  >>> doc = nlp('Крсте Петков Мисирков е роден во Постол.')
  >>> print(doc.to_conll())



  1	Крсте	Крсте	PROPN	Npmsnn	Case=Nom|Definite=Ind|Gender=Masc|Number=Sing	_	_	_	_
  2	Петков	Петков	PROPN	Npmsnn	Case=Nom|Definite=Ind|Gender=Masc|Number=Sing	_	_	_	_
  3	Мисирков	Мисирков	PROPN	Npmsnn	Case=Nom|Definite=Ind|Gender=Masc|Number=Sing	_	_	_	_
  4	е	сум	AUX	Vapip3s-n	Aspect=Prog|Mood=Ind|Number=Sing|Person=3|Polarity=Pos|Tense=Pres	_	_	_	_
  5	роден	роден	ADJ	Ap-ms-n	Definite=Ind|Gender=Masc|Number=Sing|VerbForm=Part	_	_	_	_
  6	во	во	ADP	Sps	AdpType=Prep	_	_	_	_
  7	Постол	Постол	PROPN	Npmsnn	Case=Nom|Definite=Ind|Gender=Masc|Number=Sing	_	_	_	SpaceAfter=No
  8	.	.	PUNCT	Z	_	_	_	_	_

  ```



  [Training instructions](https://github.com/clarinsi/classla-stanfordnlp/blob/master/README.train.md)



  [Superuser instructions](https://github.com/clarinsi/classla-stanfordnlp/blob/master/README.superuser.md)


pkgId: b98a0b1ab4987c8c97601d0d641d8a6503b96a340133096bc46a2905da1a8257
name: python-classopt
arch: src
version: 0.2.1
epoch: 0
release: 1
summary: Arguments parser with class for Python, inspired by StructOpt
url: https://github.com/moisutsu/classopt
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classopt-0.2.1-1.src.rpm
checksum_type: sha256
description:
  <h1 align="center">Welcome to ClassOpt 👋</h1>
  <p>
    <img alt="Version" src="https://img.shields.io/pypi/v/classopt" />
    <a href="https://github.com/moisutsu/classopt/blob/main/LICENSE" target="_blank">
      <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
    </a>
    <a href="https://twitter.com/moisutsu" target="_blank">
      <img alt="Twitter: moisutsu" src="https://img.shields.io/twitter/follow/moisutsu.svg?style=social" />
    </a>
  </p>

  > Arguments parser with class for Python, inspired by [StructOpt](https://github.com/TeXitoi/structopt)



  ```sh
  pip install classopt
  ```




  Import `classopt` and define the Opt class with decorator.

  ```python
  from classopt import classopt

  @classopt(default_long=True)
  class Opt:
      file: str
      count: int = 3
      numbers: list[int]
      flag: bool

  if __name__ == "__main__":
      opt = Opt.from_args()
      print(opt)
      print(opt.file)
  ```

  Run with command line arguments.

  ```bash
  $ python example.py --file example.txt --numbers 1 2 3 --flag
  Opt(file='example.txt', count=3, numbers=[1, 2, 3], flag=True)
  example.txt
  ```
  You can specify most of the arguments to [argparse.ArgumentParser.add_argument](https://docs.python.org/ja/3/library/argparse.html#argparse.ArgumentParser.add_argument) in `config` (except name_or_flags).


  ```python
  from classopt import classopt, config

  @classopt
  class Opt:
      file: str
      count: int = config(long=True)
      numbers: list = config(long=True, short=True, nargs="+", type=int)
      flag: bool = config(long=True, action="store_false")

  if __name__ == "__main__":
      opt = Opt.from_args()
      print(opt)
  ```

  ```bash
  $ python example.py example.txt --count 5 -n 1 2 3 --flag
  Opt(file='example.txt', count=5, numbers=[1, 2, 3], flag=False)
  ```

  Some details
  ```python


  @classopt(default_long=True)
  class Opt:
      
      file: str = config(long=False)

      
      
      numbers: list[int]

      
      flag: bool
  ```



  You can also define an argument parser by inheriting from `ClassOpt`.

  ```python
  from classopt import ClassOpt, config

  class Opt(ClassOpt):
      file: str
      count: int = config(long=True)
      numbers: list[int] = config(long=True, short="-c")
      flag: bool = config(long=True)

  if __name__ == "__main__":
      opt = Opt.from_args()
      print(opt)
      print(opt.file)
  ```

  Run with command line arguments.

  ```bash
  $ python example.py example.txt --count 5 -c 1 2 3 --flag
  Opt(file='example.txt', count=5, numbers=[1, 2, 3], flag=True)
  example.txt
  ```

  The inherited method does not support some features and may disappear in the future.
  So we recommend the decorator method.



  ```sh
  poetry run pytest
  ```



  👤 **moisutsu**

  * Twitter: [@moisutsu](https://twitter.com/moisutsu)
  * Github: [@moisutsu](https://github.com/moisutsu)



  Give a ⭐️ if this project helped you!



  Copyright © 2021 [moisutsu](https://github.com/moisutsu).<br />
  This project is [MIT](https://github.com/moisutsu/classopt/blob/main/LICENSE) licensed.

  ***
  _This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_


pkgId: 09d886c21fac44484e8ea1d1ee3f7ed6f59e87773f59a9835aa24d6878fd4f9e
name: python-classoptions
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Implement namespaced and inheritable metadata at the class level.
url: https://github.com/adrianmrit/classoptions
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classoptions-0.2.0-1.src.rpm
checksum_type: sha256
description:
  Implement namespaced and inheritable metadata at the class level.

  Inspired on Meta classes from Django models and Django Rest Framework model serializers.



  `pip install classoptions`


  ```python
  from classoptions import ClassOptionsMetaclass
  from typing import Any

  class Pizza(metaclass=ClassOptionsMetaclass):
      _meta: Any

      class DefaultMeta:
          client_can_modify = True
          notes = None

      cooking_temp = 400
      cooking_time = 1

  class HawaiianPizza(Pizza):
      ingredients = ["cheese", "ham", "pineapple"]

      class Meta:
          notes = "Do not judge the costumer."
          private_note = "If planning a party, ask first if people like it."

  print("Hawaiian Pizza:")
  print("Ingredients:", ", ".join(HawaiianPizza.ingredients))
  print("Cooking Temperature (F):", HawaiianPizza.cooking_temp)
  print("Cooking Time (hours):", HawaiianPizza.cooking_time)
  print("Client can modify:", HawaiianPizza._meta.client_can_modify)
  print("Notes:")
  print(HawaiianPizza._meta.notes)
  print("Private Note:")
  print(HawaiianPizza._meta.private_note)
  ```
  Outputs:
  ```text
  Hawaiian Pizza:
  Ingredients: cheese, ham, pineapple
  Cooking Temperature (F): 400
  Cooking Time (hours): 1
  Client can modify: True
  Notes:
  Do not judge the costumer.
  Private Note:
  If planning a party, ask first if people like it.
  ```


  Works similar to python inheritance, except we don't need to explicitly inherit from the parent class.

  ```python
  from classoptions import ClassOptionsMetaclass
  from typing import Any

  class A(metaclass=ClassOptionsMetaclass):
      _meta: Any
      class DefaultMeta:
          color = "red"
          size = 2
          hello = "world"
          i_like_pizza = True

  class B(A):
      class DefaultMeta:
          color = "blue"
          size = 3

  class C(B):
      class Meta:
          size = 4  # Specific to C only

  class D(A):
      class DefaultMeta:
          color = "black"
          hello = "country"

  class E(D, C):
      class Meta:
          i_like_hawaiian_pizza = "maybe"

  print("E custom meta")
  print("i_like_hawaiian_pizza:", E._meta.i_like_hawaiian_pizza)

  print("\nInherited from B")
  print("size:", E._meta.size)

  print("\nInherited from D")
  print("color:", E._meta.color)
  print("hello:", E._meta.hello)

  print("\nInherited from A")
  print("i_like_pizza:", E._meta.i_like_pizza)
  ```
  Outputs:
  ```text
  E custom meta
  i_like_hawaiian_pizza: maybe

  Inherited from B
  size: 3

  Inherited from D
  color: black
  hello: country

  Inherited from A
  i_like_pizza: True
  ```


  With ``ClassOptionsMetaclass.factory`` you can overwrite how you define default metadata, class specific metadata,
  and how you access the result.

  ```python
  from classoptions import ClassOptionsMetaclass
  from typing import Any

  class A(metaclass=ClassOptionsMetaclass.factory("Options", "DefaultOptions", "_options")):
      _options: Any

      class DefaultOptions:
          color = "red"
          size = 2

      cooking_temp = 400
      cooking_time = 1

  class B(A):
      class Options:
          color = "blue"

  print("B color:", B._options.color)
  print("B size:", B._options.size)
  ```
  Outputs:
  ```text
  B color: blue
  B size: 2
  ```


  MIT License.


pkgId: 20e5eab5a508d91771fe1bc9372db0464c663c87edcdb16d81011e47adfb8c90
name: python-classproperties
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: property for class methods
url: https://github.com/dpep/pyclassproperties
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classproperties-0.2.0-1.src.rpm
checksum_type: sha256
description:
  ```pip install classproperties```

  ```
  from classproperties import classproperty
  class Foo:
    @classproperty
    def prop():
      return 'hi there'
    @classproperty
    def other(cls):
      return 'also works'
  Foo.prop
  Foo.other
  ```


pkgId: 100e6aad22f4c2ba1318a394359eaa8a15f59e5a7319a35316aa88c6c1707b9f
name: python-classroom-gizmos
arch: src
version: 0.0b2.dev32
epoch: 0
release: 1
summary: Several small functions for classroom instruction.
url: https://github.com/Danseur1/Classroom_gizmos
rpm_license: GNU General Public License v3 or later (GPLv3+)
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classroom-gizmos-0.0b2.dev32-1.src.rpm
checksum_type: sha256
description:
  This is a collection of functions for classroom instruction in
  introductory physics. This is basically using ipython as a calculator
  that displays the calculation and the results.<br>
  Typical usage to make a set of useful functions available in ipython:

      from classroom_gizmos.handies import *

  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
  <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

  *_classroom_gizmos.handies_* is a collection of small functions
  that are
  useful from an ipython prompt. <br>
  __Note: Imports from astropy, PyQt5, and func_timeout__<br>
  Certain functions and functionality are not available when some of the
  imported packages are unavailable.<br>
  The **mine()** function lists all the user functions defined
  in *_handies.py_*.


      cdbn(), osname(), getCCode()
      hostname(), call(), rad(), deg(), sinD(), cosD(), tanD(),
      asinD(), acosD(), atanD(), atan2D(), atan2P(), nCr(), comb(),
      pltsize(), select_file(), select_file_timeout(), getTS(), timeStampStr(),
      isInstalled(), randomLetter(), randomElement(), count_down()
      mine()


      cls  (iPython magic %cls) outputs 23 blank lines.
      clsall() deletes previous text using ascii control character.
  Trig Functions in Degrees<br>
  &nbsp;&nbsp;&nbsp;&nbsp;'D' and 'P' trig functions work with degrees.<br>
  &nbsp;&nbsp;&nbsp;&nbsp;'P' inverse functions return only positive angles.

  greeks  &#10230; a string with greek alphabet.<br>
  pltsize( w, h, dpi=150) &#10230; resizes plots in matplotlib.<br>
  getTS() &#10230; returns a readable time stamp string.<br>
  isInstalled( pkgNameStr) &#10230; returns package or None if pkg is not installed.<br>
  timeStampStr() &#10230; returns a readable, timestamp string.<br>
  From random imports randint and defines randomLetter

  mine() &#10230; lists what handies.py defines.

  select_file and select_file_timeout

  pi, sqrt, cos, sin, tan, acos, asin, atan, atan2,
  degrees, radians, log, log10, exp

  Defines nowMJD(); mjd2date(), date2mjd().<br>
  Imports astropy.units as "u", i.e. u.cm or u.GHz

  The variable
  __IsInteractive__ is True if in interpreter, False if running from command line.<br>
  Line magic *cls* is defined, outputs 23 blank lines to 'clear' screen.<<br>
  Sets ipython numeric format to %.5g



  This module implements a file browser that can be used
  in a Jupyter Notebook.  (Not usable in Jupyter lab.)<br>
  __Typical Usage:__

  	from classroom_gizmos.jupyter_file_browser import box, get_file_path
      box

  A file select widget will be created below that cell.

  In a following notebook cell:

      path = get_file_path()  ## returns path of currently selected file in
      the file select cell.




      pkg = importInstall( 'pkg_name')
      OR
      pkg = importInstall( 'pkg_name, 'PyPI_name')
  This function tries to import a specified package and if that fails,
  it tries to install the package and then import it.<br>
  _*importInstall*_ was written so that python programs can be
  distributed to students without detailed instructions on checking if
  packages are installed
  and information on installing the needed packages.<br>
  The function returns the package or None.<br>

  **Warning:** _importInstall_ can not install all packages. It is less likely to install a package that is not pure python.



  decCredit() returns perl code for use in WebAssign answer credit calculations.
  Convenience functions:

      BBPdecCredit(), InCdecCredit(),
      HWdecCredit(), getCCode()

  <hr>
  getCCode() is an interactive 'wizard' that has no parameters, but steps through options needed to
  produce the Perl conditional code for various question types.

  All functions should have doc strings that give more information about usage and parameters.


pkgId: 9e5071af181888299a14ef08500b3a6e472dbbc3a64c07ae7fdb68a2721c45e5
name: python-classutilities
arch: src
version: 0.2.1
epoch: 0
release: 1
url: https://github.com/david-salac/classutilities
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classutilities-0.2.1-1.src.rpm
checksum_type: sha256
summary:
  A simple package that allows having class-level properties and validator for typical configuration classes.

description:
  Author: David Salac <https://github.com/david-salac>

  Simple package with helpful utilities for classes.
  That includes class level properties and filters for
  configuration classes.

  **Note:** this package does not require any external dependencies.


  Use PIP command:
  ```
  pip install classutilities
  ```


  Class level properties are properties defined on
  class level. They behave exactly the same as
  normal properties (but allow being called on
  class level and not only on instance level).

  Consider the following example (defining class
  level properties):
  ```python
  import classutilities

  class SomeClass(classutilities.ClassPropertiesMixin):
      _some_variable = 8  # Some class variable

      @classutilities.classproperty
      def some_variable(cls):  # Example of getter
          return cls._some_variable

      @some_variable.setter
      def some_variable(cls, value):  # Example of setter
          cls._some_variable = value
  ```
  `ClassPropertiesMixin` allows you to use a setter for
  properties. However, if you only need a getter, it will
  work even without this mixin.


  Usage of class-level properties:
  ```python

  value = SomeClass.some_variable
  print(value)  # >>> 8


  new_value = 9
  SomeClass.some_variable = new_value
  print(SomeClass.some_variable)  # >>> 9
  print(SomeClass._some_variable)  # >>> 9
  ```
  As you can see, class-level properties behave very
  naturally.


  Configuration classes usually follow standard patterns, mainly:
   - All members have to be upper case (if they do not start
     with an underscore).
   - There is no constructor in the class.
   - There is no standard (instance) method in the class. Only
     class methods and static methods are allowed.

  It is beneficial to have some validator for a configuration
  class that checks if all these conditions are followed.
  This is precisely what ConfigClassMixin does. Consider
  the following use-case:

  ```python
  import classutilities

  class SomeConfigClass(classutilities.ConfigClassMixin):
      
      DATABASE_HOST = "localhost"  # OK: variable name in uppercase
      DATABASE_NAME = "testing"  # OK: variable name in uppercase
      

      
      database_password = "pass"  # NO: must not be lowercase

      
      _api_version = "1.0.0"  # OK: starts with an underscore

      
      @classmethod
      def connect_to_database(cls):  # Class methods are acceptable
          return ...

      
      @staticmethod
      def check_status():  # Static methods are acceptable
          return ...

      
      def check_parameters(self):  # No instance-level methods
          return ...
  ```
  Mixin `ConfigClassMixin` can be used together with
  mixin for class-level properties. Class level properties
  are also acceptable (this filter allows them).


pkgId: 7b01232337b1f91a6f0bac01fa807cf275db1da8d77a4178e6cea10fe41da325
name: python-classy-classification
arch: src
version: 1.0.1
epoch: 0
release: 1
url: https://github.com/davidberenstein1957/classy-classification
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classy-classification-1.0.1-1.src.rpm
checksum_type: sha256
summary:
  Have you every struggled with needing a Spacy TextCategorizer but didn't have the time to train one from scratch? Classy Classification is the way to go!

description:
  Have you ever struggled with needing a [Spacy TextCategorizer](https://spacy.io/api/textcategorizer) but didn't have the time to train one from scratch? Classy Classification is the way to go! For few-shot classification using [sentence-transformers](https://github.com/UKPLab/sentence-transformers) or [spaCy models](https://spacy.io/usage/models), provide a dictionary with labels and examples, or just provide a list of labels for zero shot-classification with [Hugginface zero-shot classifiers](https://huggingface.co/models?pipeline_tag=zero-shot-classification).

  [![Current Release Version](https://img.shields.io/github/release/pandora-intelligence/classy-classification.svg?style=flat-square&logo=github)](https://github.com/pandora-intelligence/classy-classification/releases)
  [![pypi Version](https://img.shields.io/pypi/v/classy-classification.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.org/project/classy-classification/)
  [![PyPi downloads](https://static.pepy.tech/personalized-badge/classy-classification?period=total&units=international_system&left_color=grey&right_color=orange&left_text=pip%20downloads)](https://pypi.org/project/classy-classification/)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/ambv/black)


  ``` pip install classy-classification```



  I got a lot of requests for SetFit support, but I decided to create a [separate package](https://github.com/davidberenstein1957/spacy-setfit) for this. Feel free to check it out. ❤️



  ```python
  import spacy



  data = {
      "furniture": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa."],
      "kitchen": ["There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens."]
  }

  nlp = spacy.load("en_core_web_trf")
  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data,
          "model": "spacy"
      }
  )

  print(nlp("I am looking for kitchen appliances.")._.cats)




  ```

  ```python
  import spacy

  data = {
      "furniture": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa."],
      "kitchen": ["There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens."]
  }

  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data,
          "model": "spacy",
          "include_sent": True
      }
  )

  print(nlp("I am looking for kitchen appliances. And I love doing so.").sents[0]._.cats)




  ```



  ```python

  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data,
          "verbose": True,
          "config": {"seed": 42}
      }
  )
  ```



  Sometimes multiple labels are necessary to fully describe the contents of a text. In that case, we want to make use of the **multi-label** implementation, here the sum of label scores is not limited to 1. Just pass the same training data to multiple keys.

  ```python
  import spacy

  data = {
      "furniture": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa.",
                 "We have a new dinner table.",
                 "There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens.",
                  "We have a new dinner table."],
      "kitchen": ["There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens.",
                  "We have a new dinner table.",
                  "There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens.",
                  "We have a new dinner table."]
  }

  nlp = spacy.load("en_core_web_md")
  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data,
          "model": "spacy",
          "multi_label": True,
      }
  )

  print(nlp("I am looking for furniture and kitchen equipment.")._.cats)




  ```



  Sometimes it is worth to be able to do outlier detection or binary classification. This can either be approached using
  a binary training dataset, however, I have also implemented support for a `OneClassSVM` for [outlier detection using a single label](https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html). Not that this method does not return probabilities, but that the data is formatted like label-score value pair to ensure uniformity.

  Approach 1:

  ```python
  import spacy

  data_binary = {
      "inlier": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa."],
      "outlier": ["Text about kitchen equipment",
                  "This text is about politics",
                  "Comments about AI and stuff."]
  }

  nlp = spacy.load("en_core_web_md")
  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data_binary,
      }
  )

  print(nlp("This text is a random text")._.cats)




  ```

  Approach 2:

  ```python
  import spacy

  data_singular = {
      "furniture": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa.",
                 "We have a new dinner table."]
  }
  nlp = spacy.load("en_core_web_md")
  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data_singular,
      }
  )

  print(nlp("This text is a random text")._.cats)




  ```



  ```python
  import spacy

  data = {
      "furniture": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa."],
      "kitchen": ["There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens."]
  }

  nlp = spacy.blank("en")
  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data,
          "model": "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
          "device": "gpu"
      }
  )

  print(nlp("I am looking for kitchen appliances.")._.cats)




  ```



  ```python
  import spacy

  data = ["furniture", "kitchen"]

  nlp = spacy.blank("en")
  nlp.add_pipe(
      "classy_classification",
      config={
          "data": data,
          "model": "typeform/distilbert-base-uncased-mnli",
          "cat_type": "zero",
          "device": "gpu"
      }
  )

  print(nlp("I am looking for kitchen appliances.")._.cats)




  ```





  [Huggingface](https://huggingface.co/) does offer some nice models for few/zero-shot classification, but these are not tailored to multi-lingual approaches. Rasa NLU has [a nice approach](https://rasa.com/blog/rasa-nlu-in-depth-part-1-intent-classification/) for this, but its too embedded in their codebase for easy usage outside of Rasa/chatbots. Additionally, it made sense to integrate [sentence-transformers](https://github.com/UKPLab/sentence-transformers) and [Hugginface zero-shot](https://huggingface.co/models?pipeline_tag=zero-shot-classification), instead of default [word embeddings](https://arxiv.org/abs/1301.3781). Finally, I decided to integrate with Spacy, since training a custom [Spacy TextCategorizer](https://spacy.io/api/textcategorizer) seems like a lot of hassle if you want something quick and dirty.

  - [Scikit-learn](https://github.com/scikit-learn/scikit-learn)
  - [Rasa NLU](https://github.com/RasaHQ/rasa)
  - [Sentence Transformers](https://github.com/UKPLab/sentence-transformers)
  - [Spacy](https://github.com/explosion/spaCy)



  [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/98kf2552674)



  ```python

  from classy_classification import ClassyClassifier

  data = {
      "furniture": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa."],
      "kitchen": ["There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens."]
  }

  classifier = ClassyClassifier(data=data)
  classifier("I am looking for kitchen appliances.")
  classifier.pipe(["I am looking for kitchen appliances."])


  classifier.set_training_data(data=data)
  classifier("I am looking for kitchen appliances.")


  classifier.set_embedding_model(model="paraphrase-MiniLM-L3-v2")
  classifier("I am looking for kitchen appliances.")


  classifier.set_classification_model(
      config={
          "C": [1, 2, 5, 10, 20, 100],
          "kernel": ["linear"],
          "max_cross_validation_folds": 5
      }
  )
  classifier("I am looking for kitchen appliances.")
  ```



  ```python
  data = {
      "furniture": ["This text is about chairs.",
                 "Couches, benches and televisions.",
                 "I really need to get a new sofa."],
      "kitchen": ["There also exist things like fridges.",
                  "I hope to be getting a new stove today.",
                  "Do you also have some ovens."]
  }
  classifier = classyClassifier(data=data)

  with open("./classifier.pkl", "wb") as f:
      pickle.dump(classifier, f)

  f = open("./classifier.pkl", "rb")
  classifier = pickle.load(f)
  classifier("I am looking for kitchen appliances.")
  ```


pkgId: ab982d40dadc2b92aad6ba7b1f622ca06b7eaf9714f9f39fdeb0aa3b88b0d869
name: python-classy-config
arch: src
version: 0.6.0
epoch: 0
release: 1
summary: ClassyConfig is a Python3 package aiming to remove the need for a config.py or settings.py file.
url: https://github.com/GDWR/classy-config
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classy-config-0.6.0-1.src.rpm
checksum_type: sha256
description:
  **ClassyConfig** is avliable via Pypi, so it can be installed using **pip**
  ```shell
  $ pip install classy_config
  ```

  [View on the docs](https://gdwr.github.io/classy-config/source/getting-started/index.html)
  ```python
  from classy_config import ConfigValue, register_config
  from pydantic import BaseModel

  register_config(filepath="config.toml")

  def print_current_version(version: str = ConfigValue("package", str)) -> None:
      print(version)

  class Author(BaseModel):
      username: str
      email: str
      lucky_number: int

  def print_author(author: Author = ConfigValue("author", Author)) -> None:
      print(author)

  def print_value(value: int = ConfigValue("nested.value", int)) -> None:
      print(value)
  ```


pkgId: f8f9140969d391fa0bd9c39c9caff473f118cb22d2e64ffc21c25a94337845e7
name: python-classy-fastapi
arch: src
version: 0.6.1
epoch: 0
release: 1
summary: Class based routing for FastAPI
url: https://gitlab.com/companionlabs-opensource/classy-fastapi
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-classy-fastapi-0.6.1-1.src.rpm
checksum_type: sha256
description:
  This project contains classes and decorators to use FastAPI with "class based routing". In particular this allows you to
  construct an **instance** of a class and have methods of that instance be route handlers. For example:

  ```py
  from dao import Dao

  from classy_fastapi import Routable, get, delete

  def parse_arg() -> argparse.Namespace:
     """parse command line arguments."""
     ...


  class UserRoutes(Routable):
     """Inherits from Routable."""

     
     
     def __init__(self, dao: Dao) -> None:
        """Constructor. The Dao is injected here."""
        super().__init__()
        self.__dao = Dao

     @get('/user/{name}')
     def get_user_by_name(self, name: str) -> User:
        
        return self.__dao.get_user_by_name(name)

     @delete('/user/{name}')
     def delete_user(self, name: str) -> None:
        self.__dao.delete(name)


  def main():
      args = parse_args()
      
      dao = Dao(args.url, args.user, args.password)
      
      user_routes = UserRoutes(dao)

      app = FastAPI()
      
      app.include_router(user_routes.router)
  ```

  Note that there are no global variables and dependency injection is accomplished by simply passing arguments to the
  constructor.



  FastAPI generally has one define routes like:

  ```py
  app = FastAPI()

  @app.get('/echo/{x}')
  def echo(x: int) -> int:
     return x
  ```

  Note that `app` is a global. Furthermore, [FastAPI's suggested way of doing dependency
  injection](https://fastapi.tiangolo.com/tutorial/dependencies/classes-as-dependencies/) is handy for things like pulling
  values out of header in the HTTP request. However, they don't work well for more standard dependency injection scenarios
  where we'd like to do something like inject a DAO or database connection. For that, FastAPI suggests [their
  parameterized dependencies](https://fastapi.tiangolo.com/advanced/advanced-dependencies/) which might look something
  like:

  ```py
  app = FastAPI()

  class ValueToInject:
     def __init__(self, y: int) -> None:
        self.y = y

     def __call__(self) -> int:
        return self.y

  to_add = ValueToInject(2)

  @app.get('/add/{x}')
  def add(x: int, y: Depends(to_add)) -> int:
     return x + y
  ```

  This works but there's a few issues:

  * The `Dependency` must be a callable which requires an unfortunate amount of boilerplate.
  * If we want to use the same dependency on several routes, as we would with something like a database connection, we
    have to repeat the `Dependency(to_add)` bit on each endpoint. Note that FastAPI lets you group endpoints your we can
    [include the dependency on all of them]( https://fastapi.tiangolo.com/tutorial/bigger-applications) but then there's
    no way to access the dependency from the router code so this really only works for things like authentication where
    the dependency can do some route handling (e.g. return a 402 if an auth header is missing).
  * `to_add` is a global variable which is limiting.

  Let's consider an expanded, more realistic example where we have a group of routes that operate on users to add them,
  delete them, change the password, etc. Those routes will need to access a database so we have a DAO that helps set that
  up. We're going to take the database URL, password, etc. via command line arguments and then set up our routes.
  Furthermore, we'll split up our application into a few separate files. Doing this without class routing looks like the
  following:

  ```py


  import .user
  from .deps import dao

  def parse_arg() -> argparse.Namespace:
     """parse command line arguments."""
     ...

  def main():
      args = parse_args()
      global dao
      dao = Dao(args.url, args.user, args.password)

      app = FastAPI()
      app.include_router(user.router)




  from dao import Dao



  dao: Optional[Dao] = None



  from .deps import dao
  from dao import Dao
  from fastapi.routing import APIRouter

  @router.get('/user/{name}')
  def get_user_by_name(name: str, dao: Dao = Depends(dao)) -> User:
     return dao.get_user_by_name(name)

  @router.delete('/user/{name}')
  def delete_user(name: str, dao: Dao = Depends(dao)) -> None:
     dao.delete(name)


  ```

  That works but it's a bit verbose. Additionally, as noted above, it has some limitations. For example, suppose we've
  updated our API in a breaking way so we've added a `/v2` set of routes. However, the `users.py` routes haven't changed
  at all except that we've changed how we store users (e.g. a new password hashing algorithm) so `/v2` user routes need to
  use a different DAO. Ideally you'd call `app.include_router` twice with different prefixes but that won't work because
  the dependency on the DAO is to _a specific DAO instance_ in `user.py`. You can add [dependency
  overrides](https://fastapi.tiangolo.com/advanced/testing-dependencies/) but it feels awkward.

  By contrast the class based routing in this package does not have any global variables at all and injection can be
  performed by simply passing values to a constructor or via any other dependency injection framework.



  [FastAPI-utils](https://fastapi-utils.davidmontague.xyz/user-guide/class-based-views/) has a class based views
  implementation but the routes are on the class itself rather than on **instances** of the class.

  There's demand for this feature so a number of alternatives have been proposed [in an open
  bug](https://github.com/tiangolo/fastapi/issues/270) and [on
  StackOverflow](https://stackoverflow.com/q/63853813/1431244) but all seem to require global injection or hacks like
  defining all the routes inside the constructor.



  Unfortunately this does not work with `async` routes with Python versions less than 3.8 [due to bugs in
  `inspect.iscoroutinefunction`](https://stackoverflow.com/a/52422903/1431244). Specifically with older versions of Python
  `iscoroutinefunction` incorrectly returns false so `async` routes aren't `await`'d. We therefore only support Python
  versions >= 3.8


pkgId: f5a4d8827eb411e7a31518d0effd64c6fa16503e5296dff40c425073b43bfafe
name: python-clastic
arch: src
version: 24.0.0
epoch: 0
release: 1
url: https://github.com/mahmoud/clastic
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clastic-24.0.0-1.src.rpm
checksum_type: sha256
summary:
  A functional Python web framework that streamlines explicit development practices while eliminating global state.

description:
  Clastic is a functional Python web framework that streamlines
  explicit development practices while eliminating global state.


pkgId: bf7072ea865300f4669c10e45d3b1b15c13ef124c5217527baf7e0d03160ee28
name: python-claude-api
arch: src
version: 1.0.17
epoch: 0
release: 1
summary: An unofficial API for Claude AI, allowing users to access and interact with Claude AII
url: https://github.com/KoushikNavuluri/Claude-API/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claude-api-1.0.17-1.src.rpm
checksum_type: sha256
description:
  This project provides an unofficial API for Claude AI, allowing users to access and interact with Claude AI .

  <img src="https://github.com/KoushikNavuluri/Claude-API/assets/103725723/385fa539-e725-4c20-86ff-0864e6ffab82" width="400">







    * [Use Cases](#use-cases)
    * [Prerequisites](#prerequisites)
    * [Installation](#installation)
    * [Usage](#usage)
    * [List All Conversations](#list-all-conversations)
    * [Send Message](#send-message)
    * [Send Message with attachment](#send-message-with-attachment)
    * [Delete Conversation](#delete-conversation)
    * [Chat Conversation History](#chat-conversation-history)
    * [Create New Chat](#create-new-chat)
    * [Reset All Conversations](#reset-all-conversations)
    * [Rename Chat](#rename-chat)
    * [Disclaimer](#disclaimer)




      1. Python Console ChatBot ( Check in usecases folder for sample console chatbot )

      2. Discord Chatbot

      3. Many more can be done....




  To use this API, you need to have the following:

  Python installed on your system
  requests library installed
  ```bash
    pip install requests

  ```



  To use the Claude AI Unofficial API, you can either clone the GitHub repository or directly download the Python file.

  Terminal :

      pip install claude-api

  or

  Clone the repository:

      git clone https://github.com/KoushikNavuluri/Claude-API.git




  Import the claude_api module in your Python script:

      from claude_api import Client

  * Next, you need to create an instance of the Client class by providing your Claude AI cookie:

  * You can get cookie from the browser's developer tools network tab ( see for any claude.ai requests check out cookie ,copy whole value ) or storage tab ( You can find cookie of claude.ai ,there will be four values )

  * (Checkout below image for the format of cookie ,It is Better to Use from network tab to grab cookie easily )

     ![Screenshot (8)](https://github.com/KoushikNavuluri/Claude-API/assets/103725723/355971e3-f46c-47fc-a3cf-008bb55bb4c6)


        cookie = os.environ.get('cookie')
        claude_api = Client(cookie)



  To list all the conversation Id's you had with Claude , you can use the list_all_conversations method:

      conversations = claude_api.list_all_conversations()
      for conversation in conversations:
          conversation_id = conversation['uuid']
          print(conversation_id)



  To send a message to Claude, you can use the send_message method. You need to provide the prompt and the conversation ID:



      prompt = "Hello, Claude!"
      conversation_id = "<conversation_id>" or claude_api.create_new_chat()['uuid']
      response = claude_api.send_message(prompt, conversation_id)
      print(response)



  You can send any type of attachment to claude to get responses using attachment argument in send_message().
  Note: Claude currently supports only some file types.

  { You can also add timeout if you need ,using timeout parameter[default set to 500] }

      prompt = "Hey,Summarize me this document.!"
      conversation_id = "<conversation_id>" or claude_api.create_new_chat()['uuid']
      response = claude_api.send_message(prompt, conversation_id,attachment="path/to/file.pdf",timeout=600)
      print(response)




  To delete a conversation, you can use the delete_conversation method:


      conversation_id = "<conversation_id>"
      deleted = claude_api.delete_conversation(conversation_id)
      if deleted:
          print("Conversation deleted successfully")
      else:
          print("Failed to delete conversation")



  To get the chat conversation history, you can use the chat_conversation_history method:

      conversation_id = "<conversation_id>"
      history = claude_api.chat_conversation_history(conversation_id)
      print(history)



  To create a new chat conversation (id), you can use the create_new_chat method:


      new_chat = claude_api.create_new_chat()
      conversation_id = new_chat['uuid']
      print(conversation_id)



  To reset all conversations, you can use the reset_all method:


      reset = claude_api.reset_all()
      if reset:
          print("All conversations reset successfully")
      else:
          print("Failed to reset conversations")



  To rename a chat conversation, you can use the rename_chat method:

      conversation_id = "<conversation_id>"
      title = "New Chat Title"
      renamed = claude_api.rename_chat(title, conversation_id)
      if renamed:
          print("Chat conversation renamed successfully")
      else:
          print("Failed to rename chat conversation")



  This project provides an unofficial API for Claude AI and is not affiliated with or endorsed by Claude AI or Anthropic. Use it at your own risk.

  Please refer to the official Claude AI documentation[https://claude.ai/docs] for more information on how to use Claude AI.


pkgId: a33cb306eea6d575c2c7933adbd6a9d9142a48e6c482fe46be15cb800ec45da0
name: python-claude-here
arch: src
version: 0.2.3
epoch: 0
release: 1
summary: debug Python with claude.ai
url: https://github.com/evhub/claude-here
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claude-here-0.2.3-1.src.rpm
checksum_type: sha256
description:
  _debug Python with [claude.ai](https://claude.ai/new)_



  Just
  ```bash
  pip install claude-here
  ```
  then
  ```python
  import claude_here
  ```
  and any uncaught exceptions will automatically launch a new conversation in [claude.ai](https://claude.ai/new) pre-filled with information for Claude to help you debug the error.

  To debug something that isn't causing an exception, just add
  ```python
  breakpoint()
  ```
  where you want to debug and it will automatically launch Claude with info about the current locals to help you debug.



  Some extra features to note:
  * If a `breakpoint` is hit multiple times, or an uncaught exception is raised after hitting a `breakpoint`, the information sent to Claude will be cumulative.
  * If `claude_here` detects that [`webbrowser`](https://docs.python.org/3/library/webbrowser.html) will use a text-based browser by default, it will instead print an [OSC-8-compliant](https://github.com/Alhadis/OSC8-Adoption/) hyperlink to the terminal for you to open using a graphical browser. This is especially useful if you are debugging a remote machine.



  `breakpoint` additionally supports some optional arguments:
  - `msg` can be set to a string that will be included in the information sent to Claude.
  - `just_gather_info=True` will gather information to send to Claude later (on an uncaught exception or `breakpoint` without `just_gather_info=True`) without actually launching Claude or the `base_debugger`.
  - `base_debugger` determines the debugger to call in addition to launching Claude. Defaults to the previous `breakpoint` handler, which by default is [`pdb.set_trace`](https://docs.python.org/3/library/pdb.html).



  `claude_here` supports some additional configuration via environment variables:
  - `CLAUDE_HERE_PROJECT_ID` can be set to a [Claude Projects](https://claude.ai/projects) UUID (`https://claude.ai/project/<this-part-here-is-the-uuid>`) to launch your debugging conversations in.
  - `CLAUDE_HERE_VERBOSITY` can be set to a positive integer that will determine how much information to send to Claude; the larger the value the more info is sent to Claude. Defaults to `10`.


pkgId: abb223e68fc288f4d73d815ff86d4f97923f2cc1f8e8084fb837282a4525f29f
name: python-claude-pyrojects
arch: src
version: 0.1.2
epoch: 0
release: 1
summary: A tool for uploading and managing projects in Claude.ai
url: https://github.com/hcevikdotpy/claude-pyrojects
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claude-pyrojects-0.1.2-1.src.rpm
checksum_type: sha256
description:
  _sorry, I suck at naming_

  Claude-Pyrojects is a Python package that allows you to easily upload your entire project directory to a Claude project. By doing this, Claude can access your project files and utilize them effectively. This is particularly useful for leveraging Claude's capabilities in understanding and interacting with your codebase.

  Special thanks to the creators of [ClaudeAPI](https://github.com/KoushikNavuluri/Claude-API), specifically [n0kovo](https://github.com/n0kovo)'s branch



  - **Initialize Project**: Set up your project directory for integration with Claude by creating a `.ignore` file to specify folders and files that should be excluded from the upload.
  - **Create Claude Project**: Automatically create a new project in Claude and upload the entire directory structure and files.
  - **Update Project**: Reinitialize your Claude project by clearing existing files and re-uploading the current state of your project directory.
  - **Flexible Ignoring**: Customize which folders, file types, and specific file names to exclude using the `claude_pyrojects.ignore` file.



  - A Claude account (Claude Pro is recommended for the best experience).
  - Python 3.6 or higher.
  - An active Claude session key, which can be obtained from your Claude account.



  To install Claude-Pyrojects, use pip:

  ```bash
  pip install claude-pyrojects
  ```





  The first step is to initialize the project. This will create the necessary configuration files, including the ignore file (claude_pyrojects.ignore) and save your session key.

  Refer to [this](https://github.com/KoushikNavuluri/Claude-API?tab=readme-ov-file#usage) on how to get your session key.

  ```bash
  python -m claude-pyrojects.cli init -K "your_session_key"
  ```



  Once your project is initialized, you can create a new project in Claude. This will upload your entire project directory, excluding any files and folders specified in the ignore file.

  ```bash
  python -m claude-pyrojects.cli create -N "Your Project Name"
  ```



  As your project evolves, you might need to re-upload it to Claude to reflect the latest changes. The update command reinitializes the project by clearing all existing files and re-uploading the current state of your directory.

  ```bash
  python -m claude-pyrojects.cli update
  ```



  The claude_pyrojects.ignore file allows you to specify folders, file extensions, and specific filename substrings to exclude from the upload process.

  Example `claude_pyrojects.ignore`:
  ```plaintext
  ignore_folders=[".venv", ".idea", ".vscode"]
  ignore_file_extensions=["pdf", "jpg", "png", "pyc"]
  ignore_name_includes=["claude_pyrojects"]
  ```

  - ignore_folders: List of folders to be ignored.
  - ignore_file_extensions: List of file extensions to be ignored.
  - ignore_name_includes: List of substrings that, if found in a filename, will cause the file to be ignored.



  In order to change the session key, simply look for the `claude_pyrojects.key` file and replace it's contents with your new key


  - GitHub Integration: A GitHub app that automatically updates the Claude project whenever changes are pushed to the repository.



  This project provides an unofficial API for Claude AI and is not affiliated with or endorsed by Claude AI or Anthropic. Use it at your own risk.

  Please refer to the official [Claude AI documentation](https://claude.ai/docs) for more information on how to use Claude AI.


pkgId: 0fed8c379b09c45d2110eb023fe12f6d0337c0bbdf8cd43972c44c07d75068cf
name: python-claudecli
arch: src
version: 0.1.0rc3
epoch: 0
release: 1
summary: Natural language interface for command line using Claude AI
url: https://github.com/ndamulelonemakh/claudecli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claudecli-0.1.0rc3-1.src.rpm
checksum_type: sha256
description:
  Natural language interface for command line using Claude AI



  ```bash
  pip install claudecli
  ```



  ```bash

  claude "find all python files modified today"


  claude --no-confirm "list directory contents"


  claude --shell zsh "find large files"


  claude --debug "compress logs"
  ```



  - Natural language command generation using Claude AI
  - Automatic shell detection (bash/zsh/fish)
  - Smart safety checks



  The CLI looks for the following environment variables:

  - `ANTHROPIC_API_KEY`: Your Anthropic API key (**Required**)
  - `CLAUDE_CLI_DEBUG`: Enable debug mode
  - `CLAUDE_CLI_SHELL`: Override shell detection



  ```bash
  .
  ├── LICENSE
  ├── README.md
  ├── claude_cli
  │   ├── __init__.py
  │   ├── cli.py
  │   ├── core.py
  │   └── logger.py
  └── pyproject.toml
  ```



  Pull requests are definitely welcome!



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


pkgId: 23797931aa02fa56b4d286f312fc5144078c14d8fc57f961546f82d17168cb49
name: python-claudesync
arch: src
version: 0.6.2
epoch: 0
release: 1
summary: A tool to synchronize local files with Claude.ai projects
url: https://github.com/jahwag/claudesync
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claudesync-0.6.2-1.src.rpm
checksum_type: sha256
description:
  [Contributors](https://github.com/jahwag/claudesync/graphs/contributors) • [License](https://github.com/jahwag/claudesync/blob/master/LICENSE) • [Report Bug](https://github.com/jahwag/claudesync/issues) • [Request Feature](https://github.com/jahwag/claudesync/issues/new?labels=enhancement&template=feature_request.md)• [Sponsor](https://github.com/sponsors/jahwag)

rpm_license:
  MIT License  Copyright (c) 2024 Jahziah Wagner  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: 03422435d8e6d96b54a433d4572894e9941f9bd9863304409fb3698cb3776f16
name: python-claudette
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: Claudette is Claude's friend
url: https://github.com/AnswerDotAI/claudette
rpm_license: Apache Software License 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claudette-0.1.0-1.src.rpm
checksum_type: sha256
description:
  <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

  > **NB**: If you are reading this in GitHub’s readme, we recommend you
  > instead read the much more nicely formatted [documentation
  > format](https://claudette.answer.ai/) of this tutorial.

  *Claudette* is a wrapper for Anthropic’s [Python
  SDK](https://github.com/anthropics/anthropic-sdk-python).

  The SDK works well, but it is quite low level – it leaves the developer
  to do a lot of stuff manually. That’s a lot of extra work and
  boilerplate! Claudette automates pretty much everything that can be
  automated, whilst providing full control. Amongst the features provided:

  - A [`Chat`](https://claudette.answer.ai/core.html#chat) class that
    creates stateful dialogs
  - Support for *prefill*, which tells Claude what to use as the first few
    words of its response
  - Convenient image support
  - Simple and convenient support for Claude’s new Tool Use API.

  You’ll need to set the `ANTHROPIC_API_KEY` environment variable to the
  key provided to you by Anthropic in order to use this library.

  Note that this library is the first ever “literate nbdev” project. That
  means that the actual source code for the library is a rendered Jupyter
  Notebook which includes callout notes and tips, HTML tables and images,
  detailed explanations, and teaches *how* and *why* the code is written
  the way it is. Even if you’ve never used the Anthropic Python SDK or
  Claude API before, you should be able to read the source code. Click
  [Claudette’s Source](https://claudette.answer.ai/core.html) to read it,
  or clone the git repo and execute the notebook yourself to see every
  step of the creation process in action. The tutorial below includes
  links to API details which will take you to relevant parts of the
  source. The reason this project is a new kind of literal program is
  because we take seriously Knuth’s call to action, that we have a “*moral
  commitment*” to never write an “*illiterate program*” – and so we have a
  commitment to making literate programming and easy and pleasant
  experience. (For more on this, see [this
  talk](https://www.youtube.com/watch?v=rX1yGxJijsI) from Hamel Husain.)

  > “*Let us change our traditional attitude to the construction of
  > programs: Instead of imagining that our main task is to instruct a
  > **computer** what to do, let us concentrate rather on explaining to
  > **human beings** what we want a computer to do.*” Donald E. Knuth,
  > [Literate
  > Programming](https://www.cs.tufts.edu/~nr/cs257/archive/literate-programming/01-knuth-lp.pdf)
  > (1984)



  ``` sh
  pip install claudette
  ```



  Anthropic’s Python SDK will automatically be installed with Claudette,
  if you don’t already have it.

  ``` python
  import os

  ```

  To print every HTTP request and response in full, uncomment the above
  line.

  ``` python
  from claudette import *
  ```

  Claudette only exports the symbols that are needed to use the library,
  so you can use `import *` to import them. Alternatively, just use:

  ``` python
  import claudette
  ```

  …and then add the prefix `claudette.` to any usages of the module.

  Claudette provides `models`, which is a list of models currently
  available from the SDK.

  ``` python
  models
  ```

      ('claude-3-opus-20240229',
       'claude-3-5-sonnet-20240620',
       'claude-3-haiku-20240307')

  For these examples, we’ll use Sonnet 3.5, since it’s awesome!

  ``` python
  model = models[1]
  ```



  The main interface to Claudette is the
  [`Chat`](https://claudette.answer.ai/core.html#chat) class, which
  provides a stateful interface to Claude:

  ``` python
  chat = Chat(model, sp="""You are a helpful and concise assistant.""")
  chat("I'm Jeremy")
  ```

  Hello Jeremy, it’s nice to meet you. How can I assist you today?

  <details>

  - id: `msg_014J96J6f9Bxrmyr7uA5Z4E3`
  - content:
    `[{'text': "Hello Jeremy, it's nice to meet you. How can I assist you today?", 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 19, 'output_tokens': 20, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  ``` python
  r = chat("What's my name?")
  r
  ```

  Your name is Jeremy, as you just told me.

  <details>

  - id: `msg_01RpP5rBhFK34UkZwAiMnL85`
  - content:
    `[{'text': 'Your name is Jeremy, as you just told me.', 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 47, 'output_tokens': 14, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  As you see above, displaying the results of a call in a notebook shows
  just the message contents, with the other details hidden behind a
  collapsible section. Alternatively you can `print` the details:

  ``` python
  print(r)
  ```

      Message(id='msg_01RpP5rBhFK34UkZwAiMnL85', content=[TextBlock(text='Your name is Jeremy, as you just told me.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 47; Out: 14; Total: 61)

  Claude supports adding an extra `assistant` message at the end, which
  contains the *prefill* – i.e. the text we want Claude to assume the
  response starts with. Let’s try it out:

  ``` python
  chat("Concisely, what is the meaning of life?",
       prefill='According to Douglas Adams,')
  ```

  According to Douglas Adams, “42.” More seriously, it’s often considered
  to be finding personal fulfillment, happiness, and purpose.

  <details>

  - id: `msg_01Qgsa4a7cdPJkCrm989emJ5`
  - content:
    `[{'text': 'According to Douglas Adams,  "42." More seriously, it\'s often considered to be finding personal fulfillment, happiness, and purpose.', 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 81, 'output_tokens': 27, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  You can add `stream=True` to stream the results as soon as they arrive
  (although you will only see the gradual generation if you execute the
  notebook yourself, of course!)

  ``` python
  for o in chat("Concisely, what book was that in?", prefill='It was in', stream=True):
      print(o, end='')
  ```

      It was in "The Hitchhiker's Guide to the Galaxy" by Douglas Adams.



  If you use `mk_msg(msg, cache=True)`, then the message is cached using
  Claude’s [prompt
  caching](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching)
  feature. For instance, here we use caching when asking about Claudette’s
  readme file:

  ``` python
  chat = Chat(model, sp="""You are a helpful and concise assistant.""")
  ```

  ``` python
  nbtxt = Path('README.txt').read_text()
  msg = f'''<README>
  {nbtxt}
  </README>
  In brief, what is the purpose of this project based on the readme?'''
  r = chat(mk_msg(msg, cache=True))
  r
  ```

  Based on the readme, the main purpose of the Claudette project is to
  provide a high-level wrapper around Anthropic’s Python SDK for
  interacting with Claude AI models. Key features and goals include:

  1.  Automating and simplifying interactions with Claude, reducing
      boilerplate code.

  2.  Providing a stateful dialog interface through the
      [`Chat`](https://claudette.answer.ai/core.html#chat) class.

  3.  Supporting features like prefill (specifying the start of Claude’s
      response) and image handling.

  4.  Offering convenient support for Claude’s Tool Use API.

  5.  Serving as an example of “literate programming”, with the source
      code designed to be readable and educational, including explanations
      of how and why the code is written.

  6.  Supporting multiple model providers, including direct Anthropic API
      access as well as Claude models available through Amazon Bedrock and
      Google Vertex AI.

  The project aims to make working with Claude models more convenient and
  accessible for developers while also serving as an educational resource
  on how to effectively use and interact with these AI models.

  <details>

  - id: `msg_01HkjoKjfY5zrmBrkjHvtDpG`
  - content:
    `[{'text': 'Based on the readme, the main purpose of the Claudette project is to provide a high-level wrapper around Anthropic\'s Python SDK for interacting with Claude AI models. Key features and goals include:\n\n1. Automating and simplifying interactions with Claude, reducing boilerplate code.\n\n2. Providing a stateful dialog interface through the [`Chat`](https://claudette.answer.ai/core.html#chat) class.\n\n3. Supporting features like prefill (specifying the start of Claude\'s response) and image handling.\n\n4. Offering convenient support for Claude\'s Tool Use API.\n\n5. Serving as an example of "literate programming", with the source code designed to be readable and educational, including explanations of how and why the code is written.\n\n6. Supporting multiple model providers, including direct Anthropic API access as well as Claude models available through Amazon Bedrock and Google Vertex AI.\n\nThe project aims to make working with Claude models more convenient and accessible for developers while also serving as an educational resource on how to effectively use and interact with these AI models.', 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 4, 'output_tokens': 220, 'cache_creation_input_tokens': 7171, 'cache_read_input_tokens': 0}`

  </details>

  The response records the a cache has been created using these input
  tokens:

  ``` python
  print(r.usage)
  ```

      Usage(input_tokens=4, output_tokens=220, cache_creation_input_tokens=7171, cache_read_input_tokens=0)

  We can now ask a followup question in this chat:

  ``` python
  r = chat('How does it make tool use more ergonomic?')
  r
  ```

  Claudette makes tool use more ergonomic in several ways:

  1.  Simplified function definition: It uses docments to make defining
      Python functions for tools as simple as possible. Each parameter and
      the return value should have a type and a description.

  2.  Automatic handling: The
      [`Chat`](https://claudette.answer.ai/core.html#chat) class can be
      initialized with a list of tools, and Claudette handles the
      back-and-forth between Claude and the tools automatically.

  3.  Single-step execution: The
      [`Chat.toolloop`](https://claudette.answer.ai/toolloop.html#chat.toolloop)
      method allows for executing a series of tool calls in a single step,
      even if multiple tools are needed to solve a problem.

  4.  Forced tool use: You can set `tool_choice` to force Claude to always
      answer using a specific tool.

  5.  Tracing: The `toolloop` method supports a `trace_func` parameter,
      allowing you to see each response from Claude during the process.

  6.  Automatic parameter passing: When Claude decides to use a tool,
      Claudette automatically calls the tool with the provided parameters.

  7.  System prompt integration: It allows setting a system prompt to
      guide Claude’s behavior when using tools, such as instructing it not
      to mention the tools it’s using.

  These features significantly reduce the amount of code and manual
  handling required to use Claude’s tool use capabilities, making the
  process more streamlined and developer-friendly.

  <details>

  - id: `msg_01EfFbEBeYETAvfjGncn8Vcb`
  - content:
    `[{'text': "Claudette makes tool use more ergonomic in several ways:\n\n1. Simplified function definition: It uses docments to make defining Python functions for tools as simple as possible. Each parameter and the return value should have a type and a description.\n\n2. Automatic handling: The [`Chat`](https://claudette.answer.ai/core.html#chat) class can be initialized with a list of tools, and Claudette handles the back-and-forth between Claude and the tools automatically.\n\n3. Single-step execution: The [`Chat.toolloop`](https://claudette.answer.ai/toolloop.html#chat.toolloop) method allows for executing a series of tool calls in a single step, even if multiple tools are needed to solve a problem.\n\n4. Forced tool use: You can set`tool_choice`to force Claude to always answer using a specific tool.\n\n5. Tracing: The`toolloop`method supports a`trace_func`parameter, allowing you to see each response from Claude during the process.\n\n6. Automatic parameter passing: When Claude decides to use a tool, Claudette automatically calls the tool with the provided parameters.\n\n7. System prompt integration: It allows setting a system prompt to guide Claude's behavior when using tools, such as instructing it not to mention the tools it's using.\n\nThese features significantly reduce the amount of code and manual handling required to use Claude's tool use capabilities, making the process more streamlined and developer-friendly.", 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 240, 'output_tokens': 289, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 7171}`

  </details>

  We can see that this only used ~200 regular input tokens – the 7000+
  context tokens have been read from cache.

  ``` python
  print(r.usage)
  ```

      Usage(input_tokens=240, output_tokens=289, cache_creation_input_tokens=0, cache_read_input_tokens=7171)



  [Tool use](https://docs.anthropic.com/claude/docs/tool-use) lets Claude
  use external tools.

  We use [docments](https://fastcore.fast.ai/docments.html) to make
  defining Python functions as ergonomic as possible. Each parameter (and
  the return value) should have a type, and a docments comment with the
  description of what it is. As an example we’ll write a simple function
  that adds numbers together, and will tell us when it’s being called:

  ``` python
  def sums(
      a:int,  # First thing to sum
      b:int=1 # Second thing to sum
  ) -> int: # The sum of the inputs
      "Adds a + b."
      print(f"Finding the sum of {a} and {b}")
      return a + b
  ```

  Sometimes Claude will say something like “according to the `sums` tool
  the answer is” – generally we’d rather it just tells the user the
  answer, so we can use a system prompt to help with this:

  ``` python
  sp = "Never mention what tools you use."
  ```

  We’ll get Claude to add up some long numbers:

  ``` python
  a,b = 604542,6458932
  pr = f"What is {a}+{b}?"
  pr
  ```

      'What is 604542+6458932?'

  To use tools, pass a list of them to
  [`Chat`](https://claudette.answer.ai/core.html#chat), and to force it to
  always answer using a tool, set `tool_choice` to that function name:

  ``` python
  chat = Chat(model, sp=sp, tools=[sums], tool_choice='sums')
  ```

  Now when we call that with our prompt, Claude doesn’t return the answer,
  but instead returns a `tool_use` message, which means we have to call
  the named tool with the provided parameters:

  ``` python
  r = chat(pr)
  r
  ```

      Finding the sum of 604542 and 6458932

  ToolUseBlock(id=‘toolu_01C6G2iuLtBBftESiujKzXfx’, input={‘a’: 604542,
  ‘b’: 6458932}, name=‘sums’, type=‘tool_use’)

  <details>

  - id: `msg_01HPZwX3mQ7sMbjWUHEwgUsT`
  - content:
    `[{'id': 'toolu_01C6G2iuLtBBftESiujKzXfx', 'input': {'a': 604542, 'b': 6458932}, 'name': 'sums', 'type': 'tool_use'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `tool_use`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 414, 'output_tokens': 53, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  Claudette handles all that for us – we just call it again, and it all
  happens automatically:

  ``` python
  chat()
  ```

  The sum of 604542 and 6458932 is 7063474.

  <details>

  - id: `msg_01RNHxf1jXfS76h2UpF8RnZ2`
  - content:
    `[{'text': 'The sum of 604542 and 6458932 is 7063474.', 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 515, 'output_tokens': 23, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  You can see how many tokens have been used at any time by checking the
  `use` property. Note that (as of May 2024) tool use in Claude uses a
  *lot* of tokens, since it automatically adds a large system prompt.

  ``` python
  chat.use
  ```

      In: 929; Out: 76; Total: 1005

  We can do everything needed to use tools in a single step, by using
  [`Chat.toolloop`](https://claudette.answer.ai/toolloop.html#chat.toolloop).
  This can even call multiple tools as needed solve a problem. For
  example, let’s define a tool to handle multiplication:

  ``` python
  def mults(
      a:int,  # First thing to multiply
      b:int=1 # Second thing to multiply
  ) -> int: # The product of the inputs
      "Multiplies a * b."
      print(f"Finding the product of {a} and {b}")
      return a * b
  ```

  Now with a single call we can calculate `(a+b)*2` – by passing
  `show_trace` we can see each response from Claude in the process:

  ``` python
  chat = Chat(model, sp=sp, tools=[sums,mults])
  pr = f'Calculate ({a}+{b})*2'
  pr
  ```

      'Calculate (604542+6458932)*2'

  ``` python
  chat.toolloop(pr, trace_func=print)
  ```

      Finding the sum of 604542 and 6458932
      Message(id='msg_01DgZ9Fcs6h8HB7qEaFkg3Ah', content=[TextBlock(text='Certainly! To calculate (604542+6458932)*2, we\'ll need to use the available tools to perform the addition and multiplication operations. Let\'s break it down step by step:\n\n1. First, we\'ll add 604542 and 6458932 using the "sums" function.\n2. Then, we\'ll multiply the result by 2 using the "mults" function.\n\nLet\'s start with the addition:', type='text'), ToolUseBlock(id='toolu_01XTMLyKo9Q6TX4SpCVmmUsP', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 538; Out: 168; Total: 706)
      Finding the product of 7063474 and 2
      Message(id='msg_011P8jdxwLoKNf8nTDua7VM8', content=[TextBlock(text="Great! The sum of 604542 and 6458932 is 7063474.\n\nNow, let's multiply this result by 2:", type='text'), ToolUseBlock(id='toolu_01FETWkj4a9HyX25c8ETULYh', input={'a': 7063474, 'b': 2}, name='mults', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 721; Out: 106; Total: 827)
      Message(id='msg_01UXwy69vUWSy9bK24skQ3yE', content=[TextBlock(text='Now we have our final result. \n\nThe calculation (604542+6458932)*2 equals 14126948.\n\nTo break it down:\n1. 604542 + 6458932 = 7063474\n2. 7063474 * 2 = 14126948\n\nSo, the final answer to (604542+6458932)*2 is 14126948.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 841; Out: 95; Total: 936)

  Now we have our final result.

  The calculation (604542+6458932)\*2 equals 14126948.

  To break it down: 1. 604542 + 6458932 = 7063474 2. 7063474 \* 2 =
  14126948

  So, the final answer to (604542+6458932)\*2 is 14126948.

  <details>

  - id: `msg_01UXwy69vUWSy9bK24skQ3yE`
  - content:
    `[{'text': 'Now we have our final result. \n\nThe calculation (604542+6458932)*2 equals 14126948.\n\nTo break it down:\n1. 604542 + 6458932 = 7063474\n2. 7063474 * 2 = 14126948\n\nSo, the final answer to (604542+6458932)*2 is 14126948.', 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 841, 'output_tokens': 95, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>



  Claude can handle image data as well. As everyone knows, when testing
  image APIs you have to use a cute puppy.

  ``` python
  fn = Path('samples/puppy.jpg')
  display.Image(filename=fn, width=200)
  ```

  <img src="index_files/figure-commonmark/cell-26-output-1.jpeg"
  width="200" />

  We create a [`Chat`](https://claudette.answer.ai/core.html#chat) object
  as before:

  ``` python
  chat = Chat(model)
  ```

  Claudette expects images as a list of bytes, so we read in the file:

  ``` python
  img = fn.read_bytes()
  ```

  Prompts to Claudette can be lists, containing text, images, or both, eg:

  ``` python
  chat([img, "In brief, what color flowers are in this image?"])
  ```

  The flowers in this image are purple. They appear to be small,
  daisy-like flowers, possibly asters or some type of purple daisy,
  blooming in the background behind the adorable puppy in the foreground.

  <details>

  - id: `msg_01XtkdWMWHVppHqtiv7gdmtA`
  - content:
    `[{'text': 'The flowers in this image are purple. They appear to be small, daisy-like flowers, possibly asters or some type of purple daisy, blooming in the background behind the adorable puppy in the foreground.', 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 110, 'output_tokens': 50, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  The image is included as input tokens.

  ``` python
  chat.use
  ```

      In: 110; Out: 50; Total: 160

  Alternatively, Claudette supports creating a multi-stage chat with
  separate image and text prompts. For instance, you can pass just the
  image as the initial prompt (in which case Claude will make some general
  comments about what it sees), and then follow up with questions in
  additional prompts:

  ``` python
  chat = Chat(model)
  chat(img)
  ```

  This image shows an adorable puppy lying in the grass. The puppy appears
  to be a Cavalier King Charles Spaniel or a similar breed, with
  distinctive white and reddish-brown fur coloring. Its face is
  predominantly white with large, expressive eyes and a small black nose.

  The puppy is resting on a grassy surface, and behind it, you can see
  some purple flowers, likely asters or michaelmas daisies. These flowers
  provide a lovely contrast to the puppy’s fur colors. In the background,
  there seems to be a wooden structure, possibly a fence or the side of a
  building, giving the scene a rustic, outdoor feel.

  The composition of the image is quite charming, with the puppy as the
  main focus in the foreground and the flowers adding a soft, colorful
  backdrop. The lighting appears natural, highlighting the puppy’s soft
  fur and the delicate petals of the flowers. Overall, it’s a heartwarming
  scene that captures the innocence and cuteness of a young dog in a
  picturesque outdoor setting.

  <details>

  - id: `msg_01Simo36wFes3M21SXZFGBT2`
  - content:
    `[{'text': "This image shows an adorable puppy lying in the grass. The puppy appears to be a Cavalier King Charles Spaniel or a similar breed, with distinctive white and reddish-brown fur coloring. Its face is predominantly white with large, expressive eyes and a small black nose.\n\nThe puppy is resting on a grassy surface, and behind it, you can see some purple flowers, likely asters or michaelmas daisies. These flowers provide a lovely contrast to the puppy's fur colors. In the background, there seems to be a wooden structure, possibly a fence or the side of a building, giving the scene a rustic, outdoor feel.\n\nThe composition of the image is quite charming, with the puppy as the main focus in the foreground and the flowers adding a soft, colorful backdrop. The lighting appears natural, highlighting the puppy's soft fur and the delicate petals of the flowers. Overall, it's a heartwarming scene that captures the innocence and cuteness of a young dog in a picturesque outdoor setting.", 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 98, 'output_tokens': 232, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  ``` python
  chat('What direction is the puppy facing?')
  ```

  The puppy in the image is facing towards the left side of the frame. Its
  head is turned slightly, allowing us to see most of its face, including
  both eyes, its nose, and part of its mouth. The puppy’s body is angled
  diagonally, with its front paws visible and resting on the grass. This
  positioning gives the viewer a good look at the puppy’s adorable facial
  features and the distinctive coloring of its fur, while also creating an
  engaging composition within the photograph.

  <details>

  - id: `msg_019YhPzDxXXjrcpjaS6G8fmF`
  - content:
    `[{'text': "The puppy in the image is facing towards the left side of the frame. Its head is turned slightly, allowing us to see most of its face, including both eyes, its nose, and part of its mouth. The puppy's body is angled diagonally, with its front paws visible and resting on the grass. This positioning gives the viewer a good look at the puppy's adorable facial features and the distinctive coloring of its fur, while also creating an engaging composition within the photograph.", 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 341, 'output_tokens': 108, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  ``` python
  chat('What color is it?')
  ```

  The puppy in the image has a combination of two main colors:

  1.  White: The majority of its face, including the area around its eyes,
      muzzle, and part of its chest, is white.

  2.  Reddish-brown: This color, often referred to as “chestnut” or “ruby”
      in Cavalier King Charles Spaniels, covers the puppy’s ears and
      extends to patches on its body.

  The contrast between these two colors is quite striking and typical of
  the Cavalier King Charles Spaniel breed. The white fur appears bright
  and clean, while the reddish-brown areas have a rich, warm tone. This
  color combination, along with the puppy’s expressive eyes and small
  black nose, contributes to its incredibly cute and appealing appearance.

  <details>

  - id: `msg_01WVxHA2sAff5q1En3q9km8F`
  - content:
    `[{'text': 'The puppy in the image has a combination of two main colors:\n\n1. White: The majority of its face, including the area around its eyes, muzzle, and part of its chest, is white.\n\n2. Reddish-brown: This color, often referred to as "chestnut" or "ruby" in Cavalier King Charles Spaniels, covers the puppy\'s ears and extends to patches on its body.\n\nThe contrast between these two colors is quite striking and typical of the Cavalier King Charles Spaniel breed. The white fur appears bright and clean, while the reddish-brown areas have a rich, warm tone. This color combination, along with the puppy\'s expressive eyes and small black nose, contributes to its incredibly cute and appealing appearance.', 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage:
    `{'input_tokens': 457, 'output_tokens': 175, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`

  </details>

  Note that the image is passed in again for every input in the dialog, so
  that number of input tokens increases quickly with this kind of chat.
  (For large images, using prompt caching might be a good idea.)

  ``` python
  chat.use
  ```

      In: 896; Out: 515; Total: 1411



  You can also use 3rd party providers of Anthropic models, as shown here.



  These are the models available through Bedrock:

  ``` python
  models_aws
  ```

      ('anthropic.claude-3-haiku-20240307-v1:0',
       'anthropic.claude-3-sonnet-20240229-v1:0',
       'anthropic.claude-3-opus-20240229-v1:0',
       'anthropic.claude-3-5-sonnet-20240620-v1:0')

  To use them, call `AnthropicBedrock` with your access details, and pass
  that to [`Client`](https://claudette.answer.ai/core.html#client):

  ``` python
  from anthropic import AnthropicBedrock
  ```

  ``` python
  ab = AnthropicBedrock(
      aws_access_key=os.environ['AWS_ACCESS_KEY'],
      aws_secret_key=os.environ['AWS_SECRET_KEY'],
  )
  client = Client(models_aws[-1], ab)
  ```

  Now create your [`Chat`](https://claudette.answer.ai/core.html#chat)
  object passing this client to the `cli` parameter – and from then on,
  everything is identical to the previous examples.

  ``` python
  chat = Chat(cli=client)
  chat("I'm Jeremy")
  ```

  Hello Jeremy! It’s nice to meet you. How can I assist you today? Is
  there anything specific you’d like to talk about or any questions you
  have?

  <details>

  - id: `msg_bdrk_01VFVE1Pe5LNubaWYKC1sz8f`
  - content:
    `[{'text': "Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to talk about or any questions you have?", 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage: `{'input_tokens': 10, 'output_tokens': 36}`

  </details>



  These are the models available through Vertex:

  ``` python
  models_goog
  ```

      ('claude-3-haiku@20240307',
       'claude-3-sonnet@20240229',
       'claude-3-opus@20240229',
       'claude-3-5-sonnet@20240620')

  To use them, call `AnthropicVertex` with your access details, and pass
  that to [`Client`](https://claudette.answer.ai/core.html#client):

  ``` python
  from anthropic import AnthropicVertex
  import google.auth
  ```

  ``` python
  project_id = google.auth.default()[1]
  gv = AnthropicVertex(project_id=project_id, region="us-east5")
  client = Client(models_goog[-1], gv)
  ```

  ``` python
  chat = Chat(cli=client)
  chat("I'm Jeremy")
  ```

  Hello Jeremy! It’s nice to meet you. How can I assist you today? Is
  there anything specific you’d like to talk about or any questions you
  have?

  <details>

  - id: `msg_vrtx_01P251BUJXBBvihsvb3VVgZ3`
  - content:
    `[{'text': "Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to talk about or any questions you have?", 'type': 'text'}]`
  - model: `claude-3-5-sonnet-20240620`
  - role: `assistant`
  - stop_reason: `end_turn`
  - stop_sequence: `None`
  - type: `message`
  - usage: `{'input_tokens': 10, 'output_tokens': 36}`

  </details>



  - [Pydantic Structured Ouput](https://github.com/tom-pollak/claudette-pydantic)


pkgId: c5160e65ade98913d576ce7a533a485409fd59c0a3704a9966def5cb59c8841d
name: python-claudia
arch: src
version: 0.2
epoch: 0
release: 1
summary: Helper utility to manage local rippled mainnet and sidechain networks
url: https://xrpl.org/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claudia-0.2-1.src.rpm
checksum_type: sha256
description:
  Claudia can be installed on both macOS and Ubuntu. Currently, there is no support for Windows. Following prerequisites
  must be installed before installing Claudia:
  - [Python3](https://www.python.org/)
      - Run ```python3 --version``` to check if Python3 is already installed.
      - If Python3 is not installed, please install it using the
        official [Python installer](https://www.python.org/downloads/).
      - Verify installation by running: ```python3 --version```
  - [pip3](https://pip.pypa.io/en/stable/)
      - Run ```pip3 --version``` to check if Python3 is already installed.
      - If pip3 is not installed, follow the next steps:
          - macOS:
              - ```python3 -m ensurepip --upgrade```
          - Linux:
              - ```sudo apt update```
              - ```sudo apt install python3-pip```
          - Verify installation by running: ```pip3 --version```
  - [docker](https://www.docker.com/)
      - Run ```docker --version``` to check if docker is already installed.
      - If docker is not installed, follow the next steps:
          - macOS:
              - Download and then run
                the [Docker Desktop installer for macOS](https://docs.docker.com/desktop/install/mac-install/).
          - Linux:
              - Download and then run


pkgId: d928a828f76097f541cd5e601546d0613407b9e6881e96fd9d27adfb74250e03
name: python-claws
arch: src
version: 0.0.21
epoch: 0
release: 1
summary: The Crossref Labs AWS tooling system.
url: https://gitlab.com/crossref/labs/distrunner
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-claws-0.0.21-1.src.rpm
checksum_type: sha256
description:
  Claws is a Python module that provides a simple and convenient way to interact with AWS services, such as S3 and CloudWatch. It utilizes the boto3 library and aiohttp for asynchronous operations, making it ideal for applications that require high-performance and efficient resource utilization.

  ![license](https://img.shields.io/gitlab/license/crossref/labs/claws) ![activity](https://img.shields.io/gitlab/last-commit/crossref/labs/claws)

  ![AWS](https://img.shields.io/badge/AWS-%23FF9900.svg?style=for-the-badge&logo=amazon-aws&logoColor=white) ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)

  This is a prototype Crossref Labs system. It is not guaranteed to be stable and the metadata schema and behaviour may be subject to change at any time.


  * S3 client and resource management with automatic deferred initialization
  * Presigned URL generation for S3 objects
  * Asynchronous downloading of multiple S3 objects
  * Retrieval of S3 objects as strings
  * Custom exception handling for S3 object retrieval errors
  * Easy integration with monitoring and instrumentation tools
  * Streaming upload to S3 to handle large JSON files


  * Python 3.6 or higher
  * boto3
  * aiohttp
  * smart-open



  To install the Claws module, simply use the following pip command:

      pip install claws


  Here is a basic example of how to use the Claws module to interact with AWS S3:

      from claws.aws_utils import AWSConnector


      
      connector = AWSConnector(bucket="my-bucket", unsigned=False)

      
      result = connector.s3_obj_to_str(bucket="my-bucket", s3_path="path/to/object.txt")

      
      s3_objects = ["path/to/object1.txt", "path/to/object2.txt", "path/to/object3.txt"]
      results = connector.get_multiple_s3_objs(bucket="my-bucket", s3_objs=s3_objects)

      for result in results:
          print(result)


  Contributions to the Claws module are welcome. Please feel free to submit pull requests or report issues on the GitHub repository.


  Claws is released under the [MIT License](https://opensource.org/licenses/MIT).


  * [.gitignore](https://github.com/github/gitignore) from Github.
  * [AWS Lambda Powertools](https://awslabs.github.io/aws-lambda-powertools-python/2.10.0/) by Amazon.

  &copy; Crossref 2023

rpm_license:
  Copyright &copy; 2023 Crossref  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: 5851479c62681ae0992ebdc11f8a04ec778442e7592b805b5762e2db000e5760
name: python-clay
arch: src
version: 4.6.2
epoch: 0
release: 1
summary: An amazing web prototyping tool.
url: http://lucuma.github.io/clay/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clay-4.6.2-1.src.rpm
checksum_type: sha256
description:
  exclude:
    - ".*"
    - ".*/*"
    - "~*"
    - "~*/*"
    - "_*"
    - "_*/*"
    - "*.txt"



  include:
    - "robots.txt"
    - "humans.txt"

  jinja_extensions:



  binaries:
    - "favicon.ico"


pkgId: 0c7549a4b9ee43edfd7dd0c65bb14b7fdf7b7ac261a91c78bcc4335cae65d405
name: python-clc-msa-utils
arch: src
version: 0.13.0
epoch: 0
release: 1
summary: CenturyLink Managed Services Anywhere Python Utilities
url: https://github.com/CenturyLinkCloud/mos-pyutils
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clc-msa-utils-0.13.0-1.src.rpm
checksum_type: sha256
description:
  To install the ``clc_msa_utils`` package, use the command below.::

      pip3 install clc_msa_utils



  This is a utility class that abstracts loading a configuration from Consul or ETCD. This class supports perodically
  reloading the configuration from the configured key-value store, and notifying a callback method after reloading.
  The following may be passed into the constructor, or pulled from env variables:

  +------------------+-----------------------+--------------------------------------------+-----------+
  | Constructor Arg  | Environment Variable  | Description                                | Default   |
  +==================+=======================+============================================+===========+
  | consul_host      | CONSUL_HOST           | Host for Consul                            | None      |
  +------------------+-----------------------+--------------------------------------------+-----------+
  | consul_port      | CONSUL_PORT           | Port for Consul                            | 8500      |
  +------------------+-----------------------+--------------------------------------------+-----------+
  | etcd_host        | ETCD_HOST             | Host for etcd                              | localhost |
  +------------------+-----------------------+--------------------------------------------+-----------+
  | etcd_port        | ETCD_PORT             | Port for etcd                              | 2379      |
  +------------------+-----------------------+--------------------------------------------+-----------+
  | kv_prefix        | KV_PREFIX             | Prefix for config path                     | ""        |
  +------------------+-----------------------+--------------------------------------------+-----------+
  | reload_seconds   | RELOAD_CONFIG_PERIOD  | Seconds between config reloads             | 20        |
  +------------------+-----------------------+--------------------------------------------+-----------+
  | reload_enabled   | RELOAD_ENABLED        | If true, reloads the config periodically.  | False     |
  +------------------+-----------------------+--------------------------------------------+-----------+


  Nested Configurations: Will enable you specify a list of prefixes to use to overlay configuration values.

  Example Usage

  ```python
     :number-lines: 1

        from clc_msa_utils.kv_store import KVStore

          
          kv_store = KVStore(
              kv_prefix=os.getenv('CONSUL_PREFIX') or os.getenv('ETCD_PREFIX', '/config/retry-listener'),
              reload_enabled=True
          )

          
          def initialize():
              kv_store.on_reload(dynamic_configuration)

          
          def dynamic_configuration(old, new):
              if not old or old.get('exchange_configs') != new.get('exchange_configs') \
                  or kv_store.attribute_changed("rabbit_host","rabbit_port","rabbit_user","rabbit_password","rabbit_queue_name"):
              setup_queue()

      
      def setup_queue():
          rabbit_host = kv_store.get('rabbit_host', 'localhost')
          rabbit_port = int(kv_store.get('rabbit_port', 5672))
  ```



  This is a utility class that uses a KVStore to configure the python logging facility. It uses KVStore's dynamic ability
  to reload its configuration to update Python's logging facility.

  +------------------+---------------------------------------------+--------------------+
  | Constructor Arg  |  Description                                | Default            |
  +==================+=============================================+====================+
  | kv_store         |  Backing KVStore used to configure logging. | None/Required      |
  +------------------+---------------------------------------------+--------------------+

  KVStore configurations relative to the kv_prefix

  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | Key                          |  Description                                | Default                                                               |
  +==============================+=============================================+=======================================================================+
  | logging_filename             |  The file where logs are written.           | None (Std Out)                                                        |
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | logging_filemode             |  The file mode if a filename is specified   | None                                                                  |
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | logging_format               |  The format of the logging line             | [s] s - s - s - s |
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | logging_datefmt              |  The date format of the date written        | %m/%d/%Y %I:%M:%SOURCE%p
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | logging_level                |  Root logging Level                         | INFO                                                                  |
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | logging_config/log_name_1    |  Logging level for <log_name_1>             | None                                                                  |
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | logging_config/log_name_2    |  Logging level for <log_name_2>             | None                                                                  |
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+
  | logging_config/log_name_n    |  Logging level for <log_name_n>             | None                                                                  |
  +------------------------------+---------------------------------------------+-----------------------------------------------------------------------+



  Here are the available configurations for logging provided by KVStore using an example of `/config/local_config`

  ```json

      {
        "config" : {
           "local_config" : {
              "logging_level": "INFO",
              "logging_config": {
                 "default": "DEBUG",
                 "KVStore": "DEBUG",
                 "LogManager": "DEBUG"
              }
           }
        }
      }
  ```


  ```python
     :number-lines: 1

     from clc_msa_utils.kv_store import KVStore
     from clc_msa_utils.log_manager import LogManager

     kv_store = KVStore(
         kv_prefix=os.getenv('CONSUL_PREFIX') or
                   os.getenv('ETCD_PREFIX') or
                   os.getenv('KV_PREFIX', '/config/local_config'),
         reload_enabled=True
     )

     log_manager = LogManager(kv_store=kv_store)
  ```



  This is a utility class that abstracts the creation of Queue Producers and Queue Consumers/Listeners.
  The producers and consumers are constructed based on a configuration passed into their respective methods
  as a parameter.  The following is an example JSON configuration of a Queue Consumer configuration that
  could be stored in a key-value store such as ETCD or Consul. Notice that the `queue_config` attribute is
  an array and can be all of the necessary configuration for both your Consumer and Producers.

  ```json

      {
        "queue_config": [
          {
            "name": "make_managed_request",
            "type": "consumer",
            "exchange": {
              "name": "managed_server",
              "type": "x-delayed-message",
              "arguments": {"x-delayed-type": "topic"},
              "durable": true
            },
            "queue": "make_managed_mos_cmdb",
            "binding_key": "requested.make_managed",
            "host": "rabbitmq.managed-services-dev.skydns.local",
            "port": "5672",
            "auth": {
              "user": "guest",
              "password": "guest"
            }
          }
        ]
      }
  ```



  ```python
     :number-lines: 1

          from clc_msa_utils.queueing import QueueFactory

          
          queue_config = kv_store.get('queue-config')

          
          q_factory = QueueFactory()

          
          consumers = q_factory.create_consumers(queue_config)

          
          producers = q_factory.create_producers(queue_config)

          
          consumers['make_managed_request'].listen(callback_function)

          
          producers['error'].publish({"error_details": "message about how you messed things up..."})



          def callback_function(ch, method, properties, body):
          ...
  ```


  ```python
     :number-lines: 1

        queue_factory = None

        def setup_queue:

           
           
           
           if queue_factory:
               queue_factory.stop_consuming()

           
           queue_factory_config = {
               "queue_config": []
           }

           amqp_connections = int(kv_store.get('amqp_connections', '10'))
           x = 0

           while x < amqp_connections:
               queue_config = {
                   "name": "notify_worker_thread_" + str(x),
                   "type": "consumer",
                   "queue": "my_queue",
                   "host": "localhost",
                   "port": "5672",
                   "exchange": {
                       "name": "managed_server",
                       "type": "x-delayed-message",
                       "arguments": {"x-delayed-type": "topic"},
                       "durable": true
                   },
                   "auth": {
                       "user": "guest",
                       "password": "guest"
                   }
               }

               queue_factory_config["queue_config"].append(queue_config)
               x = x + 1

           
           queue_factory = QueueFactory()
           queue_factory.create_consumers(queue_factory_config)
           queue_factory.start_consuming(do_work)

           
           for queue_consumer in queue_factory.consumers():
               queue_consumer.thread().join()

        ...

        def do_work(ch, method, properties, body):
           
           pass
  ```



  This is a utility class that creates a KVStore, LogManager, configures exchanges and queues, and starts consuming. This
  class also supports multi-threaded queue consumers, specified by the amqp connections. It also provides convenience
  methods to publish success messages, error messages, and will handle catching and reporting exceptionswithout writing
  code in the callback method, and acknowldge the message when done.

  Here are the parameters available when creating a QueueWorker

  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | Parameter                    |  Description                                                                                                 | Default              |
  +==============================+==============================================================================================================+======================+
  | consul_host                  |  Consul host used to initialize the KVStore.                                                                 | None                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | consul_port                  |  Consul port used to initialize the KVStore.                                                                 | None                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | etcd_host                    |  Etcd host used to initialize the KVStore.                                                                   | None                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | etcd_port                    |  Etcd port used to initialize the KVStore.                                                                   | None                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | kv_prefix                    |  The prefix used to initialize the KVStore.                                                                  | None                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_host_key              |  The key in the kv store that contains the RabbitMQ Host.                                                    | rabbit_host          |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_port_key              |  The key in the kv store that contains the RabbitMQ Port                                                     | rabbit_port          |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_user_key              |  The key in the kv store that contains the RabbitMQ User                                                     | rabbit_user          |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_password_key          |  The key in the kv store that contains the RabbitMQ Password                                                 | rabbit_password      |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | amqp_connection_key          |  The key in the kv store that contains the number of connections to RabbitMQ                                 | amqp_connections     |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | listen_exchange_key          |  The key in the kv store that contains the exchange to publish to listen on when consuming messages          | exchange             |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | listen_routing_key_key       |  The key in the kv store that contains the routing key to bind to when consuming messages.                   | listen_routing_key   |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | queue_name_key               |  The key in the kv store that contains the queue name to listen on when consuming messages                   | queue                |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | done_exchange_key            |  The key in the kv store that contains the exchange to publish to on success                                 | done_exchange        |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | done_routing_key_key         |  The key in the kv store that contains the routing key to publish to on success.                             | done_routing_key     |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | error_exchange_key           |  The key in the kv store that contains the exchange to publish to on error                                   | error_exchange       |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | error_routing_key_key        |  The key in the kv store that contains the routing key to publish to on error.                               | error_routing_key    |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | data_key_on_error_payload    |  The key in the kv store that contains the key in the error payload when publishing  to the error exchange.  | data                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | initialize_log_manager       |  When true, creates a LogManager using the kv store created or specified                                     | True                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | kv_store                     |  When specigfied, this kv_store is used instead of creating a new one.                                       | None                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_host_default          |  The default value of the RabbitMQ Host.                                                                     | localhost            |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_port_default          |  The default value of the RabbitMQ Port                                                                      | 5672                 |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_user_default          |  The default value of the RabbitMQ User                                                                      | guest                |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | rabbit_password_default      |  The default value of the RabbitMQ Password                                                                  | guest                |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | amqp_connection_default      |  The default value of the number of connections to RabbitMQ                                                  | 10                   |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | listen_exchange_default      |  The default value of the exchange to publish to listen on when consuming messages                           | main_exchange        |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | listen_routing_key_default   |  The default value of the routing key to bind to when consuming messages.                                    | listen.key           |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | queue_name_default           |  The default value of the queue name to listen on when consuming messages                                    | default_queue        |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | done_exchange_default        |  The default value of the exchange to publish to on success                                                  | main_exchange        |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | done_routing_key_default     |  The default value of the routing key to publish to on success.                                              | done.key             |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | error_exchange_default       |  The default value ofthe exchange to publish to on error                                                     | error_exchange       |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  | error_routing_key_default    |  The default value of the routing key to publish to on error.                                                | error.key            |
  +------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+




  *worker.py*

  ```python
     :number-lines: 1

     import logging
     import time

     from clc_msa_utils.queueing import QueueWorker

     logger = logging.getLogger("default")

     unregister_queue_worker = QueueWorker(
         kv_prefix=os.getenv("ETCD_PREFIX", "/config/billing-listener"),

         
         rabbit_host_key="rabbit_host", rabbit_host_default="rabbitmq.rabbitmq",
         rabbit_port_key="rabbit_port", rabbit_port_default=15672,
         rabbit_user_key="rabbit_user", rabbit_user_default="guest",
         rabbit_password_key="rabbit_password", rabbit_password_default="guest",
         amqp_connection_key="amqp_connection_count", amqp_connection_default=10,

         
         listen_exchange_key="main_exchange", listen_exchange_default="managed_server",
         listen_routing_key_key="main_exchange_stop_billing_routing_key", listen_routing_default="requested.make_unmanaged",
         queue_name_key="rabbit_stop_billing_queue_name", queue_name_default="stop_billing",

         
         done_exchange_key="main_exchange", done_exchange_default="managed_server",
         done_routing_key_key="main_exchange_done_stop_billing_routing_key",
         done_routing_key_default="billing.make_unmanaged",

         
         error_exchange_key="dead_letter_exchange", error_exchange_default="managed_server_error",
         error_routing_key_key="dead_letter_exchange_stop_billing_routing_key",
         error_routing_key_default="monitoring_config.make_managed",
         data_key_on_error_payload="server")

     
     register_queue_worker = QueueWorker(
         
         rabbit_host_key="rabbit_host", rabbit_host_default="rabbitmq.rabbitmq",
         rabbit_port_key="rabbit_port", rabbit_port_default=15672,
         rabbit_user_key="rabbit_user", rabbit_user_default="guest",
         rabbit_password_key="rabbit_password", rabbit_password_default="guest",
         amqp_connection_key="amqp_connection_count", amqp_connection_default=10,

         
         listen_exchange_key="main_exchange", listen_exchange_default="managed_server",
         listen_routing_key_key="main_exchange_routing_key", listen_routing_default="requested.make_managed",
         queue_name_key="rabbit_queue_name", queue_name_default="start_billing",

         
         done_exchange_key="main_exchange", done_exchange_default="managed_server",
         done_routing_key_key="main_exchange_done_routing_key", done_routing_key_default="billing.make_managed",

         
         error_exchange_key="dead_letter_exchange", error_exchange_default="managed_server_error",
         error_routing_key_key="dead_letter_exchange_routing_key", error_routing_key_default="billing.make_managed",
         data_key_on_error_payload="server",

         
         initialize_log_manager=False, kv_store=unregister_queue_worker.kv_store())

     
     kv_store=unregister_queue_worker.kv_store()

     
     all_defaults_queue_worker = QueueWorker(rabbit_host_default="rabbitmq.rabbitmq")


     
     def initialize():
         logger.debug("Initializing worker...")

         
         register_queue_worker.set_callback(register_listener)
         unregister_queue_worker.set_callback(unregister_listener)
         all_defaults_queue_worker.set_callback(all_defaults_listener)

         logger.debug("Done Initializing worker")


     def register_listener(ch, method, properties, body):
         _do_work(ch, method, properties, body, "register", register_queue_worker)


     def unregister_listener(ch, method, properties, body):
         _do_work(ch, method, properties, body, "unregister", unregister_queue_worker)


     def all_defaults_listener(ch, method, properties, body):
         _do_work(ch, method, properties, body, "all_defaults", all_defaults_queue_worker)


     def _do_work(ch, method, properties, body, task_name, queue_worker, sleep_seconds=8):
         logger.info("[{0}] Received the following message: {1}".format(task_name, body.decode("utf-8")))
         logger.info("[{0}] Pretending to do something for {1} seconds...".format(task_name, str(sleep_seconds)))

         time.sleep(sleep_seconds)

         logger.info("[{0}] Done pretending to do something. ".format(task_name, str(sleep_seconds)))

         payload = {
             "task_name": task_name,
             "sleep_seconds": sleep_seconds,
             "original_message": body.decode("utf-8"),
             "properties": properties,
             "method": method
         }

      
      
      
      
      if "error" in str(body.decode("utf-8")):
          raise Exception("Raising an error.")

      
      queue_worker.publish_success(payload, properties)

      
      queue_worker.publish_error(payload)

      
      logger.info("[{0}] Acknowledged that I am done pretending to do something.".format(task_name))


     if __name__ == '__main__':
         initialize()
  ```

  *worker_UT.py*

  ```python
     :number-lines: 1

     import unittest
     import worker


     class WorkerTests(unittest.TestCase):

         def setUp(self):
             pass

         def tearDown(self):
             
             worker.kv_store.disable_reloading()

         def test_something(self):
             pass
  ```



  This utility method removes or replaces empty strings in a dictionary. Optionally, you may also replace None values.

  **positional parameters**

  - The dictionary to process

  **arguments**

  - *process_none_values*: When true, replace or remove attributes that have a value of None/Null, default=False
  - *clone_dict*: When true clones the input dictionary, processes it, and returns the clone leaving the original untouched, default=False
  - *remove_values*: When true, removes attributes that are empty or optionally None, default=False
  - *replace_with*: The replacement value, default=None
  - *replace_float_with_decimal*: The replacement value, default=None




  ```python
     :number-lines: 1

            from utils import dict_replace_empty_values

            def process_dict(my_dict):
                
                dict_a = dict_replace_empty_values(my_dict,
                                                   process_none_values=True,
                                                   clone_dict=True,
                                                   remove_values=True)

                 
                 dict_b = dict_replace_empty_values(my_dict,
                                                    process_none_values=True,
                                                    clone_dict=True,
                                                    replace_with="EMPTY")

                 
                 dict_c = dict_replace_empty_values(my_dict,
                                                    process_none_values=True,
                                                    clone_dict=True,
                                                    replace_with="EMPTY",
                                                    replace_float_with_decimal=True)
  ```


  Logs the type for every attribute in the specified dictionary.

  **positional parameters**

  - The dictionary for which to log types

  **arguments**

  - *types*: Which types to show, else show all, default=None,
  - *use_logger*: The logger uto use, default=logger


  Safely retrieves the value of a deeply nested dictionary property. If the path doesn't exist, `None` is returned.
  If no keys are specified, `obj` is returned. No exception will be thrown if any key doesn't exist.

  **positional parameters**

  - The dictionary for which to log types
  - list of keys



  ```python
     :number-lines: 1

      
      
      dig(countries, "USA", "MO")

      
      dig(1)

      
      dig(1, "a", "b")
  ```



  Most tests can run with the command:

  ```bash
  pipenv run python -m unittest discover -v
  ```

  However, the kv_store_UT.py requires a local instance of etcd to be running, and therefore still requires to be run from
  the script:

  ```bash
  ./run-tests.sh
  ```


pkgId: 8613fee194db24d7090ec162f3ae1d01840c02aa3441157a5c6dbc08c93a003e
name: python-cld4py
arch: src
version: 1.1.0
epoch: 0
release: 1
url: https://github.com/timyerg/cld4py
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cld4py-1.1.0-1.src.rpm
checksum_type: sha256
summary:
  Python 3 function to assign compact letter display letters and for plotting them with matplotlib/seaborn

description:
  Function to apply compact letter display for pairwise contrasts.
  Groups with no significant differences share a letter.




  ```python
  Required:
      df     - dataframe with contrasts (pairwise comparisons).
      G1, G2 - columns in contrasts df with compared groups.
      P      - column in contrasts df with p-value (adjusted, right?).
  Optional:
      alpha  - sigificance level (default 0.05).
      order  - None (default), list or ['ascending', 'descending'].
               This parameter will define the order of assigned letters.
               None - alphabetical order will be applied.
               List - order of groups will be defined by that list.
               String 'ascending' or 'descending' requires parameters
               'data', 'values' and 'group' to order groups by the mean.
      data   - dataframe with values that were compared to get contrasts.
      vals   - column in data with compared values.
      group  - column in data with group information.
  ```




  ```python
  pip install cld4py
  ```




  ```python
  from cld4py.cld4py import *

  cld4py(*args)
  ```


pkgId: fd0ea3425d742e3a73f46a99d1a219a68ee0d0744714a76f6f4b35b45a1592d1
name: python-cldfcatalog
arch: src
version: 1.5.1
epoch: 0
release: 1
summary: Python library to access CLDF reference catalogs
url: https://github.com/cldf/cldfcatalog
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cldfcatalog-1.5.1-1.src.rpm
checksum_type: sha256
description:
  Utilities to use `git` repository clones and reference catalogs.

  [![Build Status](https://github.com/cldf/cldfcatalog/workflows/tests/badge.svg)](https://github.com/cldf/cldfcatalog/actions?query=workflow%3Atests)
  [![codecov](https://codecov.io/gh/cldf/cldfcatalog/branch/master/graph/badge.svg)](https://codecov.io/gh/cldf/cldfcatalog)
  [![PyPI](https://img.shields.io/pypi/v/cldfcatalog.svg)](https://pypi.org/project/cldfcatalog)

  Research data - and in particular CLDF data - is often curated using `git` repositories
  for version control. [`cldfcatalog.Repository`](src/cldfcatalog/repository.py)
  provides a wrapper around GitPython's `git.Repo` class, exposing relevant functionality
  in this context.

  A particularly important piece of data for CLDF are reference catalogs, which are
  consulted during CLDF data creation. Again, such catalogs are often available as
  `git` repositories hosted on GitHub, such as
  [Glottolog](https://github.com/glottolog/glottolog) or
  [Concepticon](https://github.com/concepticon/concepticon-data).

  The typical usage scenario for these catalogs is as follows:
  - To follow upstream development of the catalogs, a user has a local clone of the
    repository, which is periodically synched running `git pull origin`.
  - When creating a CLDF dataset, a particular released version of a catalog is consulted.

  Thus, we want to
  - checkout a particular version of the catalog,
  - run the CLDF creation,
  - restore the previous state of the repository clone.

  This is exactly the functionality of [`cldfcatalog.Catalog`](src/cldfcatalog/catalog.py):
  ```python
  >>> from cldfcatalog import Catalog
  >>> glottolog = Catalog('../../glottolog/glottolog', 'v4.0')
  >>> glottolog.active_branch
  'master'
  >>> with glottolog:
  ...     print(glottolog.describe())
  ...
  v4.0
  >>> glottolog.describe()
  'v4.0-52-ga4cfc90'
  ```




  `cldfcatalog` supports discovery of local paths to catalog clones via a configuration file.
  If a file `catalog.ini` is found at `appdirs.user_config_dir('cldf')` (see [appdirs](https://pypi.org/project/appdirs/)) is found, its `clones` section is used as a
  mapping from `Catalog.cli_name()` to clone path. Thus, with a configuration
  ```ini
  [clones]
  clts = /home/forkel/.config/cldf/clts
  ```
  a catalog can be intialized as
  ```python
  with Catalog.from_config('clts', tag='v1.0'):
      ...
  ```

  When cloning a catalog,
  running `Catalog.clone`,`appdirs.user_config_dir('cldf')` will be used as directory for
  the clone, and the path will be written to the config file.

  To add add paths to a config file use it as context manager:
  ```python
  from cldfcatalog import Config

  with Config.from_file() as cfg:
      cfg.add_clone(key, path)
  ```


pkgId: 15f4fb1af56c8d54bb39dc505b81f5813ddf940614af3915779ea82981484834
name: python-cldfgeojson
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Functionality to access and curate GeoJSON in CLDF datasets
url: https://github.com/cldf/cldfgeojson
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cldfgeojson-1.1.0-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://github.com/cldf/cldfgeojson/workflows/tests/badge.svg)](https://github.com/cldf/cldfgeojson/actions?query=workflow%3Atests)
  [![PyPI](https://img.shields.io/pypi/v/cldfgeojson.svg)](https://pypi.org/project/cldfgeojson)

  `cldfgeojson` provides tools to work with geographic data structures encoded as [GeoJSON](https://geojson.org)
  in the context of [CLDF](https://cldf.clld.org) datasets.




  ```shell
  pip install cldfgeojson
  ```




  The functionality in [`cldfgeojson.create`](src/cldfgeojson/create.py) helps adding speaker area
  information when creating CLDF datasets (e.g. with [`cldfbench`](https://github.com/cldf/cldfbench)).




  Tools like `shapely` allow doing geometry with shapes derived from GeoJSON, e.g. computing
  intersections or centroids. But `shapely` considers coordinates to be in the cartesian plane rather
  than on the surface of the earth. While this works generally well enough close to the equator, it
  fails for geometries crossing the antimeridian. To prepare GeoJSON objects for investigation with
  `shapely`, we provide a function that "moves" objects on a - somewhat linguistically informed -
  pacific-centered cartesian plane: longitudes less than 26°W are adapted by adding 360°, basically
  moving the interval of valid longitudes from -180°..180° to -26°..334°. While this just moves the
  antimeridian problems to 26°W, it's still useful because most spatial data about languages does not
  cross 26°W - which cannot be said for 180°E because this longitude is crosssed by the speaker area
  of the Austronesian family.

  ```python
  >>> from cldfgeojson.geojson import pacific_centered
  >>> from shapely.geometry import shape
  >>> p1 = shape({"type": "Point", "coordinates": [179, 0]})
  >>> p2 = shape({"type": "Point", "coordinates": [-179, 0]})
  >>> p1.distance(p2)
  358.0
  >>> p1 = shape(pacific_centered({"type": "Point", "coordinates": [179, 0]}))
  >>> p2 = shape(pacific_centered({"type": "Point", "coordinates": [-179, 0]}))
  >>> p1.distance(p2)
  2.0
  ```




  The [`cldfgeojson.geotiff`](src/cldfgeojson/geotiff.py) module provides functionality related to
  images in [GeoTIFF](https://en.wikipedia.org/wiki/GeoTIFF) format.




  `cldfgeojson` also provides [`cldfbench` sub-commands](https://github.com/cldf/cldfbench?tab=readme-ov-file#commands):

  - [`geojson.webmercator`](src/cldfgeojson/commands/webmercator.py)
  - [`geojson.overlay`](src/cldfgeojson/commands/overlay.py)




  This package contains the [`leaflet.draw`](https://github.com/Leaflet/Leaflet.draw) plugin in the form of `data://` URLs in
  [a mako template](src/cldfgeojson/commands/templates/leaflet.draw.mako). `leaflet.draw` is
  distributed under a MIT license:

  > Copyright 2012-2017 Jon West, Jacob Toye, and Leaflet
  >
  > 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.


pkgId: 406e95a4833abd7bc102e73a0b5e3ebb340a1055b0f5b123b23e57318e4ddd40
name: python-cldfviz
arch: src
version: 1.3.0
epoch: 0
release: 1
summary: A cldfbench plugin to create vizualisations of CLDF datasets
url: https://github.com/cldf/cldfviz
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cldfviz-1.3.0-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://github.com/cldf/cldfviz/workflows/tests/badge.svg)](https://github.com/cldf/cldfviz/actions?query=workflow%3Atests)
  [![PyPI](https://img.shields.io/pypi/v/cldfviz.svg)](https://pypi.org/project/cldfviz)

  Python library providing tools to visualize [CLDF](https://cldf.clld.org) datasets.




  Run
  ```shell
  pip install cldfviz
  ```
  If you want to create maps in image formats (PNG, JPG, PDF), the `cartopy` package is needed,
  which will be installed with
  ```shell
  pip install cldfviz[cartopy]
  ```
  Note: Since `cartopy` has quite a few system-level requirements, installation may be somewhat tricky. Should
  problems arise, https://scitools.org.uk/cartopy/docs/v0.15/installing.html may help.

  If you want to create "treemaps" (i.e. use the [lingreemaps](https://lingtreemaps.readthedocs.io/en/latest/?badge=latest)
  package for CLDF data), you need to install via
  ```shell
  pip install cldfviz[lingtreemaps]
  ```




  `cldfviz` is implemented as [`cldfbench`](https://github.com/cldf/cldfbench)
  plugin, i.e. it provides subcommands for the `cldfbench` command.

  After installation you should see subcommands with a `cldfviz.` prefix
  listed when running
  ```shell
  cldfbench -h
  ```

  Help provided by the CLI is sometimes extensive and can be consulted via
  ```shell
  cldfbench <sucommand> -h
  ```
  e.g.
  ```shell
  $ cldfbench cldfviz.map -h
  usage: cldfbench cldfviz.map [-h] [--download-dir DOWNLOAD_DIR] [--language-filters LANGUAGE_FILTERS]
                               [--glottolog GLOTTOLOG] [--glottolog-version GLOTTOLOG_VERSION]
  ...
  ```




  A short description of the `cldfviz` subcommands can be found below; for more documentation click on the images.




  Examples in this documentation sometimes use CLDF data stored in the local filesystem.
  In particular, we'll use
  - [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7385533.svg)](https://doi.org/10.5281/zenodo.7385533): WALS Online
  - [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7398887.svg)](https://doi.org/10.5281/zenodo.7398887): Glottolog as CLDF dataset
  - [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7139937.svg)](https://doi.org/10.5281/zenodo.7139937): APiCS Online

  If you download these datasets using the `cldfbench` plugin [cldfzenodo](https://github.com/cldf/cldfzenodo/#cli)
  ```shell
  cldfbench zenodo.download 10.5281/zenodo.7385533 --full-deposit
  cldfbench zenodo.download 10.5281/zenodo.7398887 --full-deposit
  cldfbench zenodo.download 10.5281/zenodo.7139937 --full-deposit
  ```
  you should have the respective data in local directories `wals-2020.3/`, `glottolog-cldf-4.7/` and `cldf-datasets-apics-4ed59b5/`.




  A common way to visualize data from a CLDF StructureDataset is as "dots on a map",
  i.e. as [WALS](https://wals.info)-like geographic maps, displaying typological variation.
  The `cldfviz.map` subcommand allows you to create such maps. For details see [docs/map.md](docs/map.md).

  [<img alt="details" width="350" src="docs/output/wals_10B.png" />](docs/map.md)




  A rather traditional visualization of linguistic data is the practice of interspersing bits of data
  in descriptive texts, most obviously perhaps as examples formatted as **I**nterlinear **G**lossed **T**ext.
  The `cldfviz.text` subcommand allows you "render" documents written in [CLDF markdown](https://github.com/cldf/cldf/blob/master/extensions/markdown.md), i.e. converting
  such documents to plain markdown by inserting suitable representations of the referenced data.
  For details see [docs/text.md](docs/text.md).

  [<img alt="details" width="350" src="docs/output/wals_exponence.png" />](docs/text.md)




  While it is possible to (selectively) include IGT formatted examples in [CLDF Markdown](https://github.com/cldf/cldf/blob/master/extensions/markdown.md) via `cldfviz.text`,
  often it is useful to just look at an HTML formatted list of all examples from a dataset. This can
  be done via `cldfviz.examples`. For details see [docs/examples.md](docs/examples.md).

  [<img alt="details" width="350" src="docs/output/lgr_html.png" />](docs/examples.md)




  Phylogenetic (or classification) trees of languages are a "proper" [CLDF component](https://github.com/cldf/cldf/tree/master/components/trees)
  since CLDF 1.2 - and an obvious candidate for visualization (because noone likes to look at [Newick](https://en.wikipedia.org/wiki/Newick_format)).

  To provide a configurable visualization of trees in [SVG format](https://en.wikipedia.org/wiki/SVG), the
  `cldfviz.tree` command renders CLDF trees using the powerful [toytree](https://toytree.readthedocs.io/en/latest/)
  package. For details see [docs/tree.md](docs/tree.md).

  [<img alt="details" width="350" src="docs/output/wals-omotic.svg" />](docs/tree.md)




  Displaying maps and trees is nice, but visualizing how phylogeny relates to geography can also be done
  in a more integrated way as demonstrated by the [lingtreemaps](https://lingtreemaps.readthedocs.io/en/latest/examples.html)
  package. [cldfviz.treemap](docs/treemap.md) provides a front-end for this package, making it possible
  to use its functionality with data and trees in CLDF datasets.

  [<img alt="details" width="350" src="docs/output/treemap_wals88A.svg" />](docs/treemap.md)




  Another case where it is often desirable to aggregate objects from different CLDF components
  for inspection are Wordlists with associated audio files. Displaying forms for a specified
  concept together with the audio as HTML page can be done running
  [cldfviz.audiowordlist](docs/audiowordlist.md).

  [<img alt="details" width="350" src="docs/output/awl_hindukush.png" />](docs/audiowordlist.md)




  CLDF datasets typically contain multiple, related tables. The most common visualization of such a data model
  are "entity-relationship diagrams", i.e. diagramy of the [entitty-relationship model](https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model)
  of the dataset. Such a diagram can be created via `cldfviz.erd` (if a Java runtime is installed).
  For details see [docs/erd.md](docs/erd.md).

  [<img alt="details" width="350" src="docs/output/wacl.svg" />](docs/erd.md)




  A [ParameterNetwork component](https://github.com/cldf/cldf/tree/master/components/parameternetworks)
  was added to CLDF with version 1.3, acknowledging that in datasets like [CLICS](https://clics.clld.org/)
  a network of parameters (established through colexifications in CLICS) acted as both, output of the
  colexification algorithm, but also as input for various cluster methods. Since there are many tools
  for network analysis available, the main task for a CLDF-based tool is to convert (filtered) parts
  of a `ParameterNetwork` to a format that can serve as input for other tools. This is what `cldfviz.network`
  does and since [Graphviz' DOT format](https://graphviz.org/doc/info/lang.html) is one of the target
  formats supported by `cldfviz.network`, exploratory analysis is supported by just piping the output
  into the `dot` program to create a network visualization.

  [<img alt="details" width="350" src="docs/output/partof_neck2.svg" />](docs/network.md)




  Other tools to convert CLDF data to "human-readable" formats:
  - [cldfofflinebrowser](https://github.com/cldf/cldfofflinebrowser)
  - [clld](https://github.com/clld/clld)


pkgId: 319cc5e062b6c56f3ac4230e0a32e1194c2acd13404365d330f0cdfe396e05d9
name: python-cldfzenodo
arch: src
version: 2.1.2
epoch: 0
release: 1
summary: Functionality to retrieve CLDF datasets deposited on Zenodo
url: https://github.com/cldf/cldfzenodo
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cldfzenodo-2.1.2-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://github.com/cldf/cldfzenodo/workflows/tests/badge.svg)](https://github.com/cldf/cldfzenodo/actions?query=workflow%3Atests)
  [![PyPI](https://img.shields.io/pypi/v/cldfzenodo.svg)](https://pypi.org/project/cldfzenodo)

  `cldfzenodo` provides programmatic access to CLDF data deposited on [Zenodo](https://zenodo.org).

  **NOTE:** The Zenodo upgrade from October 13, 2023 introduced quite a few changes in various parts
  of the system. Thus, `cldfzenodo` before version 2.0 cannot be used anymore. `cldfzenodo` is meant
  to be backwards compatible, i.e. provides the same Python API as `cldfzenodo` 1.x - but may issue
  deprecation warnings.




  ```shell
  pip install cldfzenodo
  ```




  `cldfzenodo` registers (upon installation) a [`pycldf` dataset resolver](https://pycldf.readthedocs.io/en/latest/ext_discovery.html)
  for dataset locators of the form `https://doi.org/10.5281/zenodo.[0-9]+` and `https://zenodo.org/record/[0-9]+`.
  Thus, after installation you should be able to retrieve `pycldf.Dataset` instances running

  ```python
  >>> from pycldf.ext.discovery import get_dataset
  >>> import pathlib
  >>> pathlib.Path('wacl').mkdir()
  >>> ds = get_dataset('https://doi.org/10.5281/zenodo.7322688', pathlib.Path('wacl'))
  >>> ds.properties['dc:title']
  'World Atlas of Classifier Languages'
  ```




  `cldfzenodo` provides a subcommand to be run from [cldfbench](https://github.com/cldf/cldfbench).
  To make use of this command, you have to install `cldfbench`, which can be done via
  ```shell
  pip install cldfzenodo[cli]
  ```
  Then you can download CLDF datasets from Zenodo, using the DOI for identification. E.g.
  ```shell
  cldfbench zenodo.download 10.5281/zenodo.4683137  --directory wals-2020.1/
  ```
  will download WALS Online as CLDF dataset into `wals-2020.1`:
  ```shell
  $ tree wals-2020.1/
  wals-2020.1/
  ├── areas.csv
  ├── chapters.csv
  ├── codes.csv
  ├── contributors.csv
  ├── countries.csv
  ├── examples.csv
  ├── language_names.csv
  ├── languages.csv
  ├── parameters.csv
  ├── sources.bib
  ├── StructureDataset-metadata.json
  └── values.csv

  0 directories, 12 files
  ```




  Metadata and data of (potential) CLDF datasets deposited on Zenodo is accessed via `cldfzenodo.Record`
  objects. Such objects can be obtained in various ways:
  - Via DOI:
    ```python
    >>> from cldfzenodo import API
    >>> rec = API.get_record(doi='10.5281/zenodo.4762034')
    >>> rec.title
    'glottolog/glottolog: Glottolog database 4.4 as CLDF'
    ```
  - Via [concept DOI](https://help.zenodo.org/#versioning) and version tag:
    ```python
    >>> from cldfzenodo import API
    >>> rec = API.get_record(conceptdoi='10.5281/zenodo.3260727', version='4.5')
    >>> rec.title
    'glottolog/glottolog: Glottolog database 4.5 as CLDF'
    ```
  - From deposits grouped into a Zenodo community:
    ```python
    >>> from cldfzenodo import API
    >>> for rec in API.iter_records(community='dictionaria'):
    ...     print(rec.title)
    ...     break
    ...
    dictionaria/iquito: Iquito dictionary
    ```
  - From search results using keywords:
    ```python
    >>> from cldfzenodo import API
    >>> for rec in API.iter_records(keyword='cldf:Wordlist'):
    ...     print(rec.title)
    ...     break
    ...
    CLDF dataset accompanying Zariquiey et al.'s "Evolution of Body-Part Terminology in Pano" from 2022
    ```

  `cldfzenodo.Record` objects provide sufficient metadata to allow identification and data access:
  ```python
  >>> from cldfzenodo import API
  >>> print(API.get_record(doi='10.5281/zenodo.4762034').bibtex)
  @misc{zenodo-4762034,
    author    = {Hammarström, Harald and Forkel, Robert and Haspelmath, Martin and Bank, Sebastian},
    title     = {glottolog/glottolog: Glottolog database 4.4 as CLDF},
    keywords  = {cldf:StructureDataset, linguistics},
    publisher = {Zenodo},
    year      = {2021},
    doi       = {10.5281/zenodo.4762034},
    url       = {https://doi.org/10.5281/zenodo.4762034},
    copyright = {Creative Commons Attribution 4.0}
  }
  ```

  One can download the full deposit (and access - possible multiple - CLDF datasets):
  ```python
  from pycldf import iter_datasets

  API.get_record(doi='...').download('my_directory')
  for cldf in iter_datasets('my_directory'):
      pass
  ```

  But often, only the "pure" CLDF data is of interest - and not the additional metadata and curation
  context, e.g. of [cldfbench](https://github.com/cldf/cldfbench)-curated datasets. This can be done
  via
  ```python
  cldf = API.get_record(doi='...').download_dataset('my_directory')
  ```


pkgId: 892664ea0db2bbf05b35170de8c00aba85b6db03dab4e221db572580f1b2a3bb
name: python-cle
arch: src
version: 9.2.123
epoch: 0
release: 1
url: https://github.com/angr/cle
rpm_license: BSD-2-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cle-9.2.123-1.src.rpm
checksum_type: sha256
summary:
  CLE Loads Everything (at least, many binary formats!) and provides a pythonic interface to analyze what they are and what they would look like in memory.

description:
  [![Latest Release](https://img.shields.io/pypi/v/cle.svg)](https://pypi.python.org/pypi/cle/)
  [![Python Version](https://img.shields.io/pypi/pyversions/cle)](https://pypi.python.org/pypi/cle/)
  [![PyPI Statistics](https://img.shields.io/pypi/dm/cle.svg)](https://pypistats.org/packages/cle)
  [![License](https://img.shields.io/github/license/angr/cle.svg)](https://github.com/angr/cle/blob/master/LICENSE)

  CLE loads binaries and their associated libraries, resolves imports and
  provides an abstraction of process memory the same way as if it was loader by
  the OS's loader.


  Project repository: https://github.com/angr/cle

  Documentation: https://api.angr.io/projects/cle/en/latest/



  ```sh
  pip install cle
  ```



  ```python
  >>> import cle
  >>> ld = cle.Loader("/bin/ls")
  >>> hex(ld.main_object.entry)
  '0x4048d0'
  >>> ld.shared_objects
  {'ld-linux-x86-64.so.2': <ELF Object ld-2.21.so, maps [0x5000000:0x522312f]>,
   'libacl.so.1': <ELF Object libacl.so.1.1.0, maps [0x2000000:0x220829f]>,
   'libattr.so.1': <ELF Object libattr.so.1.1.0, maps [0x4000000:0x4204177]>,
   'libc.so.6': <ELF Object libc-2.21.so, maps [0x3000000:0x33a1a0f]>,
   'libcap.so.2': <ELF Object libcap.so.2.24, maps [0x1000000:0x1203c37]>}
  >>> ld.addr_belongs_to_object(0x5000000)
  <ELF Object ld-2.21.so, maps [0x5000000:0x522312f]>
  >>> libc_main_reloc = ld.main_object.imports['__libc_start_main']
  >>> hex(libc_main_reloc.addr)       # Address of GOT entry for libc_start_main
  '0x61c1c0'
  >>> import pyvex
  >>> some_text_data = ld.memory.load(ld.main_object.entry, 0x100)
  >>> irsb = pyvex.lift(some_text_data, ld.main_object.entry, ld.main_object.arch)
  >>> irsb.pp()
  IRSB {
     t0:Ity_I32 t1:Ity_I32 t2:Ity_I32 t3:Ity_I64 t4:Ity_I64 t5:Ity_I64 t6:Ity_I32 t7:Ity_I64 t8:Ity_I32 t9:Ity_I64 t10:Ity_I64 t11:Ity_I64 t12:Ity_I64 t13:Ity_I64 t14:Ity_I64

     15 | ------ IMark(0x4048d0, 2, 0) ------
     16 | t5 = 32Uto64(0x00000000)
     17 | PUT(rbp) = t5
     18 | t7 = GET:I64(rbp)
     19 | t6 = 64to32(t7)
     20 | t2 = t6
     21 | t9 = GET:I64(rbp)
     22 | t8 = 64to32(t9)
     23 | t1 = t8
     24 | t0 = Xor32(t2,t1)
     25 | PUT(cc_op) = 0x0000000000000013
     26 | t10 = 32Uto64(t0)
     27 | PUT(cc_dep1) = t10
     28 | PUT(cc_dep2) = 0x0000000000000000
     29 | t11 = 32Uto64(t0)
     30 | PUT(rbp) = t11
     31 | PUT(rip) = 0x00000000004048d2
     32 | ------ IMark(0x4048d2, 3, 0) ------
     33 | t12 = GET:I64(rdx)
     34 | PUT(r9) = t12
     35 | PUT(rip) = 0x00000000004048d5
     36 | ------ IMark(0x4048d5, 1, 0) ------
     37 | t4 = GET:I64(rsp)
     38 | t3 = LDle:I64(t4)
     39 | t13 = Add64(t4,0x0000000000000008)
     40 | PUT(rsp) = t13
     41 | PUT(rsi) = t3
     42 | PUT(rip) = 0x00000000004048d6
     43 | t14 = GET:I64(rip)
     NEXT: PUT(rip) = t14; Ijk_Boring
  }
  ```



  For a full listing and description of the options that can be provided to the
  loader and the methods it provides, please examine the docstrings in
  `cle/loader.py`. If anything is unclear or poorly documented (there is much)
  please complain through whatever channel you feel appropriate.



  CLE's loader is implemented in the Loader class.
  There are several backends that can be used to load a single file:

    - ELF, as its name says, loads ELF binaries. ELF files loaded this way are
      statically parsed using PyElfTools.

    - PE is a backend to load Microsoft's Portable Executable format,
      effectively Windows binaries. It uses the (optional) `pefile` module.

    - Mach-O is a backend to load, you guessed it, Mach-O binaries. Support is
      limited for this backend.

    - Blob is a backend to load unknown data. It requires that you specify
      the architecture it would be run on, in the form of a class from
      ArchInfo.

  Which backend you use can be specified as an argument to Loader. If left
  unspecified, the loader will pick a reasonable default.



  - If the `auto_load_libs` option is set to False, the Loader will not
    automatically load libraries requested by loaded objects. Otherwise...
  - The loader determines which shared objects are needed when loading
    binaries, and searches for them in the following order:
      - in the current working directory
      - in folders specified in the `ld_path` option
      - in the same folder as the main binary
      - in the system (in the corresponding library path for the architecture
        of the binary, e.g., /usr/arm-linux-gnueabi/lib for ARM, note that
        you need to install cross libraries for this, e.g.,
        libc6-powerpc-cross on Debian - needs emdebian repos)
      - in the system, but with mismatched version numbers from what is specified
        as a dependency, if the `ignore_import_version_numbers` option is True

  - If no binary is found with the correct architecture, the loader raises an
    exception if `except_missing_libs` option is True. Otherwise it simply
    leaves the dependencies unresolved.


