# packages

pkgId: 0139535a55acf1bcf11aea76a83b6a64cc97abc738b8fc3493378c46a52c6980
name: python-cellpose-counter
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: Cell/nuclei counter using cellpose models
url: https://pypi.org/project/cellpose-counter/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellpose-counter-0.1.0-1.src.rpm
checksum_type: sha256
description:
  Option 1: Install in Napari directly under the plugins tab and select
  cellpose-counter.
  Option 2: via [pip](https://pip.pypa.io/en/stable/)(or pip alternatives like
  [uv](https://docs.astral.sh/uv/)):
  ```bash

  pip install napari[all] cellpose-counter

  uv add "napari[all]" cellpose-counter
  ```

  To start, napari, run the cli using `napari -w cellpose-counter`

  All contributions are welcome. Please submit an issue for feedback or bugs.

  This plugin is built on top of the Cellpose segmentation and denoising models.
  If you use this plugin, please cite the following paper:
  ```bitex
  @article{stringer2021cellpose,
  title={Cellpose: a generalist algorithm for cellular segmentation},
  author={Stringer, Carsen and Wang, Tim and Michaelos, Michalis and Pachitariu, Marius},
  journal={Nature Methods},
  volume={18},
  number={1},
  pages={100--106},
  year={2021},
  publisher={Nature Publishing Group}
  }
  ```

  [BSD-3](./LICENSE)

rpm_license:
  Copyright (c) 2024, Szablowski Lab All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  * Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


pkgId: 6161e3660a509e3202182741646125a707ee167db67dc51c52978a2ab5ae9240
name: python-cellpose-counter
arch: src
version: 0.1.3
epoch: 0
release: 1
summary: Cell/nuclei counter using cellpose models
url: https://pypi.org/project/cellpose-counter/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellpose-counter-0.1.3-1.src.rpm
checksum_type: sha256
description:
  Option 1: Install in Napari directly under the plugins tab and select
  cellpose-counter.
  Option 2: via [pip](https://pip.pypa.io/en/stable/) (or pip alternatives like
  [uv](https://docs.astral.sh/uv/)):
  Below is a minimally working example of setting up a new virtual environment and
  installing the counter module with uv on Unix based systems.
  ```bash
  uv venv # create virtual environment in .venv
  source .venv/bin/activate
  uv pip install "napari[all]" cellpose-counter
  ```

  To enable GPU acceleration, you will need a CUDA capable GPU along with the
  [CUDA toolkit](https://developer.nvidia.com/cuda-toolkit) and [cudNN library](https://developer.nvidia.com/cudnn).
  For instructions on installing cuda toolkit and cudNN, see:
  1. [cuda toolkit installation for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#fedora)
  1. [cudNN installation for Linux](https://docs.nvidia.com/deeplearning/cudnn/latest/installation/linux.html)
  Once these are installed, update the pytorch package by first uninstalling torch
  (if already instsalled).
  ```bash
  uv pip uninstall torch
  ```
  Then install a torch version that is compatible with your CUDA version. For example,
  ```bash
  uv pip install torch --index-url https://download.pytorch.org/whl/cu118
  ```
  After installation, you can verify in an interactive python console with:
  ```python3
  import torch
  torch.cuda.is_available()
  ```

  To open Napari with the cellpose counter loaded, run `napari -w cellpose-counter`.
  A dock widget will be open on the right side of the Napari interface. There
  you can view options for restoring images (using the cellpose denoise module),
  and counting cells/nuclei in a region of interest (ROI).
  A few important notes:
  1. Images in TIFF or CZI file formats may be used.
  1. Images must be grayscale or single channel. RGB images may be loaded, but
  should be split. You can do this by right clicking on the image and select
  `split rgb` or `split stack`.
  1. ROIs can be drawn using the shape layer tools. Only a single ROI can be drawn
  per shape layer (otherwise only the first draw ROI will be used).
  1. ROIs should be square or rectangular. You can draw ROIs as polygons or other
  shapes, but a bounding box will be made from these shapes anyway.
  1. For long running processes such as image restoration or counting, it may seem
  like Napari is not doing anything. Notifications are shown in the viewer to
  display import information and a small activity indicator can be seen in the
  bottom right hand corner. If this indicator is spinning, then work is being done
  even if it doesn't look like it.

  1. via Napari plugin manager. Select cellpose-counter plugin and update button.
  1. via pip (or uv, ..., etc.)
  ```bash
  uv pip install cellpose-counter --upgrade
  ```

  All contributions are welcome. Please submit an issue for feedback or bugs.

  This plugin is built on top of the Cellpose segmentation and denoising models.
  If you use this plugin, please cite the following paper:
  ```bitex
  @article{stringer2021cellpose,
  title={Cellpose: a generalist algorithm for cellular segmentation},
  author={Stringer, Carsen and Wang, Tim and Michaelos, Michalis and Pachitariu, Marius},
  journal={Nature Methods},
  volume={18},
  number={1},
  pages={100--106},
  year={2021},
  publisher={Nature Publishing Group}
  }
  ```

  [BSD-3](./LICENSE)

rpm_license:
  Copyright (c) 2024, Szablowski Lab All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  * Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


pkgId: 279688224b2c5868183ba66b89908ac208a19d271e4b8e2396e380ec39da64b5
name: python-cellpose-counter
arch: src
version: 0.1.5
epoch: 0
release: 1
summary: Cell/nuclei counter using cellpose models
url: https://pypi.org/project/cellpose-counter/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellpose-counter-0.1.5-1.src.rpm
checksum_type: sha256
description:
  Option 1: Install in Napari directly under the plugins tab and select
  cellpose-counter.
  Option 2: via [pip](https://pip.pypa.io/en/stable/) (or pip alternatives like
  [uv](https://docs.astral.sh/uv/)):
  Below is a minimally working example of setting up a new virtual environment and
  installing the counter module with uv on Unix based systems.
  ```bash
  uv venv # create virtual environment in .venv
  source .venv/bin/activate
  uv pip install "napari[all]" cellpose-counter
  ```
  Option 3: via Docker/Podman. The provide [Dockerfile](./Dockerfile) can be used
  to install Napari and the counter plugin along with a preconfigured Xpra server
  using the napari-xpra image. Below is an example of building the image and
  running the application with GPU support.
  ```bash
  podman build -t cellpose-counter .
  podman run -it -d \
      -p 9876:9876 \
      -e XPRA_START="python3 -m napari -w cellpose-counter" \
      --device nvidia.com/gpu=all
  ```
  Then, navigate to `http://localhost:9876` to view the application in a virtual
  machine.

  To enable GPU acceleration, you will need a CUDA capable GPU along with the
  [CUDA toolkit](https://developer.nvidia.com/cuda-toolkit) and [cudNN library](https://developer.nvidia.com/cudnn).
  For instructions on installing cuda toolkit and cudNN, see:
  1. [cuda toolkit installation for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#fedora)
  1. [cudNN installation for Linux](https://docs.nvidia.com/deeplearning/cudnn/latest/installation/linux.html)
  Once these are installed, update the pytorch package by first uninstalling torch
  (if already instsalled).
  ```bash
  uv pip uninstall torch
  ```
  Then install a torch version that is compatible with your CUDA version. For example,
  ```bash
  uv pip install torch --index-url https://download.pytorch.org/whl/cu118
  ```
  After installation, you can verify in an interactive python console with:
  ```python3
  import torch
  torch.cuda.is_available()
  ```

  To open Napari with the cellpose counter loaded, run `napari -w cellpose-counter`.
  A dock widget will be open on the right side of the Napari interface. There
  you can view options for restoring images (using the cellpose denoise module),
  and counting cells/nuclei in a region of interest (ROI).
  A few important notes:
  1. Images in TIFF or CZI file formats may be used.
  1. Images must be grayscale or single channel. RGB images may be loaded, but
  should be split. You can do this by right clicking on the image and select
  `split rgb` or `split stack`.
  1. ROIs can be drawn using the shape layer tools. Only a single ROI can be drawn
  per shape layer (otherwise only the first draw ROI will be used).
  1. ROIs should be square or rectangular. You can draw ROIs as polygons or other
  shapes, but a bounding box will be made from these shapes anyway.
  1. For long running processes such as image restoration or counting, it may seem
  like Napari is not doing anything. Notifications are shown in the viewer to
  display import information and a small activity indicator can be seen in the
  bottom right hand corner. If this indicator is spinning, then work is being done
  even if it doesn't look like it.

  1. via Napari plugin manager. Select cellpose-counter plugin and update button.
  1. via pip (or uv, ..., etc.)
  ```bash
  uv pip install cellpose-counter --upgrade
  ```

  All contributions are welcome. Please submit an issue for feedback or bugs.

  This plugin is built on top of the Cellpose segmentation and denoising models.
  If you use this plugin, please cite the following paper:
  ```bitex
  @article{stringer2021cellpose,
  title={Cellpose: a generalist algorithm for cellular segmentation},
  author={Stringer, Carsen and Wang, Tim and Michaelos, Michalis and Pachitariu, Marius},
  journal={Nature Methods},
  volume={18},
  number={1},
  pages={100--106},
  year={2021},
  publisher={Nature Publishing Group}
  }
  ```

  [BSD-3](./LICENSE)

rpm_license:
  Copyright (c) 2024, Szablowski Lab All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  * Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


pkgId: 005a12c0770060064dff22fa70bd8f2831766a9b5fe95d4725e47d9d629dbb07
name: python-cellprofiler-core-nightly
arch: src
version: 5.0.0.dev143
epoch: 0
release: 1
summary: cellprofiler-core implements the bulk of CellProfiler's non-gui functionality
url: https://cellprofiler.org/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellprofiler-core-nightly-5.0.0.dev143-1.src.rpm
checksum_type: sha256
description:
  This subpackage contains the code to build the `cellprofiler-core` package. It contains the critical classes and components required by the [CellProfiler](https://cellprofiler.org) software, whereas the [frontend](https://github.com/CellProfiler/CellProfiler/tree/main/src/frontend) contains non-essential modules and the GUI interface. This package can be used in isolation, separate from the frontend, to access CellProfiler's functionality as a Python package, see [this page](https://github.com/CellProfiler/CellProfiler/wiki/CellProfiler-as-a-Python-package) for more details.

rpm_license:
  The BSD 3-Clause License  Copyright © 2003 - 2021 Broad Institute, Inc. All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1.  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3.  Neither the name of the Broad Institute, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED “AS IS.”  BROAD MAKES NO EXPRESS OR IMPLIED REPRESENTATIONS OR WARRANTIES OF ANY KIND REGARDING THE SOFTWARE AND COPYRIGHT, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, CONFORMITY WITH ANY DOCUMENTATION, NON-INFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL BROAD, THE COPYRIGHT HOLDERS, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF, HAVE REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF SUCH DAMAGE.  If, by operation of law or otherwise, any of the aforementioned warranty disclaimers are determined inapplicable, your sole remedy, regardless of the form of action, including, but not limited to, negligence and strict liability, shall be replacement of the software with an updated version if one exists.  Development of CellProfiler has been funded in whole or in part with federal funds from the National Institutes of Health, the National Science Foundation, and the Human Frontier Science Program.


pkgId: dc1ad1f3691453b9c81612b3d9a872e8ddaaa7941786bdef5862e28a11ad124b
name: python-cellprofiler-library-nightly
arch: src
version: 5.0.0.dev143
epoch: 0
release: 1
url: https://cellprofiler.org/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellprofiler-library-nightly-5.0.0.dev143-1.src.rpm
checksum_type: sha256
summary:
  cellprofiler-library implements CellProfiler's image processing and mathematical code, and is usable as a standalone library

description:
  This subpackage contains the code to build the `cellprofiler-library` package. It contains the image processing modules required by the [CellProfiler](https://cellprofiler.org) software. Both the [core](https://github.com/CellProfiler/CellProfiler/tree/main/src/subpackages/core) subpackage, and the [frontend](https://github.com/CellProfiler/CellProfiler/tree/main/src/frontend) rely on this subpackage. This package can be used in isolation, separate from the `cellprofiler` and `cellprofiler-core` packages to access CellProfiler's image processing functionality as a Python package.

  It is currently a work under progress, and does not yet contain all or even most of CellProfiler's image processing capabilities.

rpm_license:
  The BSD 3-Clause License  Copyright © 2003 - 2021 Broad Institute, Inc. All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1.  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3.  Neither the name of the Broad Institute, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED “AS IS.”  BROAD MAKES NO EXPRESS OR IMPLIED REPRESENTATIONS OR WARRANTIES OF ANY KIND REGARDING THE SOFTWARE AND COPYRIGHT, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, CONFORMITY WITH ANY DOCUMENTATION, NON-INFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL BROAD, THE COPYRIGHT HOLDERS, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF, HAVE REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF SUCH DAMAGE.  If, by operation of law or otherwise, any of the aforementioned warranty disclaimers are determined inapplicable, your sole remedy, regardless of the form of action, including, but not limited to, negligence and strict liability, shall be replacement of the software with an updated version if one exists.  Development of CellProfiler has been funded in whole or in part with federal funds from the National Institutes of Health, the National Science Foundation, and the Human Frontier Science Program.


pkgId: ae2831441105e375364c6dcede57859cfd9be7e89670b43ee6fe8fd170908ff1
name: python-cellpy
arch: src
version: 1.0.1.post3
epoch: 0
release: 1
summary: Extract and manipulate data from battery data testers.
url: https://github.com/jepegit/cellpy
rpm_license: MIT license
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellpy-1.0.1.post3-1.src.rpm
checksum_type: sha256
description:
  <img src="https://raw.githubusercontent.com/jepegit/cellpy/master/docs/_static/cellpy-icon-long.svg" height="100" alt="cellpy-icon">




  [![cellpy](https://img.shields.io/pypi/v/cellpy.svg)](https://pypi.python.org/pypi/cellpy)
  [![cellpy](https://readthedocs.org/projects/cellpy/badge/?version=latest)](https://cellpy.readthedocs.io/en/latest/?badge=latest)
  [![cellpy](https://static.pepy.tech/badge/cellpy)](https://pepy.tech/project/cellpy)

  This Python Package was developed to help the
  researchers at IFE, Norway, in their cumbersome task of
  interpreting and handling data from cycling tests of



  * Convert testing data into a common format
  * Summarize and compare data
  * Filter out the steps of interest
  * Process and plot the data
  * Do simple and advanced analysis on single datasets as well as collections of datasets
  * And more!



  The documentation for ``cellpy`` is hosted on [Read the Docs](https://cellpy.readthedocs.io).



  The easiest way to install ``cellpy`` is to install with conda or pip.

  With conda:

  ```
  conda install -c conda-forge cellpy
  ```

  Or if you prefer installing using pip:

  ```
  python -m pip install cellpy
  ```

  Have a look at the documentation for more detailed installation procedures, especially
  with respect to "difficult" dependencies when installing with pip.



  ``cellpy`` is free software made available under the MIT License.



  If you use ``cellpy`` in your work, please cite our paper:

  > Wind J., Ulvestad A., Abdelhamid M., MÃ¦hlen J.P. (2024). Cellpy â€“ an open-source library for processing and analysis of battery testing data. _Journal of Open Source Software, 9(97), 6236_.

  [![DOI](https://joss.theoj.org/papers/10.21105/joss.06236/status.svg)](https://doi.org/10.21105/joss.06236)



  Contributions are welcome, and they are greatly appreciated! Every
  little bit helps, and credit will always be given. If you want to contribute,
  please have a look at [Contributing Guidelines](CONTRIBUTING.md).






  * Utils: `example_data` now includes auto-download of example data
  * General: supports only python 3.10 and up to 3.11
  * Batch: `naked` and `init(empty=True)` easier method for creating batch with empty pages
  * File handling: new fix in `find_files`
  * Batch / Utils: refactored and updated `Collectors` (using `plotly`)
  * Batch: new summary plotter (using `plotly`)
  * Batch: new convenience function for automatically creating batch from batch-file if file exists.
  * Batch: added `mark` and `drop` methods
  * CLI: added possibility to use custom jupyter executable
  * Added checks (`c.has_xxx`) for checking if data has been processed correctly / fix errors in raw/semi-processed data.
  * Added possibility to filter on C-rates (`c.get_cycles`)
  * Added experimental feature `c.total_time_at_voltage_level` for calculating total time at low/high voltage
  * Added experimental instrument reader for neware xlsx files (hopefully not used much because it is very slow)
  * Added try-except block for ica post-processing step and add if-clause (suggested by Vajee)
  * Fixed several smaller bugs and improved some of the functionality (most notably in `c.get_cap`)
  * Added CI for macOS
  * Added conda package including `sqlalchemy-access`
  * Improved plotting tools
  * Improved documentation
  * Improved feedback from the CLI



  * Unit handling: new unit handling (using pint)
  * Unit handling: renaming summary headers
  * Unit handling: new cellpy-file-format version
  * Unit handling: tool for converting old to new format
  * Unit handling: parsing input parameters for units
  * Templates: using one repository with sub-folders
  * Templates: adding more documentation
  * File handling: allow for external raw files (ssh)
  * Readers: neware.txt (one version/model)
  * Readers: `arbin_sql7` (experimental, @jtgibson91)
  * Batch plotting: collectors for both data collection, plotting and saving
  * OCV-rlx: improvements of the OCV-rlx tools
  * Internals: rename main classes (`CellpyData` -> `CellpyCell`, `Cell` -> `Data`)
  * Internals: rename `.cell` property to `.data`
  * Internals: allow for only one `Data` object pr `CellpyCell` object
  * CLI: general improvements and bug fixes
  * CLI: move editing of db-file to the edit sub-command




  * Neware txt loader (supports one specific format only, other formats will have to wait for v.1.0)



  * Changed definition of Coulombic Difference (negative of previous)
  * Updated loaders with hooks and additional base class `TxtLoader` with configuration mechanism
  * Support for Maccor txt files
  * Supports only python 3.8 and up
  * Optional parameters through batch and pages
  * Several bug fixes and minor improvements / adjustments
  * Restrict use of instrument label to only one option
  * Fix bug in example file (@kevinsmia1939)



  * Updated documentations
  * CLI improvements
  * New argument for get_cap: `max_cycle`
  * Reverting from using Documents to user home for location of prm file in windows.
  * Easyplot by Amund
  * Arbin sql reader by Muhammad



  * Reading arbin .res files with auxiliary data should now work.
  * Many bugs have been removed - many new introduced.
  * Now on conda-forge (can be installed using conda).



  * Reading PEC files now updated and should work



  * New column names (lowercase and underscore)
  * New batch concatenating and plotting routines



  * Switching from git-flow to github-flow
  * New cli options for running batches
  * cli option for creating template notebooks
  * Using `ruamel.yaml` instead of `pyyaml`
  * Using `python-box` > 4
  * Several bug-fixes



  * Starting fixing documentation
  * TODO: create conda package
  * TODO: extensive tests



  * Refactoring - renaming from `dfsummary` to `summary`
  * Refactoring - renaming from `step_table` to `steps`
  * Refactoring - renaming from `dfdata` to `raw`
  * Refactoring - renaming `cellpy.data` to `cellpy.get`
  * Updated save and load cellpy files allowing for new naming
  * Implemented cellpy new and cellpy serve cli functionality



  * New batch-feature
  * Improved make-steps and make-summary functionality
  * Improved cmd-line interface for setup
  * More helper functions and tools
  * Experimental support for other instruments
  * invoke tasks for developers



  * Allow for using mdbtools also on win
  * Slightly faster find_files using cache and `fnmatch`
  * Bug fix: error in sorting files when using `pathlib` fixed



  * Improved creation of step tables (much faster)
  * Default compression on cellpy (hdf5) files
  * Bug fixes



  * Parameters can be set by dot-notation (`python-box`).
  * The parameter Instruments.cell_configuration is removed.
  * Options for getting voltage curves in different formats.
  * Fixed python 3.6 issues with Read the Docs.
  * Can now also be used on posix (the user must install `mdb_tools` first).
  * Improved logging allowing for custom log-directory.



  * No legacy python.



  * First release on PyPI.


pkgId: b5fd036fb56ac483184a90c19ca2cb3899150eccd03be4f8ba284d66e51d53d1
name: python-cellrank
arch: src
version: 2.0.6
epoch: 0
release: 1
summary: CellRank: dynamics from multi-view single-cell data
url: https://github.com/theislab/cellrank
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellrank-2.0.6-1.src.rpm
checksum_type: sha256
description:
  **CellRank** is a modular framework to study cellular dynamics based on Markov state modeling of
  multi-view single-cell data. See our `documentation`_, and the `CellRank 1`_ and `CellRank 2 manuscript`_ to learn more.
  See `here <https://github.com/theislab/cellrank/blob/main/docs/about/cite.rst>`_ for how to properly cite our work.
  CellRank scales to large cell numbers, is fully compatible with the `scverse`_ ecosystem, and easy to use.
  In the backend, it is powered by `pyGPCCA`_ (`Reuter et al. (2018)`_). Feel
  free to open an `issue`_ or send us an `email`_ if you encounter a bug, need our help or just
  want to make a comment/suggestion.

rpm_license:
  BSD 3-Clause License  Copyright (c) 2019, Theis Lab All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


pkgId: 82f75c609eb83064926f9786a7099b872b585e2d1750dee7e8be7eb5a3fa5b76
name: python-cellseg_models_pytorch
arch: src
version: 0.1.25
epoch: 0
release: 1
summary: Python library for 2D cell/nuclei instance segmentation models written with PyTorch.
url: https://github.com/okunator/cellseg_models.pytorch
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellseg_models_pytorch-0.1.25-1.src.rpm
checksum_type: sha256
description:
  <div align="center">

  ![Logo](./images/logo.png)

  **Python library for 2D cell/nuclei instance segmentation models written with [PyTorch](https://pytorch.org/).**

  [![Generic badge](https://img.shields.io/badge/License-MIT-<COLOR>.svg?style=for-the-badge)](https://github.com/okunator/cellseg_models.pytorch/blob/master/LICENSE)
  [![PyTorch - Version](https://img.shields.io/badge/PYTORCH-2+-red?style=for-the-badge&logo=pytorch)](https://pytorch.org/)
  [![Python - Version](https://img.shields.io/badge/PYTHON-3.10+-red?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
  <br>
  [![Github Test](https://img.shields.io/github/actions/workflow/status/okunator/cellseg_models.pytorch/tests.yml?label=Tests&logo=github&&style=for-the-badge)](https://github.com/okunator/cellseg_models.pytorch/actions/workflows/tests.yml)
  [![Pypi](https://img.shields.io/pypi/v/cellseg-models-pytorch?color=blue&logo=pypi&style=for-the-badge)](https://pypi.org/project/cellseg-models-pytorch/)
  [![Codecov](https://img.shields.io/codecov/c/github/okunator/cellseg_models.pytorch?logo=codecov&style=for-the-badge&token=oGSj7FZ1lm)](https://codecov.io/gh/okunator/cellseg_models.pytorch)
  <br>
  [![DOI](https://zenodo.org/badge/450787123.svg)](https://zenodo.org/badge/latestdoi/450787123)

  </div>

  <div align="center">

  </div>



  **cellseg-models.pytorch** is a library built upon [PyTorch](https://pytorch.org/) that contains multi-task encoder-decoder architectures along with dedicated post-processing methods for segmenting cell/nuclei instances. As the name might suggest, this library is heavily inspired by [segmentation_models.pytorch](https://github.com/qubvel/segmentation_models.pytorch) library for semantic segmentation.


  - Now you can use any pre-trained image encoder from the [timm](https://github.com/huggingface/pytorch-image-models) library as the model backbone. (Given that they implement the `forward_intermediates` method, most of them do).
  - New example notebooks showing how to finetune **Cellpose** and **Stardist** with the new *state-of-the-art* foundation model backbones: [*UNI*](https://www.nature.com/articles/s41591-024-02857-3#Sec13) from the [MahmoodLab](https://faisal.ai/), and [Prov-GigaPath](https://www.nature.com/articles/s41586-024-07441-w) from Microsoft Research. Check out the notebooks [here (UNI)](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_cellpose_UNI.ipynb), and [here (Prov-GigaPath)](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_stardist_provgigapath.ipynb).
  - **NOTE!**: **These foundation models are licensed under restrictive licences and you need to agree to the terms of any of the said models to get access to the weights. Once you have been granted access, you can run the above notebooks**. You can request for access here: [the model pages UNI](https://huggingface.co/MahmoodLab/UNI) and [model pages Prov-GigaPath](https://huggingface.co/prov-gigapath/prov-gigapath). These models may only be used for non-commercial, academic research purposes with proper attribution. **Be sure that you have read and understood the terms before requesting access**.



  - High level API to define cell/nuclei instance segmentation models.
  - 6 cell/nuclei instance segmentation model architectures and more to come.
  - Open source datasets for training and benchmarking.
  - Flexibility to modify the components of the model architectures.
  - Sliding window inference for large images.
  - Multi-GPU inference.
  - All model architectures can be augmented to [panoptic segmentation](https://arxiv.org/abs/1801.00868).
  - Popular training losses and benchmarking metrics.
  - Benchmarking utilities both for model latency & segmentation performance.
  - Regularization techniques to tackle batch effects/domain shifts such as [Strong Augment](https://arxiv.org/abs/2206.15274), [Spectral decoupling](https://arxiv.org/abs/2011.09468), [Label smoothing](https://arxiv.org/abs/1512.00567).
  - Example notebooks to train models with [lightning](https://lightning.ai/docs/pytorch/latest/) or [accelerate](https://huggingface.co/docs/accelerate/index).
  - Example notebooks to finetune models with foundation model backbones such as UNI, Prov-GigaPath, and DINOv2.





  ```shell
  pip install cellseg-models-pytorch
  ```



  | Model                      | Paper                                                                          |
  | -------------------------- | ------------------------------------------------------------------------------ |
  | [[1](#Citation)] HoVer-Net | https://www.sciencedirect.com/science/article/pii/S1361841519301045?via%3Dihub |
  | [[2](#Citation)] Cellpose  | https://www.nature.com/articles/s41592-020-01018-x                             |
  | [[3](#Citation)] Omnipose  | https://www.biorxiv.org/content/10.1101/2021.11.03.467199v2                    |
  | [[4](#Citation)] Stardist  | https://arxiv.org/abs/1806.03535                                               |
  | [[5](#Citation)] CellVit-SAM  | https://arxiv.org/abs/2306.15350.03535                                               |
  | [[6](#Citation)] CPP-Net  | https://arxiv.org/abs/2102.0686703535                                               |



  | Dataset                       | Paper                                                                                            |
  | ----------------------------- | ------------------------------------------------------------------------------------------------ |
  | [[7, 8](#References)] Pannuke | https://arxiv.org/abs/2003.10778 , https://link.springer.com/chapter/10.1007/978-3-030-23937-4_2 |



  <details>
  <summary style="margin-left: 25px;">Finetuning CellPose with UNI backbone</summary>
  <div style="margin-left: 25px;">

  - [Finetuning CellPose with UNI](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_cellpose_UNI.ipynb). Here we finetune the CellPose multi-class nuclei segmentation model with the foundation model `UNI`-image-encoder backbone (checkout [UNI](https://www.nature.com/articles/s41591-024-02857-3#Sec13)). The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained (with checkpointing) by utilizing [accelerate](https://huggingface.co/docs/accelerate/index) by hugginface. **NOTE** that you need to have granted access to the UNI weights and agreed to the terms of the model to be able to run the notebook.

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;">Finetuning Stardist with Prov-GigaPath backbone</summary>
  <div style="margin-left: 25px;">

  - [Finetuning Stardist with Prov-GigaPath](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_stardist_provgigapath.ipynb). Here we finetune the Stardist multi-class nuclei segmentation model with the foundation model `Prov-GigaPath`-image-encoder backbone (checkout [Prov-GigaPath](https://www.nature.com/articles/s41586-024-07441-w)). The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained (with checkpointing) by utilizing [accelerate](https://huggingface.co/docs/accelerate/index) by hugginface. **NOTE** that you need to have granted access to the Prov-GigaPath weights and agreed to the terms of the model to be able to run the notebook.

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;">Finetuning CellPose with DINOv2 backbone</summary>
  <div style="margin-left: 25px;">

  - [Finetuning CellPose with DINOv2 backbone for Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_cellpose_dinov2.ipynb). Here we finetune the CellPose multi-class nuclei segmentation model with a `LVD-142M` pretrained `DINOv2` backbone. The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained (with checkpointing) by utilizing [lightning](https://lightning.ai/docs/pytorch/latest/).

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;">Finetuning CellVit-SAM with Pannuke</summary>
  <div style="margin-left: 25px;">

  - [Finetuning CellVit-SAM with Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_cellvit.ipynb). Here we finetune the CellVit-SAM multi-class nuclei segmentation model with a `SA-1B` pretrained `SAM`-image-encoder backbone (checkout [SAM](https://github.com/facebookresearch/segment-anything)). The encoder is transformer based `VitDet`-model. The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained (with checkpointing) by utilizing [accelerate](https://huggingface.co/docs/accelerate/index) by hugginface.

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;"> Training Hover-Net with Pannuke</summary>
  <div style="margin-left: 25px;">

  - [Training Hover-Net with Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_hovernet.ipynb). Here we train the `Hover-Net` nuclei segmentation model with an `imagenet` pretrained `resnet50` backbone from the `timm` library. The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained by utilizing [lightning](https://lightning.ai/docs/pytorch/latest/).

  </div>
  </details>




  <details>
  <summary style="margin-left: 25px;">Training Stardist with Pannuke</summary>
  <div style="margin-left: 25px;">

  - [Training Stardist with Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_stardist.ipynb). Here we train the `Stardist` multi-class nuclei segmentation model with an `imagenet` pretrained `efficientnetv2_s` backbone from the `timm` library. The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained by utilizing [lightning](https://lightning.ai/docs/pytorch/latest/).

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;">Training CellPose with Pannuke</summary>
  <div style="margin-left: 25px;">

  - [Training CellPose with Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_cellpose.ipynb). Here we train the `CellPose` multi-class nuclei segmentation model with an `imagenet` pretrained `convnext_small` backbone from the `timm` library. The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained (with checkpointing) by utilizing [accelerate](https://huggingface.co/docs/accelerate/index) by hugginface.

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;">Training OmniPose with Pannuke</summary>
  <div style="margin-left: 25px;">

  - [Training OmniPose with Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_omnipose.ipynb). Here we train the OmniPose multi-class nuclei segmentation model with an `imagenet` pretrained `focalnet_small_lrf` backbone from the `timm` library. The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained (with checkpointing) by utilizing [accelerate](https://huggingface.co/docs/accelerate/index) by hugginface.

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;">Training CPP-Net with Pannuke</summary>
  <div style="margin-left: 25px;">

  - [Training CPP-Net with Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_nuclei_segmentation_cppnet.ipynb). Here we train the CPP-Net multi-class nuclei segmentation model with an `imagenet` pretrained `efficientnetv2_s` backbone from the `timm` library. The Pannuke dataset (fold 1 & fold 2) are used for training data and the fold 3 is used as validation data. The model is trained by utilizing [lightning](https://lightning.ai/docs/pytorch/latest/).

  </div>
  </details>

  <details>
  <summary style="margin-left: 25px;">Benchmarking Cellpose Trained on Pannuke</summary>
  <div style="margin-left: 25px;">

  - [Benchmarking Cellpose Trained on Pannuke](https://github.com/okunator/cellseg_models.pytorch/blob/main/examples/pannuke_cellpose_benchmark.ipynb). Here we run benchmarking for `Cellpose` that was trained on Pannuke. Both the model performance and latency benchmarking are covered.

  </div>
  </details>



  **Define Cellpose for cell segmentation.**

  ```python
  import cellseg_models_pytorch as csmp
  import torch

  model = csmp.models.cellpose_base(type_classes=5)
  x = torch.rand([1, 3, 256, 256])


  y = model(x) # {"cellpose": [1, 2, 256, 256], "type": [1, 5, 256, 256]}
  ```

  **Define Cellpose for cell and tissue area segmentation (Panoptic segmentation).**

  ```python
  import cellseg_models_pytorch as csmp
  import torch

  model = csmp.models.cellpose_plus(type_classes=5, sem_classes=3)
  x = torch.rand([1, 3, 256, 256])


  y = model(x) # {"cellpose": [1, 2, 256, 256], "type": [1, 5, 256, 256], "sem": [1, 3, 256, 256]}
  ```

  **Define panoptic Cellpose model with more flexibility.**

  ```python
  import cellseg_models_pytorch as csmp


  decoders = ("cellpose", "sem")


  heads = {
      "cellpose": {"cellpose": 2, "type": 5},
      "sem": {"sem": 3}
  }

  model = csmp.CellPoseUnet(
      decoders=decoders,                   # cellpose and semantic decoders
      heads=heads,                         # three output heads
      depth=5,                             # encoder depth
      out_channels=(256, 128, 64, 32, 16), # num out channels at each decoder stage
      layer_depths=(4, 4, 4, 4, 4),        # num of conv blocks at each decoder layer
      style_channels=256,                  # num of style vector channels
      enc_name="resnet50",                 # timm encoder
      enc_pretrain=True,                   # imagenet pretrained encoder
      long_skip="unetpp",                  # unet++ long skips ("unet", "unetpp", "unet3p")
      merge_policy="sum",                  # concatenate long skips ("cat", "sum")
      short_skip="residual",               # residual short skips ("basic", "residual", "dense")
      normalization="bcn",                 # batch-channel-normalization.
      activation="gelu",                   # gelu activation.
      convolution="wsconv",                # weight standardized conv.
      attention="se",                      # squeeze-and-excitation attention.
      pre_activate=False,                  # normalize and activation after convolution.
  )

  x = torch.rand([1, 3, 256, 256])


  y = model(x) # {"cellpose": [1, 2, 256, 256], "type": [1, 5, 256, 256], "sem": [1, 3, 256, 256]}
  ```

  **Run HoVer-Net inference and post-processing with a sliding window approach.**

  ```python
  import cellseg_models_pytorch as csmp


  model = csmp.models.hovernet_base(type_classes=5)


  out_activations = {"hovernet": "tanh", "type": "softmax", "inst": "softmax"}





  out_boundary_weights = {"hovernet": True, "type": False, "inst": False}


  inferer = csmp.inference.SlidingWindowInferer(
      model=model,
      input_folder="/path/to/images/",
      checkpoint_path="/path/to/model/weights/",
      out_activations=out_activations,
      out_boundary_weights=out_boundary_weights,
      instance_postproc="hovernet",               # THE POST-PROCESSING METHOD
      normalization="percentile",                 # same normalization as in training
      patch_size=(256, 256),
      stride=128,
      padding=80,
      batch_size=8,
  )

  inferer.infer()

  inferer.out_masks

  ```



  Generally, the model building API enables the effortless creation of hard-parameter sharing multi-task encoder-decoder CNN architectures. The general architectural schema is illustrated in the below image.

  <br><br>
  ![Architecture](./images/architecture_overview.png)



  The class API enables the most flexibility in defining different model architectures. It borrows a lot from [segmentation_models.pytorch](https://github.com/qubvel/segmentation_models.pytorch) models API.

  **Model classes**:

  - `csmp.CellPoseUnet`
  - `csmp.StarDistUnet`
  - `csmp.HoverNet`
  - `csmp.CellVitSAM`

  **All of the models contain**:

  - `model.encoder` - pretrained [timm](https://github.com/rwightman/pytorch-image-models) backbone for feature extraction.
  - `model.{decoder_name}_decoder` - Models can have multiple decoders with unique names.
  - `model.{head_name}_seg_head` - Model decoders can have multiple segmentation heads with unique names.
  - `model.forward(x)` - forward pass.
  - `model.forward_features(x)` - forward pass of the encoder and decoders. Returns enc and dec features

  **Defining your own multi-task architecture**

  For example, to define a multi-task architecture that has `resnet50` encoder, four decoders, and 5 output heads with `CellPoseUnet` architectural components, we could do this:

  ```python
  import cellseg_models_pytorch as csmp
  import torch

  model = csmp.CellPoseUnet(
      decoders=("cellpose", "dist", "contour", "sem"),
      heads={
          "cellpose": {"type": 5, "cellpose": 2},
          "dist": {"dist": 1},
          "contour": {"contour": 1},
          "sem": {"sem": 4}
      },
  )

  x = torch.rand([1, 3, 256, 256])
  model(x)







  ```



  With the function API, you can build models with low effort by calling the below listed functions. Under the hood, the function API simply calls the above classes with pre-defined decoder and head names. The training and post-processing tools of this library are built around these names, thus, it is recommended to use the function API, although, it is a bit more rigid than the class API. Basically, the function API only lacks the ability to define the output-tasks of the model, but allows for all the rest as the class API.

  | Model functions                        | Output names                              | Task                             |
  | -------------------------------------- | ----------------------------------------- | -------------------------------- |
  | `csmp.models.cellpose_base`            | `"type"`, `"cellpose"`,                   | **instance segmentation**        |
  | `csmp.models.cellpose_plus`            | `"type"`, `"cellpose"`, `"sem"`,          | **panoptic segmentation**        |
  | `csmp.models.omnipose_base`            | `"type"`, `"omnipose"`                    | **instance segmentation**        |
  | `csmp.models.omnipose_plus`            | `"type"`, `"omnipose"`, `"sem"`,          | **panoptic segmentation**        |
  | `csmp.models.hovernet_base`            | `"type"`, `"inst"`, `"hovernet"`          | **instance segmentation**        |
  | `csmp.models.hovernet_plus`            | `"type"`, `"inst"`, `"hovernet"`, `"sem"` | **panoptic segmentation**        |
  | `csmp.models.hovernet_small`           | `"type"`,`"hovernet"`                     | **instance segmentation**        |
  | `csmp.models.hovernet_small_plus`      | `"type"`, `"hovernet"`, `"sem"`           | **panoptic segmentation**        |
  | `csmp.models.stardist_base`            | `"stardist"`, `"dist"`                    | **binary instance segmentation** |
  | `csmp.models.stardist_base_multiclass` | `"stardist"`, `"dist"`, `"type"`          | **instance segmentation**        |
  | `csmp.models.stardist_plus`            | `"stardist"`, `"dist"`, `"type"`, `"sem"` | **panoptic segmentation**        |
  | `csmp.models.cppnet_base`              | `"stardist_refined"`, `"dist"`                    | **binary instance segmentation** |
  | `csmp.models.cppnet_base_multiclass`   | `"stardist_refined"`, `"dist"`, `"type"`          | **instance segmentation**        |
  | `csmp.models.cppnet_plus`              | `"stardist_refined"`, `"dist"`, `"type"`, `"sem"` | **panoptic segmentation**        |
  | `csmp.models.cellvit_sam_base`         | `"type"`, `"inst"`, `"hovernet"`          | **instance segmentation**        |
  | `csmp.models.cellvit_sam_plus`         | `"type"`, `"inst"`, `"hovernet"`, `"sem"` | **panoptic segmentation**        |
  | `csmp.models.cellvit_sam_small`        | `"type"`,`"hovernet"`                     | **instance segmentation**        |
  | `csmp.models.cellvit_sam_small_plus`   | `"type"`, `"hovernet"`, `"sem"`           | **panoptic segmentation**        |



  - [1] S. Graham, Q. D. Vu, S. E. A. Raza, A. Azam, Y-W. Tsang, J. T. Kwak and N. Rajpoot. "HoVer-Net: Simultaneous Segmentation and Classification of Nuclei in Multi-Tissue Histology Images." Medical Image Analysis, Sept. 2019.
  - [2] Stringer, C.; Wang, T.; Michaelos, M. & Pachitariu, M. Cellpose: a generalist algorithm for cellular segmentation Nature Methods, 2021, 18, 100-106
  - [3] Cutler, K. J., Stringer, C., Wiggins, P. A., & Mougous, J. D. (2022). Omnipose: a high-precision morphology-independent solution for bacterial cell segmentation. bioRxiv. doi:10.1101/2021.11.03.467199
  - [4] Uwe Schmidt, Martin Weigert, Coleman Broaddus, & Gene Myers (2018). Cell Detection with Star-Convex Polygons. In Medical Image Computing and Computer Assisted Intervention - MICCAI 2018 - 21st International Conference, Granada, Spain, September 16-20, 2018, Proceedings, Part II (pp. 265–273).
  - [5] Hörst, F., Rempe, M., Heine, L., Seibold, C., Keyl, J., Baldini, G., Ugurel, S., Siveke, J., Grünwald, B., Egger, J., & Kleesiek, J. (2023). CellViT: Vision Transformers for Precise Cell Segmentation and Classification (Version 1). arXiv. https://doi.org/10.48550/ARXIV.2306.15350.
  - [6] Chen, S., Ding, C., Liu, M., Cheng, J., & Tao, D. (2023). CPP-Net: Context-Aware Polygon Proposal Network for Nucleus Segmentation. In IEEE Transactions on Image Processing (Vol. 32, pp. 980–994). Institute of Electrical and Electronics Engineers (IEEE). https://doi.org/10.1109/tip.2023.3237013
  - [7] Gamper, J., Koohbanani, N., Benet, K., Khuram, A., & Rajpoot, N. (2019) PanNuke: an open pan-cancer histology dataset for nuclei instance segmentation and classification. In European Congress on Digital Pathology (pp. 11-19).
  - [8] Gamper, J., Koohbanani, N., Graham, S., Jahanifar, M., Khurram, S., Azam, A.,Hewitt, K., & Rajpoot, N. (2020). PanNuke Dataset Extension, Insights and Baselines. arXiv preprint arXiv:2003.10778.
  - [9] Graham, S., Jahanifar, M., Azam, A., Nimir, M., Tsang, Y.W., Dodd, K., Hero, E., Sahota, H., Tank, A., Benes, K., & others (2021). Lizard: A Large-Scale Dataset for Colonic Nuclear Instance Segmentation and Classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision (pp. 684-693).



  ```bibtex
  @misc{csmp2022,
      title={{cellseg_models.pytorch}: Cell/Nuclei Segmentation Models and Benchmark.},
      author={Oskari Lehtonen},
      howpublished = {\url{https://github.com/okunator/cellseg_models.pytorch}},
      doi = {10.5281/zenodo.7064617}
      year={2022}
  }
  ```



  This project is distributed under [MIT License](https://github.com/okunator/cellseg_models.pytorch/blob/main/LICENSE)

  The project contains code from the original cell segmentation and 3rd-party libraries that have permissive licenses:

  - [timm](https://github.com/rwightman/pytorch-image-models) (Apache-2)
  - [HoVer-Net](https://github.com/vqdang/hover_net) (MIT)
  - [Cellpose](https://github.com/MouseLand/cellpose) (BSD-3)
  - [Stardist](https://github.com/stardist/stardist) (BSD-3)

  If you find this library useful in your project, it is your responsibility to ensure you comply with the conditions of any dependent licenses. Please create an issue if you think something is missing regarding the licenses.


pkgId: e5b8df24b0d7aa7e830fc1792d1365aaa012608339cb60660d061f014df00748
name: python-cellshape
arch: src
version: 0.0.31
epoch: 0
release: 1
summary: 3D shape analysis using deep learning
url: https://pypi.org/project/cellshape/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellshape-0.0.31-1.src.rpm
checksum_type: sha256
description:
  [![Project Status: Active – The project has reached a stable, usable
  state and is being actively
  developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
  [![Python Version](https://img.shields.io/pypi/pyversions/cellshape.svg)](https://pypi.org/project/cellshape)
  [![PyPI](https://img.shields.io/pypi/v/cellshape.svg)](https://pypi.org/project/cellshape)
  [![Downloads](https://pepy.tech/badge/cellshape)](https://pepy.tech/project/cellshape)
  [![Wheel](https://img.shields.io/pypi/wheel/cellshape.svg)](https://pypi.org/project/cellshape)
  [![Development Status](https://img.shields.io/pypi/status/cellshape.svg)](https://github.com/Sentinal4D/cellshape)
  [![Tests](https://img.shields.io/github/workflow/status/Sentinal4D/cellshape/tests)](
      https://github.com/Sentinal4D/cellshape/actions)
  [![Coverage Status](https://coveralls.io/repos/github/Sentinal4D/cellshape/badge.svg?branch=main)](https://coveralls.io/github/Sentinal4D/cellshape?branch=main)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

  <img src="https://github.com/Sentinal4D/cellshape/blob/main/img/cellshape.png"
       alt="Cellshape logo by Matt De Vries">




  This is a Python package for 3D cell shape features and classes using deep learning. Please refer to our preprint [here](https://www.biorxiv.org/content/10.1101/2022.06.17.496550v1).

  cellshape is the main package which imports from sub-packages:
  - [cellshape-helper](https://github.com/Sentinal4D/cellshape-helper): Facilitates point cloud generation from 3D binary masks.
  - [cellshape-cloud](https://github.com/Sentinal4D/cellshape-cloud): Implementations of graph-based autoencoders for shape representation learning on point cloud input data.
  - [cellshape-voxel](https://github.com/Sentinal4D/cellshape-voxel): Implementations of 3D convolutional autoencoders for shape representation learning on voxel input data.
  - [cellshape-cluster](https://github.com/Sentinal4D/cellshape-cluster): Implementation of deep embedded clustering to add to autoencoder models.



  The software requires Python 3.7 or greater. The following are package dependencies that are installed automatically when cellshape is installed: [`PyTorch`](https://pytorch.org/), [`pyntcloud`](https://github.com/daavoo/pyntcloud), [`numpy`](https://numpy.org/), [`scikit-learn`](https://scikit-learn.org/stable/), `tensorboard`, [`tqdm`](https://github.com/tqdm/tqdm) (The full list is shown in the [setup.py](https://github.com/Sentinal4D/cellshape/blob/main/setup.py) file). This repo makes extensive use of [`cellshape-cloud`](https://github.com/Sentinal4D/cellshape-cloud), [`cellshape-cluster`](https://github.com/Sentinal4D/cellshape-cluster), [`cellshape-helper`](https://github.com/Sentinal4D/cellshape-helper), and [`cellshape-voxel`](https://github.com/Sentinal4D/cellshape-voxel). To reproduce our results in our paper, only [`cellshape-cloud`](https://github.com/Sentinal4D/cellshape-cloud), [`cellshape-cluster`](https://github.com/Sentinal4D/cellshape-cluster) are needed.


  1. We recommend creating a new conda environment. In the terminal, run:
  ```bash
  conda create --name cellshape-env python=3.8 -y
  conda activate cellshape-env
  pip install --upgrade pip
  ```
  2. Install cellshape from pip. In the same terminal, run:
  ```bash
  pip install cellshape
  ```
  This should take ~5mins or less.


  We have tested this software on an Ubuntu 20.04LTS and 18.04LTS with 128Gb RAM and NVIDIA Quadro RTX 6000 GPU.




  Datasets to reproduce our results in our paper are available [here](https://sandbox.zenodo.org/record/1080300#.YsX7f3XMIaz).
  - SamplePointCloudData.zip contains a sample dataset of a point cloud of cells in order to test our code.
  - FullData.zip contains 3 plates of point cloud representations of cells for several treatments. This data can be used to reproduce our results.
  - Output.zip contains trained model weights and deep learning cell geometric features extracted using these trained models.
  - BinaryCellMasks.zip contains a sample set of binary masks of cells which can be used as input to [`cellshape-helper`](https://github.com/Sentinal4D/cellshape-helper) to test our point cloud generation code.


  We suggest testing our code on the data contained in `SamplePointCloudData.zip`. This data is structured in the following way:

  ```
  cellshapeSamplePointCloudDatset/
      small_data.csv
      Plate1/
          stacked_pointcloud/
              Binimetinib/
                  0010_0120_accelerator_20210315_bakal01_erk_main_21-03-15_12-37-27.ply
                  ...
              Blebbistatin/
              ...
      Plate2/
          stacked_pointcloud/
      Plate3/
          stacked_pointcloud/
  ```
  This data structure is only necessary if wanting to use our data. If you would like to use your own dataset, you may structure it in any way as long as the extension of the point clouds are `.ply`. If using your own data structure, please define the parameter `--dataset_type` as `"Other"`.



  The following steps assume that one already has point cloud representations of cells or nuclei. If you need to generate point clouds from 3D binary masks, please go to [`cellshape-helper`](https://github.com/Sentinal4D/cellshape-helper).


  We suggest testing our code on the data contained in `SamplePointCloudData.zip`. Please download the data and unzip the contents into a directory of your choice. We recommend doing this in your `~Documents/` folder. This is used as parameters in the steps below, so please remember where you download the data to. Downloading and unzipping the data can be done in the terminal. You might need to first install `wget` and `unzip` with `apt-get` (e.g. `apt-get install wget`).
  1. Download the data into the `~/Documents/` folder with wget
  ```bash
  cd ~/Documents
  wget https://sandbox.zenodo.org/record/1080300/files/SamplePointCloudDataset.zip
  ```
  2. Unzip the data with unzip:
  ```bash
  unzip SamplePointCloudDataset.zip
  ```

  This will create a directory called `cellshapeSamplePointCloudDatset` under your `~Documents/` folder, i.e. `/home/USER/Documents/cellshapeSamplePointCloudDatset/` (`USER` will be different for you).


  The training procedure follows two steps:
  1. Training the dynamic graph convolutional foldingnet (DFN) autoencoder to automatically learn shape features.
  2. Adding the clustering layer to refine shape features and learn shape classes simultaneously.

  Inference can be done after each step.

  Our training functions are run through a command line interface with the command ```cellshape-train```.
  For help on all command line options, run the following in the terminal:
  ```bash
  cellshape-train -h
  ```

  The first step trains the autoencoder without the additional clustering layer. Run the following in the terminal. Remember to change the `--cloud_dataset_path`, `--dataframe_path`, and `--output_dir` parmaeters to be specific to your directories, if you have saved the data somewhere else. To test the code, we train for 5 epochs. First make sure you're in the directory where you downloaded the data to. If this is your `~/Documents/ folder, go into this:
  ```bash
  cd ~/Documents
  ```
  Then run the following:

  ```bash
  cellshape-train \
  --model_type "cloud" \
  --pretrain "True" \
  --train_type "pretrain" \
  --cloud_dataset_path "./cellshapeSamplePointCloudDataset/" \
  --dataset_type "SingleCell" \
  --dataframe_path "./cellshapeSamplePointCloudDataset/small_data.csv" \
  --output_dir "./cellshapeOutput/" \
  --num_epochs_autoencoder 5 \
  --encoder_type "dgcnn" \
  --decoder_type "foldingnetbasic" \
  --num_features 128 \
  ```

  This step will create an output directory `/home/USER/Documents/cellshapeOutput/` with the subfolders: `nets`, `reports`, and `runs` which contain the model weights, logged outputs, and tensorboard runs, respectively, for each experiment. Each experiment is named with the following convention `{encoder_type}_{decoder_type}_{num_features}_{train_type}_{xxx}`, where {xxx} is a counter. For example, if this was the first experiment you have run, the trained model weights will be saved to: `/home/USER/Documents/cellshapeOutput/nets/dgcnn_foldingnetbasic_128_pretrained_001.pt`. This path will be used in the next step for the `--pretrained-path` parameter.



  The next step is to add the clustering layer to refine the model weights. As before, run the following in the terminal. Remember to change the `--cloud_dataset_path`, `--dataframe_path`, `--output_dir`, and `--pretrained-path` parmaeters to be specific to your directories. If you have followed the previous steps, then you will still be in the `~Documents/` path. In the same terminal, run:

  ```bash
  cellshape-train \
  --model_type "cloud" \
  --train_type "DEC" \
  --pretrain False \
  --cloud_dataset_path "./cellshapeSamplePointCloudDataset/" \
  --dataset_type "SingleCell" \
  --dataframe_path "./cellshapeSamplePointCloudDataset/small_data.csv" \
  --output_dir "./cellshapeOutput/" \
  --num_features 128 \
  --num_clusters 5 \
  --pretrained_path "./cellshapeOutput/nets/dgcnn_foldingnetbasic_128_pretrained_001.pt" \
  ```

  To monitor the training using [Tensorboard](https://pytorch.org/docs/stable/tensorboard.html), in a new terminal run:
  ```bash
  pip install tensorboard
  cd ~/Documents
  tensorboard --logdir "./cellshapeOutput/runs/"
  ```


  This would be to state that you would like to `pretrain` and that you want to train `DEC`.
  ```bash
  cellshape-train \
  --model_type "cloud" \
  --train_type "DEC" \
  --pretrain True \
  --cloud_dataset_path "./cellshapeSamplePointCloudDataset/" \
  --dataset_type "SingleCell" \
  --dataframe_path "./cellshapeSamplePointCloudDataset/small_data.csv" \
  --output_dir "./cellshapeOutput/" \
  --num_features 128 \
  --num_clusters 5 \
  ```



  Example inference notebooks can be found in the `docs/notebooks/` folder.


  If you have any problems, please raise an issue [here](https://github.com/Sentinal4D/cellshape/issues)


  ```bibtex
  @article{DeVries2022single,
  	author = {Matt De Vries and Lucas Dent and Nathan Curry and Leo Rowe-Brown and Vicky Bousgouni and Adam Tyson and Christopher Dunsby and Chris Bakal},
  	title = {3D single-cell shape analysis using geometric deep learning},
  	elocation-id = {2022.06.17.496550},
  	year = {2023},
  	doi = {10.1101/2022.06.17.496550},
  	publisher = {Cold Spring Harbor Laboratory},
  	URL = {https://www.biorxiv.org/content/early/2023/03/27/2022.06.17.496550},
  	eprint = {https://www.biorxiv.org/content/early/2023/03/27/2022.06.17.496550.full.pdf},
  	journal = {bioRxiv}
  }
  ```


  [1] An Tao, 'Unsupervised Point Cloud Reconstruction for Classific Feature Learning', [GitHub Repo](https://github.com/AnTao97/UnsupervisedPointCloudReconstruction), 2020


pkgId: b3812572395692855e32afeb89afd92813a297eb2710b1767ebc56c22706a7e1
name: python-cellshape-cluster
arch: src
version: 0.0.20
epoch: 0
release: 1
summary: 3D shape analysis using deep learning
url: https://pypi.org/project/cellshape-cluster/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellshape-cluster-0.0.20-1.src.rpm
checksum_type: sha256
description:
  [![Project Status: Active – The project has reached a stable, usable
  state and is being actively
  developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
  [![Python Version](https://img.shields.io/pypi/pyversions/cellshape-cluster.svg)](https://pypi.org/project/cellshape-cluster)
  [![PyPI](https://img.shields.io/pypi/v/cellshape-cluster.svg)](https://pypi.org/project/cellshape-cluster)
  [![Downloads](https://pepy.tech/badge/cellshape-cluster)](https://pepy.tech/project/cellshape-cluster)
  [![Wheel](https://img.shields.io/pypi/wheel/cellshape-cluster.svg)](https://pypi.org/project/cellshape-cluster)
  [![Development Status](https://img.shields.io/pypi/status/cellshape-cluster.svg)](https://github.com/Sentinal4D/cellshape-cluster)
  [![Tests](https://img.shields.io/github/workflow/status/Sentinal4D/cellshape-cluster/tests)](
      https://github.com/Sentinal4D/cellshape-cluster/actions)
  [![Coverage Status](https://coveralls.io/repos/github/Sentinal4D/cellshape-cluster/badge.svg?branch=master)](https://coveralls.io/github/Sentinal4D/cellshape-cluster?branch=master)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

  <img src="https://github.com/Sentinal4D/cellshape-cluster/blob/main/img/cellshape_cluster_logo.png"
       alt="Cellshape logo by Matt De Vries">
  ___
  Cellshape-cluster is an easy-to-use tool to analyse the cluster cells by their shape using deep learning and, in particular, deep-embedded-clustering. The tool provides the ability to train popular graph-based or convolutional autoencoders on point cloud or voxel data of 3D single cell masks as well as providing pre-trained networks for inference.



  ```bash
  pip install cellshape-cluster
  ```



  ```python
  import torch
  from cellshape_cloud import CloudAutoEncoder
  from cellshape_cluster import DeepEmbeddedClustering

  autoencoder = CloudAutoEncoder(
      num_features=128,
      k=20,
      encoder_type="dgcnn"
  )

  model = DeepEmbeddedClustering(autoencoder=autoencoder,
                                 num_clusters=10,
                                 alpha=1.0)

  points = torch.randn(1, 2048, 3)

  recon, features, clusters = model(points)
  ```


  ```python
  import torch
  from torch.utils.data import DataLoader

  import cellshape_cloud as cloud
  import cellshape_cluster as cluster
  from cellshape_cloud.vendor.chamfer_distance import ChamferDistance

  dataset_dir = "path/to/pointcloud/dataset/"
  autoencoder_model = "path/to/autoencoder/model.pt"
  num_features = 128
  k = 20
  encoder_type = "dgcnn"
  num_clusters = 10
  num_epochs = 1
  learning_rate = 0.00001
  gamma = 1
  divergence_tolerance = 0.01
  output_dir = "path/to/output/"


  autoencoder = CloudAutoEncoder(
      num_features=128,
      k=20,
      encoder_type="dgcnn"
  )

  checkpoint = torch.load(autoencoder_model)

  autoencoder.load_state_dict(checkpoint['model_state_dict']

  model = DeepEmbeddedClustering(autoencoder=autoencoder,
                                 num_clusters=10,
                                 alpha=1.0)

  dataset = cloud.PointCloudDataset(dataset_dir)

  dataloader = DataLoader(dataset, batch_size=batch_size, shuffle=False) # it is very important that shuffle=False here!
  dataloader_inf = DataLoader(dataset, batch_size=1, shuffle=False) # it is very important that batch_size=1 and shuffle=False here!

  optimizer = torch.optim.Adam(
      model.parameters(),
      lr=learning_rate * 16 / batch_size,
      betas=(0.9, 0.999),
      weight_decay=1e-6,
  )

  reconstruction_criterion = ChamferDistance()
  cluster_criterion = nn.KLDivLoss(reduction="sum")

  train(
      model,
      dataloader,
      dataloader_inf,
      num_epochs,
      optimizer,
      reconstruction_criterion,
      cluster_criterion,
      update_interval,
      gamma,
      divergence_tolerance,
      output_dir
  )
  ```



  - `autoencoder`: CloudAutoEncoder or VoxelAutoEncoder.
  Instance of autoencoder class from cellshape-cloud or cellshape-voxel
  - `num_clusters`: int.
  The number of clusters to use in deep embedded clustering algorithm.
  - `alpha`: float.
  Degrees of freedom for the Student's t-distribution. Xie et al. (ICML, 2016) let alpha=1 for all experiments.


pkgId: 4650849693d23609cf0cac33c8dd84860e9304ba5a50a9db5685d31849d028fe
name: python-cellshape-helper
arch: src
version: 0.0.18
epoch: 0
release: 1
summary: 3D shape analysis using deep learning
url: https://pypi.org/project/cellshape-helper/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellshape-helper-0.0.18-1.src.rpm
checksum_type: sha256
description:
  [![Project Status: Active – The project has reached a stable, usable
  state and is being actively
  developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
  [![Python Version](https://img.shields.io/pypi/pyversions/cellshape-helper.svg)](https://pypi.org/project/cellshape-helper)
  [![PyPI](https://img.shields.io/pypi/v/cellshape-helper.svg)](https://pypi.org/project/cellshape-helper)
  [![Downloads](https://pepy.tech/badge/cellshape-helper)](https://pepy.tech/project/cellshape-helper)
  [![Wheel](https://img.shields.io/pypi/wheel/cellshape-helper.svg)](https://pypi.org/project/cellshape-helper)
  [![Development Status](https://img.shields.io/pypi/status/cellshape-helper.svg)](https://github.com/Sentinal4D/cellshape-helper)
  [![Tests](https://img.shields.io/github/workflow/status/Sentinal4D/cellshape-helper/tests)](
      https://github.com/Sentinal4D/cellshape-helper/actions)
  [![Coverage Status](https://coveralls.io/repos/github/Sentinal4D/cellshape-helper/badge.svg?branch=master)](https://coveralls.io/github/Sentinal4D/cellshape-helper?branch=master)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)


  <img src="https://github.com/Sentinal4D/cellshape-helper/blob/main/img/cellshape_helper_logo.png"
       alt="Cellshape logo by Matt De Vries">
  ___
  Cellshape-helper provides the ability to convert 3D masks to point clouds.




  ```bash
  pip install cellshape-helper
  ```


  ```python
  import cellshape_helper as helper


  PATH_TO_TIF_FILES = "path/to/tif/files/"
  PATH_TO_SAVE_MESH = "path/to/save/mesh/files/"
  PATH_TO_SAVE_PC = "path/to/save/pointcloud/files/"
  NUM_POINTS = 2048

  helper.tif_to_pc_directory(PATH_TO_TIF_FILES,
                             PATH_TO_SAVE_MESH,
                             PATH_TO_SAVE_PC,
                             NUM_POINTS)
  ```


  - `PATH_TO_TIF_FILES`: str.
  The path to you binary masks of cells or nuclei.
  - `PATH_TO_SAVE_MESH`: str.
  The path where you want to save the mesh objects to.
  - `PATH_TO_SAVE_PC`: str.
  The path where you want to save your point clouds to.
  - `NUM_POINTS`: str.
  The number of points to sample from the mesh object when creating a point cloud.


pkgId: 900d793af2bbd628c5b24d7bdef113d77d9cb923c086882d9112a769c5a2c36c
name: python-cellsnap
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: A package for enhancing single-cell population delineation by integrating cross-domain information.
url: https://github.com/sggao/cellsnap
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellsnap-0.1.0-1.src.rpm
checksum_type: sha256
description:
  Official implementation of Cell Spatial And Neighborhood Pattern (CellSNAP), a computational method that learns a single-cell representation embedding by integrating cross-domain information from tissue samples. Through the analysis of datasets spanning spatial proteomic and spatial transcriptomic modalities, and across different tissue types and disease settings, we demonstrate CellSNAP’s capability to elucidate biologically relevant cell populations that were previously elusive due to the relinquished tissue morphological information from images


pkgId: e541496430d6dfcc9dfaae9a261a35dc744867e92dc66f8dfb51925ad10a4732
name: python-celltypist
arch: src
version: 1.6.3
epoch: 0
release: 1
summary: A tool for semi-automatic cell type classification
url: https://github.com/Teichlab/celltypist
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-celltypist-1.6.3-1.src.rpm
checksum_type: sha256
description:
  <p align="left"><img src="https://github.com/Teichlab/celltypist/blob/main/docs/source/_static/img/logo_celltypist.png" width="250" height="85"></p>

  [![Python Versions](https://img.shields.io/badge/python-3.6+-brightgreen.svg)](https://pypi.org/project/celltypist) [![Documentation Status](https://readthedocs.org/projects/celltypist/badge/?version=latest)](https://celltypist.readthedocs.io/en/latest/?badge=latest)

  CellTypist is an automated cell type annotation tool for scRNA-seq datasets on the basis of logistic regression classifiers optimised by the stochastic gradient descent algorithm. CellTypist allows for cell prediction using either built-in (with a current focus on immune sub-populations) or custom models, in order to assist in the accurate classification of different cell types and subtypes.


  Information of CellTypist can be also found in our CellTypist portal. [![Website www.celltypist.org](https://img.shields.io/website-up-down-brightgreen-red/http/shields.io.svg)](https://www.celltypist.org/)


  [Using CellTypist for cell type classification ![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Teichlab/celltypist/blob/main/docs/notebook/celltypist_tutorial.ipynb)
  [Using CellTypist for multi-label classification ![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Teichlab/celltypist/blob/main/docs/notebook/celltypist_tutorial_ml.ipynb)
  [Best practice in large-scale cross-dataset label transfer using CellTypist ![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Teichlab/celltypist/blob/main/docs/notebook/celltypist_tutorial_cv.ipynb)



  ```console
  pip install celltypist
  ```


  ```console
  conda install -c bioconda -c conda-forge celltypist
  ```



  <details>
  <summary><strong>1. Use in the Python environment</strong></summary>

  + <details>
    <summary><strong>1.1. Import the module</strong></summary>

    ```python
    import celltypist
    from celltypist import models
    ```
    </details>

  + <details>
    <summary><strong>1.2. Download available models</strong></summary>

    The models serve as the basis for cell type predictions. Information of available models can be also found [here](https://www.celltypist.org/models).
    ```python
    
    models.models_description()
    
    models.download_models(model = 'Immune_All_Low.pkl')
    
    models.download_models(model = ['Immune_All_Low.pkl', 'Immune_All_High.pkl'])
    
    models.download_models(model = ['Immune_All_Low.pkl', 'Immune_All_High.pkl'], force_update = True)
    
    models.models_path
    ```
    A simple way is to download all available models. Since each model is on average 1 megabyte (MB), we encourage the users to download all of them.
    ```python
    
    models.download_models()
    
    models.download_models(force_update = True)
    ```
    By default, a folder `.celltypist/` will be created in the user's home directory to store model files. A different path/folder can be specified by exporting the environment variable `CELLTYPIST_FOLDER` in your configuration file (e.g. in `~/.bash_profile`).
    ```bash
    
    export CELLTYPIST_FOLDER='/path/to/model/folder/'
    ```
    </details>

  + <details>
    <summary><strong>1.3. Overview of the models</strong></summary>

    All models are serialised in a binary format by [pickle](https://docs.python.org/3/library/pickle.html).
    ```python
    
    
    models.models_description(on_the_fly = True)
    ```
    </details>

  + <details>
    <summary><strong>1.4. Inspect the model of interest</strong></summary>

    To take a look at a given model, load the model as an instance of the [Model](https://celltypist.readthedocs.io/en/latest/celltypist.models.Model.html) class as defined in CellTypist.
    ```python
    
    model = models.Model.load(model = 'Immune_All_Low.pkl')
    
    model
    
    model.cell_types
    
    model.features
    ```
    </details>

  + <details>
    <summary><strong>1.5. Celltyping based on the input of count table</strong></summary>

    CellTypist accepts the input data as a count table (cell-by-gene or gene-by-cell) in the format of `.txt`, `.csv`, `.tsv`, `.tab`, `.mtx` or `.mtx.gz`. A raw count matrix (reads or UMIs) is required. Non-expressed genes (if you are sure of their expression absence in your data) are suggested to be included in the input table as well, as they point to the negative transcriptomic signatures when compared with the model used.
    ```python
    
    input_file = celltypist.samples.get_sample_csv()
    ```
    Assign the cell type labels from the model to the input test cells using the [celltypist.annotate](https://celltypist.readthedocs.io/en/latest/celltypist.annotate.html) function.
    ```python
    
    predictions = celltypist.annotate(input_file, model = 'Immune_All_Low.pkl')
    
    predictions = celltypist.annotate(input_file, model = model)
    ```
    If your input file is in a gene-by-cell format (genes as rows and cells as columns), pass in the `transpose_input = True` argument. In addition, if the input is provided in the `.mtx` format, you will also need to specify the `gene_file` and `cell_file` arguments as the files containing names of genes and cells, respectively.
    ```python
    
    predictions = celltypist.annotate(input_file, model = 'Immune_All_Low.pkl', transpose_input = True)
    
    predictions = celltypist.annotate(input_file, model = 'Immune_All_Low.pkl', transpose_input = True, gene_file = '/path/to/gene/file.txt', cell_file = '/path/to/cell/file.txt')
    ```
    Again, if the `model` argument is not specified, CellTypist will by default use the `Immune_All_Low.pkl` model.

    The `annotate` function will return an instance of the [AnnotationResult](https://celltypist.readthedocs.io/en/latest/celltypist.classifier.AnnotationResult.html) class as defined in CellTypist.
    ```python
    
    predictions
    
    predictions.predicted_labels
    
    predictions.decision_matrix
    
    predictions.probability_matrix
    ```
    By default, with the `annotate` function, each query cell is predicted into the cell type with the largest score/probability among all possible cell types (`mode = 'best match'`). This mode is straightforward and can be used to differentiate between highly homogeneous cell types.

    However, in some scenarios where a query cell cannot be assigned to any cell type in the reference model (i.e., a novel cell type) or can be assigned to multiple cell types (i.e., multi-label classification), a mode of probability match can be turned on (`mode = 'prob match'`) with a probability cutoff (default to 0.5, `p_thres = 0.5`) to decide the cell types (none, 1, or multiple) assigned for a given cell.
    ```python
    
    
    predictions = celltypist.annotate(input_file, model = 'Immune_All_Low.pkl', mode = 'prob match', p_thres = 0.5)
    ```
    The three tables in the `AnnotationResult` (`.predicted_labels`, `.decision_matrix` and `.probability_matrix`) can be written out to local files (tables) by the function [to_table](https://celltypist.readthedocs.io/en/latest/celltypist.classifier.AnnotationResult.html#celltypist.classifier.AnnotationResult.to_table), specifying the target `folder` for storage and the `prefix` common to each table.
    ```python
    
    predictions.to_table(folder = '/path/to/a/folder', prefix = '')
    
    predictions.to_table(folder = '/path/to/a/folder', prefix = '', xlsx = True)
    ```
    The resulting `AnnotationResult` can be also transformed to an [AnnData](https://anndata.readthedocs.io/en/latest/) which stores the expression matrix in the log1p normalised format (to 10,000 counts per cell) by the function [to_adata](https://celltypist.readthedocs.io/en/latest/celltypist.classifier.AnnotationResult.html#celltypist.classifier.AnnotationResult.to_adata). The predicted cell type labels can be inserted to this `AnnData` as well by specifying `insert_labels = True` (which is the default behavior of `to_adata`).

    Confidence scores of query cells can be inserted by specifying `insert_conf = True` (which is also the default behavior of `to_adata`). The scores correspond to the probabilities of cell predictions based on either `predictions.predicted_labels.predicted_labels` or `predictions.predicted_labels.majority_voting` (see `1.7.`), which can be specified by `insert_conf_by` (default to the former, `predicted_labels`).
    ```python
    
    adata = predictions.to_adata(insert_labels = True, insert_conf = True)
    
    adata.obs
    ```
    In addition, you can insert the decision matrix into the `AnnData` by passing in `insert_decision = True`, which represents the decision scores of each cell type distributed across the input cells. Alternatively, setting `insert_prob = True` will insert the probability matrix into the `AnnData`. The latter is the recommended way as probabilities are more interpretable (though sometimes not all query datasets converge to a meaningful range of probability values).

    After the insertion, multiple columns will show up in the cell metadata of `AnnData`, with each column's name as a cell type name. Of note, all these columns (including the `predicted_labels` and `conf_score`) can be prefixed with a specific string by setting `prefix` in `to_adata`.
    ```python
    
    adata = predictions.to_adata(insert_labels = True, insert_conf = True, insert_decision = True)
    
    adata = predictions.to_adata(insert_labels = True, insert_conf = True, insert_prob = True)
    ```
    You can now manipulate this object with any functions or modules applicable to `AnnData`. Actually, CellTypist provides a quick function [to_plots](https://celltypist.readthedocs.io/en/latest/celltypist.classifier.AnnotationResult.html#celltypist.classifier.AnnotationResult.to_plots) to visualise your `AnnotationResult` and store the figures without the need of explicitly transforming it into an `AnnData`.
    ```python
    
    predictions.to_plots(folder = '/path/to/a/folder', prefix = '')
    ```
    A different prefix for the output figures can be specified with the `prefix` tag, and UMAP coordinates will be generated for the input dataset using a canonical [Scanpy](https://scanpy.readthedocs.io/en/stable/) pipeline. The labels in the figure may be crowded if too many cell types are predicted (can be alleviated by a majority voting process, see `1.7.`).

    If you also would like to inspect the decision score and probability distributions for each cell type involved in the model, pass in the `plot_probability = True` argument. This may take a bit longer time as one figure will be generated for each of the cell types from the model.
    ```python
    
    predictions.to_plots(folder = '/path/to/a/folder', prefix = '', plot_probability = True)
    ```
    Multiple figures will be generated, including the predicted cell type labels overlaid onto the UMAP space, plus the decision score and probability distributions of each cell type on the UMAP.
    </details>

  + <details>
    <summary><strong>1.6. Celltyping based on AnnData</strong></summary>

    CellTypist also accepts the input data as an [AnnData](https://anndata.readthedocs.io/en/latest/) generated from for example [Scanpy](https://scanpy.readthedocs.io/en/stable/).

    Since the expression of each gene will be centred and scaled by matching with the mean and standard deviation of that gene in the provided model, CellTypist requires a logarithmised and normalised expression matrix stored in the `AnnData` (log1p normalised expression to 10,000 counts per cell). CellTypist will try the `.X` attribute first, and if it does not suffice, try the `.raw.X` attribute. If none of them fit into the desired data type or the expression matrix is not properly normalised, an error will be raised.

    Within the `AnnData`, please provide all genes to ensure maximal overlap with genes in the model. If you normalise and logarithmise the gene expression matrix using all genes while later only keep a subset of genes in the `AnnData`, the prediction result may not be optimal.
    ```python
    
    predictions = celltypist.annotate('/path/to/input.h5ad', model = 'Immune_All_Low.pkl')
    
    predictions = celltypist.annotate(a_loaded_adata, model = 'Immune_All_Low.pkl')
    ```
    All the parameters and downstream operations are the same as in `1.5.`, except that 1) the transformed `AnnData` from `to_adata` stores all the expression matrix and other information as is in the original object. 2) when generating the visualisation figures, existing UMAP coordinates will be used. If no UMAP coordinates are found, CellTypist will fall back on the neighborhood graph to yield new 2D UMAP projections. If none is available, a canonical Scanpy pipeline will be performed to generate the UMAP coordinates as in `1.5.`.

    Of note, when the input is an `AnnData`, compared to the visualisations in `1.5.`, a more useful way for visualising the prediction result is to use the function `celltypist.dotplot`, which quantitatively compares the CellTypist prediction result with the cell types (or clusters) pre-defined and stashed in the `AnnData` by the user. Specifically, a dot plot will be generated, demonstrating the match between CellTypist predictions and manual annotations (or clusters). For each cell type or cluster (each column within the dot plot), this plot shows how it can be 'decomposed' into different cell types predicted by CellTypist.
    ```python
    
    
    
    celltypist.dotplot(predictions, use_as_reference = 'column_key_of_manual_annotation', use_as_prediction = 'predicted_labels')
    ```
    Check [celltypist.dotplot](https://celltypist.readthedocs.io/en/latest/celltypist.dotplot.html) for other parameters controlling visualisation details of this plot.
    </details>

  + <details>
    <summary><strong>1.7. Use a majority voting classifier combined with celltyping</strong></summary>

    By default, CellTypist will only do the prediction jobs to infer the identities of input cells, which renders the prediction of each cell independent. To combine the cell type predictions with the cell-cell transcriptomic relationships, CellTypist offers a majority voting approach based on the idea that similar cell subtypes are more likely to form a (sub)cluster regardless of their individual prediction outcomes.
    To turn on the majority voting classifier in addition to the CellTypist predictions, pass in `majority_voting = True` to the `annotate` function.
    ```python
    
    predictions = celltypist.annotate(input_file, model = 'Immune_All_Low.pkl', majority_voting = True)
    ```
    During the majority voting, to define cell-cell relations, CellTypist will use a heuristic over-clustering approach according to the size of the input data with the aid of a Leiden clustering pipeline. Users can also provide their own over-clustering result to the `over_clustering` argument. This argument can be specified in several ways:
     1) an input plain file with the over-clustering result of one cell per line.
     2) a string key specifying an existing cell metadata column in the `AnnData` (pre-created by the user).
     3) a list-like object (such as a numpy 1D array) indicating the over-clustering result of all cells.
     4) if none of the above is provided, will use a heuristic over-clustering approach, noted above.
    ```python
    
    predictions = celltypist.annotate(input_file, model = 'Immune_All_Low.pkl', majority_voting = True, over_clustering = '/path/to/over_clustering/file')
    ```
    There is also a `min_prop` parameter (defaults to 0) which controls the minimum proportion of cells from the dominant cell type required to name a given subcluster by this cell type. Subcluster that fails to pass this proportion threshold will be assigned `Heterogeneous`.

    Similarly, an instance of the `AnnotationResult` class will be returned.
    ```python
    
    predictions.predicted_labels
    
    predictions.predicted_labels.majority_voting
    
    predictions.decision_matrix
    
    predictions.probability_matrix
    ```
    Compared to the results without majority-voting functionality as in `1.5.` and `1.6.`, the `.predicted_labels` attribute now has two extra columns (`over_clustering` and `majority_voting`) in addition to the column `predicted_labels`.

    Other parameters and downstream operations are the same as in `1.5.` and `1.6.`. Note that due to the majority-voting results added, the exported tables (by `to_table`), the transformed `AnnData` (by `to_adata`), and the visualisation figures (by `to_plots`) will all have additional outputs or information indicating the majority-voting outcomes. For example, when using the function `celltypist.dotplot`, you can set `use_as_prediction = 'majority_voting'` to visualise the match between majority-voting results with manual annotations. The other example is that when using `to_adata`, you can specify `insert_conf_by = 'majority_voting'` to have the confidence scores corresponding to the majority-voting result instead of raw predictions (`insert_conf_by = 'predicted_labels'` which is the default).
    ```python
    
    celltypist.dotplot(predictions, use_as_reference = 'column_key_of_manual_annotation', use_as_prediction = 'majority_voting')
    ```
    </details>
  </details>

  <details>
  <summary><strong>2. Use as the command line</strong></summary>

  + <details>
    <summary><strong>2.1. Check the command line options</strong></summary>

    ```bash
    celltypist --help
    ```
    </details>

  + <details>
    <summary><strong>2.2. Download all available models</strong></summary>

    ```bash
    celltypist --update-models
    ```
    This will download the latest models from the remote server.
    </details>

  + <details>
    <summary><strong>2.3. Overview of the models</strong></summary>

    ```bash
    celltypist --show-models
    ```
    </details>

  + <details>
    <summary><strong>2.4. Celltyping based on the input of count table</strong></summary>

    See `1.5.` for the format of the desired count matrix.
    ```bash
    celltypist --indata /path/to/input/file --model Immune_All_Low.pkl --outdir /path/to/outdir
    ```
    You can add a different model to be used in the `--model` option. If the `--model` is not provided, CellTypist will by default use the `Immune_All_Low.pkl` model. The output directory will be set to the current working directory if `--outdir` is not specified.

    If your input file is in a gene-by-cell format (genes as rows and cells as columns), add the `--transpose-input` option.
    ```bash
    celltypist --indata /path/to/input/file --model Immune_All_Low.pkl --outdir /path/to/outdir --transpose-input
    ```
    If the input is provided in the `.mtx` format, you will also need to specify the `--gene-file` and `--cell-file` options as the files containing names of genes and cells, respectively.

    The default mode (`--mode best_match`) for prediction is to choose the cell type with the largest score/probability as the final prediction; setting `--mode prob_match` combined with a probability threshold (default to 0.5, `--p-thres 0.5`) will enable a multi-label classification, which assigns 0 (i.e., unassigned), 1, or >=2 cell type labels to each query cell.

    Other options that control the output files of CellTypist include `--prefix` which adds a custom prefix and `--xlsx` which merges the output files into one xlsx table. Check `celltypist --help` for more details.
    </details>

  + <details>
    <summary><strong>2.5. Celltyping based on AnnData</strong></summary>

    See `1.6.` for the requirement of the expression matrix in the AnnData object (`.h5ad`).
    ```bash
    celltypist --indata /path/to/input/adata --model Immune_All_Low.pkl --outdir /path/to/outdir
    ```
    Other command line options are the same as in `2.4.`.
    </details>

  + <details>
    <summary><strong>2.6. Use a majority voting classifier combined with celltyping</strong></summary>

    See `1.7.` for how the majority voting classifier works.
    ```bash
    celltypist --indata /path/to/input/file --model Immune_All_Low.pkl --outdir /path/to/outdir --majority-voting
    ```
    During the majority voting, to define cell-cell relations, CellTypist will use a heuristic over-clustering approach according to the size of the input data with the aid of a Leiden clustering pipeline. Users can also provide their own over-clustering result to the `--over-clustering` option. This option can be specified in several ways:
       1) an input plain file with the over-clustering result of one cell per line.
       2) a string key specifying an existing cell metadata column in the `AnnData` (pre-created by the user).
       3) if none of the above is provided, will use a heuristic over-clustering approach, noted above.
    ```bash
    celltypist --indata /path/to/input/file --model Immune_All_Low.pkl --outdir /path/to/outdir --majority-voting --over-clustering /path/to/over_clustering/file
    ```
    There is also a `--min-prop` option (defaults to 0) which controls the minimum proportion of cells from the dominant cell type required to name a given subcluster by this cell type. Subcluster that fails to pass this proportion threshold will be assigned `Heterogeneous`.

    Other command line options are the same as in `2.4.`.
    </details>

  + <details>
    <summary><strong>2.7. Generate visualisation figures for the results</strong></summary>

    In addition to the tables output by CellTypist, you have the option to generate multiple figures to get an overview of your prediction results. See `1.5.`, `1.6.` and `1.7.` for what these figures represent.
    ```bash
    
    celltypist --indata /path/to/input/file --model Immune_All_Low.pkl --outdir /path/to/outdir --plot-results
    
    celltypist --indata /path/to/input/file --model Immune_All_Low.pkl --outdir /path/to/outdir --majority-voting --plot-results
    ```
    </details>
  </details>

  <details>
  <summary><strong>3. Use in the R environment</strong></summary>

  Currently, there is no plan for R compatibility. Try to convert R objects into AnnData for use in CellTypist.
  </details>

  <details>
  <summary><strong>4. Use as Docker/Singularity container</strong></summary>

    

    A docker image is available from the Quay.io Container Registry as [`quay.io/teichlab/celltypist:latest`](https://quay.io/repository/teichlab/celltypist?tab=tags).

    **Simple usage:**
    ```bash
    docker run --rm -it \
      -v /path/to/data:/data \
      quay.io/teichlab/celltypist:latest \
      celltypist --indata /data/file --model Immune_All_Low.pkl --outdir /data/output
    ```
    **Usage with custom models:**
    ```bash
    docker run --rm -it \
      -v /path/to/data:/data \
      -v /path/to/models:/opt/celltypist/data/models \
      quay.io/teichlab/celltypist:latest \
      celltypist --indata /data/file --model My_Custom_Model.pkl --outdir /data/output
    ```

    

    Use the `singularity pull` command to download the container from the given container registry:
    ```bash
    singularity pull celltypist-latest.sif docker://quay.io/teichlab/celltypist:latest
    ```
    Then run the downloaded image as a container.

    **Simple usage:**
    ```bash
    singularity run \
      -B /path/to/data:/data \
      celltypist-latest.sif \
      celltypist --indata /data/file --model Immune_All_Low.pkl --outdir /data/output
    ```
    **Usage with custom models:**
    ```bash
    singularity run \
      -B /path/to/data:/data \
      -B /path/to/models:/opt/celltypist/data/models \
      celltypist-latest.sif \
      celltypist --indata /data/file --model My_Custom_Model.pkl --outdir /data/output
    ```

  </details>

  <details>
  <summary><strong>Supplemental guidance</strong></summary>

  + <details>
    <summary><strong>Generate a custom model</strong></summary>

    As well as the models provided by CellTypist (see `1.2.`), you can generate your own model from which the cell type labels can be transferred to another scRNA-seq dataset. This will be most useful when a large and comprehensive reference atlas is trained for future use, or when the similarity between two scRNA-seq datasets is under examination.

    
    The inputs for CellTypist training comprise the gene expression data, the cell annotation details (i.e., cell type labels), and in some scenarios the genes used. To facilitate the training process, the `train` function (see below) has been designed to accommodate different kinds of input formats:
       1) The gene expression data can be provided as a path to the expression table (such as `.csv` and `.mtx`), or a path to the `AnnData` (`.h5ad`), with the former containing raw counts (in order to reduce the file size) while the latter containing log1p normalised expression (to 10,000 counts per cell) stored in `.X` or `.raw.X`. In addition to specifying the paths, you can provide any array-like objects (e.g., `csr_matrix`) or `AnnData` which are already loaded in memory (both should be in the log1p format). A cell-by-gene format (cells as rows and genes as columns) is required.
       2) The cell type labels can be supplied as a path to the file containing cell type label per line corresponding to the cells in gene expression data. Any list-like objects (such as a `tuple` or `series`) are also acceptable. If the gene expression data is input as an `AnnData`, you can also provide a column name from its cell metadata (`.obs`) which represents information of cell type labels.
       3) The genes will be automatically extracted if the gene expression data is provided as a table file, an `AnnData` or a `DataFrame`. Otherwise, you need to specify a path to the file containing one gene per line corresponding to the genes in the gene expression data. Any list-like objects (such as a `tuple` or `series`) are also acceptable.

    
    Derive a new model by training the data using the [celltypist.train](https://celltypist.readthedocs.io/en/latest/celltypist.train.html) function:
    ```python
    
    new_model = celltypist.train(expression_input, labels = label_input, genes = gene_input)
    ```
    If the input is a table file, an `AnnData` or a `DataFrame`, genes will be automatically extracted and the `genes` tag can thus be omitted from the above code. If your input is in a gene-by-cell format (genes as rows and cells as columns), remember to pass in the `transpose_input = True` argument.

    Before the training is conducted, the gene expression format will be checked to make sure the input data is supplied as required. For example, the expression matrix should be in log1p normalised expression (to 10,000 counts per cell) if the input is an `AnnData`. This means when you subset the input with given genes (e.g., by highly variable genes), an error may be raised as CellTypist cannot judge the input as properly normalised with only a subset of genes. In such a case, pass in `check_expression = False` to skip the expression format check.
    ```python
    
    
    
    new_model = celltypist.train(some_adata[:, some_adata.var.highly_variable], labels = label_input, check_expression = False)
    ```
    By default, data is trained using a traditional logistic regression classifier. This classifier is well suited to datasets of small or intermediate sizes (as an empirical estimate, <= 100k cells), and usually leads to an unbiased probability range with less parameter tuning. Among the training parameters, three important ones are `solver` which (if not specified by the user) is selected based on the size of the input data by CellTypist, `C` which sets the inverse of L2 regularisation strength, and `max_iter` which controls the maximum number of iterations before reaching the minimum of the cost function. Other (hyper)parameters from [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) are also applicable in the `train` function.

    When the dimensions of the input data are large, training may take longer time even with CPU parallelisation (achieved by the `n_jobs` argument). To reduce the training time as well as to add some randomness to the classifier's solution, a stochastic gradient descent (SGD) logistic regression classifier can be enabled by `use_SGD = True`.
    ```python
    
    new_model = celltypist.train(expression_input, labels = label_input, genes = gene_input, use_SGD = True)
    ```
    A logistic regression classifier with SGD learning reduces the training burden dramatically and has a comparable performance versus a traditional logistic regression classifier. A minor caveat is that more careful model parameter tuning may be needed if you want to utilise the probability values from the model for scoring cell types in the prediction step (the selection of the most likely cell type for each query cell is not influenced however). Among the training parameters, two important ones are `alpha` which sets the L2 regularisation strength and `max_iter` which controls the maximum number of iterations. Other (hyper)parameters from [SGDClassifier](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html) are also applicable in the `train` function.

    When the training data contains a huge number of cells (for example >500k cells) or more randomness in selecting cells for training is needed, you may consider using the mini-batch version of the SGD logistic regression classifier by specifying `use_SGD = True` and `mini_batch = True`. As a result, in each epoch (default to 10 epochs, `epochs = 10`), cells are binned into equal-sized (the size is default to 1000, `batch_size = 1000`) random batches, and are trained in a batch-by-batch manner (default to 100 batches, `batch_number = 100`).
    ```python
    
    new_model = celltypist.train(expression_input, labels = label_input, genes = gene_input, use_SGD = True, mini_batch = True)
    ```
    By selecting part of cells for training (default to 1,000,000 cells with possible duplications, `epochs` x `batch_size` x `batch_number`), training time can be again reduced and the performance of the derived model is shown to persist as compared to the above two methods. Since some rare cell types may be undersampled during this procedure, you can pass in the `balance_cell_type = True` argument to sample rare cell types with a higher probability, ensuring close-to-even cell type distributions in mini-batches (subject to the maximum number of cells that can be provided by a given cell type).

    There are also some free texts that can be inserted (e.g., `date`) to describe the model. Check out the [celltypist.train](https://celltypist.readthedocs.io/en/latest/celltypist.train.html) for more information.

    The resulting model is an instance of the `Model` class as in `1.4.`, and can be manipulated as with other CellTypist models.

    Save this model locally:
    ```python
    
    new_model.write('/path/to/local/folder/some_model_name.pkl')
    ```
    A suggested location for stashing the model is the `models.models_path` (see `1.2.`). Through this, all models (including the models provided by CellTypist) will be in the same folder, and can be accessed in the same manner as in `1.4.`.
    ```python
    
    new_model.write(f'{models.models_path}/some_model_name.pkl')
    ```
    To leverage this model, first load it by `models.Model.load`.
    ```python
    new_model = models.Model.load('/path/to/local/folder/some_model_name.pkl')
    ```
    This model can be used as with the built-in CellTypist models, for example, it can be specified as the `model` argument in `annotate`.
    ```python
    
    predictions = celltypist.annotate(input_file, model = new_model)
    
    predictions = celltypist.annotate(input_file, model = '/path/to/local/folder/some_model_name.pkl')
    
    predictions = celltypist.annotate(input_file, model = 'some_model_name.pkl')
    ```
    Downstream operations are the same as in `1.4.`, `1.5.`, `1.6.`, and `1.7.`.

    
    Some scRNA-seq datasets may involve the noise mostly from genes not helpful or even detrimental to the characterisation of cell types. To mitigate this, `celltypist.train` has the option (`feature_selection = True`) to do a fast feature selection based on the feature importance (here, the absolute regression coefficients) using SGD learning. In short, top important genes (default: `top_genes = 300`) are selected from each cell type, and are further combined across cell types as the final feature set. The classifier is then re-run using the corresponding subset of the input data.
    ```python
    
    new_model = celltypist.train(expression_input, labels = label_input, genes = gene_input, feature_selection = True)
    
    new_model = celltypist.train(expression_input, labels = label_input, genes = gene_input, use_SGD = True, feature_selection = True)
    
    new_model = celltypist.train(expression_input, labels = label_input, genes = gene_input, use_SGD = True, mini_batch = True, feature_selection = True)
    ```
    If you prefer other feature selection approaches and obtain a set of genes which are designated as important features, you can subset your input data and train the CellTypist model accordingly. As noted in the previous section, remember to pass in the `check_expression = False` argument.
    ```python
    new_model = celltypist.train(expression_input_subset, labels = label_input, genes = gene_input, check_expression = False)
    ```
    The downstream workflow is the same as that from one-pass data training.

    
    `max_iter`: when `celltypist.train` does not converge for a long time, setting `max_iter` to a lower number can reduce runtime at a possible cost of a suboptimal model.

    `with_mean`: when the training data is a sparse matrix, setting `with_mean = False` will preserve sparsity by skipping the step of subtraction by the mean during scaling, and thus lower the RAM usage at the cost of a suboptimal model.

    `n_jobs`: Number of CPUs used. This argument is not applicable to mini-batch training.

    `use_GPU`: GPU acceleration by using logistic regression from [cuml](https://docs.rapids.ai/api/cuml/stable). You need to install RAPIDS and cuml first. This argument is ignored if SGD learning is enabled.
    </details>

  + <details>
    <summary><strong>Cross-species model conversion</strong></summary>

    It is always recommended to predict a query dataset using the reference model from the same species. In cases where a cross-species label projection is needed, you can convert the model of interest to its "orthologous" form of another species. This is achieved by aligning orthologous genes between species.

    Load a human immune model.
    ```python
    model = models.Model.load('Immune_All_Low.pkl')
    ```
    This model can be converted to a mouse equivalent through the [convert](https://celltypist.readthedocs.io/en/latest/celltypist.models.Model.html#celltypist.models.Model.convert) method. By default, a human-mouse conversion (or the opposite) will be conducted by automatically detecting the species of the model (e.g., human) and transforming it to the other species (e.g., mouse).
    ```python
    
    model.convert()
    ```
    By default (`unique_only = True`), only 1:1 orthologs between the two species are kept and all other genes are discarded in the model. You can also keep those genes (including both 1:N and N:1 orthologs) by specifying `unique_only = False`. By doing so, you need to specify how these 1:N orthologs will be handled: for each gene, averaging the classifier weights (`collapse = 'average'`, which is the default when `unique_only = False`) or randomly choosing one gene's weight as the representative (`collapse = 'random'`) from all its orthologs.
    ```python
    
    
    ```
    As mentioned above, the default mode is a human-to-mouse (or mouse-to-human) conversion using the built-in gene mapping [file](https://github.com/Teichlab/celltypist/blob/main/celltypist/data/samples/Ensembl105_Human2Mouse_Genes.csv) (Ensembl105 version). For conversion to other species, you can provide a different file (`map_file`), with one column being the species of the model and the other column being the species you want to convert to. Check out `models.Model.convert` for more information.

    Lastly, write out the converted model locally.
    ```python
    model.write('/path/to/local/folder/some_model_name.pkl')
    ```
    This model can be used as with other CellTypist models.
    </details>

  + <details>
    <summary><strong>Model conversion from gene symbols to Ensembl IDs</strong></summary>

    CellTypist models are usually trained based on gene symbols. When genes of a query dataset are formatted as Ensembl IDs, you can convert gene symbols in the model to Ensembl ID for matching the query dataset. The [convert](https://celltypist.readthedocs.io/en/latest/celltypist.models.Model.html#celltypist.models.Model.convert) method will be utilised as in the above section.

    Specifically, you need to provide a gene-symbol-to-Ensembl-ID file, such that gene symbols in the model will be converted to IDs (or vice versa). A built-in [file](https://github.com/Teichlab/celltypist/blob/main/celltypist/data/samples/GENCODEv44_Gene_id2name.csv) is provided in CellTypist (GENCODE v44). Parameters and details during model conversion can be found in the previous section `Cross-species model conversion`.

    Load a human immune model.
    ```python
    model = models.Model.load('Immune_All_Low.pkl')
    ```
    Convert gene symbols to Ensembl IDs using the built-in file. You can also provide a path to your own ID mapping file.
    ```python
    
    model.convert('GENCODEv44_Gene_id2name.csv')
    ```
    Lastly, write out the converted model locally.
    ```python
    model.write('/path/to/local/folder/some_model_name.pkl')
    ```
    This model can be used as with other CellTypist models.
    </details>
  </details>


  Dominguez Conde et al., Cross-tissue immune cell analysis reveals tissue-specific features in humans. Science 376, eabl5197 (2022). [Link](https://doi.org/10.1126/science.abl5197)


pkgId: becc2543484de8707def740c0d859f9b9bcb32610bc45d938f4f0b9f9318e413
name: python-celluloid
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Easy matplotlib animation.
url: https://github.com/jwkvam/celluloid
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-celluloid-0.2.0-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://travis-ci.com/jwkvam/celluloid.svg?branch=master)](https://travis-ci.com/jwkvam/celluloid)
  [![codecov](https://codecov.io/gh/jwkvam/celluloid/branch/master/graph/badge.svg)](https://codecov.io/gh/jwkvam/celluloid)
  [![pypi](https://badge.fury.io/py/celluloid.svg)](https://pypi.org/project/celluloid/)
  [![pypi versions](https://img.shields.io/pypi/pyversions/celluloid.svg)](https://pypi.org/project/celluloid/)

  Easy Matplotlib Animation

  <p align="center">
    <a href="https://github.com/jwkvam/celluloid/blob/master/examples/sines.py">
      <img src="https://user-images.githubusercontent.com/86304/48657442-9c11e080-e9e5-11e8-9f54-f46a960be7dd.gif">
    </a>
  </p>

  Creating animations should be easy.
  This module makes it easy to adapt your existing visualization code to create an animation.



  ```
  pip install celluloid
  ```



  Follow these steps:

  1. Create a matplotlib `Figure` and create a `Camera` from it:

  ```python
  from celluloid import Camera
  fig = plt.figure()
  camera = Camera(fig)
  ```

  2. Reusing the figure and after each frame is created, take a snapshot with the camera.

  ```python
  plt.plot(...)
  plt.fancy_stuff()
  camera.snap()
  ```

  3. After all frames have been captured, create the animation.

  ```python
  animation = camera.animate()
  animation.save('animation.mp4')
  ```

  The entire [module](https://github.com/jwkvam/celluloid/blob/master/celluloid.py) is less than 50 lines of code.





  As simple as it gets.

  ```python
  from matplotlib import pyplot as plt
  from celluloid import Camera

  fig = plt.figure()
  camera = Camera(fig)
  for i in range(10):
      plt.plot([i] * 10)
      camera.snap()
  animation = camera.animate()
  ```

  <p align="center">
    <a href="https://github.com/jwkvam/celluloid/blob/master/examples/simple.py">
      <img src="https://user-images.githubusercontent.com/86304/48666133-66660980-ea70-11e8-9024-b167c21a5e83.gif">
    </a>
  </p>



  Animation at the top.

  ```python
  import numpy as np
  from matplotlib import pyplot as plt
  from celluloid import Camera

  fig, axes = plt.subplots(2)
  camera = Camera(fig)
  t = np.linspace(0, 2 * np.pi, 128, endpoint=False)
  for i in t:
      axes[0].plot(t, np.sin(t + i), color='blue')
      axes[1].plot(t, np.sin(t - i), color='blue')
      camera.snap()
  animation = camera.animate()
  ```



  Domain coloring example.

  ```python
  import numpy as np
  from matplotlib import pyplot as plt
  from matplotlib.colors import hsv_to_rgb

  from celluloid import Camera

  fig = plt.figure()
  camera = Camera(fig)

  for a in np.linspace(0, 2 * np.pi, 30, endpoint=False):
      x = np.linspace(-3, 3, 800)
      X, Y = np.meshgrid(x, x)
      x = X + 1j * Y
      y = (x ** 2 - 2.5) * (x - 2.5 * 1j) * (x + 2.5 * 1j) \
          * (x - 2 - 1j) ** 2 / ((x - np.exp(1j * a)) ** 2
          * (x - np.exp(1j * 2 * a)) ** 2)

      H = np.angle(y) / (2 * np.pi) + .5
      r = np.log2(1. + np.abs(y))
      S = (1. + np.abs(np.sin(2. * np.pi * r))) / 2.
      V = (1. + np.abs(np.cos(2. * np.pi * r))) / 2.

      rgb = hsv_to_rgb(np.dstack((H, S, V)))
      ax.imshow(rgb)
      camera.snap()
  animation = camera.animate()
  ```

  <p align="center">
    <a href="https://github.com/jwkvam/celluloid/blob/master/examples/complex.py">
      <img src="https://user-images.githubusercontent.com/86304/48747098-f483f080-ec26-11e8-9734-c409e9b0c9ec.gif">
    </a>
  </p>



  ```python
  import matplotlib
  from matplotlib import pyplot as plt
  from celluloid import Camera

  fig = plt.figure()
  camera = Camera(fig)
  for i in range(5):
      t = plt.plot(range(i, i + 5))
      plt.legend(t, [f'line {i}'])
      camera.snap()
  animation = camera.animate()
  ```

  <p align="center">
    <a href="https://github.com/jwkvam/celluloid/blob/master/examples/complex.py">
      <img src="https://user-images.githubusercontent.com/86304/48750564-9100bf80-ec34-11e8-87fb-bc5c7ddcc6e7.gif">
    </a>
  </p>



  - The axes' limits should be the same for all plots. The limits of the animation will be the limits of the final plot.
  - Legends will accumulate from previous frames. Pass the artists to the `legend` function to draw them separately.



  Inspired by [plotnine](https://github.com/has2k1/plotnine/blob/master/plotnine/animation.py).


pkgId: 00ffcb0b10d6df1a33459cf88432a4054cdbdc24163d6a33696834af6d91fd38
name: python-cellxgene-census
arch: src
version: 1.16.2
epoch: 0
release: 1
url: https://pypi.org/project/cellxgene-census/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellxgene-census-1.16.2-1.src.rpm
checksum_type: sha256
summary:
  API to facilitate the use of the CZ CELLxGENE Discover Census. For more information about the API and the project visit https://github.com/chanzuckerberg/cellxgene-census/

description:
  The `cellxgene_census` package provides an API to facilitate the use of the CZ CELLxGENE Discover Census. For more information about the API and the project visit the [chanzuckerberg/cellxgene-census GitHub repo](https://github.com/chanzuckerberg/cellxgene-census/).



  For more help, please file a issue on the repo, or contact us at <soma@chanzuckerberg.com>.

  If you believe you have found a security issue, we would appreciate notification. Please send email to <security@chanzuckerberg.com>.



  - Create a virtual environment using `venv` or `conda`
  - `cd` to the root of this repository
  - `pip install -e api/python/cellxgene_census`
  - To install dependencies needed to work on the [experimental](./src/cellxgene_census/experimental/) portion of the API:
    `pip install -e 'api/python/cellxgene_census[experimental]'`.
  - `pip install jupyterlab`
  - **Test it!** Either open up a new `jupyter` notebook or the `python` interpreter and run this code:

  ```python
  import cellxgene_census

  with cellxgene_census.open_soma() as census:

      cell_metadata = cellxgene_census.get_obs(
          census,
          "homo_sapiens",
          value_filter = "sex == 'female' and cell_type in ['microglial cell', 'neuron']",
          column_names = ["assay", "cell_type", "tissue", "tissue_general", "suspension_type", "disease"]
      )
      cell_metadata
  ```

  The output is a `pandas.DataFrame` with over 600K cells meeting our query criteria and the selected columns:

  ```python

  The "stable" release is currently 2023-12-15. Specify 'census_version="2023-12-15"' in future calls to open_soma() to ensure data consistency.

                  assay        cell_type                 tissue tissue_general suspension_type disease     sex
  0        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
  1        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
  2        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
  3        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
  4        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
  ...               ...              ...                    ...            ...             ...     ...     ...
  607636  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
  607637  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
  607638  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
  607639  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
  607640  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female

  [607641 rows x 7 columns]

  ```

  - Learn more about the Census API by going through the tutorials in the [notebooks](../notebooks/)


pkgId: ccccea71db822544ce9f8532fe27deebaa057ada4f1a04769e8d70a76d379eeb
name: python-cellxgene-ontology-guide
arch: src
version: 1.3.0
epoch: 0
release: 1
summary: Access ontology metadata used by CZ cellxgene
url: https://pypi.org/project/cellxgene-ontology-guide/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellxgene-ontology-guide-1.3.0-1.src.rpm
checksum_type: sha256
description:
  API Documentation: https://chanzuckerberg.github.io/cellxgene-ontology-guide/cellxgene_ontology_guide.html

rpm_license:
  MIT License  Copyright (c) 2021 Chan Zuckerberg Initiative  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: 1a7f2415f138b79f666975729992b08ef97caa29c13a5a343b732cb8b634ff75
name: python-cellxgene_lamin
arch: src
version: 0.3.2
epoch: 0
release: 1
summary: Manage cellxgene metadata using LaminDB.
url: https://pypi.org/project/cellxgene_lamin/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cellxgene_lamin-0.3.2-1.src.rpm
checksum_type: sha256
description:
  [![pypi](https://img.shields.io/pypi/v/cellxgene-lamin?color=blue&label=pypi%20package)](https://pypi.org/project/cellxgene-lamin)



  Try it out with the public instance `laminlabs/cellxgene`:

  - via LaminHub: https://lamin.ai/laminlabs/cellxgene
  - via LaminDB API: `lamin load laminlabs/cellxgene`

  Reference:

  - [CELLxGENE](https://cellxgene.cziscience.com/)
  - [CELLxGENE Census](https://chanzuckerberg.github.io/cellxgene-census/)
  - [TileDB-SOMA](https://github.com/single-cell-data/TileDB-SOMA)
  - [TileDB](https://github.com/TileDB-Inc/TileDB-Py)


pkgId: 8eb20883dedc464697a07554f8c9220772b58fd028fe81d66bc5582b415e2bd0
name: python-cemba-data
arch: src
version: 1.6.9
epoch: 0
release: 1
summary: Pipelines for single nucleus methylome and multi-omic dataset.
url: https://github.com/lhqing/cemba_data
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cemba-data-1.6.9-1.src.rpm
checksum_type: sha256
description:
  [](http://www.network-science.de/ascii/)
  <pre>
   **    **     **        *******
  //**  **     ****      /**////**
   //****     **//**     /**   /**
    //**     **  //**    /*******
     /**    **********   /**////
     /**   /**//////**   /**
     /**   /**     /**   /**
     //    //      //    //
  </pre>


  Pipeline(s) for mapping and cluster-level aggregation of single nucleus methylome and multi-omic datasets.
  Technologies supported:
  - snmC-seq(1/2/3)
  - snmCT-seq (mC + RNA)
  - snmC2T-seq (mC + RNA + Chromatin Accessibility)
  - snm3C-seq (mC + Chromatin Conformation)
  - any NOMe treated version of the above

  [See Documentation](https://hq-1.gitbook.io/mc/)


pkgId: 64288a5feab8cf85b09a3814c63fc603e5e0adcbf69f211f6c6bf75e97809cd4
name: python-cemc-plots-kit
arch: src
version: 2024.10.0
epoch: 0
release: 1
summary: Plots tool for CEMC's NWP Opearting systems.
url: https://github.com/cemc-oper/cemc-plots-kit
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cemc-plots-kit-2024.10.0-1.src.rpm
checksum_type: sha256
description:
  适用于 CEMC 数值天气预报模式数据的绘图工具。



  Copyright &copy; 2024, developers at cemc-oper.

  `cemc-plots-kit` is licensed under [Apache License V2.0](./LICENSE)


pkgId: 08764a283d6facfcc9614b7f2e4b25af7be81c943600468f7022d244b3315049
name: python-cemirutils
arch: src
version: 2.2.3
epoch: 0
release: 1
url: https://github.com/cememir/cemirutils
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cemirutils-2.2.3-1.src.rpm
checksum_type: sha256
summary:
  Pythona yeni başlayanlar ve zaten kullananların yaptıkları işlerde vakit kazanmasını sağlayacak fonksiyon, metod, kütüphane ve dekoratörler...

description:
  `cemirutils` is a Python utility library designed to provide a range of commonly used functions, methods, libraries, and decorators to streamline development in Linux and Python environments.

  - Python 3.9 or higher

  ```sh
  pip install -U cemirutils
  ```

  1. Cem Emir Yüksektepe ([@gmail.com](mailto:cememir2017@gmail.com)) https://cem.pw
  2. Muslu Yüksektepe ([@gmail.com](mailto:musluyuksektepe@gmail.com)) https://muslu.org
  3. Hasan Yüksektepe ([@gmail.com](mailto:hasokeyk@gmail.com)) https://hayatikodla.net

  * [https://pypi.org/project/cemirutils/](https://pypi.org/project/cemirutils/)


pkgId: 68bf2ae95f1db336d9a929f47546ab193ac88f19b0ff947fd7658b36cbd49c8b
name: python-cems-nuclei
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Python wrapper around NUCLEI's functionality.
url: https://pypi.org/project/cems-nuclei/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cems-nuclei-1.0.1-1.src.rpm
checksum_type: sha256
description:
  [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
  [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

  This repository is created by [CEMS BV](https://cemsbv.nl/) and helps the user to access and process API calls to
  the [NUCLEI](https://nuclei.cemsbv.io/#/) environment.



  To install this package, including the `NucleiClient` library and its dependencies, run:

  ```bash
  pip install cems-nuclei[client]
  ```

  To skip the installation of the `NucleiClient` library, in case you do not need it (e.g. only use pure requests), run:

  ```bash
  pip install cems-nuclei
  ```



  To use `nuclei` add the follow ENV vars to your environment. Or provide them when asked.

  ```
  * NUCLEI_TOKEN
      - Your NUCLEI user token
  ```

  You can obtain your `NUCLEI_TOKEN` on [NUCLEI](https://nuclei.cemsbv.io/#/).
  Go to `personal-access-tokens` and create a new user token.





  We recommend developing in Python3.9 with a clean virtual environment (using `virtualenv` or `conda`), installing the
  requirements from the requirements.txt file:

  Example using `virtualenv` and `pip` to install the dependencies in a new environment .env on Linux:

  ```bash
  python -m venv .env
  source activate .env/bin/activate
  python -m pip install --upgrade pip setuptools
  pip install -r requirements.txt
  pip install -e .
  ```



  Build the docs:

  ```bash
  python -m pip install --upgrade pip setuptools
  pip install -r requirements.txt
  pip install .
  sphinx-build -b html docs public
  ```

  Note: You'll need to set the `NUCLEI_TOKEN` environmental variable.
  You can get your token at: `https://cemsbv.crux-nuclei.com`



  We format our code with black and isort.

  ```bash
  black --config "pyproject.toml" src/nuclei tests
  isort --settings-path "pyproject.toml" src/nuclei tests
  ```



  To maintain code quality we use the GitHub super-linter.

  To run the linters locally, run the `run_super_linters.sh` bash script from the root directory.



  Test the software with the use of coverage:

  ```bash
  python -m pip install --upgrade pip setuptools
  pip install -r requirements.txt
  pip install .
  coverage run -m pytest
  ```



  Requirements are autogenerated by `pip-compile` with python 3.9

  ```bash
  pip-compile --extra=test --extra=docs --extra=lint --extra=client --output-file=requirements.txt pyproject.toml
  ```

  To update the requirements within the defined ranges, run:

  ```bash
  pip-compile --upgrade --extra=test --extra=docs --extra=lint --extra=client --output-file=requirements.txt pyproject.toml
  ```

rpm_license:
  MIT License  Copyright (c) 2023 CEMS  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: 3fb20d1e37de4e472ec95cac066f415fdd149b9ff97c63728c2f88c202cd28e9
name: python-cen_detect_hor
arch: src
version: 0.0.1
epoch: 0
release: 1
url: https://pypi.org/project/cen_detect_hor/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cen_detect_hor-0.0.1-1.src.rpm
checksum_type: sha256
summary:
  Library to characterise tandem repeats in genomic sequences in terms of evolutionary relationships, looking for so called higher-order-repeats. It has been pecifically designed to analyse non-coding centromeric high-repetition regions of chromosomes.

description:
  - [Installation](#installation)
  - [License](#license)

  ```console
  pip install cen_detect_hor
  ```

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


pkgId: adec196eb90ad33ee002363f9433f16dc4090f14aac477392b30c3e4510c5ad6
name: python-cenclave
arch: src
version: 1.0.0a5
epoch: 0
release: 1
summary: Command Line Interface for Cosmian Enclave
url: https://pypi.org/project/cenclave/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cenclave-1.0.0a5-1.src.rpm
checksum_type: sha256
description:
  Cosmian Enclave allows to easily run confidential Python web applications based on [Intel® SGX](https://www.intel.com/content/www/us/en/products/docs/accelerator-engines/software-guard-extensions.html) and [Gramine](https://gramine.readthedocs.io/en/latest/).
  Its features include the ability to encrypt the code and the construction of a [RATLS](https://arxiv.org/pdf/1801.05863) channel with your enclave.

  Read [Cosmian Enclave documentation](https://docs.cosmian.com/compute/cosmian_enclave/overview/) for more details.



  ```console
  $ pip install cenclave
  ```



  ```console
  $ cenclave -h
  ```

  Note: if you set the env variable `BACKTRACE=full`, a Python stacktrace will be printed in case of errors.



  __User__: the code provider

  ```console
  $ cenclave scaffold example
  ```



  __User__: the code provider

  ```console
  $ cenclave localtest --project example/
  ```



  __User__: the code provider

  ```console
  $ cenclave package --project example/ \
                     --output workspace/code_provider
  ```

  The generated package can now be sent to the sgx operator.



  __User__: the SGX operator

  ```console
  $ cenclave spawn --host 127.0.0.1 \
                   --port 9999 \
                   --size 4096 \
                   --package workspace/code_provider/package_cenclave_src_1683276327723953661.tar \
                   --output workspace/sgx_operator/ \
                   app_name
  ```

  At this moment, evidences have been automatically collected and the web application is up.

  Evidences are essential for the code provider to verify the trustworthiness of the running application.

  The file `workspace/sgx_operator/evidence.json` can now be shared with the other participants.



  __User__: the code provider

  The trustworthiness is established based on multiple information:

  - the full code package (tarball)
  - the arguments used to spawn the web app
  - evidences captured from the enclave

  Verification of the enclave information:

  ```console
  $ cenclave verify --package workspace/code_provider/package_cenclave_src_1683276327723953661.tar \
                    --evidence output/evidence.json \
                    --output /tmp
  ```

  If the verification succeeds, you get the RA-TLS certificate (written as a file named `ratls.pem`) and you can now seal
  the code key to share it with the SGX operator.



  __User__: the code provider

  ```console
  $ cenclave seal --secrets example/secrets_to_seal.json \
                  --cert /tmp/ratls.pem \
                  --output workspace/code_provider/
  ```



  __User__: the SGX operator

  ```console
  $ cenclave run --sealed-secrets workspace/code_provider/secrets_to_seal.json.sealed \
                 app_name
  ```



  __User__: the SGX operator

  ```console
  $ cenclave test --test workspace/sgx_operator/tests/ \
                  --config workspace/sgx_operator/config.toml \
                  app_name
  ```



  __User__: the code provider

  Assume the SGX operator gets a result as follows: `curl https://localhost:7788/result --cacert /tmp/ratls.pem >
  result.enc`

  Then, the code provider can decrypt the result as follows:

  ```console
  $ cenclave decrypt --key key.txt \
                     --output workspace/code_provider/result.plain \
                     result.enc
  $ cat workspace/code_provider/result.plain
  ```



  __User__: the SGX operator

  You can stop and remove the container as follows:

  ```console
  $ cenclave stop [--remove] <app_name>
  ```

  You can restart a stopped and not removed containers as follows:

  ```console
  $ cenclave restart <app_name>
  ```

  You can get the Cosmian Enclave container logs as follows:

  ```console
  $ cenclave logs <app_name>
  ```

  You can get the Cosmian Enclave docker status as follows:

  ```console
  $ cenclave status <app_name>
  ```

  You can get the list of running Cosmian Enclave containers:

  ```console
  $ cenclave list
  ```


pkgId: 60c35b713688c4e331ada04a95570e41df6eec3884d02cef6dc29c7beba336e0
name: python-cenclave-lib-crypto
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: Cryptography Library for Cosmian Enclave
url: https://pypi.org/project/cenclave-lib-crypto/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cenclave-lib-crypto-1.0.0-1.src.rpm
checksum_type: sha256
description:
  Python cryptography library for [Cosmian Enclave](https://docs.cosmian.com/compute/cosmian_enclave/overview/) based on [PyNaCl](https://github.com/pyca/pynacl/) (binding to [libsodium](https://github.com/jedisct1/libsodium)) and [cryptography](https://github.com/pyca/cryptography).



  ```console
  $ pip install cenclave-lib-crypto
  ```


pkgId: d122cbe594fb46cda9b4a9fc69aeeade1346d48d9c3439c013b7e160f50762ac
name: python-cenclave-lib-sgx
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: Library to bootstrap WSGI/ASGI application for Gramine
url: https://pypi.org/project/cenclave-lib-sgx/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cenclave-lib-sgx-1.0.0-1.src.rpm
checksum_type: sha256
description:
  Cosmian Enclave lib SGX bootstraps the execution of an encrypted ASGI/WSGI Python web application for [Gramine](https://gramine.readthedocs.io/).

  The library is responsible for:

  - Configuring the SSL certificates with either:
    - *RA-TLS*, a self-signed certificate including the Intel SGX quote in an X.509 v3 extension
    - *Custom*, the private key and full keychain is provided by the application owner
    - *No SSL*, the secure channel may be managed elsewhere by an SSL proxy
  - Decrypting Python modules encrypted with XSala20-Poly1305 AE
  - Running the ASGI/WSGI Python web application with [hypercorn](https://pgjones.gitlab.io/hypercorn/)



  The flow to run an encrypted Python web application is the following:

  1. A first self-signed HTTPS server using RA-TLS is launched waiting to receive a JSON payload with:
     - UUID, a unique application identifier provided to `enclave-bootstrap` as an argument
     - the decryption key of the code
     - Optionally the private key corresponding to the certificate provided to `enclave-bootstrap` (for *Custom* certificate)
  2. If the UUID and decryption key are the expected one, the configuration server is stopped, the code is decrypted and finally run as a new server




  ```console
  $ pip install cenclave-lib-sgx
  ```



  ```console
  $ cenclave-bootstrap --help
  usage: cenclave-bootstrap [-h] [--host HOST] [--port PORT] [--subject SUBJECT] [--san SAN] --app-dir
                            APP_DIR --id ID [--plaincode] [--timeout TIMEOUT] [--version] [--debug]
                            (--ratls EXPIRATION_DATE | --no-ssl | --certificate CERTIFICATE_PATH)
                            application

  Bootstrap ASGI/WSGI Python web application for Gramine

  positional arguments:
    application           ASGI application path (as module:app)

  options:
    -h, --help            show this help message and exit
    --host HOST           hostname of the server
    --port PORT           port of the server
    --subject SUBJECT     Subject as RFC 4514 string for the RA-TLS certificate
    --san SAN             Subject Alternative Name in the RA-TLS certificate
    --app-dir APP_DIR     path of the python web application
    --id ID               identifier of the application as UUID in RFC 4122
    --plaincode           unencrypted python web application
    --timeout TIMEOUT     seconds before closing the configuration server
    --version             show program's version number and exit
    --debug               debug mode with more logging
    --ratls EXPIRATION_DATE
                          generate a self-signed certificate for RA-TLS with a specific expiration date
                          (Unix time)
    --no-ssl              use HTTP without SSL
    --certificate CERTIFICATE_PATH
                          custom certificate used for the SSL connection, private key must be sent through
                          the configuration server

  ```


pkgId: 8c98c031b2f651c00bb1fe8d4f0e99a5186670e987342d28c690954063d32e1b
name: python-cenpy
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Explore and download data from Census APIs
url: https://github.com/cenpy-devs/cenpy
rpm_license: 3-Clause BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cenpy-1.0.1-1.src.rpm
checksum_type: sha256
description:
  An interface to explore and query the US Census API and return Pandas
  Dataframes. This package is intended for exploratory data
  analysis and draws inspiration from sqlalchemy-like interfaces and
  ``acs.R``. With separate APIs for application developers and folks who
  only want to get their data quickly & painlessly, ``cenpy`` should meet
  the needs of most who aim to get US Census Data from Python.
  A few examples are available from `our website <https://cenpy-devs.github.io/cenpy>`__:
  - `getting data quickly using Cenpy <https://nbviewer.jupyter.org/github/cenpy-devs/cenpy/blob/master/notebooks/product-api.ipynb>`__.
  - `analyzing segregation over time & across space using cenpy and segregation <https://nbviewer.jupyter.org/github/cenpy-devs/cenpy/blob/master/notebooks/segregation.ipynb>`__
  - `a road to frictionless urban data science using cenpy and osmnx <https://nbviewer.jupyter.org/github/cenpy-devs/cenpy/blob/master/notebooks/osmnx-and-cenpy.ipynb>`__
  - `developer building blocks <http://nbviewer.ipython.org/github/cenpy-devs/cenpy/blob/master/notebooks/automatic-wrapper.ipynb>`__.
  - `piecing together the developer building blocks (by @dfolch) <https://nbviewer.jupyter.org/gist/dfolch/2440ba28c2ddf5192ad7>`__


pkgId: 0faa896b569502654f893b30e62169507dd336fdfb723000d4335563848c0cb4
name: python-censius
arch: src
version: 1.9.1
epoch: 0
release: 1
summary: API for Censius SDK
url: https://github.com/Censius/censius-logs-python-sdk
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-censius-1.9.1-1.src.rpm
checksum_type: sha256
description:
  ```
  pip install censius -U

  ```


  ```
   pip install --trusted-host pypi-dev.eastus.azurecontainer.io:8080 \
   --index-url http://pypi-dev.eastus.azurecontainer.io:8080/simple/ censius -U
  ```



  https://documentation.censius.ai/api-reference


   - build the package with below command
   ```
      python setup.py sdist
   ```
   your package will be available in dist folder

   - install package in local venv
   ```
      pip install your_package_name
   ```


pkgId: 54a2f2850a9d2deef35e84c7c3a861042dd9535221dc4ec9ddab092a14dcb014
name: python-censore
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: A package for censoring profanity in text
url: https://github.com/censor-text/censore
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-censore-0.2.0-1.src.rpm
checksum_type: sha256
description:
  If you have a special case and you need to censor the text in some specific languages ​​other than the preloaded ones, you can specify them in the `languages` parameter:
  ```python
  censor.censor_text("fuck you хуєсос kapullo", languages=["en", "es"])

  ```
  Oh, the Ukrainian word `хуєсос` was **not** censored 😨
  We could add Ukrainian to the `languages` parameter, but would you like to enter there every time the standard languages ​​and additional ones that should be used only in this case (in this case Spanish) ?
  I think not, then we can just use the `additional_languages` option:
  ```python
  censor.censor_text("fuck you хуєсос kapullo", additional_languages=["es"])

  ```


pkgId: 658e1e51827f8934e91eeaea76c820de2f4aa9c74738470b8889346e2a20d406
name: python-censoredsummarystats
arch: src
version: 0.2.14
epoch: 0
release: 1
url: https://github.com/kurtvanness/CensoredSummaryStats
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-censoredsummarystats-0.2.14-1.src.rpm
checksum_type: sha256
summary:
  A python package for calculating summary stats on censored data (data that contains < and > symbols).

description:
  A repository that contains a CensoredData class for analyzing censored data for basic stats.



  When initiating the class, there are two required inputs, 6 default analysis settings that can be changed, and several output column names that can be customized.

  Required inputs:

  - **data**: A pandas DataFrame containing data
  - **value_col**: The column name for the column of potentially censored values

  Default analysis settings:

  - **include_negative_interval**: (default False) This setting controls whether left censored results are assumed to have a lower bound of 0 or whether the result can be negative.
  - **focus_high_potential**: (default True) This setting controls whether the highest potential or lowest potential is the focus for the result. The functions in this repository consider the full range of potential values of a censored result. This can often lead to a potential range for a statistical result. This setting determines whether to focus on the high or low end of the range. The maximum and minimum statistic ignores this setting and focuses on the high and low end of possible values, respectively.
  - **precision_tolerance_to_drop_censor**: (default 0.25) This setting controls whether a range of possible results is returned as censored or non-censored. For example, if an average is known to be between 2 and 3, then 2.5 would be returned as the result since the whole range is within 20% of 2.5 (20% < 25%). If this parameter was set to 0.15 (15%), then the tolerance would not cover the range and a result of <3 or >2 would be returned depending on the value of focus_high_potential.
  - **precision_rounding**: (default True) This setting controls whether to apply a specific rounding procedure (discussed below).
  - **thousands_comma**: (default False) This setting controls whether to output values over 1000 with commas (1,000).
  - **output_interval**: (default True) This setting controls whether to output the interval was converted to the output result.

  Customizable output column names:

  - **stat_col**: (default 'Statistic') This column contains the statistic that was analyzed (minimum, maximum, median, etc.).
  - **result_col**: (default 'Result') This column contains the result of the statistical analysis as a string value. It may contain additional information for percentile or percent exceedance results.
  - **censor_col**: (default 'CensorComponent') This column contains the censor component for statistical results.
  - **numeric_col**: (default 'NumericComponent') This column contains the numeric component for statistical results.
  - **interval_col**: (default 'Interval') This column contains the possible range of the statistical result when considering all possibilities of censored values.
  - **threshold_col**: (default 'Threshold') This column contains the threshold supplied by the user for the percent_exceedances method.
  - **exceedances_col**: (default 'Exceedances') This column contains the number of exceedances resulting from the percent_exceedances method.
  - **non_exceedances_col**: (default 'NonExceedances') This column contains the number of non-exceedances resulting from the percent_exceedances method.
  - **ignored_col**: (default 'Ignored') This column contains the number of values that couldn't be assessed for the percent_exceedances method. For example, a value of '<2' cannot be determined as being above or below 1. Users should manually adjust values to be above or below the supplied threshold if they need to be considered.
  - **warning_col**: (default 'Warning') This column is only generated for percentiles under certain situations.



  There is a built in rounding option that is based on common water quality reporting measurement precision.

  | NumericComponent  | Rounding process |
  | ------------- | ------------- |
  | ≥100  | 3 significant figures  |
  | ≥10 to <100  | 1 decimal place  |
  | ≥0.2 to <10  | 2 decimal place  |
  | ≥0.1 to <0.2  | 3 decimal place  |
  | <0.1  | 2 significant figures  |


  The primary methods include maximum, minimum, mean, percentile, median (same as 50th percentile). Additional methods are described below.

  The class requires a dataframe that contains a column of potentially censored values. This package is most useful when the results are written as strings that cannot be directly converted to a numeric datatype due to the presence of symbols that indicate the value is potentially above or below a particular value. The accepted censorship symbols include (<,≤,≥,>).

  Additional table columns can be provided as a list so that the statistical functions obtain results for specified groups.

  1.	**maximum**: Calculate the maximum value for a set of values.

  2.	**minimum**: Calculate the minimum value for a set of values.

  3.	**mean** or **average**: Calculate the average value for a set of values.

  4.	**median**: Calculate the median value for a set of values.

  5.	**percentile**: Calculate a percentile for a set of values. The desired percentile should be provided as a number between 0 and 100. The default percentile method is Hazen, but other methods include Weibull, Tukey, Blom, and Excel as described in https://environment.govt.nz/assets/Publications/Files/hazen-percentile-calculator-2.xls

  6.	**add**: Calculate the sum for a set of values.

  7.	**percent_exceedance**: Calculate the percentage of values that exceed a specified threshold. The desired threshold should be provided as a number. The default is to not treat results equal to the threshold as exceedances, but this can be changed by setting threshold_is_exceedance to True.




  Many of the methods above have similar input parameters. Those are:

  - **groupby_cols**: (default None) These are the columns that should be used to define the groups. Multiple groupings can be provided for some functions. This is useful to even weight data over sites or time periods. For example, a potential input for could be [['Year','Month','Day'], ['Year','Month'], ['Year']]. This would ensure that all days are evenly weighted within the month and that all months are evenly weighted within the year for a stat such as mean or median.
  - **count_cols**: (default None) Supplying a list of strings here will cause methods to return value counts. There should be the same number of strings as there are groupings in groupby_cols. Using the same example for groupby_cols, a user could supply ['Samples', 'Days Sampled', 'Months Sampled'] to get value counts for each grouping.
  - **stat_name**: (default is statistic) The text to use to describe the stat ('Minimum', 'Median', etc.)
  - **filters**: (default None) A dictionary of column names with values to filter for. This allows some simple filtering without recreating CensoredData objects.

  The percentile function has the following additional input parameters:
  - **percentile**: The percentile that should be determined. The supplied value needs to be between 0 and 100.
  - **method**: (default hazen) The percentile method to use. Options include: 'weibull', 'tukey', 'blom', 'hazen', 'excel'.



  For the installation of `censoredsummarystats`, the following packages are required:
  - [numpy >= 1.24](https://www.numpy.org/)



  You can install `censoredsummarystats` using pip. For Windows users

  ```python
  pip install censoredsummarystats
  ```



  An example of `censoredsummarystats` usage is given below.

  ```python
  import pandas as pd
  import censoredsummarystats as css


  df = pd.DataFrame([
      ['Site1','E. coli', 2021, '<1'],
      ['Site1','E. coli', 2021, '<1'],
      ['Site1','E. coli', 2022, 455],
      ['Site1','E. coli', 2022, '>2420'],
      ['Site1','E. coli', 2022, 257],
      ['Site2','E. coli', 2021, 5],
      ['Site2','E. coli', 2021, '>2420'],
      ['Site2','E. coli', 2022, '<10'],
      ['Site2','E. coli', 2022, 17000],
      ['Site2','Temperature', 2022, 12.4]
      ],
      columns=['SiteID','Parameter','Year','Result'])

    SiteID    Parameter  Year Result
  0  Site1      E. coli  2021     <1
  1  Site1      E. coli  2021     <1
  2  Site1      E. coli  2022    455
  3  Site1      E. coli  2022  >2420
  4  Site1      E. coli  2022    257
  5  Site2      E. coli  2021      5
  6  Site2      E. coli  2021  >2420
  7  Site2      E. coli  2022    <10
  8  Site2      E. coli  2022  17000
  9  Site2  Temperature  2022   12.4


  cdf = css.CensoredData(data=df,value_col='Result')


  annual_maximums = cdf.maximum(groupby_cols=[['SiteID','Parameter','Year']],
                                  count_cols=['Samples'],
                                  stat_name='Annual Maximum')


  site_ecoli_maximums = cdf.maximum(groupby_cols=[['SiteID','Year'],['SiteID']],
                                  count_cols=['Samples','YearsSampled'],
                                  stat_name='Site Maximum',
                                  filters = {'Parameter':['E. coli']})


  annual_averages = cdf.average(groupby_cols=[['SiteID','Parameter','Year']],
                                  count_cols=['Samples'],
                                  stat_name='Annual Average')

  ```
  Outputs are like this:
  ```python
  print(annual_maximums)
  	SiteID	Parameter	Year	Statistic	Result	Interval	Samples
  0	Site1	E. coli	        2021	Annual Maximum	<1	[0, 1)	        2
  1	Site1	E. coli	        2022	Annual Maximum	>2420	(2420, inf)	3
  2	Site2	E. coli	        2021	Annual Maximum	>2420	(2420, inf)	2
  3	Site2	E. coli	        2022	Annual Maximum	17000	[17000, 17000]	2
  4	Site2	Temperature	2022	Annual Maximum	12.4    [12.4, 12.4]	1


  print(site_ecoli_maximums)
  	SiteID	Statistic	Result	Interval	Samples	YearsSampled
  0	Site1	Site Maximum	>2420	(2420, inf)	5	2
  1	Site2	Site Maximum	≥17000	[17000, inf)	4	2


  print(annual_averages)
  	SiteID	Parameter	Year	Statistic	Result	Interval	Samples
  0	Site1	E. coli	        2021	Annual Average	<1	[0, 1)	        2
  1	Site1	E. coli	        2022	Annual Average	>1040	(1044, inf)	3
  2	Site2	E. coli	        2021	Annual Average	>1210	(1212.5, inf)	2
  3	Site2	E. coli	        2022	Annual Average	8500	[8500, 8505)	2
  4	Site2	Temperature	2022	Annual Average	12.4	[12.4, 12.4]	1
  ```


pkgId: 3ce64e1e7ebf85b98ae36c05024349ccc7306c958f07e70288aec59a4960f4a7
name: python-census-data-downloader
arch: src
version: 0.0.37
epoch: 0
release: 1
summary: Download U.S. census data and reformat it for humans
url: http://www.github.com/datadesk/census-data-downloader
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-census-data-downloader-0.0.37-1.src.rpm
checksum_type: sha256
description:
  Download [American Community Survey data](https://www.census.gov/programs-surveys/acs/data.html) from the U.S. Census Bureau and reformat it for humans.



  All of the data files processed by this repository are published in the [`data/processed/`](./data/processed/) folder. They can be called in to applications via their raw URLs, like https://raw.githubusercontent.com/datadesk/census-data-downloader/master/data/processed/acs5_2017_population_counties.csv



  The library can be installed as a command-line interface that lets you download files on demand.



  ```bash
  $ pipenv install census-data-downloader
  ```



  There's now a tool named `censusdatadownloader` ready for you.

  ```bash
  Usage: censusdatadownloader [OPTIONS] TABLE COMMAND [ARGS]...

    Download Census data and reformat it for humans

  Options:
    --data-dir TEXT  The folder where you want to download the data
    --year [2009-2021]   The years of data to download. By default it gets only the
                     latest year. Not all data are available for every year. Submit 'all' to get every year.
    --force          Force the downloading of the data
    --help           Show this message and exit.

  Commands:
    aiannhhomelands            Download American Indian, Alaska Native and...
    cnectas                    Download combined New England city and town...
    congressionaldistricts     Download Congressional districts
    counties                   Download counties in all states
    countysubdivision          Download county subdivisions
    csas                       Download combined statistical areas
    divisions                  Download divisions
    elementaryschooldistricts  Download elementary school districts
    everything                 Download everything from everywhere
    msas                       Download metropolitian statistical areas
    nationwide                 Download nationwide data
    nectas                     Download New England city and town areas
    places                     Download Census-designated places
    pumas                      Download public use microdata areas
    regions                    Download regions
    secondaryschooldistricts   Download secondary school districts
    statelegislativedistricts  Download statehouse districts
    states                     Download states
    tracts                     Download Census tracts
    unifiedschooldistricts     Download unified school districts
    urbanareas                 Download urban areas
    zctas                      Download ZIP Code tabulation areas
  ```

  Before you can use it you will need to add your CENSUS_API_KEY to your environment. If you don't have an API key, you can go [here.](https://api.census.gov/data/key_signup.html) One quick way to add your key:

  ```bash
  $ export CENSUS_API_KEY='<your API key>'
  ```

  Using it is as simple as providing one our processed table names to one of the download subcommands.

  Here's an example of downloading all state-level data from the `medianage` dataset.

  ```bash
  $ censusdatadownloader medianage states
  ```

  You can specify the download directory with `--data-dir`.

  ```bash
  $ censusdatadownloader --data-dir ./my-special-folder/ medianage states
  ```

  And you can change the year you download with `--year`.

  ```bash
  $ censusdatadownloader --year 2010 medianage states
  ```

  That's it. Mix and match tables and subcommands to get whatever you need.



  You can also download tables from Python scripts. Import the class of the [processed table](https://github.com/datadesk/census-data-downloader/tree/master/census_data_downloader/tables) you wish to retrieve and pass in your API key. Then call one of the download methods.

  This example brings in all state-level data from the medianhouseholdincomeblack dataset.

  ```python
  >>> from census_data_downloader.tables import MedianHouseholdIncomeBlackDownloader
  >>> downloader = MedianHouseholdIncomeBlackDownloader('<YOUR KEY>')
  >>> downloader.download_states()
  ```

  You can specify the data directory and the years by passing in the `data_dir` and `years` keyword arguments.

  ```python
  >>> downloader = MedianHouseholdIncomeBlackDownloader('<YOUR KEY>', data_dir='./', years=2016)
  >>> downloader.download_states()
  ```



  A gallery of graphics powered by our data is available on [Observable](https://observablehq.com/collection/@datadesk/u-s-census-data).

  [![Black and Latino U.S. population shares](./img/race-map.png)](https://observablehq.com/collection/@datadesk/u-s-census-data)

  The Los Angeles Times used this library for [an analysis of Census undercounts](https://www.latimes.com/projects/la-na-census-native-americans-navajo-nation/) on Native American reservations. The code that powers it is available as an [open-source computational notebook](https://github.com/datadesk/native-american-census-analysis).

  [![The 2020 census is coming. Will Native Americans be counted?](./img/latimes-native-american-undercount.png)](https://www.latimes.com/projects/la-na-census-native-americans-navajo-nation/)





  Subclass our downloader and provided it with its required inputs.

  ```python
  import collections
  from census_data_downloader.core.tables import BaseTableConfig
  from census_data_downloader.core.decorators import register


  @register
  class MedianHouseholdIncomeDownloader(BaseTableConfig):
      PROCESSED_TABLE_NAME = "medianhouseholdincome"  # Your humanized table name
      UNIVERSE = "households"  # The universe value for this table
      RAW_TABLE_NAME = 'B19013'  # The id of the source table
      RAW_FIELD_CROSSWALK = collections.OrderedDict({
          
          "001": "median"
      })
  ```

  Add it to the imports in the [`__init__.py`](census_data_downloader/tables/__init__.py) file and it's good to go.



  The command-line interface is implemented using Click and setuptools. To install it locally for development inside your virtual environment, run the following installation command, as [prescribed by the Click documentation](https://click.palletsprojects.com/en/7.x/setuptools/#setuptools-integration).

  ```bash
  $ pip install --editable .
  ```

  That's it. If you make some good ones, please consider submitting them as pull requests so everyone can benefit.


pkgId: fac9b47db90dd3383487323d590dd5b055d080a132a39d5136653295a737086b
name: python-censusbatchgeocoder
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: A simple Python wrapper for the U.S. Census Geocoding Services API batch service
url: http://www.github.com/palewire/censusbatchgeocoder/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-censusbatchgeocoder-0.1.1-1.src.rpm
checksum_type: sha256
description:
  * Docs: [palewi.re/docs/censusbatchgeocoder](http://palewi.re/docs/censusbatchgeocoder)
  * Code: [github.com/palewire/censusbatchgeocoder/](https://github.com/palewire/censusbatchgeocoder/)
  * Issues: [github.com/palewire/censusbatchgeocoder/issues](https://github.com/palewire/censusbatchgeocoder/issues)
  * Packaging: [pypi.python.org/pypi/censusbatchgeocoder](https://pypi.python.org/pypi/censusbatchgeocoder)


pkgId: c78e734eb63ddeb811cdab07318aab0c18627206d698c92045bf0a73944cfe46
name: python-censusdis
arch: src
version: 1.2.2
epoch: 0
release: 1
summary: US Census utilities for a variety of data loading, analysis, and mapping purposes.
url: https://github.com/vengroff/censusdis
rpm_license: HL3-CL-ECO-EXTR-FFD-LAW-MIL-SV
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-censusdis-1.2.2-1.src.rpm
checksum_type: sha256
description:
  ![U.S. Map of Integration](https://github.com/vengroff/censusdis/raw/main/docs/_static/images/sample05.png)

  [![Hippocratic License HL3-CL-ECO-EXTR-FFD-LAW-MIL-SV](https://img.shields.io/static/v1?label=Hippocratic%20License&message=HL3-CL-ECO-EXTR-FFD-LAW-MIL-SV&labelColor=5e2751&color=bc8c3d)](https://firstdonoharm.dev/version/3/0/cl-eco-extr-ffd-law-mil-sv.html)
  ![PyPI](https://img.shields.io/pypi/v/censusdis)
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/censusdis)

  ![PyPI - Status](https://img.shields.io/pypi/status/censusdis?label=PyPI%20Status)
  ![PyPI - Format](https://img.shields.io/pypi/format/censusdis?label=PyPI%20Format)
  ![PyPI - Downloads](https://img.shields.io/pypi/dm/censusdis?label=PyPI%20Downloads)

  ![GitHub last commit](https://img.shields.io/github/last-commit/vengroff/censusdis)
  ![Tests Badge](https://github.com/vengroff/censusdis/raw/main/reports/junit/tests-badge.svg)
  ![Coverage Badge](https://github.com/vengroff/censusdis/raw/main/reports/coverage/coverage-badge.svg)
  [![Documentation Status](https://readthedocs.org/projects/censusdis/badge/?version=latest)](https://censusdis.readthedocs.io/en/latest/?badge=latest)

  censusdis is a package for discovering, loading, and analyzing U.S. Census data.
  It is designed

  - to support **every dataset**, **every geography, and every year**. It's not just about ACS data through the last time the software
  was updated and released;
  - to support **all geographies, on and off-spine**, not just states, counties, and census tracts;
  - to have **integrated mapping capabilities** that save you time and extra coding;
  - to be intuitive, Pythonic, and fast.



  For the full README, please visit the
  [censusdis source repository](https://github.com/vengroff/censusdis).



  censusdis can be installed with `pip`:

  ```shell
  pip install censusdis
  ```

  Every censusdis query needs four things:

  1. What data set we want to query.
  2. What vintage, or year.
  3. What variables.
  4. What geographies.

  Here is an example of how we can use censusdis to download data once we know
  those four things.

  ```python
  import censusdis.data as ced
  from censusdis.datasets import ACS5
  from censusdis import states

  df_median_income = ced.download(
      
      dataset=ACS5,

      
      vintage=2022,

      
      download_variables=['NAME', 'B19013_001E'],

      
      state=states.NJ,
      county='*'
  )
  ```

  There are many more examples in the tuturial and in the sample notebooks.



  For a tutorial, please see the [censusdis-tutorial](https://github.com/vengroff/censusdis-tutorial) repository.
  This tutorial was presented at [PyData Seattle 2023](https://pydata.org/seattle2023/). If you want to try it out for yourself, the README.md
  contains links that let you run the tutorial notebooks live on [mybinder.org](https://mybinder.org/) in your browser without needing to set up a
  local development environment or download or install any code.



  A 86 minute
  [video](https://www.youtube.com/watch?v=3vyC7ON0Tvg)
  of the tutorial as presented at
  [PyData Seattle 2023](https://pydata.org/seattle2023/)
  is also available.

  [![PyData Seattle Tutorial Video](https://img.youtube.com/vi/3vyC7ON0Tvg/0.jpg)](https://www.youtube.com/watch?v=3vyC7ON0Tvg)



  For the full README, lots of maps, demo notebooks, and more, please visit the
  [censusdis source repository](https://github.com/vengroff/censusdis).


pkgId: 56a847ab92d895ff657e9c291b17ac431943ce0e3fd23b13a6efb1abf36dc8b4
name: python-censusgeocode
arch: src
version: 0.5.2
epoch: 0
release: 1
summary: Thin Python wrapper for the US Census Geocoder
url: https://github.com/fitnr/censusgeocode
rpm_license: GNU General Public License v3 (GPLv3)
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-censusgeocode-0.5.2-1.src.rpm
checksum_type: sha256
description:
  Census Geocode is a light weight Python wrapper for the US Census [Geocoder API](http://geocoding.geo.census.gov/geocoder/), compatible with  Python 3. It comes packaged with a simple command line tool for geocoding an address to a longitude and latitude, or a batch file into a parsed address and coordinates.
  It's strongly recommended to review the [Census Geocoder docs](https://www.census.gov/programs-surveys/geography/technical-documentation/complete-technical-documentation/census-geocoder.html) before using this module.
  Basic example:
  ```python
  import censusgeocode as cg
  cg.coordinates(x=-76, y=41)
  cg.onelineaddress('1600 Pennsylvania Avenue, Washington, DC')
  cg.address('1600 Pennsylvania Avenue', city='Washington', state='DC', zip='20006')
  cg.addressbatch('data/addresses.csv')
  ```
  Use the returntype keyword to specify 'locations' or 'geographies'. 'Locations' yields structured information about the address, and 'geographies' yields information about the Census geographies. Geographies is the default.
  ```python
  cg.onelineaddress('1600 Pennsylvania Avenue, Washington, DC', returntype='locations')
  ```
  Queries return a CensusResult object, which is basically a Python list with an extra 'input' property, which the Census returns to tell you how they interpreted your request.
  ```python
  >>> result = cg.coordinates(x=-76, y=41)
  >>> result.input
  {
      u'vintage': {
          u'vintageName': u'Current_Current',
          u'id': u'4',
          u'vintageDescription': u'Current Vintage - Current Benchmark',
          u'isDefault': True
      },
      u'benchmark': {
          u'benchmarkName': u'Public_AR_Current',
          u'id': u'4',
          u'isDefault': False,
          u'benchmarkDescription': u'Public Address Ranges - Current Benchmark'
      },
      u'location': {
          u'y': 41.0,
          u'x': -76.0
      }
  }
  >>> result
  [{
      '2010 Census Blocks': [{
          'AREALAND': 1409023,
          'AREAWATER': 0,
          'BASENAME': '1045',
          'BLKGRP': '1',
          'BLOCK': '1045',
          'CENTLAT': '+40.9957436',
          'CENTLON': '-076.0089338',
          'COUNTY': '079',
          'FUNCSTAT': 'S',
          'GEOID': '420792166001045',
          'INTPTLAT': '+40.9957436',
          'INTPTLON': '-076.0089338',
          'LSADC': 'BK',
          'LWBLKTYP': 'L',
          'MTFCC': 'G5040',
          'NAME': 'Block 1045',
          'OBJECTID': 9940449,
          'OID': 210404020212114,
          'STATE': '42',
          'SUFFIX': '',
          'TRACT': '216600'
      }],
      'Census Tracts': [{
          
          'NAME': 'Census Tract 2166',
          'OBJECTID': 61245,
          'OID': 20790277158250,
          'STATE': '42',
          'TRACT': '216600'
      }],
      'Counties': [{
          
          'NAME': 'Luzerne County',
          'OBJECTID': 866,
          'OID': 27590277115518,
          'STATE': '42'
      }],
      'States': [{
          
          'NAME': 'Pennsylvania',
          'REGION': '1',
          'STATE': '42',
          'STATENS': '01779798',
          'STUSAB': 'PA'
      }]
  }]
  ```

  By default, the geocoder uses the "Current" vintage and benchmarks. To use another vintage or benchmark, use the `CensusGeocode` class:
  ````python
  from censusgeocode import CensusGeocode
  cg = CensusGeocode(benchmark='Public_AR_Current', vintage='Census2020_Current')
  cg.onelineaddress(foobar)
  ````
  The Census may update the available benchmarks and vintages. Review the Census Geocoder docs for the currently available [benchmarks](https://geocoding.geo.census.gov/geocoder/benchmarks) and [vintages](https://geocoding.geo.census.gov/geocoder/vintages?form).

  The `censusgeocode` tool has two settings.
  At the simplest, it takes one argument, an address, and returns a comma-delimited longitude, latitude pair.
  ````bash
  censusgeocode '100 Fifth Avenue, New York, NY'
  -73.992195,40.73797
  censusgeocode '1600 Pennsylvania Avenue, Washington DC'
  -77.03535,38.898754
  ````
  The Census geocoder is reasonably good at recognizing non-standard addresses.
  ````bash
  censusgeocode 'Hollywood & Vine, LA, CA'
  -118.32668,34.101624
  ````
  It can also use the Census Geocoder's batch function to process an entire file. The file must be comma-delimited, have no header, and include the following columns:
  ````
  unique id, street address, state, city, zip code
  ````
  The geocoder can read from a file:
  ````
  censusgeocode --csv tests/fixtures/batch.csv
  ````
  ([example file](https://github.com/fitnr/censusgeocode/blob/master/tests/fixtures/batch.csv))
  Or from stdin, using `-` as the filename:
  ````
  head tests/fixtures/batch.csv | censusgeocode --csv -
  ````
  According to the Census docs, the batch geocoder is limited to 10,000 rows.
  The output will be a CSV file (with a header) and the columns:
  * id
  * address
  * match
  * matchtype
  * parsed
  * tigerlineid
  * side
  * lat
  * lon
  If your data doesn't have a unique id, try adding line numbers with the Unix command line utility `nl`:
  ```
  nl -s , input.csv | censusgeocode --csv - > output.csv
  ```

  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  You should have received a copy of the GNU General Public License along with this program.  If not, see http://www.gnu.org/licenses/.


pkgId: d75d6c5a48d5c56943650b1a05729a1060d591393325ced882a335c99916f449
name: python-censys
arch: src
version: 2.2.16
epoch: 0
release: 1
summary: An easy-to-use and lightweight API wrapper for Censys APIs (censys.io).
url: https://pypi.org/project/censys/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-censys-2.2.16-1.src.rpm
checksum_type: sha256
description:
  [![PyPI](https://img.shields.io/pypi/v/censys?color=orange&logo=pypi&logoColor=orange)](https://pypi.org/project/censys/)
  [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue?logo=python)](https://www.python.org/downloads/)
  [![Read the Docs (version)](https://img.shields.io/readthedocs/censys-python/latest?logo=read%20the%20docs)](https://censys-python.readthedocs.io/en/stable/?badge=stable)
  [![GitHub Discussions](https://img.shields.io/badge/GitHub-Discussions-brightgreen?logo=github)](https://github.com/censys/censys-python/discussions)
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-organge.svg?logo=git&logoColor=organge)](http://makeapullrequest.com)
  [![License](https://img.shields.io/github/license/censys/censys-python?logo=apache)](https://github.com/censys/censys-python/blob/main/LICENSE)

  An easy-to-use and lightweight API wrapper for Censys APIs ([censys.io](https://censys.io/)). Python 3.8+ is currently supported. This library has been tested on Python 3.8 and 3.x (Currently version 3.10).

  > **Notice:** The Censys Search v1 endpoints are deprecated as of Nov. 30, 2021. Please begin using v2 endpoints to query hosts and certificates and check out our [support center](https://support.censys.io/hc/en-us/sections/360013076551-Censys-Search-2-0) for resources.



  - [Search Censys data](https://censys-python.readthedocs.io/en/stable/usage-v2.html)
  - [Bulk Certificate lookups](https://censys-python.readthedocs.io/en/stable/usage-v2.html#bulk-view)
  - [Download Bulk Data](https://censys-python.readthedocs.io/en/stable/usage-v1.html#data)
  - [Manage assets, events, and seeds in Censys ASM](https://censys-python.readthedocs.io/en/stable/usage-asm.html)
  - [Command-line interface](https://censys-python.readthedocs.io/en/stable/cli.html)

  <!-- markdownlint-disable MD033 -->

  <a href="https://asciinema.org/a/500416" target="_blank"><img src="https://asciinema.org/a/500416.svg" width="600"/></a>

  <!-- markdownlint-enable MD033 -->



  The library can be installed using `pip`.

  ```sh
  pip install censys
  ```

  To upgraded using `pip`.

  ```sh
  pip install --upgrade censys
  ```

  Alternatively, you can install the library using `poetry`.

  ```sh
  git clone https://github.com/censys/censys-python.git
  cd censys-python/
  poetry install
  ```

  Optionally, you can enable tab completion for the CLI by adding this line to your `~/.bashrc`, `~/.zshrc`, or equivalent.

  > Please note that autocomplete is supported for field names in the `search` command.

  ```sh
  eval "$(register-python-argcomplete censys)"
  ```

  To configure your search credentials run `censys config` or set both `CENSYS_API_ID` and `CENSYS_API_SECRET` environment variables.

  ```sh
  $ censys config

  Censys API ID: XXX
  Censys API Secret: XXX
  Do you want color output? [y/n]: y

  Successfully authenticated for your@email.com
  ```

  If you have a Censys ASM account, you can configure your ASM credentials by running `censys asm config` or set both `CENSYS_ASM_API_KEY` environment variables.

  ```sh
  $ censys asm config

  Censys ASM API Key: XXX
  Do you want color output? [y/n]: y

  Successfully authenticated
  ```



  The examples located in the [`examples/`](examples/) directory are a great place to start. You can also find more examples in the [usage documentation](https://censys-python.readthedocs.io/en/stable/usage-v2.html).



  [![Read the Docs](https://raw.githubusercontent.com/censys/censys-python/main/docs/_static/readthedocs.png)](https://censys-python.readthedocs.io/)



  - [Source](https://github.com/censys/censys-python)
  - [Issue Tracker](https://github.com/censys/censys-python/issues)
  - [Changelog](https://github.com/censys/censys-python/releases)
  - [Documentation](https://censys-python.rtfd.io)
  - [Discussions](https://github.com/censys/censys-python/discussions)
  - [Censys Homepage](https://censys.io/)
  - [Censys Search](https://search.censys.io/)



  All contributions (no matter how small) are always welcome. See [Contributing to Censys Python](.github/CONTRIBUTING.md)



  This project uses [poetry](https://python-poetry.org/) for dependency management. Please ensure you have [installed the latest version](https://python-poetry.org/docs/#installation).

  ```sh
  git clone git@github.com:censys/censys-python.git
  cd censys-python/
  poetry install
  ```



  ```sh

  poetry run pytest

  poetry run pytest --cov-report html
  ```



  This software is licensed under [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)

  - Copyright (C) 2024 Censys, Inc.


pkgId: b93ba82c1f5f160ab3bf8d831d01f620dd0e1b7b7a9b86edd7390d83e932d35a
name: python-cent
arch: src
version: 5.0.0
epoch: 0
release: 1
summary: Python library to communicate with Centrifugo v5 server HTTP API
url: https://pypi.org/project/cent/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cent-5.0.0-1.src.rpm
checksum_type: sha256
description:
  Python SDK to communicate with Centrifugo v5 HTTP API. Python >= 3.9 supported.

  To install run:

  ```bash
  pip install cent
  ```



  * **Cent v5 and higher works only with Centrifugo v5**.
  * If you need to work with Centrifugo v3, v4 => use Cent v4
  * If you need to work with Centrifugo v2 => use Cent v3



  First of all, see the description of Centrifugo [server API](https://centrifugal.dev/docs/server/server_api) in the documentation. This library also supports API extensions provided by Centrifugo PRO. In general, refer to [api.proto](https://github.com/centrifugal/centrifugo/blob/master/internal/apiproto/api.proto) Protobuf schema file as a source of truth about all available Centrifugo server APIs. Don't forget that Centrifugo supports both HTTP and GRPC API – so you can switch to GRPC by using `api.proto` file to generate stubs for communication.

  This library contains `Client` and `AsyncClient` to work with Centrifugo HTTP server API. Both clients have the same methods to work with Centrifugo API and raise the same top-level exceptions.



  ```python
  from cent import Client
  ```

  Required init arguments:

  * `api_url` (`str`) - Centrifugo HTTP API URL address, for example, `http://localhost:8000/api`
  * `api_key` (`str`) - Centrifugo HTTP API key for auth

  Optional arguments:

  * `timeout` (`float`) - base timeout for all requests in seconds, default is 10 seconds.
  * `session` (`requests.Session`) - custom `requests` session to use.

  Example:

  ```python
  from cent import Client, PublishRequest

  api_url = "http://localhost:8000/api"
  api_key = "<CENTRIFUGO_API_KEY>"

  client = Client(api_url, api_key)
  request = PublishRequest(channel="channel", data={"input": "Hello world!"})
  result = client.publish(request)
  print(result)
  ```



  ```python
  from cent import AsyncClient
  ```

  Required init arguments:

  * `api_url` (`str`) - Centrifugo HTTP API URL address, for example, `http://localhost:8000`
  * `api_key` (`str`) - Centrifugo HTTP API key for auth

  Optional arguments:

  * `timeout` (`float`) - base timeout for all requests in seconds, default is 10 seconds.
  * `session` (`aiohttp.ClientSession`) - custom `aiohttp` session to use.

  Example:

  ```python
  import asyncio
  from cent import AsyncClient, PublishRequest

  api_url = "http://localhost:8000/api"
  api_key = "<CENTRIFUGO_API_KEY>"

  async def main():
      client = AsyncClient(api_url, api_key)
      request = PublishRequest(channel="channel", data={"input": "Hello world!"})
      result = await client.publish(request)
      print(result)

  if __name__ == "__main__":
      asyncio.run(main())
  ```



  This library raises exceptions if sth goes wrong. All exceptions are subclasses of `cent.CentError`.

  * `CentError` - base class for all exceptions
  * `CentNetworkError` - raised in case of network related errors (connection refused)
  * `CentTransportError` - raised in case of transport related errors (HTTP status code is not 2xx)
  * `CentTimeoutError` - raised in case of timeout
  * `CentUnauthorizedError` - raised in case of unauthorized access (signal of invalid API key)
  * `CentDecodeError` - raised in case of server response decoding error
  * `CentApiResponseError` - raised in case of API response error (i.e. error returned by Centrifugo itself, you can inspect code and message returned by Centrifugo in this case)

  Note, that `BroadcastRequest` and `BatchRequest` are quite special – since they contain multiple commands in one request, handling `CentApiResponseError` is still required, but not enough – you also need to manually iterate over the results to check for individual errors. For example, one publish command can fail while another one can succeed. For example:

  ```python
  from cent import *

  c = Client("http://localhost:8000/api", "api_key")
  req = BroadcastRequest(channels=["1", "2"], data={})
  c.broadcast(req)






  req = BroadcastRequest(channels=["invalid:1", "2"], data={})
  c.broadcast(req)






  ```

  I.e. `cent` library does not raise exceptions for individual errors in `BroadcastRequest` or `BatchRequest`, only for top-level response error, for example, sending empty list of channels in broadcast:

  ```
  req = BroadcastRequest(channels=[], data={})
  c.broadcast(req)
  Traceback (most recent call last):
      ...
      raise CentApiResponseError(
  cent.exceptions.CentApiResponseError: Server API response error #107: bad request
  ```

  So this all adds some complexity, but that's the trade-off for the performance and efficiency of these two methods. You can always write some convenient wrappers around `cent` library to handle errors in a way that suits your application.



  You can use this library to constructs events for Centrifugo [async consumers](https://centrifugal.dev/docs/server/consumers). For example, to get proper method and payload for async publish:

  ```python
  from cent import PublishRequest

  request = PublishRequest(channel="channel", data={"input": "Hello world!"})
  method = request.api_method
  payload = request.api_payload

  ```



  To demonstrate the benefits of using `BroadcastRequest` and `BatchRequest` let's compare approaches. Let's say at some point in your app you need to publish the same message into 10k different channels. Let's compare sequential publish, batch publish and broadcast publish. Here is the code to do the comparison:

  ```python
  from cent import *
  from time import time


  def main():
      publish_requests = []
      channels = []
      for i in range(10000):
          channel = f"test_{i}"
          publish_requests.append(PublishRequest(channel=channel, data={"msg": "hello"}))
          channels.append(channel)
      batch_request = BatchRequest(requests=publish_requests)
      broadcast_request = BroadcastRequest(channels=channels, data={"msg": "hello"})

      client = Client("http://localhost:8000/api", "api_key")

      start = time()
      for request in publish_requests:
          client.publish(request)
      print("sequential", time() - start)

      start = time()
      client.batch(batch_request)
      print("batch", time() - start)

      start = time()
      client.broadcast(broadcast_request)
      print("broadcast", time() - start)


  if __name__ == "__main__":
      main()
  ```

  On local machine, the output may look like this:

  ```
  sequential 5.731332778930664
  batch 0.12313580513000488
  broadcast 0.06050515174865723
  ```

  So `BatchRequest` is much faster than sequential requests in this case, and `BroadcastRequest` is the fastest - publication to 10k Centrifugo channels took only 60ms. Because all the work is done in one network round-trip. In reality the difference will be even more significant because of network latency.





  Prerequisites – start Centrifugo server locally:

  ```bash
  CENTRIFUGO_API_KEY=api_key CENTRIFUGO_HISTORY_TTL=300s CENTRIFUGO_HISTORY_SIZE=100 \
  CENTRIFUGO_PRESENCE=true CENTRIFUGO_GRPC_API=true ./centrifugo
  ```

  And install dependencies:

  ```bash
  make dev
  ```

  Then to run tests, run:

  ```bash
  make test
  ```

  To run benchmarks, run:

  ```bash
  make bench
  ```



  Cent v5 contains the following notable changes compared to Cent v4:

  * Client constructor slightly changed, refer to the examples above.
  * To call desired API import and construct a request object (inherited from Pydantic `BaseModel`) and then call corresponding method of client. This should feel very similar to how GRPC is usually structured.
  * Base exception class is now `CentError` instead of `CentException`, exceptions SDK raises were refactored.
  * To send multiple commands in one HTTP request SDK provides `batch` method.


pkgId: c7d76948aea429f9be3732d391390f08dd0913650a2722ca5fb60843a9cd18d3
name: python-centerline
arch: src
version: 1.1.1
epoch: 0
release: 1
summary: Calculate the centerline of a polygon
url: https://github.com/fitodic/centerline
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-centerline-1.1.1-1.src.rpm
checksum_type: sha256
description:
  Roads, rivers and similar linear structures are often represented by
  long and complex polygons. Since one of the most important attributes of
  a linear structure is its length, extracting that attribute from a
  polygon can prove to be more or less difficult.
  This library tries to solve this problem by creating the the polygon's
  centerline using the `Voronoi diagram
  <https://en.wikipedia.org/wiki/Voronoi_diagram>`_. For more info on how
  to use this package, see the
  `official documentation <http://centerline.readthedocs.io/>`_.
  Features
  ^^^^^^^^
  * A command-line script for creating centerlines from a vector source file and saving them into a destination vector file: ``create_centerlines``
      $ create_centerlines input.shp output.geojson
  * The ``Centerline`` class that allows integration into your own workflow.
      >>> from shapely.geometry import Polygon
      >>> from centerline.geometry import Centerline
      >>> polygon = Polygon([[0, 0], [0, 4], [4, 4], [4, 0]])
      >>> attributes = {"id": 1, "name": "polygon", "valid": True}
      >>> centerline = Centerline(polygon, **attributes)
      >>> centerline.id == 1
      True
      >>> centerline.name
      'polygon'
      >>> centerline.geometry.geoms
      <shapely.geometry.base.GeometrySequence object at 0x7f7d24116210>


pkgId: 466daaa091cf8fc91cf9db6a39df7dac045132e571cfcbe37ee1797dc3caed33
name: python-centerline-width
arch: src
version: 2.0.0
epoch: 0
release: 1
url: https://pypi.org/project/centerline-width/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-centerline-width-2.0.0-1.src.rpm
checksum_type: sha256
summary:
  A Python package to find the centerline and width of rivers based on the latitude and longitude of the right and left bank

description:
   <p align="center">
    <img src="https://raw.githubusercontent.com/cyschneck/centerline-width/main/assets/centerline_logo.jpg" />
  </p>

  ![PyPi](https://img.shields.io/pypi/v/centerline-width)
  ![license](https://img.shields.io/github/license/cyschneck/centerline-width)
  [![repo-status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
  [![NSF-2141064](https://img.shields.io/badge/NSF-2141064-blue)](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2141064&HistoricalAwards=false)
  ![PyPi-Versions](https://img.shields.io/pypi/pyversions/centerline-width)
  [![pytests](https://github.com/cyschneck/centerline-width/actions/workflows/pytests.yml/badge.svg)](https://github.com/cyschneck/centerline-width/actions/workflows/pytests.yml)
  [![pre-commit](https://github.com/cyschneck/centerline-width/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/cyschneck/centerline-width/actions/workflows/pre-commit.yml)
  [![codecov](https://codecov.io/gh/cyschneck/centerline-width/graph/badge.svg?token=V6Z2DC37MT)](https://codecov.io/gh/cyschneck/centerline-width)

  Find the centerline and width of rivers based on the latitude and longitude positions from the right and left bank

  * **Convert raw data from Google Earth Pro to CSV**
      * kml_to_csv()
      * txt_to_csv()
  * **Find centerline and width of river**
      * plot_centerline()
      * plot_centerline_width()
      * width()
      * centerline_voronoi
      * centerline_equal_distance
      * centerline_evenly_spaced
      * centerline_smoothed
  * **Return river features**
      * centerline_length
      * right_bank_length
      * left_bank_length
      * area
      * sinuosity
      * incremental_sinuosity()
  * **Export centerline to .CSV and .MAT files**
      * save_centerline_csv()
      * save_centerline_mat()

  | River Outlined in Google Earth Pro | Generated Centerline for the Riverbank |
  | ------------- | ------------- |
  | ![river_google_earth+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_example_google_earth.png) | ![river_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_example.png) |

  > [!NOTE]
  > This is Beta quality software that is being actively developed, use at your own risk. This project is not supported or endorsed by either JPL or NASA. The code is provided “as is”, use at your own risk.


  PyPi pip install at [pypi.org/project/centerline-width/](https://pypi.org/project/centerline-width/)

  ```
  pip install centerline-width
  ```



  The core of centerline-width works with a .csv file of the left and right bank latitude/longitudes. So, if starting from Google Earth Pro, two .kml must first be translated to a single .csv file

  ```python
  import centerline_width
  centerline_width.kml_to_csv(left_kml="left_bank.kml",
                      right_kml="right_bank.kml",
                      text_output_name="river_coordinates_output.csv")
  ```
  Then once the .csv file is created, to run the centerline-width functions, generate a river object from the `river_coordinates_output.csv`

  ```python
  river_object = centerline_width.CenterlineWidth(csv_data="river_coordinates_output.csv")
  ```

  To plot the centerline, run the `plot_centerline()` function from `river_object` created. By default, will display with `Decimal Degrees` (latitude/longitude) coordinates
  ```python
  river_object.plot_centerline()
  ```
  ![river_coords_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png)

  To plot the width of the river at intervals along the bank, run `plot_centerline_width()`

  While `apply_smoothing`, `remove_intersections`, and `display_true_centerline` are optional, they are recommended to generate a minimal width diagram
  ```python
  river_object.plot_centerline_width(apply_smoothing=True, remove_intersections=True, display_true_centerline=False)
  ```
  ![river_coords_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width.png)

  It is possible to also display all the coordinates as a `Relative Distance`, where all the coordinates are converted to a relative distance (in meters) from the first point on the left bank
  ```python
  river_object.plot_centerline(coordinate_unit="Relative Distance")
  ```
  ![river_coords_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_relative_distance_coords_centerline.png)

  For more details to fix unexpected behavior or error code: [Debugging, Error Handling, and Edge Cases](#debugging-error-handling-and-edge-cases)

  For a complete example script to run centerline-width: [centerline_width_example_script.py](https://github.com/cyschneck/centerline-width/blob/main/data/example_script_outputs/centerline_width_example_script.py) with [example outputs](https://github.com/cyschneck/centerline-width/tree/main/data/example_script_outputs)



  Riverbanks can be defined here as the high-contrast boundary between active/recently-active flow and the surrounding landscape. We will be mapping the right and left bank separately

  **Step 1**

  Map the left bank using the path tool. You can zoom into the river using the scroll-wheel. Flatten the mapping projection by pressing `u`. Leave the pop-up window open while you are mapping. You can erase the last point placed in a path by left-clicking. To erase a different point on the path, select the point with a right-click and then erase with a left-click and then select the last point to continue mapping downstream. To move a point, select it with a right-click. The selected point is highlighted blue, other points in the current path are highlighted red. The mapped distance downstream is shown in the measurements tab in the path tool pop-up window. When done mapping the left bank, close the pop-up window for the path
  ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/generate_kml.png)

  **Step 2**

  Save the path to a .kml file by right clicking on the path in Places and selecting 'save as'. Be sure to save as a .kml and not .kmz file. It is generally good practice to do this for each new path to ensure that no work is lost if Google Earth Pro crashes

  **Step 3**

  Repeat (1) and (2) for the right bank by starting a new path



  Convert two .kml files from Google Earth Pro (for the left and right bank) and export the coordinates into a csv file

  ```
  kml_to_csv(left_kml: str = None,
             right_kml: str = None,
             flip_direction: bool = False,
             csv_output: str = None)
  ```

  * **[REQUIRED]** left_kml (string): File location of the kml file for left bank
  * **[REQUIRED]** right_kml (string): File location of the kml file for right bank
  * **[REQUIRED]** csv_output (string): Output file name (and location)
  * [OPTIONAL] flip_direction (boolean): If the latitude/longitude of the banks are generated in reverse order, flip the final values so left/right bank are in order

  Scripts expects data as a list of point for left and right banks:
  - Header: llat, llon, rlat, rlon

  ```python
  import centerline_width
  centerline_width.kml_to_csv(left_kml="leftbank.kml",
                      right_kml="rightbank.kml",
                      csv_output="data/river_coords_output.csv")
  ```
  Example:
  ```
  llat,llon,rlat,rlon
  30.037581,-92.868569,30.037441,-92.867476
  30.037613,-92.868549,30.037448,-92.867474
  30.037648,-92.868546,30.037482,-92.867449
  30.037674,-92.868536,30.037506,-92.867432
  30.037702,-92.868533,30.037525,-92.867430
  ```
  Output: A csv file `data/river_coords.csv` with the headers `llat, llon, rlat, rlon`



  Convert a text file with coordinates for a left and right bank's latitude and longitude to a csv file with columns for the left bank latitude (llat), left bank longitude (llon), right bank latitude (rlat), right bank longitude (rlon)

  ```
  txt_to_csv(txt_input: str = None,
             flip_direction: bool = False
  ```

  * **[REQUIRED]** txt_input (string): File location of the text file to convert
  * [OPTIONAL] flip_direction (boolean): If the latitude/longitude of the banks are generated in reverse order, flip the final values so left/right bank are in order

  Scripts expects data as a list of point for left and right banks:
  - Header: llat, llon, rlat, rlon

  ```python
  import centerline_width
  centerline_width.txt_to_csv(txt_input="data/river_coords.txt",
                  flip_direction=True)
  ```
  Converts text file:
  ```
       llat       llon      rlat       rlon
  30.037581 -92.868569 30.037441 -92.867476
  30.037613 -92.868549 30.037448 -92.867474
  30.037648 -92.868546 30.037482 -92.867449
  30.037674 -92.868536 30.037506 -92.867432
  30.037702 -92.868533 30.037525 -92.867430
  ```
  To a CSV file:
  ```
  llat,llon,rlat,rlon
  30.037581,-92.868569,30.037441,-92.867476
  30.037613,-92.868549,30.037448,-92.867474
  30.037648,-92.868546,30.037482,-92.867449
  30.037674,-92.868536,30.037506,-92.867432
  30.037702,-92.868533,30.037525,-92.867430
  ```
  Output: A csv file `data/river_coords.csv` with the headers `llat, llon, rlat, rlon`



  First, generate a river object to contain river data and available transformations
  ```
  centerline_width.CenterlineWidth(csv_data=None,
                  cutoff=None,
                  interpolate_data=False,
                  interpolate_n=5,
                  interpolate_n_centerpoints=None,
                  equal_distance=10,
                  ellipsoid="WGS84")
  ```
  * **[REQUIRED]** csv_data (string): File location of the text file to convert
  * [OPTIONAL] cutoff (int): Include only the first x number of the data to chart (useful for debugging)
  * [OPTIONAL] interpolate_data (boolean): Interpolate between existing data by adding additional points
  * [OPTIONAL] interpolate_n (int): Number of additional points to add between existing data, defaults to 5 (note: larger numbers will take exponentially longer to run, recommends less than 15)
  * [OPTIONAL] interpolate_n_centerpoints (int): Number of points used to interpolate the Voronoi centerline, defaults to the the length of the data frame (df_len)
  * [OPTIONAL] equal_distance (int): Equal distance between points (in meters) used to interpolate the Voronoi centerline, defaults 10 meters
  * [OPTIONAL] ellipsoid (string): Ellipsoid definition of Earth to provide size and shape for built-in functions to convert degrees to meters, options include (is sensitive to case): ["GRS80", "airy", "bessel", "clrk66", "intl", "WGS60", "WGS66", "WGS72", "WGS84", "sphere"] for more details: ["Built-in ellipsoid definitions"](https://proj.org/en/9.2/usage/ellipsoids.html#built-in-ellipsoid-definitions), defaults to "WGS84"

  **Equal Distance - Equal linear distance between points**

  `equal_distance` will generate points along the centerline that are an equal linear distance from one another in meters. When `equal_distance=5` each point will be 5 meters apart

  | equal_distance=5 | equal_distance=20 |
  | ------------- | ------------- |
  | ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/equal_distance_5_m.jpg) | ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/equal_distance_20_m.jpg) |

  The red pins represent the equal distance centerline coordinates produced by centerline-width. The yellow line is the distance measured in Google Earth Pro between the points. The mapped river banks are in purple.

  **Interpolation - A solution for sparse data**

  `interpolate_data` is an option that can be used to find a centerline when the existing data generates a Voronoi graph that is jagged or contains gaps due to the combination of sparse data and a narrow river (See: Debugging, Error Handling, and Edge Cases - Fix Gaps and Jagged Centerlines). By default, `interpolate_data=True` will add 5 additional points between each existing point but can be increased or decreased by modifying the `interpolate_n` option

  `interpolate_n_centerpoints` is an option that can be used to increase the resolution (number of points) of the centerline found by the Voronoi vertices. By default, will evenly space out to the size of the dataframe. Can artificially increase the amount of width lines generated by increasing the number of center points. When `interpolate_n_centerpoints` increases, the number of width lines generated will increase (and visa versa)

  | interpolate_n_centerpoints=75 | interpolate_n_centerpoints=200 |
  | ------------- | ------------- |
  | ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/interpolate_n_centerpoints_75.png) | ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/interpolate_n_centerpoints_200.png) |

  **Object (class) useful attributes:**

  * centerline_voronoi (list of tuples): List of the latitude and longitude coordinates of the centerline generated by Voronoi diagrams
  * centerline_equal_distance (list of tuples): List of the latitude and longitude coordinates of the centerline generated by equal distances between coordinates from the Voronoi diagrams
  * centerline_evenly_spaced (list of tuples): List of the latitude and longitude coordinates of the centerline generated by evenly spacing out points generated by the Voronoi diagrams
  * centerline_smoothed (list of tuples): List of the latitude and longitude coordinates of the centerline generated by smoothing out the evenly spaced-out points generated by the Voronoi diagrams
  * centerline_length (float): Length of the centerline of the river (in km)
  * right_bank_length (float): Length of the right bank of the river (in km)
  * left_bank_length (float): Length of the left bank of the river (in km)
  * area (float): Area contained within river bank polygon (in km^2)
  * sinuosity (float): Sinuosity of the river based on evenly spaced centerline coordinates
  * centerline_voronoi_relative (list of tuples): List of the relative distance coordinates of the centerline generated by Voronoi diagrams
  * centerline_equal_distance_relative (list of tuples): List of the relative distance coordinates of the centerline generated by equal distances between coordinates from the Voronoi diagrams
  * centerline_evenly_spaced_relative (list of tuples): List of the relative distance coordinates of the centerline generated by evenly spacing out points generated by the Voronoi diagrams
  * centerline_smoothed_relative (list of tuples): List of the relative distance coordinates of the centerline generated by smoothing out the evenly spaced out points generated by the Voronoi diagrams

  <details closed>
  <summary><b>Object (class) additional attributes:</b> (Click to view all)</summary>
  <ul>
  <li>river_name (string): name of object, set to the csv_data string</li>
  <li>left_bank_coordinates (list of tuples): list of latitude/longitude coordinates of the left bank generated from the csv file (`[(x, y), (x, y)]`)</li>
  <li>right_bank_coordinates (list of tuples) list of latitude/longitude coordinates of the right bank generated from the csv file (`[(x, y), (x, y)]`)</li>
  <li>left_bank_relative_coordinates (list of tuples): list of relative distances coordinates of the left bank, measured as the distance in meters from the first point on the left bank (`[(x, y), (x, y)]`)</li>
  <li>right_bank_relative_coordinates (list of tuples): list of relative distances coordinates of the right bank, measured as the distance in meters from the first point on the left bank (`[(x, y), (x, y)]`)</li>
  <li>df_len (int): Length of the data frame of the csv data (spliced by the cutoff)</li>
  <li>equal_distance (int): Distance between points (in meters) used in centerline_equal_distance, defaults to points every 10 meters</li>
  <li>ellipsoid (string): Built-in ellipsoid definition of Earth to determine how degrees are converted to meters used by centerline_equal_distance, defaults to "WGS84"</li>
  <li>bank_polygon (Shapley Polygon): Multi-sided polygon generated to encapsulate the latitude/longitude coordinate riverbank (used to define an inside and an outside of the river)</li>
  <li>bank_polygon_relative (Shapley Polygon): Multi-sided polygon generated to encapsulate the relative distance coordinate riverbank (used to define an inside and an outside of the river)</li>
  <li>top_bank (Shapley Linestring): Linestring that represents the top of the river/polygon for the latitude/longitude coordinate system</li>
  <li>top_bank_relative (Shapley Linestring): Linestring that represents the top of the river/polygon for the relative distance coordinate system</li>
  <li>bottom_bank (Shapley Linestring): Linestring that represents the bottom of the river/polygon for the latitude/longitude coordinate system</li>
  <li>bottom_bank_relative (Shapley Linestring): Linestring that represents the bottom of the river/polygon for the relative distance coordinate system</li>
  <li>starting_node (tuple): Tuple of the starting position (latitude and longitude) of the centerline path</li>
  <li>starting_node_relative (tuple): Tuple of the starting position (relative distance x and relative distance y) of the centerline path</li>
  <li>ending_node (tuple): Tuple of the end position (latitude and longitude) of the centerline path</li>
  <li>ending_node_relative (tuple): Tuple of the end position (relative distance x and relative distance y) of the centerline path</li>
  <li>bank_voronoi (scipy Voronoi object): Voronoi generated by left/right banks of the latitude/longitude coordinate system</li>
  <li>bank_voronoi_relative (scipy Voronoi object): Voronoi generated by left/right banks of the relative distance coordinate system</li>
  <li>x_voronoi_ridge_point (list of tuples): X positions on Voronoi ridge (starting Latitude position to ending Latitude position)</li>
  <li>y_voronoi_ridge_point (list of tuples): Y position on Voronoi ridge (starting Longitude position to ending Longitude position)</li>
  <li>x_voronoi_ridge_point_relative (list of tuples): X positions on Voronoi ridge (starting Relative Distance X position to ending Relative Distance X position)</li>
  <li>y_voronoi_ridge_point_relative (list of tuples): Y position on Voronoi ridge (starting Relative Distance Y position to ending Relative Distance Y position)</li>
  <li>interpolate_data (boolean): if interpolating between existing data, defaults to False</li>
  <li>interpolate_n (int): specifies how many additional points will be added between points along the riverbank when interpolating data, defaults to 5</li>
  <li>interpolate_n_centerpoints (int): specifies how many points will be used to interpolate the Voronoi centerline, defaults to the length of the data frame (df_len)</li>
  </details>


  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  ```


  Return the coordinates of the centerline based on the left and right banks with either `Decimal Degree` (latitude/longitude) or `Relative Distance` (meters)

  **Types of Centerlines**

  There are four types of centerline coordinates formed from the riverbank data

  - **Voronoi centerline**: centerline generated from where Voronoi vertices intersect within the river
  ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/voronoi_centerline.png)
  - **Equal Distance Centerline**: centerline based on Voronoi centerline but each point is equally spaced out from the previous (in meters) and takes into account the radius of the Earth to convert degrees to meters (example below: `equal_distance=10`)
  ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/equal_distance_centerline.png)
  - **Evenly Spaced Centerline**: centerline based on Voronoi centerline but evenly spaced with a fixed number of points (example: `interpolate_n_centerpoints=200`)
  ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/evenly_spaced_centerline.png)
  - **Smoothed Centerline**: centerline generated from the evenly spaced centerline but smoothed by a b-spline
  ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/smoothed_centerline.png)

  By default, coordinates are formed in `Decimal Degrees`, but can be set to `Relative Distance`. Relative Distance measures the distance (in meters) of a point from the first point on the left bank

  Centerline coordinates are formed by the Voronoi vertices
  ```
  river_object.centerline_voronoi
  ```
  | river_object.centerline_voronoi | river_object.centerline_voronoi_relative |
  | ------------- | ------------- |
  | ![centerlineVoronoi+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/voronoi_centerline.png) | ![centerlineVoronoiRelative+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/voronoi_centerline_relative.png) |

  Centerline coordinates are formed by Equally Distanced vertices, set by `equal_distance`
  ```
  river_object.centerline_equal_distance
  ```
  | river_object.centerline_equal_distance | river_object.centerline_equal_distance_relative |
  | ------------- | ------------- |
  | ![centerlineEqualDistance+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/equal_distance_centerline.png) | ![centerlineEqualDistanceRelative+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/equal_distance_centerline_relative.png) |

  Centerline coordinates are formed by Evenly Spaced vertices, set by `interpolate_n_centerpoints`
  ```
  river_object.centerline_evenly_spaced
  ```
  | river_object.centerline_evenly_spaced | river_object.centerline_evenly_spaced_relative |
  | ------------- | ------------- |
  | ![centerlineEvenlySpaced+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/evenly_spaced_centerline.png) | ![centerlineEvenlySpacedRelative+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/evenly_spaced_centerline_relative.png) |

  Centerline coordinates are formed from Smoothed vertices
  ```
  river_object.centerline_smoothed
  ```
  | river_object.centerline_smoothed | river_object.centerline_smoothed_relative |
  | ------------- | ------------- |
  | ![centerlineEvenlySpaced+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/smoothed_centerline.png) | ![centerlineEvenlySpacedRelative+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/smoothed_centerline_relative.png) |

  Example:
  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_centerline_coordinates = river_object.centerline_voronoi
  ```
  Output is a list of tuples: (example) `[(-92.86788596499872, 30.03786596717931), (-92.86789573751797, 30.037834641974108), (-92.8679141386283, 30.037789636848878), (-92.8679251193248, 30.037756853899904), (-92.86796903819089, 30.03765423778148), (-92.86797335733262, 30.037643336049054), (-92.8679920356456, 30.037592224469797), (-92.86800576063828, 30.037555441489403), (-92.86800841510367, 30.037546512833107), (-92.8680119498663, 30.03753043193875)]`


  Save the centerline coordinates to a csv file with columns for latitude and longitude. This is the file format for a table of (latitude,longitude) pairs accepted to import back into Google Earth Pro.

  ```
  save_centerline_csv(save_to_csv=None, centerline_type="Voronoi", coordinate_unit="Decimal Degrees")
  ```
  * **[REQUIRED]** save_to_csv (string): CSV filename, requires a .csv extension
  * [OPTIONAL] centerline_type (string): Centerline type to save to CSV (not case-sensitive), options: ["Voronoi", "Evenly Spaced", "Smoothed", "Equal Distance"], defaults to "Voronoi"
  * [OPTIONAL] latitude_header (string): Column header for latitude values, defaults to `<centerline_type> Centerline Latitude (Deg)` or `<centerline_type> Relative Distance Y (from Latitude) (m)`
  * [OPTIONAL] longitude_header (string): Column header for longitude values, defaults to `<centerline_type> Centerline Longitude (Deg)` or `<centerline_type> Relative Distance X (from Longitude) (m)`
  * [OPTIONAL] coordinate_unit (string): Coordinates of the river are return as "Decimal Degrees" (latitude/longitude) or converted to a distance from the first point on the left bank as "Relative Distance", defaults to "Decimal Degrees"

  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_object.save_centerline_csv(save_to_csv="centerline_coordinates.csv", centerline_type="Smoothed")
  ```
  Returns a csv with the Latitude and Longitude coordinates of the specified centerline with column headers with centerline type: `Smoothed Centerline Latitude (Deg), Smoothed Centerline Longitude (Deg)`

  > [!TIP]
  > It is best practice to plot the centerline with `plot_centerline()` to ensure that the results saved are as expected


  Save the centerline coordinates to a .mat file with columns for latitude and longitude

  ```
  save_centerline_mat(save_to_mat=None, centerline_type="Voronoi", coordinate_unit="Decimal Degrees")
  ```
  * **[REQUIRED]** save_to_mat (string): MAT filename, requires a .mat extension
  * [OPTIONAL] centerline_type (string): Centerline type to save to MAT (not case-sensitive), options: ["Voronoi", "Evenly Spaced", "Smoothed", "Equal Distance"], defaults to "Voronoi"
  * [OPTIONAL] latitude_header (string): Column header for latitude values, defaults to `<centerline_type>_Centerline_Latitude_(Deg)` or `<centerline_type>_Relative_Distance_Y_From_Latitude_m` (cannot include spaces or special characters)
  * [OPTIONAL] longitude_header (string): Column header for Longitude values, defaults to `<centerline_type>_Centerline_Longitude_(Deg)` or `<centerline_type>_Relative_Distance_X_From_Longitude_m` (cannot include spaces or special characters)
  * [OPTIONAL] coordinate_unit (string): Coordinates of the river are return as "Decimal Degrees" (latitude/longtidue) or converted to a distance from the first point on the left bank as "Relative Distance", defaults to "Decimal Degrees"

  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_object.save_centerline_mat(save_to_mat="centerline_coordinates.mat", centerline_type="Smoothed")
  ```
  Returns a .mat file with the Latitude and Longitude coordinates of the specified centerline with column headers with centerline type: `Smoothed_Centerline_Latitude_(Deg), Smoothed_Centerline_Longitude_(Deg)`

  > [!TIP]
  > It is best practice to plot the centerline with `plot_centerline()` to ensure that the results saved are as expected


  Return the length of the centerline found between the left and right bank generated by the Voronoi diagram
  ```
  river_object.centerline_length
  ```
  Length returned in kilometers
  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_centerline_length = river_object.centerline_length
  ```
  The length of the river centerline returns `215.34700589636674` km


  Return the area contained within the polygon generated the left and right bank latitude/longitudes
  ```
  river_object.area
  ```
  Area returned in kilometers^2
  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_area = river_object.area
  ```
  The area of the river returns `334.0398585246558` km^2


  Return the total sinuosity of the river
  ```
  river_object.sinuosity
  ```
  The sinuosity (or sinuosity index) is the ratio of the curved centerline and the straight distance of the river

  ```
  Sinuosity = centerline length / straight distance from first/last point
  Sinuosity = river length / straight line length of the river
  ```
  Where sinuosity is broken in types:
  - SI < 1.05: Almost straight river
  - 1.05 <= SI < 1.25: Winding river
  - 1.25 <= SI < 1.5: Twisty river
  - 1.5 <= Meandering river

  Sinuosity of river based on the evenly spaced centerline coordinates
  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_area = river_object.sinuosity
  ```
  The sinuosity of the river returns as a float `1.4593141841039725`


  Return the incremental sinuosity of the river at evenly spaced increments
  ```
  incremental_sinuosity(
          incremental_points=100,
          save_to_csv=None)
  ```
  * **[REQUIRED]** incremental_points: grouping of centerline coordinates, defaults to 100 (must be less than the length of the evenly spaced centerline coordinates)
  * [OPTIONAL] save_to_csv (string): CSV filename, requires a .csv extension with headers `["Centerline Latitude Start (Deg)", "Centerline Longitude Start (Deg)", "Centerline Latitude End (Deg)", "Centerline Longitude End (Deg)", "Sinuosity"]`

  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_object.incremental_sinuosity()
  ```
  Returns a dictionary with the start and end centerline coordinates and associated sinuosity `{((-92.87803465419134, 30.04494734395193), (-92.87718084516158, 30.03944640478984)): 0.8164574107802118, ((-92.87714797109666, 30.03944945940497), (-92.87020323809925, 30.039886265891074)): 0.9810773013508994}`


  Plot the centerline created from a list of right and left banks

  ```
  plot_centerline(centerline_type="Voronoi",
          marker_type="line",
          centerline_color="black",
          dark_mode=False,
          equal_axis=False,
          display_all_possible_paths=False,
          plot_title=None,
          save_plot=None,
          display_voronoi=False,
          show_plot=True,
          coordinate_unit="Decimal Degrees")
  ```
  * [OPTIONAL] centerline_type (string): Centerline type graph within river (not case-sensitive), options: ["Voronoi", "Evenly Spaced", "Smoothed", "Equal Distance"], defaults to "Voronoi"
  * [OPTIONAL] marker_type (string): Graph type (not case-sensitive), options: ["Line", "Scatter"], defaults to "Line"
  * [OPTIONAL] centerline_color (string): Color of centerline coordinates on graph (not case-sensitive), options: [matplotlib named colors](https://matplotlib.org/stable/gallery/color/named_colors.html), defaults to "black"
  * [OPTIONAL] dark_mode (bool): Change plot to a black ground (and override if `centerline_color="black"` to `centerline_color="white"`), defaults to False
  * [OPTIONAL] equal_axis (bool): Set x/y axes in plot to be equal, defaults to False
  * [OPTIONAL] display_all_possible_paths (boolean): Display all possible paths, not just the centerline (useful for debugging), defaults to False
  * [OPTIONAL] plot_title (string): Change plot title, defaults to "River Coordinates: Valid Centerline = True/False, Valid Polygon = True/False, Interpolated = True/False"
  * [OPTIONAL] save_plot (string): Save the plot with a given name and location
  * [OPTIONAL] display_voronoi (boolean): Overlay Voronoi diagram used to generate centerline, defaults to False
  * [OPTIONAL] show_plot (boolean): display and open plots (plt.show() in Matplotlib), defaults to True
  * [OPTIONAL] coordinate_unit (string): Coordinates of the river are return as "Decimal Degrees" (latitude/longitude) or converted to a distance from the first point on the left bank as "Relative Distance", defaults to "Decimal Degrees"

  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_object.plot_centerline()
  ```
  ![river_coords_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png)

  **centerline_type**

  Display different centerline types in plot ("Voronoi", "Evenly Spaced", "Smoothed", "Equal Distance"), but defaults to "Voronoi"

  | centerline_type="Voronoi" | centerline_type="Smoothed" |
  | ------------- | ------------- |
  | ![centerline_type_voronoi+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png) | ![centerline_type_equal_distance+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_centerline_type_smoothed.png) |

  **marker_type**

  Display centerline plot as either line or scatter

  | marker_type="Line" | marker_type="Scatter" |
  | ------------- | ------------- |
  | ![marker_type_line+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png)  | ![marker_type_scatter+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_marker_type_scatter.png) |

  **centerline_color**

  Change the color of the centerline, defaults to black

  | centerline_color="black" | centerline_color="palegreen" |
  | ------------- | ------------- |
  | ![centerline_color_black+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png) | ![centerline_color_purple+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_centerline_color.png) |

  **dark_mode**

  dark_mode will change the default Matplotlib background black and swap `centerline_color` from default black to white

  | dark_mode=False | dark_mode=True |
  | ------------- | ------------- |
  | ![dark_mode_false+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png) | ![dark_mode_true+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_dark_mode.png) |

  **equal_axis**

  equal_axis will set the x and y axis of the plot to be equal

  | equal_axis=False | equal_axis=True |
  | ------------- | ------------- |
  | ![river_not_equal+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_equal_axis_false.png) | ![river_equal+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_equal_axis_true.png)|

  **display_all_possible_paths**

  Display all possible paths generated by Voronoi edge ridges, defaults to False

  | display_all_possible_paths=False | display_all_possible_paths=True |
  | ------------- | ------------- |
  | ![display_all_possible_paths_false+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png) | ![display_all_possible_paths_true+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_display_all_possible_paths_true.png) |

  **display_voronoi**

  Overlay Voronoi diagram used to generate centerline, defaults to False

  | display_voronoi=False | display_voronoi=True |
  | ------------- | ------------- |
  | ![display_voronoi_default+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_display_voronoi_false.png) | ![display_voronoi_true+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_display_voronoi_true.png) |


  **coordinate_unit**

  Plot as either "Decimal Degrees" and "Relative Distance". defaults to "Decimal Degrees"

  | coordinate_unit="Decimal Degrees" | coordinate_unit="Relative Distance" |
  | ------------- | ------------- |
  | ![coordinate_unit_dd+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_centerline.png) | ![coordinate_unit_rd+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coordinate_unit_rd.png) |




  Plot the width of the river based on the centerline

  ```
  plot_centerline_width(plot_title=None,
          save_plot=None,
          display_true_centerline=True,
          transect_span_distance=3,
          transect_slope="Average",
          apply_smoothing=False,
          flag_intersections=True,
          remove_intersections=False,
          dark_mode=False,
          equal_axis=False,
          show_plot=True,
          coordinate_unit="Decimal Degrees")
  ```
  * [OPTIONAL] plot_title (string): Change plot title, defaults to "River Width Coordinates: Valid Centerline = True/False, Valid Polygon = True/False, Centerline made of <interpolate_n_centerpoints> Fixed Points, width lines generated every <transect_span_distance> points, Interpolated = True/False"
  * [OPTIONAL] save_plot (string): Save the plot with a given name and location
  * [OPTIONAL] display_true_centerline (boolean): Display generated true centerline based on Voronoi diagrams, defaults to True
  * [OPTIONAL] transect_span_distance (int): Number n points around a center point to determine the slope (increase to decrease the impact of sudden changes), defaults to 3, must be greater than 1 (since the slope is found from the difference in position between two points)
  * [OPTIONAL] transect_slope (str): Determine how the width lines are generated, either by averaging all slopes "Average" or directly from the first to last point in the span distance as "Direct", defaults to "Average"
  * [OPTIONAL] apply_smoothing (boolean): Apply a B-spline smoothing to centerline
  * [OPTIONAL] flag_intersections (boolean): Display intersecting width lines as red in graph, defaults to True
  * [OPTIONAL] remove_intersections (boolean): Remove intersecting lines (but maintain the most width lines as possible) and only return non-intersecting width lines, defaults to False
  * [OPTIONAL] dark_mode (bool): Change plot to a black ground (and override if `centerline_color="black"` to `centerline_color="white"`), defaults to False
  * [OPTIONAL] equal_axis (bool): Set x/y axes in plot to be equal, defaults to False
  * [OPTIONAL] show_plot (boolean): display and open plots (plt.show() in Matplotlib), defaults to True
  * [OPTIONAL] coordinate_unit (string): Coordinates of the river are return as "Decimal Degrees" (latitude/longitude) or converted to a distance from the first point on the left bank as "Relative Distance", defaults to "Decimal Degrees"


  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_object.plot_centerline_width(apply_smoothing=True, remove_intersections=True, display_true_centerline=False)
  ```
  ![river_coords_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width.png)

  **display_true_centerline**

  The width lines are generated from the evenly spaced coordinate (by default) or with the smoothed coordinates (when `apply_smoothing=True`), but display_true_centerline will overlay the Voronoi centerline on top of the plot

  | display_true_centerline=True | display_true_centerline=False |
  | ------------- | ------------- |
  | ![river_with_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_with_centerline.png) | ![river_no_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_without_centerline.png) |

  **apply_smoothing**

  apply_smoothing applies a spline to smooth the centerline points created by the Voronoi vertices. This reduces the noise of the slopes and can create width lines that are less susceptible to small changes in the bank

  | apply_smoothing=False | apply_smoothing=True |
  | ------------- | ------------- |
  | ![river_without_smoothing+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_without_smoothing.png) | ![river_with_smoothing+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_with_smoothing.png) |

  **transect_span_distance**

  Transect span describes the number of points that are averaged to generate the slope of the width line (example: transect_span_distance=3, average of three slopes). The slope of the width line is  orthogonal to the average slopes measured along the transect span

  If the span is odd then the width line will be generated at the position of the middle of the span on n/2. If the span is even, then the width line will be generated at 1 + n/2, for example, `[A, B, C, D]` will generated a width line at point `C`

  ![transect_span_distance](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/span_description.png)

  | transect_span_distance=6 | transect_span_distance=30 |
  | ------------- | ------------- |
  | ![river_transect_6+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_transect_6.png) | ![river_transect_30+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_transect_30.png) |

  **transect_slope**

  The width lines are generated as perpendicular to the slopes of the points across `transect_span_distance`

  By default, `transect_slope="Average"` where the width lines are perpendicular to the average slopes of the across span distance. For example: `[A, B, C, D] = avg( slope([A, B]) + slope([B, C]) + slope([C+D]) )`

  Optionally, if `transect_slope="Direct"` then the width lines will be perpendicular to slope of the first and last point. For example: `[A, B, C, D] = slope([A, D])` to avoid being susceptible to rapid small changes along the centerline

  ![transect_span_distance](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/slope_description.png)
  | transect_slope="Average" | transect_slope="Direct" |
  | ------------- | ------------- |
  | ![river_transect_avg+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_transect_avg.png) | ![river_transect_direct+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_transect_direct.png) |

  **remove_intersections**

  remove_intersections will remove the width lines that intersect other lines (that could be creating unrepresentative long width lines). Intersections are removed first in order from most to least number of intersections and then based on the longer of two intersecting lines. This ensures that the most width lines as possible are kept

  Intersecting lines are flagged in red by default (flag_intersections=True)

  | remove_intersections=False | remove_intersections=True |
  | ------------- | ------------- |
  | ![river_keep+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_keep_intersections.png) | ![river_remove+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_remove_intersections.png)|

  **dark_mode**

  dark_mode will change the default Matplotlib background black and swap `centerline_color` from default black to white

  | dark_mode=False | dark_mode=True |
  | ------------- | ------------- |
  | ![river_white+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_dark_mode_false.png) | ![river_black+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_dark_mode_true.png)|

  **equal_axis**

  equal_axis will set the x and y axis of the plot to be equal. Useful to show the perpendicular width lines as perpendicular since it can appear distorted by default in Matplotlib

  | equal_axis=False | equal_axis=True |
  | ------------- | ------------- |
  | ![river_not_equal+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_not_equal_default_ax.png) | ![river_equal+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_equal_ax.png)|

  **coordinate_unit**

  Two options for measuring and displaying coordinates. The two options are "Decimal Degrees" and "Relative Distance". "Decimal Degrees" is the default option that uses the original data coordinate system with latitude/longitude. "Relative Distance" changes the coordinates of each point to be the distance (in meters) from the first point on the left bank

  | coordinate_unit="Decimal Degrees" | coordinate_unit="Relative Distance" |
  | ------------- | ------------- |
  | ![dd_coords+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_decimal_degrees.png) | ![rd_coords+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_relative_distance.png)|


  Return the width of the river at each (evenly spaced or smoothed) with coordinates where width line intersects either the centerline, `(Centerline Longitude, Centerline Latitude) : width`, or riverbanks, `((Right Bank Longitude, Right Bank Latitude), (Left Bank Longitude, Left Bank Latitude)) : width` in kilometers

  ```
  width(transect_span_distance=3,
              transect_slope="Average",
              apply_smoothing=True,
              remove_intersections=False,
              coordinate_unit="Decimal Degrees",
              coordinate_reference="Centerline",
              save_to_csv=None)
  ```
  * [OPTIONAL] transect_span_distance (int): Number n points around a center point to determine the slope (increase to decrease the impact of sudden changes), defaults to 3, must be greater than 1 (since the slope is found from the difference in position between two points)
  * [OPTIONAL] transect_slope (str): Determine how the width lines are generated, either by averaging all slopes "Average" or directly from the first to last point in the span distance as "Direct", defaults to "Average"
  * [OPTIONAL] apply_smoothing (boolean): Apply a B-spline smoothing to centerline
  * [OPTIONAL] remove_intersections (boolean): Iterative remove intersecting lines, to maintain the most width lines, but return only non-intersecting width lines, defaults to True
  * [OPTIONAL] coordinate_unit (string): Coordinates of the river are return as "Decimal Degrees" (latitude/longtidue) or converted to a distance from the first point on the left bank as "Relative Distance", defaults to "Decimal Degrees"
  * [OPTIONAL] coordinate_reference (string): Reference where the width line intersects the river, either along the centerline ("Centerline") as `(Centerline Longitude, Centerline Latitude) : width`, or riverbanks ("Banks") as `((Right Bank Longitude, Right Bank Latitude), (Left Bank Longitude, Left Bank Latitude)) : width`
  * [OPTIONAL] save_to_csv (string): CSV filename to output width dictionary, defaults to None (no file is saved), requires a .csv extension (Column Headers automatically generated based on `coordinate_unit` and `coordinate_reference`)

  > [!IMPORTANT]
  > When using `apply_smoothing=True`, the centerline generated is the result of evenly spaced coordinates generated from the original Voronoi coordinates, so the smoothed coordinates may not match exactly to the original centerline coordinates. When `apply_smoothing=False`, width lines are generated from the evenly spaced centerline coordinates

  ```python
  import centerline_width
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
  river_width_dict = river_object.width(transect_span_distance=3,
                              apply_smoothing=True,
                              coordinate_reference="Centerline",
                              remove_intersections=True)
  ```
  Width dictionary = `{(-92.86792084788995, 30.037769672351182): 0.10969163557087018, (-92.86795038641004, 30.03769867854198): 0.10794219579997719}`

  > [!TIP]
  > It is best practice to plot the centerline and width with same arguments in `plot_centerline_width()` to ensure that the results when `save_to_csv=True` are as expected



  The centerline is defined by the greatest distance from the right and left bank, created from a Voronoi Diagram. The remaining paths within the river are filtered through Dijkstra's algorithm to find the shortest path that is the centerline


  ![algorithm_step1+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step1.png)


  ![algorithm_step2+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step2.png)


  ![algorithm_step3+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step3.png)


  Filter out any point pairs that only have one connection to filter out the short dead end paths

  With the vertices removed, it is possible to form multiple unconnected graphs within the polygon. The largest subgraph is assumed to contain the centerline and the other subgraphs are filtered out
  ![algorithm_step4+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step4.png)


  The top of the river is defined as the last plotted points in the data, while the bottom of the river is the first plotted points
  ![algorithm_step5+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step5.png)


  The starting/ending node is defined by the vertex closest to the top/bottom of the polygon along the longest path
  ![algorithm_step6+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step6.png)


  | Points on Riverbank | NetworkX Graph of Points on Riverbank |
  | ------------- | ------------- |
  | ![algorithm_step7+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step7.png) | ![algorithm_step8+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step8.png) |


  ![algorithm_step9+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step9.png)

  This is an attempt at a more robust algorithm working from raw data to ensure that all dead ends are removed, and no gaps exist in the centerline

  Points that only have one connection are removed, but limiting the number of connections for a point to just two will create gaps. The Voronoi vertices connect to other vertex values, but some connect to more and some only connect to one other point. Removing additional values will create gaps, so this is avoided in this code by not applying additional filters.

  **All vertices:**
  ![algorithm_step4+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step4.png)

  **Vertices that have at least two connections (that would create gaps):**
  ![algorithm_step10+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/algorithm_step10.png)



  If the data starts or ends with a large width, it is possible for the starting/ending nodes to end up in the wrong position
  ![invalid_too_wide+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_too_wide.png)
  Currently, the starting node is determined by the closest node on the path to the top of the bank (in green) and the ending node is determined by the closest node on the path to the bottom of the bank (in red) that sits along the longest path


  A polygon is formed to encapsulate the river with the given data (to determine the inside and outside of the river). The top and bottom are connected by a straight line from the start/end of the available data. As a result, it is possible for this straight line to overlap and create an invalid polygon.

  A polygon is invalid if it overlaps within itself:
  ![invalid_minor_polygon+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_minor_polygon.png)
  In this example, the polygon is invalid, but with such a small overlap it is still able to find a valid path

  With limited data, the polygon will overlap more dramatically and will struggle to find a valid centerline:
  ![invalid_major_polygon+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_major_polygon.png)


  If the data is too small, a centerline and its coordinates cannot be found (since only a single Voronoi vertex exists within the polygon and after dead ends are filtered)

  `CRITICAL ERROR, Polygon too short for the Voronoi diagram generated (no starting node found), unable to plot centerline. Set display_voronoi=True to view vertices. Can typically be fixed by adding more data to expand range`
  ![invalid_too_small+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_too_small.png)
  Can be fixed by expanding the data until the polygon is large enough to contain at least two different vertex points


  Error: `WARNING: Invalid Polygon Due to Flipped Banks, fix recommendation: rerun convertColumnsToCSV() and set flip_direction=True (or reset to default 'False' if currently set to flip_direction=True)`

  If the data for the left and right riverbanks are generated in reverse order, they will be read in the incorrect order and the graph will find the invalid top and bottom of the bank

  If the latitude/longitude of the banks are generated in reverse order, flip the final values so left/right bank are in order

  This can be fixed by using the flip_direction optional argument `centerline_width.convertColumnsToCSV(text_file="data_example.txt", flip_direction=True)`
  ![invalid_flipped_banks+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_flipped_banks.png)


  The smoothed centerline (`river_object.centerline_smoothed`) can end up lying outside the river if the centerline data points are sparse in a narrow river. If more than two points in the smoothed centerline lie outside the river, a warning will be thrown

  Example Error: `WARNING: Partially invalid smoothed centerline due to sparse centerline data (6 points lie outside the polygon), fix recommendation: rerun CenterlineWidth to create river object with interpolate_n_centerpoints set to 62+`

  By default, `interpolate_n_centerpoints` is set to None and no additional points will be added between the existing points along the centerline. By adding additional points between the existing centerline, the smoothed centerline can be fixed to stay within the polygon. This fix is set by creating a river object, `centerline_width.CenterlineWidth`, with `interpolate_n_centerpoints=65` (with the recommended 62+) to fix for centerline coordinates that lie outside the polygon

  `interpolate_n_centerpoints = None` does not interpolate data points, so the size will be set to the number of fixed points when creating the evenly spaced coordinates (equal to the size of the data frame)

  | interpolate_n_centerpoints = None | interpolate_n_centerpoints = 65 |
  | ------------- | ------------- |
  | ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_smoothed_centerline.png) | ![river_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_smoothed_centerline_fixed.png) |

  For very narrow rivers, this problem can become extreme and pronounced
  ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/invalid_smoothed_centerline_extreme.png)

  By increasing the interpolation between the centerline points, the smoothed centerlines will be forced within the polygon and reduce the number of points outside of the polygon. By default, this warning will be thrown if more than 2 points are outside of polygon, so as long as more than 2 points lie outside the polygon, the warning will recommend doubling the amount of centerline points, with diminishing returns


  Gaps formed can cause part of the centerline to be skipped due to sparse data. As a result, the start and end of the centerline can skip parts at the beginning or end of a river
  ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/interpolate_false_gaps_short_path.png)
  Set river object created by `centerline_width.CenterlineWidth` to `interpolate_data=True` to fix for jagged edges or gaps formed by the interaction of sparse data and narrow banks
  ```python
  river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv", interpolate_data=True)
  ```
  | interpolate_data = False | interpolate_data = True |
  | ------------- | ------------- |
  | ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/interpolate_false_gaps.png) | ![river_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/interpolate_true_no_gaps.png) |
  | ![example+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/interpolate_false_gaps_2.png) | ![river_centerline+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/interpolate_true_no_gaps_2.png) |

  The number of additional points added by interpolating can be adjusted with `interpolate_n`, but defaults to add 5 additional points between values


  To run or test against `centerline-width` github repo/fork, a development environment can be created via conda/miniconda

  First, [install Miniconda](https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html)

  Then, using the existing `environment.yml`, a new conda environment can be create to run/test scripts against

  ```
  conda env create --file environment.yml
  ```
  Once the environment has been built, activate the environment:
  ```
  conda activate centerline_width
  ```
  Set up pre-commit hooks to ensure standard code formatting and spelling:
  ```
  pre-commit install
  ```
  Pre-commit hooks can be manually run before commits:
  ```
  pre-commit run --all-files
  ```
  To run existing and new tests from the root directory:
  ```
  python -m pytest
  ```

  These features are not included in pip install because they are still experimental and being tested/debugged. For more information and getting them up and running, contact cyschneck@gmail.com or ugschneck@gmail.com or post a question as a [Github Issue](https://github.com/cyschneck/centerline-width/issues)

  - Calculate the dominant meander wavelength amd its variance

  - Research and Contribute to [OpenStreetMap](https://github.com/cyschneck/centerline-width/issues/5) for existing mapped rivers with generated centerlines

  - Calculate the asymmetry of the meanders

  - Calculate the dominant submeander and supermeander scales

  - Extract elevation/slope from river profiles (.kml files)

  - Overlay plots with images via geopandas

  - Calculate centerline migration rate


  Originally, centerline-width was developed as a Python implementation of [R-Code CMGO](https://github.com/AntoniusGolly/cmgo) (Golly et al. 2017) but has since been extensively expanded and changed:

  >Golly, A. and Turowski, J. M.: Deriving principal channel metrics from bank and long-profile geometry with the R package cmgo, Earth Surf. Dynam., 5, 557-570, https://doi.org/10.5194/esurf-5-557-2017, 2017.

   <p align="center">
    <img src="https://user-images.githubusercontent.com/22159116/222872092-e0b579cc-4f84-4f49-aa53-397785fb9bf2.png" />
    <img src="https://user-images.githubusercontent.com/22159116/222872119-7c485ee2-4ffd-413a-9e4f-b043b122d2bb.png" />
    <img src="https://user-images.githubusercontent.com/22159116/222872019-12931138-9e10-4e51-aa1e-552e72d09af0.png" />
  </p>


  Please acknowledge the use of this software in any publications:

  ```
  "River centerline/width extraction software was provided by C. Y. Schneck and U. G. Schneck, and is available at URL: https://github.com/cyschneck/centerline-width."
  ```
  We are interested in expanding this software based on river needs, so please send a copy of such publications to: cyschneck@gmail.com and ugschneck@gmail.com (we'd love to see them!)


  This material is based upon work supported by the National Science Foundation Graduate Fellowship under Grant No. 2141064. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.



  Submit a bug fix, question, or feature request as a [Github Issue](https://github.com/cyschneck/centerline-width/issues) or to ugschneck@gmail.com/cyschneck@gmail.com

rpm_license:
  MIT License  Copyright (c) 2023 Cora Y. Schneck  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: 333e2042f9cd021e2456c806c08295d7ca5c792e10a5206c78fb0b3c2b02cbc7
name: python-centraal-client-flow
arch: src
version: 0.1.12
epoch: 0
release: 1
summary: Proyecto que facilita el flujo de información de cliente.
url: https://github.com/centraal-api/centraal-client-flow
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-centraal-client-flow-0.1.12-1.src.rpm
checksum_type: sha256
description:
  <a href="https://pypi.python.org/pypi/centraal_client_flow">
      <img src="https://img.shields.io/pypi/v/centraal_client_flow.svg"
          alt = "Release Status">
  </a>

  <a href="https://github.com/centraal-api/centraal-client-flow/actions">
      <img src="https://github.com/centraal-api/centraal-client-flow/actions/workflows/dev.yml/badge.svg?branch=release" alt="CI Status">
  </a>

  <a href="https://centraal-api.github.io/centraal-client-flow/">
      <img src="https://img.shields.io/website/https/centraal-api.github.io/centraal-client-flow/index.html.svg?label=docs&down_message=unavailable&up_message=available" alt="Documentation Status">
  </a>


  `centraal-client-flow` es una librería de Python diseñada para facilitar la implementación de una una solución basada en eventos para la sincronización y consistencia de datos entre sistemas distribuidos de clientes utilizando Azure. Esta librería proporciona herramientas para manejar eventos, aplicar reglas de procesamiento, integrar con sistemas externos y mantener un esquema unificado de clientes.



  `Centraal-Cliente-Flow` facilita la implementación de arquitecturas de sincronización de datos en Azure, proporcionando una base sólida para manejar eventos en tiempo real, reglas de negocio, integración con APIs externas y mantenimiento de un log de auditoría.



  La arquitectura está diseñada para unificar la información de los clientes alrededor de un identificador único, asegurando la consistencia de los datos a través de los siguientes componentes clave:

  - **Eventos**: Gestionados por Azure Functions para manejar eventos entrantes en tiempo real y operaciones periódicas de extracción de datos.
  - **Reglas**: Implementan la lógica de procesamiento de eventos para actualizar un esquema unificado de clientes.
  - **Reglas de Integración**: Sincronizan las actualizaciones del esquema unificado con sistemas externos a través de APIs REST.
  - **Esquema Unificado**: Modelo de datos centralizado que asegura consistencia y escalabilidad en la información de los clientes.
  - **Log de Auditoría**: Registra todas las actualizaciones del esquema unificado para asegurar trazabilidad.
  - **Uso de Pydantic**: La libreria hace uso extensivo e incentiva que cada intercambio de datos este mediado por modelos [Pydantic](https://docs.pydantic.dev/latest/), ya de esta manera se asegura calidad y reglas de negocio.

  ```
                  Evento
                    ^
                    |
                    v
  +------------------------------+
  |   Receiver/Timer Function     |
  |  (Valida y envía a la cola    |
  |   usando Pydantic)            |
  +------------------------------+
              |
              |
           [P]-EventoBase(IdModel)
              |
              v
  +------------------------------+
  |   Azure Service Bus Queue     |
  |  (Ordena eventos por          |
  |   Session ID)                 |
  +------------------------------+
              |
              v
  +---------------------------------------+
  |  Processor Function                   |
  |  Reglas de Actualización              |
  |  (Actualiza esquema y log de          |
  |   auditoría usando Pydantic,          |
  |   Publica actualizaciones)            |
  +---------------------------------------+
              |                   |
              |                   |
           [P]-EntradaEsquemaUnificado
      [P] - AuditoriaEntry        |
              |                   |
              v                   v
  +-----------------------+   +-------------------------+
  |     Cosmos DB         |   |  Azure Service Bus      |
  | (Esquema Unificado y  |   |         Topic           |
  |  Log de Auditoría)    |   |                         |
  +-----------------------+   +-------------------------+
              |                           |
              |                           |
        [P]-AuditoriaEntry                |
              |                           |
              v                           v
  +-----------------------+   +-------------------------+
  | Log de Auditoría en   |   | Integration Function    |
  | Cosmos DB             |   | Reglas  y Estrategias   |
  | (Registra cambios)    |   | de Integración          |
  +-----------------------+   |                         |
                              |                         |
                              +-------------------------+
                                         |
                                   [P]-BaseModel
                                         |
                                         v
                              +-------------------------+
                              |    Sistemas Externos    |
                              | (Reciben actualizaciones|
                              |  a través de APIs REST) |
                              +-------------------------+

  ```





  - **Receiver Functions**: Manejan eventos entrantes en tiempo real. Implementadas en el módulo `receiver.py` utilizando clases como `EventFunctionBuilder`.
  - **Timer Functions**: Ejecutan tareas periódicas para extraer información de sistemas externos, definidas en `timer.py` usando `TimerFunctionBuilder`.



  Las reglas para actualizar el esquema unificado de clientes se implementan usando `UpdateProcessor` y `RuleProcessor`, que permiten procesar y aplicar reglas específicas a los eventos entrantes.



  Se implementan en `strategy.py` usando la clase `RESTIntegration`, que permite la sincronización de datos con APIs REST externas.



  Definido en `schemas.py`, utiliza modelos Pydantic para asegurar la validación y consistencia de datos. Los modelos incluyen `IDModel`, `EntradaEsquemaUnificado`, y otros sub-esquemas específicos.



  Para asegurar la trazabilidad de las actualizaciones, todos los cambios en los sub-esquemas se registran en una colección de auditoría en Cosmos DB.





  Asegúrate de tener configuradas las variables de entorno necesarias para las conexiones a Cosmos DB y Azure Service Bus.

  ```python
  import os

  os.environ["COSMOS_CONN"] = "<tu_cosmos_db_connection_string>"
  os.environ["DATABASE"] = "<tu_database_name>"
  os.environ["BUS_CONN"] = "<tu_service_bus_connection_string>"
  ```





  Utiliza el siguiente ejemplo para registrar funciones receptoras y de temporización.

  ```python
  from azure.functions import FunctionApp
  from centraal_client_flow.receiver import Recieve
  from centraal_client_flow.timer import Pull

  app = FunctionApp()


  receiver = Recieve(event_source="source_name", queue_name="queue_name", service_bus_client=service_bus_client_instance)
  receiver.register_function(app, processor=event_processor_instance, event_model=event_model_instance)


  pull = Pull(schedule="0 */5 * * * *", event_source="source_name", queue_name="queue_name", service_bus_client=service_bus_client_instance)
  pull.register_function(app, processor=pull_processor_instance)
  ```



  ```python
  from azure.functions import FunctionApp
  from update_rules import bp_update_rules

  app = FunctionApp()
  app.register_functions(bp_update_rules)
  ```



  ```python
  from azure.functions import FunctionApp
  from integration_rules import bp_int_rules

  app = FunctionApp()
  app.register_functions(bp_int_rules)
  ```



  Define los modelos de datos utilizando Pydantic para asegurar la validación de datos entrantes.

  ```python
  from pydantic import BaseModel, EmailStr

  class EventoEjemplo(BaseModel):
      id: int
      nombre: str
      email: EmailStr
  ```

  Implementa procesadores para manejar la lógica de actualización de acuerdo con las reglas de negocio.

  ```python
  from centraal_client_flow.rules.update import UpdateProcessor
  from modelos import EventoEjemplo

  class EjemploProcessor(UpdateProcessor):
      def process_message(self, event: EventoEjemplo, current_registro=None):
          
          pass
  ```



  Asegúrate de que todas las dependencias estén instaladas y ejecuta la aplicación utilizando un servidor de funciones de Azure.

  ```bash
  func start
  ```



  Las [contribuciones](./CONTRIBUTING.md) son bienvenidas. Por favor, abre un issue o un pull request en el repositorio para discutir cualquier cambio.

  * Free software: Apache-2.0
  * Documentation: <https://centraal-api.github.io/centraal_client_flow/>




  This package was created with the [ppw](https://zillionare.github.io/python-project-wizard) tool. For more information, please visit the [project page](https://zillionare.github.io/python-project-wizard/).


pkgId: 96721d98d82c301e39552cbefc69d12bd2b940e69778e6f5f59b89b1440f063f
name: python-centralcli
arch: src
version: 7.2.3
epoch: 0
release: 1
url: https://github.com/Pack3tL0ss/central-api-cli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-centralcli-7.2.3-1.src.rpm
checksum_type: sha256
summary:
  A CLI for interacting with Aruba Central (Cloud Management Platform).  Facilitates bulk imports, exports, reporting.  A handy tool if you have devices managed by Aruba Central.

description:
  [![Latest Version](https://img.shields.io/pypi/v/centralcli.svg)](https://pypi.org/project/centralcli)
  [![Documentation Status](https://readthedocs.org/projects/central-api-cli/badge/?version=latest)](https://central-api-cli.readthedocs.io/en/latest/?badge=latest)
  [![Downloads](https://static.pepy.tech/badge/centralcli)](https://pepy.tech/project/centralcli)
  [![PyPI - Installs](https://img.shields.io/pypi/dm/centralcli.svg?color=blue&label=Installs&logo=pypi&logoColor=gold)](https://pypi.org/project/centralcli/)
  [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)

  A CLI app for interacting with Aruba Central Cloud Management Platform. With cross-platform shell support. Auto Completion, easy device/site/group/template identification (fuzzy match), support for batch import, and a lot more.

    > As commands are built out the CLI hierarchy may evolve.  Refer to the [documentation](https://central-api-cli.readthedocs.org) or help text for CLI structure/syntax.

  ![centralcli Animated Demo](https://raw.githubusercontent.com/Pack3tL0ss/central-api-cli/master/docs/img/cencli-demo.gif)



  - Cross Platform Support
  - Auto/TAB Completion
  - Specify device, site, etc. by fuzzy match of multiple fields (i.e. name, mac, serial#, ip address)
  - Multiple output formats
  - Output to file
  - Numerous import formats (csv, yaml, json, etc.)
  - Multiple account support (easily switch between different central accounts `--account myotheraccount`)
  - Batch Operation based on data from input file.  i.e. Add sites in batch based on data from a csv.
  - Automatic Token refresh.  With prompt to paste in a new token if it becomes invalid.
    > If using Tokens, dedicate the token to the CLI alone, using it in swagger or on another system, will eventually lead to a refresh that invalidates the tokens on the other systems using it.
  - You can also use username/Password Auth. which will facilitate automatic retrieval of new Tokens even if they do become invalid.



  Requires python 3.8+ and pip
  > Use `python3 -V` to determine version, but pip won't allow it to install if Python is not >= 3.8



  ```shell

  sudo apt install python3-pip


  pip install centralcli


  pip install centralcli[speedups]
  ```


  > It's ideal to install in a virtual environment (venv) on *nix based systems.  A virtualenv is an isolated environment.  This is prefered as it avoids any potential package conflicts with any system executables that use the system-wide python.  When installing in a venv some steps have to be taken to ensure the venv is in PATH so `cencli` is a recognized command, and tab completion is retained.  The venv either needs to be activated or the venv/bin directory needs to be added to PATH for completion to work.  If this is something foriegn to you, you can install pipx which is like pip but installs packages in virtual environments and automatically takes care of the rest.

  **Option 1 via pipx:**

  > The first section below is for Debian based systems refer to [pipx documentation](https://pipx.pypa.io/stable/installation/) for instructions on other OSs.
    ```shell
    
    sudo apt update
    sudo apt install pipx
    pipx ensurepath
    sudo pipx ensurepath --global  # optional refer to pipx docs

    
    pipx install centralcli --include-deps

    
    pipx install centralcli[speedups]
    ```

  **Option 2 manual installation in a venv:**

  > The example below is for Debian based systems, where `apt` is referenced but should be easy to translate to other OSs given you have some familiarity with the package management commands (i.e. `dnf`).  On Windows python should install with pip.  The pip commands are still valid.
    ```shell
    
    sudo apt update
    sudo apt install python3-pip

    
    python3 -m pip install virtualenv                 # Alternatively on Debian based systems: 'sudo apt install python3-virtualenv'

    
    cd ~                                              # ensure you are in your home dir
    mkdir .venvs                                      # creates hidden .venvs dir to store venv in
    cd .venvs                                         # change to that directory
    export DEB_PYTHON_INSTALL_LAYOUT='deb'            # Just ensures the directory structure for simpler instructions (Ubuntu 22.04 changed the dir layout of venvs without it)
    python3 -m virtualenv centralcli --prompt cencli  # prompt is optional
    source centralcli/bin/activate                    # activates the venv

    
    pip install centralcli

    
    pip install centralcli[speedups]

    which centralcli # Should return ~/.venvs/centralcli/bin/centralcli

    
    echo 'export PATH="$PATH:$HOME/.venvs/centralcli/bin"' >> ~/.bashrc

    
    ```



  `pip3 install -U centralcli`



  - You can get it for any platform @ [https://www.python.org](https://www.python.org)
  - On Windows 10 it's also available in the Windows store.


  ✨ pre-populating the config as described below is optional.  Central CLI will prompt for the information it needs on first run if no config exists.
  > It's still a good idea to look over the example config to see the optional config items.

  Refer to [config.yaml.example](https://github.com/Pack3tL0ss/central-api-cli/blob/master/config/config.yaml.example) to guide in the creation of config.yaml and place in the config directory.

  Central CLI will look in \<Users home dir\>/.config/centralcli, and \<Users home dir\>\\.centralcli.
  i.e. on Windows `c:\Users\wade\.centralcli` or on Linux `/home/wade/.config/centralcli`

  Once `config.yaml` is populated per [config.yaml.example](https://github.com/Pack3tL0ss/central-api-cli/blob/master/config/config.yaml.example), run some test commands to validate the config.

  For Example `cencli show all`

  ```bash
  wade@wellswa6:~ $ cencli show all
                                                                                         All Devices
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    name                  type   model                            ip                mac                 serial       group          site             labels        version       status
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    6100F-48-LAB          cx     6100 48G CL4 4SFP+ Swch          10.0.40.11        --redacted--   --redacted--    WadeLab8x                                     10.08.1010       Down
                                 (JL675A)
    SDBranch1:7008        gw     A7008                            192.168.240.101   --redacted--   --redacted--    Branch1        Antigua          Branch View   10.3.0.0_82528   Up
    br1-2930F-sw          sw     Aruba2930F-8G-PoE+-2SFP+         10.101.5.4        --redacted--   --redacted--    Branch1        Antigua          Branch View   16.11.0002       Up
                                 Switch(JL258A)
    br1-315.0c88-ap       ap     315                              10.101.6.200      --redacted--   --redacted--    Branch1        Antigua          Branch View   10.3.0.0_82528   Up
    MB1-505h              ap     505H                             10.10.1.101       --redacted--   --redacted--    MicroBranch1   Champions Hill                 10.3.0.0_82528   Up
    6200F-Bot             cx     6200F 48G CL4 4SFP+740W Swch     10.0.40.16        --redacted--   --redacted--    WadeLab8x      Pommore                        10.08.1010       Down
                                 (JL728A)
    6200F-Top             cx     6200F 48G CL4 4SFP+740W Swch     10.0.40.6         --redacted--   --redacted--    WadeLab8x      Pommore                        10.08.1010       Down
                                 (JL728A)
    APGW1                 gw     A9004-LTE                        10.0.35.10        --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    APGW2                 gw     A9004                            10.0.35.20        --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    VPNC1                 gw     A7005                            172.30.0.242      --redacted--   --redacted--    VPNC           WadeLab          Branch View   10.3.0.0_82528   Up
    VPNC2                 gw     A7005                            172.30.0.243      --redacted--   --redacted--    VPNC           WadeLab          Branch View   10.3.0.0_82528   Up
    av-555.11b8-ap        ap     555                              10.0.31.155       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    barn-303p.2c30-ap     ap     303P                             10.1.30.151       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    barn-4100i            cx     4100i 12G CL4/6 POE 2SFP+ DIN    10.1.30.152       --redacted--   --redacted--    WadeLab        WadeLab                        10.08.1010       Up
                                 Sw (JL817A)
    barn-518.2816-ap      ap     518                              10.1.30.101       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    bsmt-515.51s9-ap      ap     515                              10.0.30.233       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    craft-2930F           sw     Aruba2930F-8G-PoE+-2SFP+         10.0.30.5         --redacted--   --redacted--    WadeLab        WadeLab                        16.11.0002       Up
                                 Switch(JL258A)
    garage-345.5136-ap    ap     345                              10.0.31.148       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    ktcn-505H.206c-ap     ap     505H                             10.0.30.212       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    lwrptio-575.0824-ap   ap     575                              10.0.30.219       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    zrm-535.70be-ap       ap     535                              10.0.31.101       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    Show all displays fields common to all device types. To see all columns for a given device type use show <DEVICE TYPE>
    API Rate Limit: 925 of 1000 remaining.

  ```

  Use `cencli ?` to become familiar with the command options.



  The CLI supports auto-completion.  To configure auto-completion run `cencli --install-completion`.  This will auto-detect the type of shell you are running in, and install the necessary completion into your profile.  You'll need to exit the shell and start a new session for it to take effect.
  > Note for OSX 11: Additional step, edit .zshrc and add "autoload -Uz compinit && compinit -i" then exit and start new session.





  - Caching: The CLI caches information on all devices, sites, groups and templates along with some other items.  It's a minimal amount per device, and is done to allow human friendly identifiers.  The API typically accepts serial #, site id, etc.  This function allows you to specify a device by name, IP, mac (any format), and serial.

  The lookup sequence for a device:

    1. Exact Match of any of the identifier fields (name, ip, mac, serial)
    2. case insensitive match
    3. case insensitive match disregarding all hyphens and underscores (in case you type 6200f_bot and the device name is 6200F-Bot)
    4. Case insensitive Fuzzy match with implied wild-card, otherwise match any devices that start with the identifier provided. `cencli show switches 6200F` will result in a match of `6200F-Bot`.
    5. If a typo was made, and an item is a close match, you will be prompted to confirm that's what you meant.

  > If there is no match found, a cache update is triggered, and the match rules are re-tried.

  - Caching works in a similar manner for groups, templates, and sites.  Sites can match on name and nearly any address field.  So if you only had one site in San Antonio you could specify that site with `show sites 'San Antonio'`  \<-- Note the use of quotes because there is a space in the name.

  - **Multiple Matches**:  If a provided identifier is ambiguous, meaning there are multiple matches.  You will be prompted to select the intended device from a list of the matches.



  There are a number of output formats available.  Most commands default to what is likely the easiest to view given the number of fields.  Otherwise longer outputs are typically displayed vertically by default.  If the output can reasonably fit, it's displayed in tabular format horizontally.

  You can specify the output format with command line flags `--json`, `--yaml`, `--csv`, `--table`  rich is tabular format with folding (multi line within the same row) and truncating.

  > Most outputs will evolve to support an output with the most commonly desired fields by default and expanded vertical output via the `-v` option (not implemented yet.).  Currently the output is tabular horizontally if the amount of data is likely to fit most displays, and vertical otherwise.



  Just use `--out \<filename\>` (or \<path\\filename\>), and specify the desired format.



  Use `?` or `--help` from the cli, which you can do at any level.  `ccenli ?`, `cencli bounce --help` etc.

  You can also see the entire supported tree via the [CLI Reference Guide](https://central-api-cli.readthedocs.io/en/latest/cli.html).
  *NOTE: The Reference Guide documents a few commands that are hidden in the CLI*


pkgId: 85dbb50f78f38814c4c65b894e01b841719966763e42c54f4288db89f2dffb52
name: python-centralcli
arch: src
version: 7.3.0
epoch: 0
release: 1
url: https://github.com/Pack3tL0ss/central-api-cli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-centralcli-7.3.0-1.src.rpm
checksum_type: sha256
summary:
  A CLI for interacting with Aruba Central (Cloud Management Platform).  Facilitates bulk imports, exports, reporting.  A handy tool if you have devices managed by Aruba Central.

description:
  [![Latest Version](https://img.shields.io/pypi/v/centralcli.svg)](https://pypi.org/project/centralcli)
  [![Documentation Status](https://readthedocs.org/projects/central-api-cli/badge/?version=latest)](https://central-api-cli.readthedocs.io/en/latest/?badge=latest)
  [![Downloads](https://static.pepy.tech/badge/centralcli)](https://pepy.tech/project/centralcli)
  [![PyPI - Installs](https://img.shields.io/pypi/dm/centralcli.svg?color=blue&label=Installs&logo=pypi&logoColor=gold)](https://pypi.org/project/centralcli/)
  [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)

  A CLI app for interacting with Aruba Central Cloud Management Platform. With cross-platform shell support. Auto Completion, easy device/site/group/template identification (fuzzy match), support for batch import, and a lot more.

    > As commands are built out the CLI hierarchy may evolve.  Refer to the [documentation](https://central-api-cli.readthedocs.org) or help text for CLI structure/syntax.

  ![centralcli Animated Demo](https://raw.githubusercontent.com/Pack3tL0ss/central-api-cli/master/docs/img/cencli-demo.gif)



  - Cross Platform Support
  - Auto/TAB Completion
  - Specify device, site, etc. by fuzzy match of multiple fields (i.e. name, mac, serial#, ip address)
  - Multiple output formats
  - Output to file
  - Numerous import formats (csv, yaml, json, etc.)
  - Multiple account support (easily switch between different central accounts `--account myotheraccount`)
  - Batch Operation based on data from input file.  i.e. Add sites in batch based on data from a csv.
  - Automatic Token refresh.  With prompt to paste in a new token if it becomes invalid.
    > If using Tokens, dedicate the token to the CLI alone, using it in swagger or on another system, will eventually lead to a refresh that invalidates the tokens on the other systems using it.
  - You can also use username/Password Auth. which will facilitate automatic retrieval of new Tokens even if they do become invalid.



  Requires python 3.8+ and pip
  > Use `python3 -V` to determine version, but pip won't allow it to install if Python is not >= 3.8



  ```shell

  sudo apt install python3-pip


  pip install centralcli


  pip install centralcli[speedups]
  ```


  > It's ideal to install in a virtual environment (venv) on *nix based systems.  A virtualenv is an isolated environment.  This is prefered as it avoids any potential package conflicts with any system executables that use the system-wide python.  When installing in a venv some steps have to be taken to ensure the venv is in PATH so `cencli` is a recognized command, and tab completion is retained.  The venv either needs to be activated or the venv/bin directory needs to be added to PATH for completion to work.  If this is something foriegn to you, you can install pipx which is like pip but installs packages in virtual environments and automatically takes care of the rest.

  **Option 1 via pipx:**

  > The first section below is for Debian based systems refer to [pipx documentation](https://pipx.pypa.io/stable/installation/) for instructions on other OSs.
    ```shell
    
    sudo apt update
    sudo apt install pipx
    pipx ensurepath
    sudo pipx ensurepath --global  # optional refer to pipx docs

    
    pipx install centralcli --include-deps

    
    pipx install centralcli[speedups] --force  # force if centralcli was already installed and you are just adding speedups
    ```

  **Option 2 manual installation in a venv:**

  > The example below is for Debian based systems, where `apt` is referenced but should be easy to translate to other OSs given you have some familiarity with the package management commands (i.e. `dnf`).  On Windows python should install with pip.  The pip commands are still valid.
    ```shell
    
    sudo apt update
    sudo apt install python3-pip

    
    python3 -m pip install virtualenv                 # Alternatively on Debian based systems: 'sudo apt install python3-virtualenv'

    
    cd ~                                              # ensure you are in your home dir
    mkdir .venvs                                      # creates hidden .venvs dir to store venv in
    cd .venvs                                         # change to that directory
    export DEB_PYTHON_INSTALL_LAYOUT='deb'            # Just ensures the directory structure for simpler instructions (Ubuntu 22.04 changed the dir layout of venvs without it)
    python3 -m virtualenv centralcli --prompt cencli  # prompt is optional
    source centralcli/bin/activate                    # activates the venv

    
    pip install centralcli

    
    pip install centralcli[speedups]

    which centralcli # Should return ~/.venvs/centralcli/bin/centralcli

    
    echo 'export PATH="$PATH:$HOME/.venvs/centralcli/bin"' >> ~/.bashrc

    
    ```



  `pip3 install -U centralcli`



  - You can get it for any platform @ [https://www.python.org](https://www.python.org)
  - On Windows 10 it's also available in the Windows store.


  ✨ pre-populating the config as described below is optional.  Central CLI will prompt for the information it needs on first run if no config exists.
  > It's still a good idea to look over the example config to see the optional config items.

  Refer to [config.yaml.example](https://github.com/Pack3tL0ss/central-api-cli/blob/master/config/config.yaml.example) to guide in the creation of config.yaml and place in the config directory.

  Central CLI will look in \<Users home dir\>/.config/centralcli, and \<Users home dir\>\\.centralcli.
  i.e. on Windows `c:\Users\wade\.centralcli` or on Linux `/home/wade/.config/centralcli`

  Once `config.yaml` is populated per [config.yaml.example](https://github.com/Pack3tL0ss/central-api-cli/blob/master/config/config.yaml.example), run some test commands to validate the config.

  For Example `cencli show all`

  ```bash
  wade@wellswa6:~ $ cencli show all
                                                                                         All Devices
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    name                  type   model                            ip                mac                 serial       group          site             labels        version       status
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    6100F-48-LAB          cx     6100 48G CL4 4SFP+ Swch          10.0.40.11        --redacted--   --redacted--    WadeLab8x                                     10.08.1010       Down
                                 (JL675A)
    SDBranch1:7008        gw     A7008                            192.168.240.101   --redacted--   --redacted--    Branch1        Antigua          Branch View   10.3.0.0_82528   Up
    br1-2930F-sw          sw     Aruba2930F-8G-PoE+-2SFP+         10.101.5.4        --redacted--   --redacted--    Branch1        Antigua          Branch View   16.11.0002       Up
                                 Switch(JL258A)
    br1-315.0c88-ap       ap     315                              10.101.6.200      --redacted--   --redacted--    Branch1        Antigua          Branch View   10.3.0.0_82528   Up
    MB1-505h              ap     505H                             10.10.1.101       --redacted--   --redacted--    MicroBranch1   Champions Hill                 10.3.0.0_82528   Up
    6200F-Bot             cx     6200F 48G CL4 4SFP+740W Swch     10.0.40.16        --redacted--   --redacted--    WadeLab8x      Pommore                        10.08.1010       Down
                                 (JL728A)
    6200F-Top             cx     6200F 48G CL4 4SFP+740W Swch     10.0.40.6         --redacted--   --redacted--    WadeLab8x      Pommore                        10.08.1010       Down
                                 (JL728A)
    APGW1                 gw     A9004-LTE                        10.0.35.10        --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    APGW2                 gw     A9004                            10.0.35.20        --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    VPNC1                 gw     A7005                            172.30.0.242      --redacted--   --redacted--    VPNC           WadeLab          Branch View   10.3.0.0_82528   Up
    VPNC2                 gw     A7005                            172.30.0.243      --redacted--   --redacted--    VPNC           WadeLab          Branch View   10.3.0.0_82528   Up
    av-555.11b8-ap        ap     555                              10.0.31.155       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    barn-303p.2c30-ap     ap     303P                             10.1.30.151       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    barn-4100i            cx     4100i 12G CL4/6 POE 2SFP+ DIN    10.1.30.152       --redacted--   --redacted--    WadeLab        WadeLab                        10.08.1010       Up
                                 Sw (JL817A)
    barn-518.2816-ap      ap     518                              10.1.30.101       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    bsmt-515.51s9-ap      ap     515                              10.0.30.233       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    craft-2930F           sw     Aruba2930F-8G-PoE+-2SFP+         10.0.30.5         --redacted--   --redacted--    WadeLab        WadeLab                        16.11.0002       Up
                                 Switch(JL258A)
    garage-345.5136-ap    ap     345                              10.0.31.148       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    ktcn-505H.206c-ap     ap     505H                             10.0.30.212       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    lwrptio-575.0824-ap   ap     575                              10.0.30.219       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    zrm-535.70be-ap       ap     535                              10.0.31.101       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    Show all displays fields common to all device types. To see all columns for a given device type use show <DEVICE TYPE>
    API Rate Limit: 925 of 1000 remaining.

  ```

  Use `cencli ?` to become familiar with the command options.



  The CLI supports auto-completion.  To configure auto-completion run `cencli --install-completion`.  This will auto-detect the type of shell you are running in, and install the necessary completion into your profile.  You'll need to exit the shell and start a new session for it to take effect.
  > Note for OSX 11: Additional step, edit .zshrc and add "autoload -Uz compinit && compinit -i" then exit and start new session.





  - Caching: The CLI caches information on all devices, sites, groups and templates along with some other items.  It's a minimal amount per device, and is done to allow human friendly identifiers.  The API typically accepts serial #, site id, etc.  This function allows you to specify a device by name, IP, mac (any format), and serial.

  The lookup sequence for a device:

    1. Exact Match of any of the identifier fields (name, ip, mac, serial)
    2. case insensitive match
    3. case insensitive match disregarding all hyphens and underscores (in case you type 6200f_bot and the device name is 6200F-Bot)
    4. Case insensitive Fuzzy match with implied wild-card, otherwise match any devices that start with the identifier provided. `cencli show switches 6200F` will result in a match of `6200F-Bot`.
    5. If a typo was made, and an item is a close match, you will be prompted to confirm that's what you meant.

  > If there is no match found, a cache update is triggered, and the match rules are re-tried.

  - Caching works in a similar manner for groups, templates, and sites.  Sites can match on name and nearly any address field.  So if you only had one site in San Antonio you could specify that site with `show sites 'San Antonio'`  \<-- Note the use of quotes because there is a space in the name.

  - **Multiple Matches**:  If a provided identifier is ambiguous, meaning there are multiple matches.  You will be prompted to select the intended device from a list of the matches.



  There are a number of output formats available.  Most commands default to what is likely the easiest to view given the number of fields.  Otherwise longer outputs are typically displayed vertically by default.  If the output can reasonably fit, it's displayed in tabular format horizontally.

  You can specify the output format with command line flags `--json`, `--yaml`, `--csv`, `--table`  rich is tabular format with folding (multi line within the same row) and truncating.

  > Most outputs will evolve to support an output with the most commonly desired fields by default and expanded vertical output via the `-v` option (not implemented yet.).  Currently the output is tabular horizontally if the amount of data is likely to fit most displays, and vertical otherwise.



  Just use `--out \<filename\>` (or \<path\\filename\>), and specify the desired format.



  Use `?` or `--help` from the cli, which you can do at any level.  `ccenli ?`, `cencli bounce --help` etc.

  You can also see the entire supported tree via the [CLI Reference Guide](https://central-api-cli.readthedocs.io/en/latest/cli.html).
  *NOTE: The Reference Guide documents a few commands that are hidden in the CLI*


pkgId: 1495237c528b4eacf5a7fafcad6edbfe04fc33bf55067ff4cde5567f0f8b86ec
name: python-centralcli
arch: src
version: 7.4.0
epoch: 0
release: 1
url: https://github.com/Pack3tL0ss/central-api-cli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-centralcli-7.4.0-1.src.rpm
checksum_type: sha256
summary:
[cell repeats an earlier one in this file: 176 characters]

description:
  [![Latest Version](https://img.shields.io/pypi/v/centralcli.svg)](https://pypi.org/project/centralcli)
  [![Documentation Status](https://readthedocs.org/projects/central-api-cli/badge/?version=latest)](https://central-api-cli.readthedocs.io/en/latest/?badge=latest)
  [![Downloads](https://static.pepy.tech/badge/centralcli)](https://pepy.tech/project/centralcli)
  [![PyPI - Installs](https://img.shields.io/pypi/dm/centralcli.svg?color=blue&label=Installs&logo=pypi&logoColor=gold)](https://pypi.org/project/centralcli/)
  [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)

  A CLI app for interacting with Aruba Central Cloud Management Platform. With cross-platform shell support. Auto Completion, easy device/site/group/template identification (fuzzy match), support for batch import, and a lot more.

    > As commands are built out the CLI hierarchy may evolve.  Refer to the [documentation](https://central-api-cli.readthedocs.org) or help text for CLI structure/syntax.

  ![centralcli Animated Demo](https://raw.githubusercontent.com/Pack3tL0ss/central-api-cli/master/docs/img/cencli-demo.gif)


  When running with Python 3.12 it's possible to see a number of SyntaxWarning messages regarding "invaslid escape sequence".  This is due to a change in behavior in 3.12.  This will be resolved in an upcoming release.  The warnings do not impact functionality.



  - Cross Platform Support
  - Auto/TAB Completion
  - Specify device, site, etc. by fuzzy match of multiple fields (i.e. name, mac, serial#, ip address)
  - Multiple output formats
  - Output to file
  - Numerous import formats (csv, yaml, json, etc.)
  - Multiple account support (easily switch between different central accounts `--account myotheraccount`)
  - Batch Operation based on data from input file.  i.e. Add sites in batch based on data from a csv.
  - Automatic Token refresh.  With prompt to paste in a new token if it becomes invalid.
    > If using Tokens, dedicate the token to the CLI alone, using it in swagger or on another system, will eventually lead to a refresh that invalidates the tokens on the other systems using it.
  - You can also use username/Password Auth. which will facilitate automatic retrieval of new Tokens even if they do become invalid.



  The recommended method is to use uv, which is a single Rust binary that you can use to install Python apps. It's significantly faster than alternative tools, and will get you up and running with Posting in seconds.  `uv` will install `centralcli` in an isolated environment and expose the `cencli` command in PATH.

  You don't even need to worry about installing Python yourself - uv will manage everything for you.



  ```bash

  curl -LsSf https://astral.sh/uv/install.sh | sh
  ```


  ```bash

  powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  ```
  > Changing the execution policy allows running a script from the internet.

  `uv` can also be installed via Homebrew, Cargo, Winget, pipx, and more. See the [installation guide](https://docs.astral.sh/uv/getting-started/installation/) for more information.



  ```bash

  uv tool install --python 3.11 centralcli
  ```

  Then to Upgrade `centralcli`
  ```bash
  uv tool upgrade centralcli
  ```


  `centralcli` can also be installed via pipx, similar to `uv` pipx will install `centralcli` in an isolated environment, and expose the `cencli` command in PATH.

  > The first section below is for Debian based systems refer to [pipx documentation](https://pipx.pypa.io/stable/installation/) for instructions on other OSs.
    ```bash
    
    sudo apt update
    sudo apt install pipx
    pipx ensurepath

    
    pipx install centralcli --include-deps

    
    pipx install centralcli[speedups] --force  # force if centralcli was already installed and you are just adding speedups
    ```

  Then to Upgrade `centralcli`
  ```bash
  pip upgrade centralcli
  ```



  > The example below is for Debian based systems, where `apt` is referenced but should be easy to translate to other OSs given you have some familiarity with the package management commands (i.e. `dnf`).  On Windows python should install with pip.  The pip commands are still valid.
    ```shell
    
    sudo apt update
    sudo apt install python3-pip
    sudo apt install python3-virtualenv

    
    cd ~                                              # ensure you are in your home dir
    mkdir .venvs                                      # creates hidden .venvs dir to store venv in
    cd .venvs                                         # change to that directory
    export DEB_PYTHON_INSTALL_LAYOUT='deb'            # Just ensures the directory structure for simpler instructions (Ubuntu 22.04 changed the dir layout of venvs without it)
    python3 -m virtualenv centralcli --prompt cencli  # prompt is optional
    source centralcli/bin/activate                    # activates the venv

    
    pip install centralcli

    
    pip install centralcli[speedups]

    which centralcli # Should return ~/.venvs/centralcli/bin/centralcli

    
    echo 'export PATH="$PATH:$HOME/.venvs/centralcli/bin"' >> ~/.bashrc

    
    ```

    Then to upgrade:
  ```bash
  ~/.venvs/centralcli/bin/pip install -U centralcli
  ```


  [Requires python3.9 or above and pip.](#if-you-dont-have-python)

  It's recommended to use the `uv` install method above, however if you don't use a lot of python apps (meaning a dependency conflict with other apps is not a concern).  Then simply installing via pip is possible (*albeit not recommended*).
  > This method is primarily feasible on Windows, as current versions of many Linux distributions do not allow installing apps in the system python environment.


  ```bash
  pip install centralcli


  pip install centralcli[speedups]
  ```

  Then to upgrade:
  ```bash
  pip install -U centralcli
  ```



  - You can get it for any platform @ [https://www.python.org](https://www.python.org)
  - On Windows 10 it's also available in the Windows store, and via winget.


  ✨ pre-populating the config as described below is optional.  Central CLI will prompt for the information it needs on first run if no config exists.
  > It's still a good idea to look over the example config to see the optional config items.

  Refer to [config.yaml.example](https://github.com/Pack3tL0ss/central-api-cli/blob/master/config/config.yaml.example) to guide in the creation of config.yaml and place in the config directory.

  Central CLI will look in \<Users home dir\>/.config/centralcli, and \<Users home dir\>\\.centralcli.
  i.e. on Windows `c:\Users\wade\.centralcli` or on Linux `/home/wade/.config/centralcli`

  Once `config.yaml` is populated per [config.yaml.example](https://github.com/Pack3tL0ss/central-api-cli/blob/master/config/config.yaml.example), run some test commands to validate the config.

  For Example `cencli show all`

  ```bash
  wade@wellswa6:~ $ cencli show all
                                                                                         All Devices
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    name                  type   model                            ip                mac                 serial       group          site             labels        version       status
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    6100F-48-LAB          cx     6100 48G CL4 4SFP+ Swch          10.0.40.11        --redacted--   --redacted--    WadeLab8x                                     10.08.1010       Down
                                 (JL675A)
    SDBranch1:7008        gw     A7008                            192.168.240.101   --redacted--   --redacted--    Branch1        Antigua          Branch View   10.3.0.0_82528   Up
    br1-2930F-sw          sw     Aruba2930F-8G-PoE+-2SFP+         10.101.5.4        --redacted--   --redacted--    Branch1        Antigua          Branch View   16.11.0002       Up
                                 Switch(JL258A)
    br1-315.0c88-ap       ap     315                              10.101.6.200      --redacted--   --redacted--    Branch1        Antigua          Branch View   10.3.0.0_82528   Up
    MB1-505h              ap     505H                             10.10.1.101       --redacted--   --redacted--    MicroBranch1   Champions Hill                 10.3.0.0_82528   Up
    6200F-Bot             cx     6200F 48G CL4 4SFP+740W Swch     10.0.40.16        --redacted--   --redacted--    WadeLab8x      Pommore                        10.08.1010       Down
                                 (JL728A)
    6200F-Top             cx     6200F 48G CL4 4SFP+740W Swch     10.0.40.6         --redacted--   --redacted--    WadeLab8x      Pommore                        10.08.1010       Down
                                 (JL728A)
    APGW1                 gw     A9004-LTE                        10.0.35.10        --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    APGW2                 gw     A9004                            10.0.35.20        --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    VPNC1                 gw     A7005                            172.30.0.242      --redacted--   --redacted--    VPNC           WadeLab          Branch View   10.3.0.0_82528   Up
    VPNC2                 gw     A7005                            172.30.0.243      --redacted--   --redacted--    VPNC           WadeLab          Branch View   10.3.0.0_82528   Up
    av-555.11b8-ap        ap     555                              10.0.31.155       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    barn-303p.2c30-ap     ap     303P                             10.1.30.151       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    barn-4100i            cx     4100i 12G CL4/6 POE 2SFP+ DIN    10.1.30.152       --redacted--   --redacted--    WadeLab        WadeLab                        10.08.1010       Up
                                 Sw (JL817A)
    barn-518.2816-ap      ap     518                              10.1.30.101       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82528   Up
    bsmt-515.51s9-ap      ap     515                              10.0.30.233       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    craft-2930F           sw     Aruba2930F-8G-PoE+-2SFP+         10.0.30.5         --redacted--   --redacted--    WadeLab        WadeLab                        16.11.0002       Up
                                 Switch(JL258A)
    garage-345.5136-ap    ap     345                              10.0.31.148       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    ktcn-505H.206c-ap     ap     505H                             10.0.30.212       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    lwrptio-575.0824-ap   ap     575                              10.0.30.219       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
    zrm-535.70be-ap       ap     535                              10.0.31.101       --redacted--   --redacted--    WLNET          WadeLab                        10.3.0.0_82463   Down
   ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    Show all displays fields common to all device types. To see all columns for a given device type use show <DEVICE TYPE>
    API Rate Limit: 925 of 1000 remaining.

  ```

  Use `cencli ?` to become familiar with the command options.



  The CLI supports auto-completion.  To configure auto-completion run `cencli --install-completion`.  This will auto-detect the type of shell you are running in, and install the necessary completion into your profile.  You'll need to exit the shell and start a new session for it to take effect.
  > Note for OSX 11: Additional step, edit .zshrc and add "autoload -Uz compinit && compinit -i" then exit and start new session.





  - Caching: The CLI caches information on all devices, sites, groups and templates along with some other items.  It's a minimal amount per device, and is done to allow human friendly identifiers.  The API typically accepts serial #, site id, etc.  This function allows you to specify a device by name, IP, mac (any format), and serial.

  The lookup sequence for a device:

    1. Exact Match of any of the identifier fields (name, ip, mac, serial)
    2. case insensitive match
    3. case insensitive match disregarding all hyphens and underscores (in case you type 6200f_bot and the device name is 6200F-Bot)
    4. Case insensitive Fuzzy match with implied wild-card, otherwise match any devices that start with the identifier provided. `cencli show switches 6200F` will result in a match of `6200F-Bot`.
    5. If a typo was made, and an item is a close match, you will be prompted to confirm that's what you meant.

  > If there is no match found, a cache update is triggered, and the match rules are re-tried.

  - Caching works in a similar manner for groups, templates, and sites.  Sites can match on name and nearly any address field.  So if you only had one site in San Antonio you could specify that site with `show sites 'San Antonio'`  \<-- Note the use of quotes because there is a space in the name.

  - **Multiple Matches**:  If a provided identifier is ambiguous, meaning there are multiple matches.  You will be prompted to select the intended device from a list of the matches.



  There are a number of output formats available.  Most commands default to what is likely the easiest to view given the number of fields.  Otherwise longer outputs are typically displayed vertically by default.  If the output can reasonably fit, it's displayed in tabular format horizontally.

  You can specify the output format with command line flags `--json`, `--yaml`, `--csv`, `--table`  rich is tabular format with folding (multi line within the same row) and truncating.

  > Most outputs will evolve to support an output with the most commonly desired fields by default and expanded vertical output via the `-v` option (not implemented yet.).  Currently the output is tabular horizontally if the amount of data is likely to fit most displays, and vertical otherwise.



  Just use `--out \<filename\>` (or \<path\\filename\>), and specify the desired format.



  Use `?` or `--help` from the cli, which you can do at any level.  `ccenli ?`, `cencli bounce --help` etc.

  You can also see the entire supported tree via the [CLI Reference Guide](https://central-api-cli.readthedocs.io/en/latest/cli.html).
  *NOTE: The Reference Guide documents a few commands that are hidden in the CLI*


pkgId: 108799a480cddc288ed54167ec0cf23d6383af7bc796819da209637fdb81c31d
name: python-centrifuge-python
arch: src
version: 0.3.1
epoch: 0
release: 1
summary: WebSocket SDK for Centrifugo (and any Centrifuge-based server) on top of Python asyncio library
url: https://pypi.org/project/centrifuge-python/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-centrifuge-python-0.3.1-1.src.rpm
checksum_type: sha256
description:
  [![CI](https://github.com/centrifugal/centrifuge-python/actions/workflows/test.yml/badge.svg)](https://github.com/centrifugal/centrifuge-python/actions/workflows/test.yml?query=event%3Apush+branch%3Amaster+workflow%3ATest)
  [![pypi](https://img.shields.io/pypi/v/centrifuge-python.svg)](https://pypi.python.org/pypi/centrifuge-python)
  [![versions](https://img.shields.io/pypi/pyversions/centrifuge-python.svg)](https://github.com/centrifugal/centrifuge-python)
  [![license](https://img.shields.io/github/license/centrifugal/centrifuge-python.svg)](https://github.com/centrifugal/centrifuge-python/blob/master/LICENSE)

  This is a WebSocket real-time SDK for [Centrifugo](https://github.com/centrifugal/centrifugo) server (and any [Centrifuge-based](https://github.com/centrifugal/centrifuge) server) on top of Python asyncio library.

  > [!TIP]
  > If you are looking for Centrifugo [server API](https://centrifugal.dev/docs/server/server_api) client – check out [pycent](https://github.com/centrifugal/pycent) instead.

  Before starting to work with this library check out Centrifugo [client SDK API specification](https://centrifugal.dev/docs/transports/client_api) as it contains common information about Centrifugal real-time SDK behavior. This SDK supports all major features of Centrifugo client protocol - see [SDK feature matrix](https://centrifugal.dev/docs/transports/client_sdk#sdk-feature-matrix).



  ```
  pip install centrifuge-python
  ```

  Then in your code:

  ```
  from centrifuge import Client
  ```

  See [example code](https://github.com/centrifugal/centrifuge-python/blob/master/example.py) and [how to run it](#run-example) locally.



  By default, SDK uses JSON protocol. If you want to use Protobuf protocol instead then pass `use_protobuf=True` option to `Client` constructor.

  When using JSON protocol:

  * all payloads (data to publish, connect/subscribe data) you pass to the library are encoded to JSON internally using `json.dumps` before sending to server. So make sure you pass only JSON-serializable data to the library.
  * all payloads received from server are decoded to Python objects using `json.loads` internally before passing to your code.

  When using Protobuf protocol:

  * all payloads you pass to the library must be `bytes` or `None` if optional. If you pass non-`bytes` data – exception will be raised.
  * all payloads received from the library will be `bytes` or `None` if not present.
  * don't forget that when using Protobuf protocol you can still have JSON payloads - just encode them to `bytes` before passing to the library.



  Event callbacks are called by SDK using `await` internally, the websocket connection read loop is blocked for the time SDK waits for the callback to be executed. This means that if you need to perform long operations in callbacks consider moving the work to a separate coroutine/task to return fast and continue reading data from the websocket.

  The fact WebSocket read is blocked for the time we execute callbacks means that you can not call awaitable SDK APIs from callback – because SDK does not have a chance to read the reply. You will get `OperationTimeoutError` exception. The rule is the same - do the work asynchronously, for example use `asyncio.ensure_future`.



  To run [example](https://github.com/centrifugal/centrifuge-python/blob/master/example.py), first start Centrifugo with config like this:

  ```json
  {
    "token_hmac_secret_key": "secret",
    "namespaces": [
      {
        "name": "example",
        "presence": true,
        "history_size": 300,
        "history_ttl": "300s",
        "join_leave": true,
        "force_push_join_leave": true,
        "allow_publish_for_subscriber": true,
        "allow_presence_for_subscriber": true,
        "allow_history_for_subscriber": true
      }
    ]
  }
  ```

  And then:

  ```bash
  python -m venv env
  . env/bin/activate
  make dev
  python example.py
  ```



  To run tests, first start Centrifugo server:

  ```bash
  docker pull centrifugo/centrifugo:v5
  docker run -d -p 8000:8000 -e CENTRIFUGO_LOG_LEVEL=trace \
  -e CENTRIFUGO_TOKEN_HMAC_SECRET_KEY="secret" -e CENTRIFUGO_PRESENCE=true \
  -e CENTRIFUGO_JOIN_LEAVE=true -e CENTRIFUGO_FORCE_PUSH_JOIN_LEAVE=true \
  -e CENTRIFUGO_HISTORY_TTL=300s -e CENTRIFUGO_HISTORY_SIZE=100 \
  -e CENTRIFUGO_DELTA_PUBLISH=true -e CENTRIFUGO_ALLOWED_DELTA_TYPES="fossil" \
  -e CENTRIFUGO_FORCE_RECOVERY=true -e CENTRIFUGO_USER_SUBSCRIBE_TO_PERSONAL=true \
  -e CENTRIFUGO_ALLOW_PUBLISH_FOR_SUBSCRIBER=true -e CENTRIFUGO_ALLOW_PRESENCE_FOR_SUBSCRIBER=true \
  -e CENTRIFUGO_ALLOW_HISTORY_FOR_SUBSCRIBER=true centrifugo/centrifugo:v5 centrifugo
  ```

  And then (from cloned repo root):

  ```bash
  python -m venv env
  . env/bin/activate
  make dev
  make test
  ```


pkgId: e8e9f6cb4afec1f3a99215faed5c328c42ce048af07bad339acdc0573779355b
name: python-cepmex
arch: src
version: 0.2.2
epoch: 0
release: 1
summary: CEP client library
url: https://github.com/cuenca-mx/cep-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cepmex-0.2.2-1.src.rpm
checksum_type: sha256
description:
  [![test](https://github.com/cuenca-mx/cep-python/workflows/test/badge.svg)](https://github.com/cuenca-mx/cep-python/actions?query=workflow%3Atest)
  [![codecov](https://codecov.io/gh/cuenca-mx/cep-python/branch/master/graph/badge.svg)](https://codecov.io/gh/cuenca-mx/cep-python)
  [![PyPI](https://img.shields.io/pypi/v/cuenca.svg)](https://pypi.org/project/cuenca/)

  Python client library for CEP (http://www.banxico.org.mx/cep/)




  ```bash
  pip install cepmex
  ```



  ```python
  from datetime import date

  from cep import Transferencia

  tr = Transferencia.validar(
      fecha=date(2019, 4, 12),
      clave_rastreo='CUENCA1555093850',
      emisor='90646',  # STP
      receptor='40012',  # BBVA
      cuenta='012180004643051249',
      monto=8.17,
  )
  pdf = tr.descargar()
  ```


pkgId: f3635601f62c59760eab7b9bae2c6cc51bf8d0652471c44aee87d299f7696574
name: python-cer
arch: src
version: 1.2.0
epoch: 0
release: 1
summary: Translation Edit Rate on the character level
url: https://github.com/BramVanroy/CharacTER
rpm_license: GPLv3
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cer-1.2.0-1.src.rpm
checksum_type: sha256
description:
  CharacTER: Translation Edit Rate on Character Level

  CharacTer (cer) is a novel character level metric inspired by the commonly applied translation edit rate (TER). It is defined
  as the minimum number of character edits required to adjust a hypothesis, until it completely matches the reference,
  normalized by the length of the hypothesis sentence. CharacTer calculates the character level edit distance while
  performing the shift edit on word level. Unlike the strict matching criterion in TER, a hypothesis word is considered
  to match a reference word and could be shifted, if the edit distance between them is below a threshold value. The
  Levenshtein distance between the reference and the shifted hypothesis sequence is computed on the character level. In
  addition, the lengths of hypothesis sequences instead of reference sequences are used for normalizing the edit
  distance, which effectively counters the issue that shorter translations normally achieve lower TER.




  Bram Vanroy made some changes to this package that do not affect the result of the metric but that should
  improve usability. Code has been re-written to avoid the need for custom C++ code (instead the [C implementation
  of Levenshtein](https://github.com/maxbachmann/Levenshtein) alongside an LRU cache is used), to make functions more
  accessible and readable, and typing info has been included. Packaging has also improved to make uploading to PyPi a
  breeze. This means that the package can now be installed via pip:

  ```shell
  pip install cer
  ```

  The main functions are `calculate_cer` and `calculate_cer_corpus`, which both expect tokenized input. The first
  argument contains the hypotheses and the second the references.

  ```python
  from cer import calculate_cer

  cer_score = calculate_cer(["i", "like", "your", "bag"], ["i", "like", "their", "bags"])
  cer_score
  0.3333333333333333
  ```

  `calculate_cer_corpus` is similar but instead it expects a sequence of sequence of words, basically a corpus of
  sentences of words. It will report some statistics of the sentence-level CER scores that were calculated.

  ```python
  from cer import calculate_cer_corpus

  hyps = ["this week the saudis denied information published in the new york times",
          "this is in fact an estimate"]
  refs = ["saudi arabia denied this week information published in the american new york times",
          "this is actually an estimate"]

  hyps = [sent.split() for sent in hyps]
  refs = [sent.split() for sent in refs]

  cer_corpus_score = calculate_cer_corpus(hyps, refs)
  cer_corpus_score
  {
      'count': 2,
      'mean': 0.3127282211789254,
      'median': 0.3127282211789254,
      'std': 0.07561653111280243,
      'min': 0.25925925925925924,
      'max': 0.36619718309859156
  }
  ```

  In addition to the Python interface, a command-line entry-point is also installed, which you can use as
  `calculate-cer`. Its idea is to calculate aggregate scores on the corpus-level (similar to calculate_cer_corpus)
  based on two input files. One with hypotheses and one with references (one on each line). Results are written to
  stdout.

  ```shell
  usage: calculate-cer [-h] [-r] fhyp fref

  CharacTER: Character Level Translation Edit Rate

  positional arguments:
    fhyp                Path to file containing hypothesis sentences. One per line.
    fref                Path to file containing reference sentences. One per line.

  optional arguments:
    -h, --help          show this help message and exit
    -r, --per_sentence  Whether to output CER scores per ref/hyp pair in addition to corpus-level statistics
  ```


  [GPLv3](LICENSE)


pkgId: e04eb5cd2a691b0f6744b2e54e0efcdb1b6a7917384108ddfba923404ebca947
name: python-ceramic
arch: src
version: 2020.11.12
epoch: 0
release: 1
summary: Python library for defining data tables as tiles
url: https://github.com/idin/ceramic
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ceramic-2020.11.12-1.src.rpm
checksum_type: sha256
description:
  *Ceramic* is a Python library for turning dataframes into *mosaics* for
  ease of use. For example, you can create a mosaic with *X* and *y* tile columns and
  *training* and *test* tile rows for fitting and testing machine learning models.


pkgId: 276569163ead37eee12f7f678eeb48aa32241b4eb3d56a0aad721c49430b3b38
name: python-ceramic-python
arch: src
version: 0.1.7
epoch: 0
release: 1
url: https://github.com/indexnetwork/ceramic-python/tree/main/ceramic-client
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ceramic-python-0.1.7-1.src.rpm
checksum_type: sha256
summary:
  This Ceramic client implements the payload building, encoding, and signing needed to interact with the Ceramic Network. It currently supports ModelInstanceDocument.

description:
  This Ceramic client implements the payload building, encoding, and signing needed to interact with the [Ceramic Network](https://ceramic.network/). It currently supports `ModelInstanceDocument`.



  - Implements payload building, encoding, and signing for Ceramic interactions
  - Currently supports `ModelInstanceDocument`





  ```bash
  pip3 install ceramic_python
  ```


  First, generate a Decentralized Identifier (DID) using a DID library.

  ```python
  from ceramic_python.helper import get_iso_timestamp
  from ceramic_python.did import DID
  from ceramic_python.ceramic_client import CeramicClient
  from ceramic_python.model_instance_document import ModelInstanceDocument, ModelInstanceDocumentMetadataArgs

  def initialize_ceramic():
      did = DID(
          id="did:key:z6MkefHJkv4f658zsR59uRAZqCa8wuz8hKJ8VGQUHznN3XB9",
          private_key="e40070a71c32a1b22dbd2123cde261446a9e9d2dfefefef03ec4619697d14eb2",
      )
      ceramic_client = CeramicClient("<CERAMIC_NODE_URL>", did)
      return ceramic_client, did

  def create_document():
      ceramic_client, did = initialize_ceramic()

      metadata_args = ModelInstanceDocumentMetadataArgs(
          controller=did.id,
          model="kjzl6hvfrbw6c7wjdc58s11ru9y3h2ubzq6yixqy134xkc63bnnzjcnwaimf711",
      )

      content = {
          "title": "Alice",
          "createdAt": get_iso_timestamp(),
          "updatedAt": get_iso_timestamp(),
      }

      doc = ModelInstanceDocument.create(ceramic_client, content, metadata_args)
      print(f"Stream created with ID: {doc.stream_id}")
      return doc


  create_document()
  ```




  ```python
  from ceramic_python.did import DID
  from ceramic_python.ceramic_client import CeramicClient
  from ceramic_python.model_instance_document import ModelInstanceDocument

  def initialize_ceramic():
      did = DID(
          id="did:key:z6MkefHJkv4f658zsR59uRAZqCa8wuz8hKJ8VGQUHznN3XB9",
          private_key="e40070a71c32a1b22dbd2123cde261446a9e9d2dfefefef03ec4619697d14eb2",
      )
      ceramic_client = CeramicClient("<CERAMIC_NODE_URL>", did)
      return ceramic_client, did

  def load_document(stream_id):
      ceramic_client, _ = initialize_ceramic()
      doc = ModelInstanceDocument.load(ceramic_client, stream_id)
      print(f"Data from stream: {doc.content}")
      return doc


  load_document(<STREAM_ID>)

  ```


  ```python
  from ceramic_python.helper import get_iso_timestamp
  from ceramic_python.did import DID
  from ceramic_python.ceramic_client import CeramicClient
  from ceramic_python.model_instance_document import ModelInstanceDocument

  def initialize_ceramic():
      did = DID(
          id="did:key:z6MkefHJkv4f658zsR59uRAZqCa8wuz8hKJ8VGQUHznN3XB9",
          private_key="e40070a71c32a1b22dbd2123cde261446a9e9d2dfefefef03ec4619697d14eb2",
      )
      ceramic_client = CeramicClient("<CERAMIC_NODE_URL>", did)
      return ceramic_client, did

  def update_document(stream_id):
      ceramic_client, _ = initialize_ceramic()
      doc = ModelInstanceDocument.load(ceramic_client, stream_id)

      updated_content = {
          "title": "Second",
          "createdAt": get_iso_timestamp(),
          "updatedAt": get_iso_timestamp(),
      }

      updated = doc.replace(updated_content)
      print(f"Updated data: {updated.content}")
      return updated


  update_document(<STREAM_ID>)
  ```


  ```python
  from ceramic_python.helper import get_iso_timestamp
  from ceramic_python.did import DID
  from ceramic_python.ceramic_client import CeramicClient
  from ceramic_python.model_instance_document import ModelInstanceDocument

  def initialize_ceramic():
      did = DID(
          id="did:key:z6MkefHJkv4f658zsR59uRAZqCa8wuz8hKJ8VGQUHznN3XB9",
          private_key="e40070a71c32a1b22dbd2123cde261446a9e9d2dfefefef03ec4619697d14eb2",
      )
      ceramic_client = CeramicClient("<CERAMIC_NODE_URL>", did)
      return ceramic_client, did

  def patch_document(stream_id):
      ceramic_client, _ = initialize_ceramic()
      doc = ModelInstanceDocument.load(ceramic_client, stream_id)

      patch = [
          {"op": "replace", "path": "/title", "value": "Patched Title"},
          {"op": "replace", "path": "/updatedAt", "value": get_iso_timestamp()}
      ]

      patched_doc = doc.patch(patch)
      print(f"Stream patched. New content: {patched_doc.content}")
      return patched_doc


  patch_document(<STREAM_ID>)
  ```



  * Clone this repository
  ```shell
  git clone git@github.com:indexnetwork/ceramic-python.git
  cd ceramic-client
  ```
  * Install [Pipenv](https://pipenv.pypa.io/en/latest/).
  * Generate the virtual environment:
  ```shell
  make new_env && pipenv shell
  ```



  This project is largely based on the work done by the team at https://github.com/valory-xyz/ceramic-py/. We are grateful for their contributions to the Ceramic ecosystem and the open-source community.


pkgId: 0984b64c8a4eb627f5f7bbf50d8c2d4ad9c62dd845705f59bbfb13f09eb74ffd
name: python-cerberus-list-schema
arch: src
version: 1.0.3
epoch: 0
release: 1
url: https://github.com/Firepubes/cerberus-list-schema
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cerberus-list-schema-1.0.3-1.src.rpm
checksum_type: sha256
summary:
  Cerburus based validation extended to support list schemas and list transposition to dictionary and python objects

description:
  [![PyPI version](https://badge.fury.io/py/cerberus-list-schema.svg)](https://badge.fury.io/py/cerberus-list-schema)
  [![Build Status](https://travis-ci.org/Fireclunge/cerberus-list-schema.svg?branch=master)](https://travis-ci.org/Fireclunge/cerberus-list-schema)
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

  **Cerberus List Schema** is a **Cerberus based validation library with extended methods** to support list schemas as well
  as list transposition to dictionary and python objects.

  - List/array schema support
  - Transposition of lists to python objects via schemas
  - Support for missing values in document



  Cerberus List Schema can be installed using pip.

  ```
  $ pip install cerberus-list-schema
  ```




  ```python
  >>> schema = {
  >>>     "type": "list",
  >>>     "items": [{"type": "string"}, {"type": "integer", "min": 20}],
  >>> }
  ```



  Lists can now be validated out of context of a dictionary

  ```python
  >>> document = ["Apples", 40]
  >>> v = Validator(schema)
  >>> v.validate(document)
  True
  ```

  ... and usual cerberus validation rules still apply

  ```python
  >>> document = ["Apples", 15]
  >>> v.validate(document)
  False
  >>> v.errors
  {'_schema': [{1: ['min value is 20']}]}
  ```



  In cerberus, documents that are missing information specified in a list schema will fail.
  Using Cerberus List Schema you can pass `allow_list_missing=True` to a Validator object to enable incomplete lists.

  ```python
  >>> document = ["Apples"]
  >>> v.validate(document)
  False
  >>> v.errors
  {'_schema': ['length of list should be 2, it is 1']}

  >>> v = Validator(schema, allow_list_missing=True)
  >>> v.validate(document)
  True
  ```





  Lists can now be normalized as dict additional to the standard cerberus validation.
  By default they are given a key equalled to their list index.

  ```python
  >>> document = {"produce": ["Apple", 5, "High"]}
  >>> schema = {
  >>>     "produce": {
  >>>         "type": "list",
  >>>         "items": [
  >>>             {"type": "string"},
  >>>             {"type": "integer", "min": 0},
  >>>             {"type": "string"},
  >>>         ],
  >>>     }
  >>> }

  >>> v = Validator(schema)
  >>> v.normalized_as_dict(document)
  {"fruits": {0: "Apple", 1: 5, 2: "High"}}
  ```



  However by using the `name` rule, lists can be assigned to a namable dict. Note that this is different to `rename`
  and should be preferred when using the dictionary normalization as rename can produce adverse effects.

  ```python
  >>> document = {"produce": ["Apple", 5, "High"]}
  >>> schema = {
  >>>     "produce": {
  >>>         "type": "list",
  >>>         "name": "fruits",
  >>>         "items": [
  >>>             {"name": "type", "type": "string"},
  >>>             {"name": "count", "type": "integer", "min": 0},
  >>>             {"name": "quality", "type": "string"},
  >>>         ],
  >>>     }
  >>> }

  >>> v = Validator(schema)
  >>> v.normalized_as_dict(document)
  {'fruits': {'type': 'Apple', 'count': 5, 'quality': 'High'}}
  ```



  By default, conflicting names will throw an error.
  However, `allow_name_conflicts` can be specified to ignore the error.
  In this case, previous assignments will be overwritten without error

  ```python
  >>> document = {"produce": ["Apple", "Orange"]}
  >>> schema = {
  >>>     "produce": {
  >>>         "type": "list",
  >>>         "items": [
  >>>             {"name": "fruit_type", "type": "string"},
  >>>             {"name": "fruit_type", "type": "string"},
  >>>         ],
  >>>     }
  >>> }

  >>> v = Validator(schema)
  >>> v.normalized_as_dict(document)
  AttributeError: `name` rule (`fruit_type`) already in use by another field

  >>> v.normalized_as_dict(document, allow_name_conflicts=True)
  {'produce': {'type': 'Orange'}}
  ```



  Lists can now be normalized as dict additional to the standard cerberus validation.
  By default they are given a key equalled to their list index. However `name` may be used to rename
  object property to that provided. (ensuring the name is a valid python variable name)

  ```python
  >>> document = {"produce": ["Apple", 5, "High"], "supplier": ["Greg", "United Kingdom", 7.34]}
  >>> schema = {
  >>>     "produce": {
  >>>         "type": "list",
  >>>         "name": "fruits",
  >>>         "items": [
  >>>             {"name": "type", "type": "string"},
  >>>             {"name": "count", "type": "integer", "min": 0},
  >>>             {"name": "quality", "type": "string"},
  >>>         ],
  >>>     },
  >>>     "supplier": {
  >>>         "type": "list",
  >>>         "items": [
  >>>             {"type": "string"},
  >>>             {"type": "string"},
  >>>             {"type": "string", "coerce": int},
  >>>         ],
  >>>     },
  >>> }

  >>> v = Validator(schema)
  >>> obj = v.normalized_as_object(document)

  >>> obj.fruits.type  # note produce has been renamed to fruits
  'Apple'
  >>> obj.fruits.quality
  'High'
  >>> obj.supplier[0]
  'Greg'
  >>> obj.supplier[2]  # w/ coerce as int rule applied
  7
  ```



  Array values without a `name` property can also be callable by using `callable_numbers`. This is places an underscore
  before the key index such that it can be called as a property of an object rather than by index.

  ```python
  >>> document = ["Greg", "United Kingdom", 7.34]
  >>> schema = {
  >>>    "type": "list",
  >>>    "items": [
  >>>        {"type": "string"},
  >>>        {"type": "string", "name": "country"},
  >>>        {"type": "string", "coerce": int},
  >>>    ],
  >>>}

  >>> v = Validator(schema)
  >>> obj = v.normalized_as_object(document, callable_numbers=True)

  >>> obj._0
  'Greg'
  >>> obj._1  # value renamed to country

  >>> obj.country
  'United Kingdom'
  >>> obj._2
  7
  ```



  More information about Cerberus and its validators can be found on their GitHub page @ https://github.com/pyeve/cerberus

  Complete documentation for Cerberus is available at http://docs.python-cerberus.org


pkgId: 11d7546798a4296734a0e6e15a8eb80c3b90661668bb222fc2ae7bee0da1a575
name: python-cereal-lazer
arch: src
version: 0.1.6
epoch: 0
release: 1
url: https://github.com/maarten-dp/cereal-lazer
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cereal-lazer-0.1.6-1.src.rpm
checksum_type: sha256
summary:
  Small layer on top of Serialize package that allows to register objects by name instead of namespace


pkgId: 539e5ded3179b4ade0791253aee6e439be1ea4fd2bfa110d95b2249139989ac8
name: python-cerealbox
arch: src
version: 0.1.2
epoch: 0
release: 1
summary: Zero dependency generic serializer and deserializer with DynamoDB JSON support
url: https://github.com/a2d24/cerealbox
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cerealbox-0.1.2-1.src.rpm
checksum_type: sha256
description:
     None                                    {'NULL': True}
     True/False                              {'BOOL': True/False}
     int/Decimal                             {'N': str(value)}
     string                                  {'S': string}
     Binary/bytearray/bytes (py3 only)       {'B': bytes}
     set([int/Decimal])                      {'NS': [str(value)]}
     set([string])                           {'SS': [string])
     set([Binary/bytearray/bytes])           {'BS': [bytes]}
     list                                    {'L': list}
     dict                                    {'M': dict}
     float                                   {'S': str(value)}
     datetime/date/time                      {'S': str(value.isoformat())}
     Enum                                    {'S': str(value.value)}
     UUID                                    {'S': str(value)}
  ```
  When serializing from DynamoDB JSON to a Python dict, the following mapping is used:
  ```


pkgId: 497166e271ce0d12ca09c760269222a055d9e0e6a4eacc694af97d9850bfc3ba
name: python-cerebras-cloud-sdk
arch: src
version: 1.11.0
epoch: 0
release: 1
summary: The official Python library for the cerebras API
url: https://github.com/Cerebras/cerebras-cloud-sdk-python
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cerebras-cloud-sdk-1.11.0-1.src.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/cerebras_cloud_sdk.svg)](https://pypi.org/project/cerebras_cloud_sdk/)

  The Cerebras Python library provides convenient access to the Cerebras REST API from any Python 3.8+
  application. The library includes type definitions for all request params and response fields,
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

  It is generated with [Stainless](https://www.stainlessapi.com/).



  At Cerebras, we've developed the world's largest and fastest AI processor, the Wafer-Scale Engine-3 (WSE-3). The Cerebras CS-3 system, powered by the WSE-3, represents a new class of AI supercomputer that sets the standard for generative AI training and inference with unparalleled performance and scalability.

  With Cerebras as your inference provider, you can:
  - Achieve unprecedented speed for AI inference workloads
  - Build commercially with high throughput
  - Effortlessly scale your AI workloads with our seamless clustering technology

  Our CS-3 systems can be quickly and easily clustered to create the largest AI supercomputers in the world, making it simple to place and run the largest models. Leading corporations, research institutions, and governments are already using Cerebras solutions to develop proprietary models and train popular open-source models.

  Want to experience the power of Cerebras? Check out our [website](https://cerebras.net) for more resources and explore options for accessing our technology through the Cerebras Cloud or on-premise deployments!



  The REST API documentation can be found on [inference-docs.cerebras.ai](https://inference-docs.cerebras.ai). The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).


  ```
  pip install cerebras_cloud_sdk
  ```


  Get an API Key from [cloud.cerebras.ai](https://cloud.cerebras.ai/) and add it to your environment variables:
  ```
  export CEREBRAS_API_KEY="your-api-key-here"
  ```



  The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).

  <!-- RUN TEST: Standard -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  completion = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )

  print(completion)
  ```

  While you can provide an `api_key` keyword argument,
  we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
  to add `CEREBRAS_API_KEY="My API Key"` to your `.env` file
  so that your API Key is not stored in source control.



  Simply import `AsyncCerebras` instead of `Cerebras` and use `await` with each API call:

  <!-- RUN TEST: Async -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )


  async def main() -> None:
      completion = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
      )
      print(completion)


  asyncio.run(main())
  ```

  Functionality between the synchronous and asynchronous clients is otherwise identical.



  We provide support for streaming responses using Server Side Events (SSE).

  Note that when streaming, `usage` and `time_info` will be information will only be included in the final chunk.

  <!-- RUN TEST: Streaming -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  stream = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
      stream=True,
  )

  for chunk in stream:
      print(chunk.choices[0].delta.content or "", end="")
  ```

  The async client uses the exact same interface.

  <!-- RUN TEST: AsyncStreaming -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )


  async def main() -> None:
      stream = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
          stream=True,
      )
      async for chunk in stream:
          print(chunk.choices[0].delta.content or "", end="")


  asyncio.run(main())
  ```



  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:

  - Serializing back into JSON, `model.to_json()`
  - Converting to a dictionary, `model.to_dict()`

  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.



  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cerebras.cloud.sdk.APIConnectionError` is raised.

  When the API returns a non-success status code (that is, 4xx or 5xx
  response), a subclass of `cerebras.cloud.sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

  All errors inherit from `cerebras.cloud.sdk.APIError`.

  <!-- RUN TEST: Error -->
  ```python
  import cerebras.cloud.sdk
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()

  try:
      client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "This should cause an error!",
              }
          ],
          model="some-model-that-doesnt-exist",
      )
  except cerebras.cloud.sdk.APIConnectionError as e:
      print("The server could not be reached")
      print(e.__cause__)  # an underlying Exception, likely raised within httpx.
  except cerebras.cloud.sdk.RateLimitError as e:
      print("A 429 status code was received; we should back off a bit.")
  except cerebras.cloud.sdk.APIStatusError as e:
      print("Another non-200-range status code was received")
      print(e.status_code)
      print(e.response)
  ```

  Error codes are as followed:

  | Status Code | Error Type                 |
  | ----------- | -------------------------- |
  | 400         | `BadRequestError`          |
  | 401         | `AuthenticationError`      |
  | 403         | `PermissionDeniedError`    |
  | 404         | `NotFoundError`            |
  | 422         | `UnprocessableEntityError` |
  | 429         | `RateLimitError`           |
  | >=500       | `InternalServerError`      |
  | N/A         | `APIConnectionError`       |



  Certain errors are automatically retried 2 times by default, with a short exponential backoff.
  Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
  429 Rate Limit, and >=500 Internal errors are all retried by default.

  You can use the `max_retries` option to configure or disable retry settings:

  <!-- RUN TEST: Retries -->
  ```python
  from cerebras.cloud.sdk import Cerebras


  client = Cerebras(
      
      max_retries=0,
  )


  client.with_options(max_retries=5).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```



  By default requests time out after 1 minute. You can configure this with a `timeout` option,
  which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:

  <!-- RUN TEST: Timeout -->
  ```python
  from cerebras.cloud.sdk import Cerebras
  import httpx


  client = Cerebras(
      
      timeout=20.0,
  )


  client = Cerebras(
      timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
  )


  client.with_options(timeout=5.0).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```

  On timeout, an `APITimeoutError` is thrown.

  Note that requests that time out are [retried twice by default](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/#retries).





  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

  You can enable logging by setting the environment variable `CEREBRAS_LOG` to `debug`.

  ```shell
  $ export CEREBRAS_LOG=debug
  ```



  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:

  ```py
  if response.my_field is None:
    if 'my_field' not in response.model_fields_set:
      print('Got json like {}, without a "my_field" key present at all.')
    else:
      print('Got json like {"my_field": null}.')
  ```



  The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

  <!-- RUN TEST: Advanced -->
  ```py
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()
  response = client.chat.completions.with_raw_response.create(
      messages=[{
          "role": "user",
          "content": "Why is fast inference important?",
      }],
      model="llama3.1-8b",
  )
  print(response.headers.get('X-My-Header'))

  completion = response.parse()  # get the object that `chat.completions.create()` would have returned
  print(completion)
  ```

  These methods return an [`APIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) object.

  The async client returns an [`AsyncAPIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

  <!--


  The above interface eagerly reads the full response body when you make the request, which may not always be what you want.

  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

  ```python
  with client.chat.completions.with_streaming_response.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  ) as response:
      print(response.headers.get("X-My-Header"))

      for line in response.iter_lines():
          print(line)
  ```

  The context manager is required so that the response will reliably be closed.
  -->



  This library is typed for convenient access to the documented API.

  If you need to access undocumented endpoints, params, or response properties, the library can still be used.



  To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
  http verbs. Options on the client will be respected (such as retries) will be respected when making this
  request.

  ```py
  import httpx

  response = client.post(
      "/foo",
      cast_to=httpx.Response,
      body={"my_param": True},
  )

  print(response.headers.get("x-foo"))
  ```



  If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
  options.



  To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
  can also get all the extra fields on the Pydantic model as a dict with
  [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).



  You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

  - Support for proxies
  - Custom transports
  - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

  ```python
  from cerebras.cloud.sdk import Cerebras, DefaultHttpxClient

  client = Cerebras(
      
      base_url="http://my.test.server.example.com:8083",
      http_client=DefaultHttpxClient(
          proxies="http://my.test.proxy.example.com",
          transport=httpx.HTTPTransport(local_address="0.0.0.0"),
      ),
  )
  ```

  You can also customize the client on a per-request basis by using `with_options()`:

  ```python
  client.with_options(http_client=DefaultHttpxClient(...))
  ```



  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.



  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
  2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
  3. Changes that we do not expect to impact the vast majority of users in practice.

  We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

  We are keen for your feedback; please open an [issue](https://www.github.com/Cerebras/cerebras-cloud-sdk-python/issues) with questions, bugs, or suggestions.



  If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.

  You can determine the version that is being used at runtime with:

  ```py
  import cerebras.cloud.sdk
  print(cerebras.cloud.sdk.__version__)
  ```



  Python 3.8 or higher.



  See [the contributing documentation](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/./CONTRIBUTING.md).


pkgId: 94e7c1e2acecef25a07fb477ea734c101c144dcf8a71aaaa6d93ba779fc3d4db
name: python-cerebras-cloud-sdk
arch: src
version: 1.12.1
epoch: 0
release: 1
summary: The official Python library for the cerebras API
url: https://github.com/Cerebras/cerebras-cloud-sdk-python
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cerebras-cloud-sdk-1.12.1-1.src.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/cerebras_cloud_sdk.svg)](https://pypi.org/project/cerebras_cloud_sdk/)

  The Cerebras Python library provides convenient access to the Cerebras REST API from any Python 3.8+
  application. The library includes type definitions for all request params and response fields,
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

  It is generated with [Stainless](https://www.stainlessapi.com/).



  At Cerebras, we've developed the world's largest and fastest AI processor, the Wafer-Scale Engine-3 (WSE-3). The Cerebras CS-3 system, powered by the WSE-3, represents a new class of AI supercomputer that sets the standard for generative AI training and inference with unparalleled performance and scalability.

  With Cerebras as your inference provider, you can:
  - Achieve unprecedented speed for AI inference workloads
  - Build commercially with high throughput
  - Effortlessly scale your AI workloads with our seamless clustering technology

  Our CS-3 systems can be quickly and easily clustered to create the largest AI supercomputers in the world, making it simple to place and run the largest models. Leading corporations, research institutions, and governments are already using Cerebras solutions to develop proprietary models and train popular open-source models.

  Want to experience the power of Cerebras? Check out our [website](https://cerebras.net) for more resources and explore options for accessing our technology through the Cerebras Cloud or on-premise deployments!



  The REST API documentation can be found on [inference-docs.cerebras.ai](https://inference-docs.cerebras.ai). The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).


  ```
  pip install cerebras_cloud_sdk
  ```


  Get an API Key from [cloud.cerebras.ai](https://cloud.cerebras.ai/) and add it to your environment variables:
  ```
  export CEREBRAS_API_KEY="your-api-key-here"
  ```



  The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).


  <!-- RUN TEST: ChatStandard -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      api_key=os.environ.get("CEREBRAS_API_KEY"),  # This is the default and can be omitted
  )

  chat_completion = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )

  print(chat_completion)
  ```


  <!-- RUN TEST: TextStandard -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      api_key=os.environ.get("CEREBRAS_API_KEY"),  # This is the default and can be omitted
  )

  completion = client.completions.create(
      prompt="It was a dark and stormy ",
      max_tokens=100,
      model="llama3.1-8b",
  )

  print(completion)
  ```


  While you can provide an `api_key` keyword argument,
  we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
  to add `CEREBRAS_API_KEY="My API Key"` to your `.env` file
  so that your API Key is not stored in source control.



  Simply import `AsyncCerebras` instead of `Cerebras` and use `await` with each API call:

  <!-- RUN TEST: ChatAsync -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      api_key=os.environ.get("CEREBRAS_API_KEY"),  # This is the default and can be omitted
  )


  async def main() -> None:
      chat_completion = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
      )
      print(chat_completion)


  asyncio.run(main())
  ```

  Functionality between the synchronous and asynchronous clients is otherwise identical.



  We provide support for streaming responses using Server Side Events (SSE).

  Note that when streaming, `usage` and `time_info` will be information will only be included in the final chunk.


  <!-- RUN TEST: ChatStreaming -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  stream = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
      stream=True,
  )

  for chunk in stream:
      print(chunk.choices[0].delta.content or "", end="")
  ```

  The async client uses the exact same interface.

  <!-- RUN TEST: ChatAsyncStreaming -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )


  async def main() -> None:
      stream = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
          stream=True,
      )
      async for chunk in stream:
          print(chunk.choices[0].delta.content or "", end="")


  asyncio.run(main())
  ```


  <!-- RUN TEST: TextStreaming -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  stream = client.completions.create(
      prompt="It was a dark and stormy ",
      max_tokens=100,
      model="llama3.1-8b",
      stream=True,
  )

  for chunk in stream:
      print(chunk.choices[0].text or "", end="")
  ```




  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:

  - Serializing back into JSON, `model.to_json()`
  - Converting to a dictionary, `model.to_dict()`

  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.



  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cerebras.cloud.sdk.APIConnectionError` is raised.

  When the API returns a non-success status code (that is, 4xx or 5xx
  response), a subclass of `cerebras.cloud.sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

  All errors inherit from `cerebras.cloud.sdk.APIError`.

  <!-- RUN TEST: Error -->
  ```python
  import cerebras.cloud.sdk
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()

  try:
      client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "This should cause an error!",
              }
          ],
          model="some-model-that-doesnt-exist",
      )
  except cerebras.cloud.sdk.APIConnectionError as e:
      print("The server could not be reached")
      print(e.__cause__)  # an underlying Exception, likely raised within httpx.
  except cerebras.cloud.sdk.RateLimitError as e:
      print("A 429 status code was received; we should back off a bit.")
  except cerebras.cloud.sdk.APIStatusError as e:
      print("Another non-200-range status code was received")
      print(e.status_code)
      print(e.response)
  ```

  Error codes are as followed:

  | Status Code | Error Type                 |
  | ----------- | -------------------------- |
  | 400         | `BadRequestError`          |
  | 401         | `AuthenticationError`      |
  | 403         | `PermissionDeniedError`    |
  | 404         | `NotFoundError`            |
  | 422         | `UnprocessableEntityError` |
  | 429         | `RateLimitError`           |
  | >=500       | `InternalServerError`      |
  | N/A         | `APIConnectionError`       |



  Certain errors are automatically retried 2 times by default, with a short exponential backoff.
  Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
  429 Rate Limit, and >=500 Internal errors are all retried by default.

  You can use the `max_retries` option to configure or disable retry settings:

  <!-- RUN TEST: Retries -->
  ```python
  from cerebras.cloud.sdk import Cerebras


  client = Cerebras(
      
      max_retries=0,
  )


  client.with_options(max_retries=5).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```



  By default requests time out after 1 minute. You can configure this with a `timeout` option,
  which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:

  <!-- RUN TEST: Timeout -->
  ```python
  from cerebras.cloud.sdk import Cerebras
  import httpx


  client = Cerebras(
      
      timeout=20.0,
  )


  client = Cerebras(
      timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
  )


  client.with_options(timeout=5.0).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```

  On timeout, an `APITimeoutError` is thrown.

  Note that requests that time out are [retried twice by default](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/#retries).





  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

  You can enable logging by setting the environment variable `CEREBRAS_LOG` to `debug`.

  ```shell
  $ export CEREBRAS_LOG=debug
  ```



  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:

  ```py
  if response.my_field is None:
    if 'my_field' not in response.model_fields_set:
      print('Got json like {}, without a "my_field" key present at all.')
    else:
      print('Got json like {"my_field": null}.')
  ```



  The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

  <!-- RUN TEST: Advanced -->
  ```py
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()
  response = client.chat.completions.with_raw_response.create(
      messages=[{
          "role": "user",
          "content": "Why is fast inference important?",
      }],
      model="llama3.1-8b",
  )
  print(response.headers.get('X-My-Header'))

  completion = response.parse()  # get the object that `chat.completions.create()` would have returned
  print(completion)
  ```

  These methods return an [`APIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) object.

  The async client returns an [`AsyncAPIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

  <!--


  The above interface eagerly reads the full response body when you make the request, which may not always be what you want.

  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

  ```python
  with client.chat.completions.with_streaming_response.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  ) as response:
      print(response.headers.get("X-My-Header"))

      for line in response.iter_lines():
          print(line)
  ```

  The context manager is required so that the response will reliably be closed.
  -->



  This library is typed for convenient access to the documented API.

  If you need to access undocumented endpoints, params, or response properties, the library can still be used.



  To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
  http verbs. Options on the client will be respected (such as retries) will be respected when making this
  request.

  ```py
  import httpx

  response = client.post(
      "/foo",
      cast_to=httpx.Response,
      body={"my_param": True},
  )

  print(response.headers.get("x-foo"))
  ```



  If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
  options.



  To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
  can also get all the extra fields on the Pydantic model as a dict with
  [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).



  You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

  - Support for proxies
  - Custom transports
  - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

  ```python
  from cerebras.cloud.sdk import Cerebras, DefaultHttpxClient

  client = Cerebras(
      
      base_url="http://my.test.server.example.com:8083",
      http_client=DefaultHttpxClient(
          proxies="http://my.test.proxy.example.com",
          transport=httpx.HTTPTransport(local_address="0.0.0.0"),
      ),
  )
  ```

  You can also customize the client on a per-request basis by using `with_options()`:

  ```python
  client.with_options(http_client=DefaultHttpxClient(...))
  ```



  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.



  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
  2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
  3. Changes that we do not expect to impact the vast majority of users in practice.

  We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

  We are keen for your feedback; please open an [issue](https://www.github.com/Cerebras/cerebras-cloud-sdk-python/issues) with questions, bugs, or suggestions.



  If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.

  You can determine the version that is being used at runtime with:

  ```py
  import cerebras.cloud.sdk
  print(cerebras.cloud.sdk.__version__)
  ```



  Python 3.8 or higher.



  See [the contributing documentation](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/./CONTRIBUTING.md).


pkgId: 30682e6e8844d76961b9d3c1939a980535ea46822f874784efd738fc04a58f20
name: python-cerebras-cloud-sdk
arch: src
version: 1.13.0
epoch: 0
release: 1
summary: The official Python library for the cerebras API
url: https://github.com/Cerebras/cerebras-cloud-sdk-python
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cerebras-cloud-sdk-1.13.0-1.src.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/cerebras_cloud_sdk.svg)](https://pypi.org/project/cerebras_cloud_sdk/)

  The Cerebras Python library provides convenient access to the Cerebras REST API from any Python 3.8+
  application. The library includes type definitions for all request params and response fields,
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

  It is generated with [Stainless](https://www.stainlessapi.com/).



  At Cerebras, we've developed the world's largest and fastest AI processor, the Wafer-Scale Engine-3 (WSE-3). The Cerebras CS-3 system, powered by the WSE-3, represents a new class of AI supercomputer that sets the standard for generative AI training and inference with unparalleled performance and scalability.

  With Cerebras as your inference provider, you can:
  - Achieve unprecedented speed for AI inference workloads
  - Build commercially with high throughput
  - Effortlessly scale your AI workloads with our seamless clustering technology

  Our CS-3 systems can be quickly and easily clustered to create the largest AI supercomputers in the world, making it simple to place and run the largest models. Leading corporations, research institutions, and governments are already using Cerebras solutions to develop proprietary models and train popular open-source models.

  Want to experience the power of Cerebras? Check out our [website](https://cerebras.net) for more resources and explore options for accessing our technology through the Cerebras Cloud or on-premise deployments!

  > [!NOTE]
  > This SDK has a mechanism that sends a few requests to `/v1/tcp_warming` upon construction to reduce the TTFT. If this behaviour is not desired, set `warm_tcp_connection=False` in the constructor.
  >
  > If you are repeatedly reconstructing the SDK instance it will lead to poor performance. It is recommended that you construct the SDK once and reuse the instance if possible.



  The REST API documentation can be found on [inference-docs.cerebras.ai](https://inference-docs.cerebras.ai). The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).


  ```
  pip install cerebras_cloud_sdk
  ```


  Get an API Key from [cloud.cerebras.ai](https://cloud.cerebras.ai/) and add it to your environment variables:
  ```
  export CEREBRAS_API_KEY="your-api-key-here"
  ```



  The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).


  <!-- RUN TEST: ChatStandard -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      api_key=os.environ.get("CEREBRAS_API_KEY"),  # This is the default and can be omitted
  )

  chat_completion = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )

  print(chat_completion)
  ```


  <!-- RUN TEST: TextStandard -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      api_key=os.environ.get("CEREBRAS_API_KEY"),  # This is the default and can be omitted
  )

  completion = client.completions.create(
      prompt="It was a dark and stormy ",
      max_tokens=100,
      model="llama3.1-8b",
  )

  print(completion)
  ```


  While you can provide an `api_key` keyword argument,
  we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
  to add `CEREBRAS_API_KEY="My API Key"` to your `.env` file
  so that your API Key is not stored in source control.



  Simply import `AsyncCerebras` instead of `Cerebras` and use `await` with each API call:

  <!-- RUN TEST: ChatAsync -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      api_key=os.environ.get("CEREBRAS_API_KEY"),  # This is the default and can be omitted
  )


  async def main() -> None:
      chat_completion = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
      )
      print(chat_completion)


  asyncio.run(main())
  ```

  Functionality between the synchronous and asynchronous clients is otherwise identical.



  We provide support for streaming responses using Server Side Events (SSE).

  Note that when streaming, `usage` and `time_info` will be information will only be included in the final chunk.


  <!-- RUN TEST: ChatStreaming -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  stream = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
      stream=True,
  )

  for chunk in stream:
      print(chunk.choices[0].delta.content or "", end="")
  ```

  The async client uses the exact same interface.

  <!-- RUN TEST: ChatAsyncStreaming -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )


  async def main() -> None:
      stream = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
          stream=True,
      )
      async for chunk in stream:
          print(chunk.choices[0].delta.content or "", end="")


  asyncio.run(main())
  ```


  <!-- RUN TEST: TextStreaming -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  stream = client.completions.create(
      prompt="It was a dark and stormy ",
      max_tokens=100,
      model="llama3.1-8b",
      stream=True,
  )

  for chunk in stream:
      print(chunk.choices[0].text or "", end="")
  ```




  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:

  - Serializing back into JSON, `model.to_json()`
  - Converting to a dictionary, `model.to_dict()`

  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.



  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cerebras.cloud.sdk.APIConnectionError` is raised.

  When the API returns a non-success status code (that is, 4xx or 5xx
  response), a subclass of `cerebras.cloud.sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

  All errors inherit from `cerebras.cloud.sdk.APIError`.

  <!-- RUN TEST: Error -->
  ```python
  import cerebras.cloud.sdk
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()

  try:
      client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "This should cause an error!",
              }
          ],
          model="some-model-that-doesnt-exist",
      )
  except cerebras.cloud.sdk.APIConnectionError as e:
      print("The server could not be reached")
      print(e.__cause__)  # an underlying Exception, likely raised within httpx.
  except cerebras.cloud.sdk.RateLimitError as e:
      print("A 429 status code was received; we should back off a bit.")
  except cerebras.cloud.sdk.APIStatusError as e:
      print("Another non-200-range status code was received")
      print(e.status_code)
      print(e.response)
  ```

  Error codes are as followed:

  | Status Code | Error Type                 |
  | ----------- | -------------------------- |
  | 400         | `BadRequestError`          |
  | 401         | `AuthenticationError`      |
  | 403         | `PermissionDeniedError`    |
  | 404         | `NotFoundError`            |
  | 422         | `UnprocessableEntityError` |
  | 429         | `RateLimitError`           |
  | >=500       | `InternalServerError`      |
  | N/A         | `APIConnectionError`       |



  Certain errors are automatically retried 2 times by default, with a short exponential backoff.
  Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
  429 Rate Limit, and >=500 Internal errors are all retried by default.

  You can use the `max_retries` option to configure or disable retry settings:

  <!-- RUN TEST: Retries -->
  ```python
  from cerebras.cloud.sdk import Cerebras


  client = Cerebras(
      
      max_retries=0,
  )


  client.with_options(max_retries=5).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```



  By default requests time out after 1 minute. You can configure this with a `timeout` option,
  which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:

  <!-- RUN TEST: Timeout -->
  ```python
  from cerebras.cloud.sdk import Cerebras
  import httpx


  client = Cerebras(
      
      timeout=20.0,
  )


  client = Cerebras(
      timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
  )


  client.with_options(timeout=5.0).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```

  On timeout, an `APITimeoutError` is thrown.

  Note that requests that time out are [retried twice by default](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/#retries).





  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

  You can enable logging by setting the environment variable `CEREBRAS_LOG` to `info`.

  ```shell
  $ export CEREBRAS_LOG=info
  ```

  Or to `debug` for more verbose logging.



  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:

  ```py
  if response.my_field is None:
    if 'my_field' not in response.model_fields_set:
      print('Got json like {}, without a "my_field" key present at all.')
    else:
      print('Got json like {"my_field": null}.')
  ```



  The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

  <!-- RUN TEST: Advanced -->
  ```py
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()
  response = client.chat.completions.with_raw_response.create(
      messages=[{
          "role": "user",
          "content": "Why is fast inference important?",
      }],
      model="llama3.1-8b",
  )
  print(response.headers.get('X-My-Header'))

  completion = response.parse()  # get the object that `chat.completions.create()` would have returned
  print(completion)
  ```

  These methods return an [`APIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) object.

  The async client returns an [`AsyncAPIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

  <!--


  The above interface eagerly reads the full response body when you make the request, which may not always be what you want.

  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

  ```python
  with client.chat.completions.with_streaming_response.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  ) as response:
      print(response.headers.get("X-My-Header"))

      for line in response.iter_lines():
          print(line)
  ```

  The context manager is required so that the response will reliably be closed.
  -->



  This library is typed for convenient access to the documented API.

  If you need to access undocumented endpoints, params, or response properties, the library can still be used.



  To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
  http verbs. Options on the client will be respected (such as retries) will be respected when making this
  request.

  ```py
  import httpx

  response = client.post(
      "/foo",
      cast_to=httpx.Response,
      body={"my_param": True},
  )

  print(response.headers.get("x-foo"))
  ```



  If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
  options.



  To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
  can also get all the extra fields on the Pydantic model as a dict with
  [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).



  You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

  - Support for proxies
  - Custom transports
  - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

  ```python
  from cerebras.cloud.sdk import Cerebras, DefaultHttpxClient

  client = Cerebras(
      
      base_url="http://my.test.server.example.com:8083",
      http_client=DefaultHttpxClient(
          proxies="http://my.test.proxy.example.com",
          transport=httpx.HTTPTransport(local_address="0.0.0.0"),
      ),
  )
  ```

  You can also customize the client on a per-request basis by using `with_options()`:

  ```python
  client.with_options(http_client=DefaultHttpxClient(...))
  ```



  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.



  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
  2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
  3. Changes that we do not expect to impact the vast majority of users in practice.

  We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

  We are keen for your feedback; please open an [issue](https://www.github.com/Cerebras/cerebras-cloud-sdk-python/issues) with questions, bugs, or suggestions.



  If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.

  You can determine the version that is being used at runtime with:

  ```py
  import cerebras.cloud.sdk
  print(cerebras.cloud.sdk.__version__)
  ```



  Python 3.8 or higher.



  See [the contributing documentation](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/./CONTRIBUTING.md).


pkgId: e396c5ad1efeb253efb34da20f6a09a88cb2b6015dc80f2bde2271d0e4ea5e7f
name: python-cerebras-cloud-sdk
arch: src
version: 1.8.0
epoch: 0
release: 1
summary: The official Python library for the cerebras API
url: https://github.com/Cerebras/cerebras-cloud-sdk-python
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cerebras-cloud-sdk-1.8.0-1.src.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/cerebras_cloud_sdk.svg)](https://pypi.org/project/cerebras_cloud_sdk/)

  The Cerebras Python library provides convenient access to the Cerebras REST API from any Python 3.7+
  application. The library includes type definitions for all request params and response fields,
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

  It is generated with [Stainless](https://www.stainlessapi.com/).



  At Cerebras, we've developed the world's largest and fastest AI processor, the Wafer-Scale Engine-3 (WSE-3). The Cerebras CS-3 system, powered by the WSE-3, represents a new class of AI supercomputer that sets the standard for generative AI training and inference with unparalleled performance and scalability.

  With Cerebras as your inference provider, you can:
  - Achieve unprecedented speed for AI inference workloads
  - Build commercially with high throughput
  - Effortlessly scale your AI workloads with our seamless clustering technology

  Our CS-3 systems can be quickly and easily clustered to create the largest AI supercomputers in the world, making it simple to place and run the largest models. Leading corporations, research institutions, and governments are already using Cerebras solutions to develop proprietary models and train popular open-source models.

  Want to experience the power of Cerebras? Check out our [website](https://cerebras.net) for more resources and explore options for accessing our technology through the Cerebras Cloud or on-premise deployments!



  The REST API documentation can be found on [inference-docs.cerebras.ai](https://inference-docs.cerebras.ai/). The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).


  ```
  pip install cerebras_cloud_sdk
  ```


  Get an API Key from [cloud.cerebras.ai](https://cloud.cerebras.ai/) and add it to your environment variables:
  ```
  export CEREBRAS_API_KEY="your-api-key-here"
  ```



  The full API of this library can be found in [api.md](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/api.md).

  <!-- RUN TEST: Standard -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  completion = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )

  print(completion)
  ```

  While you can provide an `api_key` keyword argument,
  we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
  to add `CEREBRAS_API_KEY="My API Key"` to your `.env` file
  so that your API Key is not stored in source control.



  Simply import `AsyncCerebras` instead of `Cerebras` and use `await` with each API call:

  <!-- RUN TEST: Async -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )


  async def main() -> None:
      completion = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
      )
      print(completion)


  asyncio.run(main())
  ```

  Functionality between the synchronous and asynchronous clients is otherwise identical.



  We provide support for streaming responses using Server Side Events (SSE).

  Note that when streaming, `usage` and `time_info` will be information will only be included in the final chunk.

  <!-- RUN TEST: Streaming -->
  ```python
  import os
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )

  stream = client.chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
      stream=True,
  )

  for chunk in stream:
      print(chunk.choices[0].delta.content or "", end="")
  ```

  The async client uses the exact same interface.

  <!-- RUN TEST: AsyncStreaming -->
  ```python
  import os
  import asyncio
  from cerebras.cloud.sdk import AsyncCerebras

  client = AsyncCerebras(
      
      api_key=os.environ.get("CEREBRAS_API_KEY"),
  )


  async def main() -> None:
      stream = await client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
          stream=True,
      )
      async for chunk in stream:
          print(chunk.choices[0].delta.content or "", end="")


  asyncio.run(main())
  ```



  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:

  - Serializing back into JSON, `model.to_json()`
  - Converting to a dictionary, `model.to_dict()`

  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.



  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cerebras.cloud.sdk.APIConnectionError` is raised.

  When the API returns a non-success status code (that is, 4xx or 5xx
  response), a subclass of `cerebras.cloud.sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

  All errors inherit from `cerebras.cloud.sdk.APIError`.

  <!-- RUN TEST: Error -->
  ```python
  import cerebras.cloud.sdk
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()

  try:
      client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "This should cause an error!",
              }
          ],
          model="some-model-that-doesnt-exist",
      )
  except cerebras.cloud.sdk.APIConnectionError as e:
      print("The server could not be reached")
      print(e.__cause__)  # an underlying Exception, likely raised within httpx.
  except cerebras.cloud.sdk.RateLimitError as e:
      print("A 429 status code was received; we should back off a bit.")
  except cerebras.cloud.sdk.APIStatusError as e:
      print("Another non-200-range status code was received")
      print(e.status_code)
      print(e.response)
  ```

  Error codes are as followed:

  | Status Code | Error Type                 |
  | ----------- | -------------------------- |
  | 400         | `BadRequestError`          |
  | 401         | `AuthenticationError`      |
  | 403         | `PermissionDeniedError`    |
  | 404         | `NotFoundError`            |
  | 422         | `UnprocessableEntityError` |
  | 429         | `RateLimitError`           |
  | >=500       | `InternalServerError`      |
  | N/A         | `APIConnectionError`       |



  Certain errors are automatically retried 2 times by default, with a short exponential backoff.
  Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
  429 Rate Limit, and >=500 Internal errors are all retried by default.

  You can use the `max_retries` option to configure or disable retry settings:

  <!-- RUN TEST: Retries -->
  ```python
  from cerebras.cloud.sdk import Cerebras


  client = Cerebras(
      
      max_retries=0,
  )


  client.with_options(max_retries=5).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```



  By default requests time out after 1 minute. You can configure this with a `timeout` option,
  which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:

  <!-- RUN TEST: Timeout -->
  ```python
  from cerebras.cloud.sdk import Cerebras
  import httpx


  client = Cerebras(
      
      timeout=20.0,
  )


  client = Cerebras(
      timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
  )


  client.with_options(timeout=5.0).chat.completions.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  )
  ```

  On timeout, an `APITimeoutError` is thrown.

  Note that requests that time out are [retried twice by default](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/#retries).





  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

  You can enable logging by setting the environment variable `CEREBRAS_LOG` to `debug`.

  ```shell
  $ export CEREBRAS_LOG=debug
  ```



  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:

  ```py
  if response.my_field is None:
    if 'my_field' not in response.model_fields_set:
      print('Got json like {}, without a "my_field" key present at all.')
    else:
      print('Got json like {"my_field": null}.')
  ```



  The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

  <!-- RUN TEST: Advanced -->
  ```py
  from cerebras.cloud.sdk import Cerebras

  client = Cerebras()
  response = client.chat.completions.with_raw_response.create(
      messages=[{
          "role": "user",
          "content": "Why is fast inference important?",
      }],
      model="llama3.1-8b",
  )
  print(response.headers.get('X-My-Header'))

  completion = response.parse()  # get the object that `chat.completions.create()` would have returned
  print(completion)
  ```

  These methods return an [`APIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) object.

  The async client returns an [`AsyncAPIResponse`](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/src/cerebras/cloud/sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

  <!--


  The above interface eagerly reads the full response body when you make the request, which may not always be what you want.

  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

  ```python
  with client.chat.completions.with_streaming_response.create(
      messages=[
          {
              "role": "user",
              "content": "Why is fast inference important?",
          }
      ],
      model="llama3.1-8b",
  ) as response:
      print(response.headers.get("X-My-Header"))

      for line in response.iter_lines():
          print(line)
  ```

  The context manager is required so that the response will reliably be closed.
  -->



  This library is typed for convenient access to the documented API.

  If you need to access undocumented endpoints, params, or response properties, the library can still be used.



  To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
  http verbs. Options on the client will be respected (such as retries) will be respected when making this
  request.

  ```py
  import httpx

  response = client.post(
      "/foo",
      cast_to=httpx.Response,
      body={"my_param": True},
  )

  print(response.headers.get("x-foo"))
  ```



  If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
  options.



  To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
  can also get all the extra fields on the Pydantic model as a dict with
  [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).



  You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

  - Support for proxies
  - Custom transports
  - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

  ```python
  from cerebras.cloud.sdk import Cerebras, DefaultHttpxClient

  client = Cerebras(
      
      base_url="http://my.test.server.example.com:8083",
      http_client=DefaultHttpxClient(
          proxies="http://my.test.proxy.example.com",
          transport=httpx.HTTPTransport(local_address="0.0.0.0"),
      ),
  )
  ```

  You can also customize the client on a per-request basis by using `with_options()`:

  ```python
  client.with_options(http_client=DefaultHttpxClient(...))
  ```



  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.



  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
  2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
  3. Changes that we do not expect to impact the vast majority of users in practice.

  We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

  We are keen for your feedback; please open an [issue](https://www.github.com/Cerebras/cerebras-cloud-sdk-python/issues) with questions, bugs, or suggestions.



  If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.

  You can determine the version that is being used at runtime with:

  ```py
  import cerebras.cloud.sdk
  print(cerebras.cloud.sdk.__version__)
  ```



  Python 3.7 or higher.



  See [the contributing documentation](https://github.com/Cerebras/cerebras-cloud-sdk-python/tree/main/./CONTRIBUTING.md).


pkgId: b89597e8776ce7defaaa0326ee6235f0ec60d184bd7f9c3d79450a1764bab8fa
name: python-cerebrumscanner
arch: src
version: 0.0.6
epoch: 0
release: 1
summary: Cerebrum Scanner Project
url: https://gitlab.com/nekodu/cerebrumscanner/cerebrum-scanner
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cerebrumscanner-0.0.6-1.src.rpm
checksum_type: sha256
description:
  ![CS-LOGO](https://github.com/cihangoksu/cerebrum-scanner/assets/58362107/ce15b97d-1d83-43c4-b032-b6ad05136df4)




  Cerebrum Scanner (CS) is a digital platform for easy, fast, and efficient acute medical data and image sharing in acute medical teams. A specific example is the second most-deadly disease in the world STROKE! Significant amount of hospitals and Emergency doctors use insecure, less-efficient messanger apps for acute medical data and image sharing. They take a video or image of the medical scan (computerized tomography CT or magnetic resonance imaging MRI) share in their medical teams, e.g. to consult a stroke-specialist remotely. This does not only violate patient's data privacy but also inefficient for a healthy communication within teams, as stroke specialists need a more advanced image viewer with essential features like zoom in/out, contrast adjustment and enhancement, stroke windowing, etc. for a better diagnosis.

  Here we present a digital platform Cerebrum Scanner to solve these issues, where stroke teams can communicate more efficiently.
  CS is comprised of 3 submodules:

  1) CS-ORG for organizations like hospitals, primary stroke centers, etc.
  2) CS-TEAMS for medical staff in stroke teams, like ER doctors, neurologists, radiologists, etc.
  3) CS-CLOUD for AI-assisted automatic diagnosis, e.g. for hemorrhage detection


  ER Doctors create a case with the neurological assesment data of the patient and with its CT scan (non-contrast in this example). They can view, zoom in/out, drag the CT image, navigate through slices (if 3D), adjust the contrast of the image, and play with stroke windowing for a better diagnosis (brain, stroke, bone, soft tissue, etc. windowing). They can also consult to consult a stroke-specialist (e.g. a neurologist) if the need arises.


  CS-CLOUD is the intermediary connection bridge between hospitals and specialists (CS-ORG and CS-TEAMS apps). ER doctors upload the patient data to CS-CLOUD and consult specialists via it. In CS-CLOUD AI-powered automatic diagnostic tools, e.g. a hemorrhage classifier runs, to assist specialist for a more efficient diagnosis (a likely helping case is to decrease door-to-needle time for tPA treatment in case of an ischemic stroke case). CS-CLOUD then send processed data to the specialist.


  Specialists use CS-TEAMS app in their mobile devices (android only at the moment) to examine patient's data. CS-TEAMS allow them to zoom in/out, drag the CT image, navigate through slices (if 3D), adjust the contrast of the image, and play with stroke windowing for a better diagnosis (brain, stroke, bone, soft tissue, etc. windowing). They can also use AI-assisted results (e.g. if there is any hemorrhage with its class epidural, subdural, etc.) to speed up their diagnosis.

  We believe such a platform can improve Stroke diagnostics in terms of both speed and accuracy.

  get detailed info from
  https://www.cerebrumscanner.com



  You may contact us by sending an e-mail to info@nekodu.com

  ![nekodu-mark](https://github.com/cihangoksu/cerebrum-scanner/assets/58362107/63003d8a-ba48-4260-9a5f-8a4364b31aec)

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


pkgId: 100c6283e5614b11a6372e9f47bd1fdac95faf6883f369d6c71182c8e6427a58
name: python-cereeberus
arch: src
version: 0.1.5
epoch: 0
release: 1
summary: A Python package for Reeb graphs
url: https://pypi.org/project/cereeberus/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cereeberus-0.1.5-1.src.rpm
checksum_type: sha256
description:
  ceREEBerus is a Python package that allows you to perform various operations and analysis on Reeb graphs. The main goal of this package is to implement the available theoretical work on the Reeb graph interleaving distance and its variants for use in applied and machine learning contexts.



  - Generate Reeb graphs from input data
  - Visualize Reeb graphs in a clear and intuitive way
  - Perform topological analysis on Reeb graphs
  - Extract critical points and features from Reeb graphs
  - Apply various algorithms and techniques to analyze Reeb graphs



  You can either update the latest version from pip using

  ```
  pip install cereeberus
  ```

  or to work with the most up to date version, you can clone the repo and install with

  ```{sh}
  git clone git@github.com:MunchLab/ceREEBerus.git
  cd ceREEBerus
  pip install .
  ```



  Find the documentation for ceREEBerus [here](https://munchlab.github.io/ceREEBerus/).



  The code is a compilation of work done by [Elizabeth Munch](http://www.elizabethmunch.com) with her research group and collaborators. People who have contributed to ceREEBerus include:

  - [Danielle Barnes](https://github.com/barnesd8)
  - [Elena Wang](https://elenaxwang.com)
  - [Ishika Ghsoh](https://www.ishikaghosh.com/)



  - [Liz Munch](http://www.elizabethmunch.com): [muncheli@msu.edu](mailto:muncheli@msu.edu)


pkgId: 01a878111a5800b89a1735eb116f7992a93fb01b13744526213c3f1911140501
name: python-cereslib
arch: src
version: 1.0.6
epoch: 0
release: 1
summary: GrimoireLab: Unify, eventize and enrich information from Perceval
url: https://chaoss.github.io/grimoirelab/
rpm_license: GPL-3.0+
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cereslib-1.0.6-1.src.rpm
checksum_type: sha256
description:
  Ceres is a library that aims at dealing with data in general,
  and software development data in particular.

  The initial goal of Ceres is to parse information in several ways
  from the [Perceval](https://github.com/grimoirelab/perceval) tool
  in the [GrimoireLab project](https://github.com/grimoirelab).

  However, the more code is added to this project, the more generic
  methods are found to be useful in other areas of analysis.

  The following are the areas of analysis that Ceres can help at:



  The 'eventizer' helps to split information coming from Perceval.
  In short, Perceval produces JSON documents and those can be consumed
  by Ceres and by the 'eventizing' side of the library.

  By 'eventizing', this means the process to parse a full Perceval JSON
  document and produce a Pandas DataFrame with certain amount of information.

  As an example, a commit contains information about the commit itself, and
  the files that were 'touched' at some point. Depending on the granularity
  of the analysis Ceres will work in the following way:

  * Granularity = 1: This is the first level and produces 1 to 1 relationship
    with the main items in the original data source. For example 1 commit would
    be just 1 row in the resultant dataframe. This would be a similar case for
    a code review process in Gerrit or in Bugzilla for tickets.
  * Granularity = 2: This is the second level and depends on the data source
    how in depth this goes. In the specific case of commits, this would return
    n rows in the dataframe. And there will be as many rows as files where
    'touched' in the original data source.




  The format part of the library contains some utils that are useful for
  some basic formatting actions such as having a whole column in the Pandas
  dataframe with the same string format.

  Another example would be the use of the format utils to cast from string
  to date using datetuils and applying the method to a whole column of a
  given dataframe.



  The filter utility basically removes rows based on certain values in
  certain cells of a dataframe.



  This is the utility most context-related together with the eventizing
  actions. This will add or modify one or more columns in several ways.

  There are several examples such as taking care of the surrogates enabling
  UTF8, adding new columns based on some actions on others, adding the gender
  of the name provided in another column, and others.




  This project is still quite new, and the development is really slow, so
  any extra hand would be really awesome, even giving directions, pieces
  of advice or feature requests :).

  And of course, using the software would be great!



  The examples folder contains some of the clients I've used for some
  analysis such as the gender analysis or to produce dataframes that help
  to understand the areas of the code where developers are working.

  Those are probably a good place to have a look at.



   * Python >= 3.9

  You will also need some other libraries for running the tool, you can find the
  whole list of dependencies in [pyproject.toml](pyproject.toml) file.



  There are several ways to install Cereslib on your system: packages or source
  code using Poetry or pip.



  Cereslib can be installed using pip, a tool for installing Python packages.
  To do it, run the next command:
  ```
  $ pip install cereslib
  ```



  To install from the source code you will need to clone the repository first:
  ```
  $ git clone https://github.com/chaoss/grimoirelab-cereslib
  $ cd grimoirelab-cereslib
  ```

  Then use pip or Poetry to install the package along with its dependencies.


  To install the package from local directory run the following command:
  ```
  $ pip install .
  ```
  In case you are a developer, you should install cereslib in editable mode:
  ```
  $ pip install -e .
  ```


  We use [poetry](https://python-poetry.org/) for dependency management and
  packaging. You can install it following its [documentation](https://python-poetry.org/docs/#installation).
  Once you have installed it, you can install cereslib and the dependencies in
  a project isolated environment using:
  ```
  $ poetry install
  ```
  To spaw a new shell within the virtual environment use:
  ```
  $ poetry shell
  ```



  Licensed under GNU General Public License (GPL), version 3 or later.


