# packages

pkgId: b73d8018162207a67b873acefc114ec9606778704aaba170e8c6ce3a8003d166
name: python-clone-auto
arch: src
version: 0.0.5
epoch: 0
release: 1
summary: Clone all public repositories from a user in a GIT server
url: https://gitlab.com/sivefunc/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clone-auto-0.0.5-1.src.rpm
checksum_type: sha256
description:
  Clone auto is a small script to clone all public repositories of a user from platforms like Gitlab, Github or codeberg.


  - python3 >= 3.11
  - requests >= 2.32.3




  ```sh
  sudo apt-get install python3 python3-pip python3-setuptools git
  ```


  ```sh
  python3 -m pip install clone-auto
  ```



  ```sh
  clone_auto -u sivefunc --platforms gitlab codeberg github
  ```

  ```sh
  clone_auto -u sivefunc --platforms gitlab --timeout 7.77
  ```


  <table>
      <tr>
          <td>Name</td>
          <td>Image</td>
      </tr>
      <tr>
          <td>Gitlab</td>
          <td><img src="https://codeberg.org/Sivefunc/clone_auto/raw/branch/master/readme_res/gitlab.png" width="100" height="100"></td>
      </tr>
      <tr>
          <td>Codeberg</td>
          <td><img src="https://codeberg.org/Sivefunc/clone_auto/raw/branch/master/readme_res/codeberg.png" width="100" height="100"></td>
      </tr>
      <tr>
          <td>Github</td>
          <td><img src="https://codeberg.org/Sivefunc/clone_auto/raw/branch/master/readme_res/github.png" width="100" height="100"></td>
      </tr>
   </table>

rpm_license:
  clone-auto <-> Git clone public repositories from a user Copyright (C) 2024 Sivefunc  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 <https://www.gnu.org/licenses/>.


pkgId: 302f9b118815ff42e8e5df6a27cf03681c29e127d4399e4d51e87fc4e798f241
name: python-cloneArmy
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: Analyze haplotypes from Illumina paired-end amplicon sequencing
url: https://pypi.org/project/cloneArmy/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloneArmy-0.1.1-1.src.rpm
checksum_type: sha256
description:
  CloneArmy is a modern Python package for analyzing haplotypes from Illumina paired-end amplicon sequencing data. It provides a streamlined workflow for processing FASTQ files, aligning reads, and identifying sequence variants.



  - Fast paired-end read processing using BWA-MEM
  - Quality-based filtering of bases and alignments
  - Haplotype identification and frequency analysis
  - Rich command-line interface with progress tracking
  - Comprehensive output reports
  - Multi-threading support



  ```bash
  pip install cloneArmy
  ```



  - Python ≥ 3.8
  - BWA (must be installed and available in PATH)
  - Samtools (must be installed and available in PATH)





  ```bash

  cloneArmy /path/to/fastq/directory reference.fasta


  cloneArmy /path/to/fastq/directory reference.fasta \
      --threads 8 \
      --output results \
      --min-base-quality 20 \
      --min-mapping-quality 30
  ```



  ```python
  from pathlib import Path
  from clone_army.processor import AmpliconProcessor


  processor = AmpliconProcessor(
      reference_path="reference.fasta",
      min_base_quality=20,
      min_mapping_quality=30
  )


  results = processor.process_sample(
      fastq_r1="sample_R1.fastq.gz",
      fastq_r2="sample_R2.fastq.gz",
      output_dir="results",
      threads=4
  )


  print(results)
  ```



  For each sample, CloneArmy generates:
  - A sorted BAM file with alignments
  - A CSV file containing haplotype information:
    - Sequence
    - Read count
    - Frequency
    - Number of mutations
  - Console output


pkgId: 480969225cdcd2c8f2b7b9c47ed41ea9d48e413af26d0b7d0c7cd546fea41a3c
name: python-cloneArmy
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Analyze haplotypes from Illumina paired-end amplicon sequencing
url: https://pypi.org/project/cloneArmy/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloneArmy-0.2.0-1.src.rpm
checksum_type: sha256
description:
  CloneArmy is a modern Python package for analyzing haplotypes from Illumina paired-end amplicon sequencing data. It provides a streamlined workflow for processing FASTQ files, aligning reads, identifying sequence variants, and performing comparative analyses between samples.



  - Fast paired-end read processing using BWA-MEM
  - Quality-based filtering of bases and alignments
  - Haplotype identification and frequency analysis
  - Statistical comparison between samples with FDR correction
  - Interactive visualization of mutation frequencies
  - Rich command-line interface with progress tracking
  - Comprehensive HTML reports
  - Multi-threading support
  - Support for full-length sequence analysis



  ```bash
  pip install cloneArmy
  ```



  - Python ≥ 3.8
  - BWA (must be installed and available in PATH)
  - Samtools (must be installed and available in PATH)







  ```bash

  cloneArmy run /path/to/fastq/directory reference.fasta


  cloneArmy run /path/to/fastq/directory reference.fasta \
      --threads 8 \
      --output results \
      --min-base-quality 20 \
      --min-mapping-quality 30 \
      --no-report  # Skip HTML report generation
  ```



  ```bash

  cloneArmy compare \
      /path/to/sample1/fastq \
      /path/to/sample2/fastq \
      reference.fasta \
      --threads 8 \
      --output comparison_results \
      --min-base-quality 20 \
      --min-mapping-quality 30 \
      --full-length-only  # Only consider full-length sequences
  ```



  ```python
  from pathlib import Path
  from clone_army.processor import AmpliconProcessor
  from clone_army.comparison import run_comparative_analysis


  processor = AmpliconProcessor(
      reference_path="reference.fasta",
      min_base_quality=20,
      min_mapping_quality=30
  )


  results1 = processor.process_sample(
      fastq_r1="sample1_R1.fastq.gz",
      fastq_r2="sample1_R2.fastq.gz",
      output_dir="results/sample1",
      threads=4
  )

  results2 = processor.process_sample(
      fastq_r1="sample2_R1.fastq.gz",
      fastq_r2="sample2_R2.fastq.gz",
      output_dir="results/sample2",
      threads=4
  )


  comparison_results = run_comparative_analysis(
      results1={"sample1": results1},
      results2={"sample2": results2},
      reference_seq="ATCG...",  # Reference sequence string
      output_path="comparison_results.csv",
      full_length_only=False
  )


  print(results1)  # Sample 1 haplotypes
  print(comparison_results)  # Statistical comparison
  ```




  - Sorted BAM file with alignments
  - CSV file containing haplotype information:
    - Sequence
    - Read count
    - Frequency
    - Number of mutations
    - Full-length status
  - Interactive HTML report (optional)
  - Console output with summary statistics


  - CSV file with statistical comparisons:
    - Mutation positions and types
    - Frequencies in each sample
    - Statistical significance (p-values)
    - FDR-corrected p-values
  - Interactive HTML plot showing mutation frequency differences
  - Console output with significant mutations


pkgId: e3ee135d138c63cd58ade442af146779cd56530887710add72aa446c87fbfe9c
name: python-cloneholio
arch: src
version: 0.13.4
epoch: 0
release: 1
summary: I am cloneholio! I need syncing of my repos.
url: https://gitlab.com/nvllsvm/cloneholio
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloneholio-0.13.4-1.src.rpm
checksum_type: sha256
description:
  *I am cloneholio! I need backup of my repos.*
  |Version|
  Maintain local backups of *all Git repositories* belonging to a user or group.
  **Features:**
  - Supports both GitHub and GitLab.
  - Backup *all repositories* owned by users, groups, and subgroups.
  - Backup individual repositories.
  - Scale to a configurable number of processes.


pkgId: d8af0c1328b5f27d6e2b83430a2565fdb2e80853a3117f196a99f3ea776f1ee7
name: python-clonellm
arch: src
version: 0.2.4
epoch: 0
release: 1
summary: Python package to create an AI clone of yourself using LLMs.
url: https://github.com/msamsami/clonellm
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clonellm-0.2.4-1.src.rpm
checksum_type: sha256
description:
  <p align="center">
      <img src="https://raw.githubusercontent.com/msamsami/clonellm/main/docs/assets/images/logo.png" alt="Logo" width="250" />
  </p>
  <h1 align="center">
      CloneLLM
  </h1>
  <p align="center">
      <p align="center">Create an AI clone of yourself using LLMs.</p>
  </p>

  <h4 align="center">
      <a href="https://pypi.org/project/clonellm/" target="_blank">
          <img src="https://img.shields.io/badge/release-v0.2.4-green" alt="Latest Release">
      </a>
      <a href="https://pypi.org/project/clonellm/" target="_blank">
          <img src="https://img.shields.io/pypi/v/clonellm.svg" alt="PyPI Version">
      </a>
      <a target="_blank">
          <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue" alt="Python Versions">
      </a>
      <a target="_blank">
          <img src="https://img.shields.io/pypi/l/clonellm" alt="PyPI License">
      </a>
  </h4>


  A minimal Python package that enables you to create an AI clone of yourself using LLMs. Built on top of LiteLLM and LangChain, CloneLLM utilizes the Retrieval-Augmented Generation (RAG) to tailor AI responses as if you are answering the questions.

  You can input texts and documents about yourself — including personal information, professional experience, educational background, etc. — which are then embedded into a vector space for dynamic retrieval. This AI clone can act as a virtual assistant or digital representation, capable of handling queries and tasks in a manner that reflects the your own knowledge, tone, style and mannerisms.


  Before installing CloneLLM, make sure you have Python 3.10 or newer installed on your machine.


  ```bash
  pip install clonellm
  ```


  ```bash
  poetry add clonellm
  ```


  ```bash

  git clone https://github.com/msamsami/clonellm.git


  cd clonellm


  pip install .
  ```




  You can set up a clone of yourself using CloneLLM in just a few lines of code.

  **Step 1**. Gather documents that contain relavant information about you. These documents form the base from which your AI clone will learn to mimic your tone, style, and expertise.
  ```python
  from langchain_core.documents import Document

  documents = [
      Document(page_content="My name is Mehdi Samsami."),
      open("about_me.txt", "r").read(),
  ]
  ```

  **Step 2**. Initialize a clone with your documents and your preferred LLM.
  ```python
  from clonellm import CloneLLM

  clone = CloneLLM(model="gpt-4o", documents=documents)
  ```

  **Step 3**. Configure environment variables to store API keys for LLM model.
  ```bash
  export OPENAI_API_KEY=sk-...
  ```

  **Step 4**. Fit the clone to the data (documents).
  ```python
  clone.fit()
  ```

  **Step 5**. Invoke the clone to ask questions.
  ```python
  clone.invoke("What's your name?")


  ```


  At its core, CloneLLM utilizes LiteLLM for interactions with various LLMs. This is why you can choose from 100+ LLMs from many different providers, including Bedrock, Azure, OpenAI, Cohere, Anthropic, Ollama, Sagemaker, HuggingFace, Replicate, etc.


  You can use LangChain's document loaders to seamlessly import data from various sources into `Document` format. Take, for example, text and HTML loaders:
  ```python

  from langchain_community.document_loaders import TextLoader, UnstructuredHTMLLoader

  documents = TextLoader("cv.txt").load() + UnstructuredHTMLLoader("linkedin.html").load()
  ```

  Or JSON loader:
  ```python

  from langchain_community.document_loaders import JSONLoader

  documents = JSONLoader(
      file_path='chat.json',
      jq_schema='.messages[].content',
      text_content=False
  ).load()
  ```


  In the basic usage described above, documents are summarized to create a static context for interacting with the LLM. This is the default behavior where the `embedding` and `vector_store` parameters are not specified. For a more advanced usage, you can specify an embedding model and a vector store to implement a RAG-based question-answering system. In this scenario, the documents are embedded and stored in the vector store, allowing them to serve as a dynamic retrieval context for each prompt.


  With `LiteLLMEmbeddings`, CloneLLM allows you to utilize embedding models from a variety of providers supported by LiteLLM:
  ```python
  from clonellm import CloneLLM, LiteLLMEmbeddings
  import os

  os.environ["OPENAI_API_KEY"] = "openai-api-key"

  embedding = LiteLLMEmbeddings(model="text-embedding-3-small", dimensions=1024)
  clone = CloneLLM(model="gpt-4o-mini", documents=documents, embedding=embedding)
  ```

  Additionally, you can select any preferred embedding model from LangChain's extensive range. Take, for example, the Hugging Face embedding:
  ```python

  from langchain_community.embeddings import HuggingFaceEmbeddings
  from clonellm import CloneLLM
  import os

  os.environ["COHERE_API_KEY"] = "cohere-api-key"

  embedding = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
  clone = CloneLLM(model="command-xlarge-beta", documents=documents, embedding=embedding)
  ```

  Or, the Llama-cpp embedding:
  ```python

  from langchain_community.embeddings import LlamaCppEmbeddings
  from clonellm import CloneLLM
  import os

  os.environ["OPENAI_API_KEY"] = "openai-api-key"

  embedding = LlamaCppEmbeddings(model_path="ggml-model-q4_0.bin")
  clone = CloneLLM(model="gpt-4o-mini", documents=documents, embedding=embedding)
  ```


  Currently, CloneLLM supports the following vector stores:
  - [Chroma](https://github.com/chroma-core/chroma)
  - [FAISS](https://github.com/facebookresearch/faiss)
  - [InMemory](https://python.langchain.com/api_reference/core/vectorstores/langchain_core.vectorstores.in_memory.InMemoryVectorStore.html) (default)

  When an embedding model is specified (via the `embedding` parameter), the dynamic context retrieval is enabled and the selected vector store will be initialized and used to store the document embeddings.
  ```python

  from clonellm import CloneLLM, LiteLLMEmbeddings, RagVectorStore
  import os

  os.environ["OPENAI_API_KEY"] = "openai-api-key"

  embedding = LiteLLMEmbeddings(model="text-embedding-3-small")
  clone = CloneLLM(model="gpt-4o", documents=documents, embedding=embedding, vector_store=RagVectorStore.FAISS)
  ```


  Create a personalized profile using CloneLLM's `UserProfile`, which allows you to feed detailed personal information into your clone for more customized interactions:
  ```python
  from clonellm import UserProfile

  profile = UserProfile(
      first_name="Mehdi",
      last_name="Samsami",
      city="Shiraz",
      country="Iran",
      expertise=["Data Science", "AI/ML", "Data Analytics"],
  )
  ```

  Or simply define your profile using Python dictionaries:
  ```python
  profile = {
      "full_name": "Mehdi Samsami",
      "age": 28,
      "location": "Shiraz, Iran",
      "expertise": ["Data Science", "AI/ML", "Data Analytics"],
      "languages": ["English", "Persian"],
      "tone": "Friendly",
  }
  ```

  Finnaly:
  ```python

  from clonellm import CloneLLM
  import os

  os.environ["ANTHROPIC_API_KEY"] = "anthropic-api-key"

  clone = CloneLLM(
      model="claude-3-opus-20240229",
      documents=documents,
      embedding=embedding,
      vector_store=RagVectorStore.Chroma,
      user_profile=profile,
  )
  ```


  Enable the memory feature to allow your clone to access to the history of conversation. This is simply done by setting `memory` argument to `True` or -1 for infinite memory or an integer greater than zero for a fixed size of memory:
  ```python
  from clonellm import CloneLLM
  import os

  os.environ["HUGGINGFACE_API_KEY"] = "huggingface-api-key"

  clone = CloneLLM(
      model="meta-llama/Llama-2-70b-chat",
      documents=documents,
      embedding=embedding,
      memory=10,  # Enable memory with maximum size of 10
  )
  ```

  Use the `memory_size` attribute to get the current length of conversation history, i.e., the size of clone memory:
  ```
  print(clone.memory_size)

  ```

  If you needed to clear the history of the conversation, i.e., the clone memory, at any time, you can easily call either of the `reset_memory()` and `clear_memory()` methods.
  ```python
  clone.clear_memory()

  ```


  CloneLLM supports streaming responses from the LLM, allowing for real-time processing of text as it is being generated, rather than receiving the whole output at once.
  ```python
  from clonellm import CloneLLM, LiteLLMEmbeddings
  import os

  os.environ["VERTEXAI_PROJECT"] = "hardy-device-28813"
  os.environ["VERTEXAI_LOCATION"] = "us-central1"
  os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/your/credentials.json"

  embedding = LiteLLMEmbeddings(model="textembedding-gecko@001")
  clone = CloneLLM(model="gemini-1.0-pro", documents=documents, embedding=embedding)

  for chunk in clone.stream("Describe yourself in 100 words"):
      print(chunk, end="", flush=True)
  ```


  CloneLLM provides asynchronous counterparts to its core methods, `afit`, `ainvoke`, and `astream`, enhancing performance in asynchronous programming contexts.


  ```python
  import asyncio
  from clonellm import CloneLLM, LiteLLMEmbeddings
  from langchain_core.documents import Document
  import os

  os.environ["OPENAI_API_KEY"] = "openai-api-key"

  async def main():
      documents = [...]
      embedding = LiteLLMEmbeddings(model="text-embedding-ada-002")
      clone = CloneLLM(model="gpt-4o", documents=documents, embedding=embedding)
      await clone.afit()
      response = await clone.ainvoke("Tell me about your skills?")
      return response

  response = asyncio.run(main())
  print(response)
  ```


  ```python
  import asyncio
  from clonellm import CloneLLM, LiteLLMEmbeddings
  from langchain_core.documents import Document
  import os

  os.environ["OPENAI_API_KEY"] = "openai-api-key"

  async def main():
      documents = [...]
      embedding = LiteLLMEmbeddings(model="text-embedding-3-small")
      clone = CloneLLM(model="gpt-4o", documents=documents, embedding=embedding)
      await clone.afit()
      async for chunk in clone.astream("How comfortable are you with remote work?"):
          print(chunk, end="", flush=True)

  asyncio.run(main())
  ```


  If you find CloneLLM useful, please consider showing your support in one of the following ways:

  - ⭐ **Star our GitHub repository:** This helps increase the visibility of our project.
  - 💡 **Contribute:** Submit pull requests to help improve the codebase, whether it's adding new features, fixing bugs, or improving documentation.
  - 📰 **Share:** Post about CloneLLM on LinkedIn or other social platforms.

  Thank you for your interest in CloneLLM. We look forward to seeing you create your digital twin!


pkgId: 457b02d5d444d97e8f0fc88877c7ca1e326e58143a4acd233cb660abdae73ba7
name: python-clophfit
arch: src
version: 0.11.0
epoch: 0
release: 1
summary: Cli for fitting macromolecule pH titration or binding assays data e.g. fluorescence spectra.
url: https://github.com/darosio/ClopHfit
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clophfit-0.11.0-1.src.rpm
checksum_type: sha256
description:
  [![PyPI](https://img.shields.io/pypi/v/ClopHfit.svg)](https://pypi.org/project/ClopHfit/)
  [![CI](https://github.com/darosio/ClopHfit/actions/workflows/ci.yml/badge.svg)](https://github.com/darosio/ClopHfit/actions/workflows/ci.yml)
  [![codecov](https://codecov.io/gh/darosio/ClopHfit/branch/main/graph/badge.svg?token=OU6F9VFUQ6)](https://codecov.io/gh/darosio/ClopHfit)
  [![RtD](https://readthedocs.org/projects/clophfit/badge/)](https://clophfit.readthedocs.io/)
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6354111.svg)](https://doi.org/10.5281/zenodo.6354111)

  This package provides a command line interface for fitting pH titration or
  binding assay data for macromolecules, such as fluorescence spectra. With this
  tool, users can easily analyze their data and obtain accurate fitting results.

  - Version: "0.11.0"



  You can get the library directly from [PyPI](https://pypi.org/project/ClopHfit/)
  using `pip`:

      pip install clophfit

  Alternatively, you can use [pipx](https://pypa.github.io/pipx/) to install it in
  an isolated environment:

      pipx install clophfit

  To enable auto completion for the `clop` command, follow these steps:

  1.  Generate the completion script by running the following command:

          _CLOP_COMPLETE=bash_source clop > ~/.local/bin/clop-complete.bash

  2.  Source the generated completion script to enable auto completion:

          source ~/.local/bin/clop-complete.bash



  You can check out the documentation on <https://darosio.github.io/ClopHfit> for
  up to date usage information and examples.



  ClopHfit provides several command line interface tools for fitting and
  processing data.



  Extract and fit titrations from a list of Tecan files collected at various pH or
  chloride concentrations:

      ppr -o prova2 --is-ph tecan list.pH --scheme ../scheme.txt --norm
          --dil additions.pH --Klim 6.8,8.4 --sel 7.6,20

  Use the --no-weight option to reproduce an older pr.tecan version.



  Predict chloride dissociation constant K_d at a given pH:

      clop eq1 --help



  Parser for EnSpire (PerkinElmer) file:

      ppr -o folder enspire file.csv

  Destination folder (default: "./Meas-${version}") will contain for each Measurement:

  - a table (csv) in wide tabular form e.g. <lambda, A01, ..., H12>;
  - corresponding graphical (png) representation of spectra from all wells.

  By adding a note.csv file:

      ppr -o folder enspire file.csv note.csv

  destination folder (default: "./Meas-${version}") will also contain:

  - a pdf for each titration and label;
  - a pdf for global (multiband) analysis pdfalong with global and all_SVD;
  - a pdf for SVD analysis of all concatenated spectra.



      note_to_csv -t 37.0 -l "B E F" -o 37 NTT-G03-Cl_note
      note_to_csv -t 20.0 -l "A C D" -o 20 NTT-G03-Cl_note
      cat 20 37 > G03_Cl_note.csv



  ClopHfit can be imported and used as a Python package. The following modules are
  available:

      clophfit.prenspire - parser for EnSpire (PerkinElmer) files
      clophfit.prtecan - perform fitting of pH titration or binding assay data
      clophfit.binding - perform fitting of macromolecule binding assay data

  To use clophfit in your python:

      from clophfit import prenspire, prtecan, binding



  - Plate Reader data Parser.
  - Perform non-linear least square fitting.
  - Extract and fit pH and chloride titrations of GFP libraries.
    - For 2 labelblocks (e.g. 400, 485 nm) fit data separately and globally.
    - Estimate uncertainty using bootstrap.
    - Subtract buffer for each titration point.
    - Report controls e.g. S202N, E2 and V224Q.
    - Correct for dilution of titration additions.
    - Plot data when fitting fails and save txt file anyway.



  We use a shared copyright model that enables all contributors to maintain the
  copyright on their contributions.

  All code is licensed under the terms of the [revised BSD license](LICENSE.txt).



  If you are interested in contributing to the project, please read our
  [contributing](https://darosio.github.io/ClopHfit/references/contributing.html)
  and
  [development environment](https://darosio.github.io/ClopHfit/references/development.html)
  guides, which outline the guidelines and conventions that we follow for
  contributing code, documentation, and other resources.


pkgId: 32826dc85d686e12f580fe3f2e5b203437e938f1f0674e595084d6e1f9a7de8a
name: python-clophfit
arch: src
version: 0.12.0
epoch: 0
release: 1
summary: Cli for fitting macromolecule pH titration or binding assays data e.g. fluorescence spectra.
url: https://github.com/darosio/ClopHfit
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clophfit-0.12.0-1.src.rpm
checksum_type: sha256
description:
  [![PyPI](https://img.shields.io/pypi/v/ClopHfit.svg)](https://pypi.org/project/ClopHfit/)
  [![CI](https://github.com/darosio/ClopHfit/actions/workflows/ci.yml/badge.svg)](https://github.com/darosio/ClopHfit/actions/workflows/ci.yml)
  [![codecov](https://codecov.io/gh/darosio/ClopHfit/branch/main/graph/badge.svg?token=OU6F9VFUQ6)](https://codecov.io/gh/darosio/ClopHfit)
  [![GitHub Pages](https://img.shields.io/badge/docs-GitHub%20Pages-blue?logo=github)](https://darosio.github.io/ClopHfit/)
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6354111.svg)](https://doi.org/10.5281/zenodo.6354111)

  This package provides a command line interface for fitting pH titration or
  binding assay data for macromolecules, such as fluorescence spectra. With this
  tool, users can easily analyze their data and obtain accurate fitting results.

  - Version: "0.12.0"



  You can get the library directly from [PyPI](https://pypi.org/project/ClopHfit/)
  using `pip`:

      pip install clophfit

  Alternatively, you can use [pipx](https://pypa.github.io/pipx/) to install it in
  an isolated environment:

      pipx install clophfit

  To enable auto completion for the `clop` command, follow these steps:

  1.  Generate the completion script by running the following command:

          _CLOP_COMPLETE=bash_source clop > ~/.local/bin/clop-complete.bash

  2.  Source the generated completion script to enable auto completion:

          source ~/.local/bin/clop-complete.bash



  You can check out the documentation on <https://darosio.github.io/ClopHfit> for
  up to date usage information and examples.



  ClopHfit provides several command line interface tools for fitting and
  processing data.



  Extract and fit titrations from a list of Tecan files collected at various pH or
  chloride concentrations:

      ppr -o prova2 --is-ph tecan list.pH --scheme ../scheme.txt --norm
          --dil additions.pH --Klim 6.8,8.4

  Use the --no-weight option to reproduce an older pr.tecan version.



  Predict chloride dissociation constant K_d at a given pH:

      clop eq1 --help



  Parser for EnSpire (PerkinElmer) file:

      ppr -o folder enspire file.csv

  Destination folder (default: "./Meas-${version}") will contain for each Measurement:

  - a table (csv) in wide tabular form e.g. <lambda, A01, ..., H12>;
  - corresponding graphical (png) representation of spectra from all wells.

  By adding a note.csv file:

      ppr -o folder enspire file.csv note.csv

  destination folder (default: "./Meas-${version}") will also contain:

  - a pdf for each titration and label;
  - a pdf for global (multiband) analysis pdfalong with global and all_SVD;
  - a pdf for SVD analysis of all concatenated spectra.



      note_to_csv -t 37.0 -l "B E F" -o 37 NTT-G03-Cl_note
      note_to_csv -t 20.0 -l "A C D" -o 20 NTT-G03-Cl_note
      cat 20 37 > G03_Cl_note.csv



  ClopHfit can be imported and used as a Python package. The following modules are
  available:

      clophfit.prenspire - parser for EnSpire (PerkinElmer) files
      clophfit.prtecan - perform fitting of pH titration or binding assay data
      clophfit.binding - perform fitting of macromolecule binding assay data

  To use clophfit in your python:

      from clophfit import prenspire, prtecan, binding



  - Plate Reader data Parser.
  - Perform non-linear least square fitting.
  - Extract and fit pH and chloride titrations of GFP libraries.
    - For 2 labelblocks (e.g. 400, 485 nm) fit data separately and globally.
    - Estimate uncertainty using bootstrap.
    - Subtract buffer for each titration point.
    - Report controls e.g. S202N, E2 and V224Q.
    - Correct for dilution of titration additions.
    - Plot data when fitting fails and save txt file anyway.



  We use a shared copyright model that enables all contributors to maintain the
  copyright on their contributions.

  All code is licensed under the terms of the [revised BSD license](LICENSE.txt).



  If you are interested in contributing to the project, please read our
  [contributing](https://darosio.github.io/ClopHfit/references/contributing.html)
  and
  [development environment](https://darosio.github.io/ClopHfit/references/development.html)
  guides, which outline the guidelines and conventions that we follow for
  contributing code, documentation, and other resources.


pkgId: 5b1e5ed40cec849aa2ba4e2dfa4af44ff381424903b78b30696723222e141c92
name: python-clore-pynvml
arch: src
version: 11.5.4
epoch: 0
release: 1
summary: Python Bindings for the NVIDIA Management Library
url: http://www.nvidia.com/
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clore-pynvml-11.5.4-1.src.rpm
checksum_type: sha256
description:
  Provides a Python interface to GPU management and monitoring functions.
  This is a wrapper around the NVML library.
  For information about the NVML library, see the NVML developer page
  http://developer.nvidia.com/nvidia-management-library-nvml
  As of version 11.0.0, the NVML-wrappers used in pynvml are identical
  to those published through [nvidia-ml-py](https://pypi.org/project/nvidia-ml-py/).
  Note that this file can be run with 'python -m doctest -v README.txt'
  although the results are system dependent


pkgId: 3d3258075c090cdb182a7140cf57b9315e0177b2043f54e2ba83d5e74cb3844b
name: python-clorps
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: CLORPS: A module for CLIP, LPIPS, and ORB based image similarity.
url: https://github.com/vaidatascientist
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-clorps-0.1.0-1.src.rpm
checksum_type: sha256
description:
  **CLORPS** is a Python package for calculating image similarity based on three complementary techniques: **CLIP embeddings**, **LPIPS (Learned Perceptual Image Patch Similarity)**, and **ORB (Oriented FAST and Rotated BRIEF)**. It provides a combined similarity score for one image compared to another image or a set of target images. Ideal for image retrieval, similarity-based ranking, and image comparison tasks.



  - **CLIP Embeddings**: Uses OpenAI’s CLIP model for embedding-based similarity.
  - **LPIPS Similarity**: Calculates perceptual similarity using LPIPS.
  - **ORB Keypoint Matching**: Traditional ORB-based similarity for structural comparison.
  - **Combined Score**: Normalizes and combines the three scores for a final similarity metric.



  ```bash
  pip install clorps
  ```
  **Usage**
  ```bash
  from clorps import CLORPS


  clorps_instance = CLORPS()


  input_image_path = "/path/to/input/image.jpg"
  target_image_paths = ["/path/to/target/image1.jpg", "/path/to/target/image2.jpg"]


  combined_scores = clorps_instance.calculate_combined_similarity(input_image_path, target_image_paths)
  print("Combined similarity scores:", combined_scores)
  ```
  **Input:** Path to the input image and either a single target image path or a list of target image paths.
  **Output:** A list of similarity scores, one for each target image.

  **Requirements:**
  - Python 3.6+
  - torch
  - open_clip_torch
  - lpips
  - numpy
  - scikit-learn
  - Pillow
  - opencv-python

  **LICENSE**
  This project is licensed under the MIT License.


pkgId: f0abdc7cd875914446dea37163c8e1e076f3f0b26bcb353560a27e6fc63971fd
name: python-closet-engine-cv
arch: src
version: 0.2.1
epoch: 0
release: 1
summary: A small example package
url: https://github.com/pypa/sampleproject
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-closet-engine-cv-0.2.1-1.src.rpm
checksum_type: sha256
description:
  OpenCV tool for CLO web engine E2E Test

  https://pypi.org/project/closet-engine-cv/



  ```
  pip3 install "closet-engine-cv==0.2.1"
  ```


pkgId: 2cfed0184ac6050d90e89f01da83581d407307bc24d1087fe934600da23ae152
name: python-cloth-simulation-filter
arch: src
version: 1.1.5
epoch: 0
release: 1
summary: CSF: Ground Filtering based on Cloth Simulation
url: http://ramm.bnu.edu.cn/projects/CSF/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloth-simulation-filter-1.1.5-1.src.rpm
checksum_type: sha256
description:
  ![csf1](https://github.com/jianboqi/CSF/blob/master/CSFDemo/CSF1.png) ![csf2](https://github.com/jianboqi/CSF/blob/master/CSFDemo/CSF2.png)

  Airborne LiDAR filtering method based on Cloth Simulation.
  This is the code for the article:

  W. Zhang, J. Qi*, P. Wan, H. Wang, D. Xie, X. Wang, and G. Yan, “An Easy-to-Use Airborne LiDAR Data Filtering Method Based on Cloth Simulation,” Remote Sens., vol. 8, no. 6, p. 501, 2016.
  (http://www.mdpi.com/2072-4292/8/6/501/htm)


  **New feature has been implemented:**

  Now, We has wrapped a Python interface for CSF with swig. It is simpler to use now. This new feature can make CSF easier to be embeded into a large project. For example, it can work with Laspy (https://github.com/laspy/laspy). What you do is just read a point cloud into a python 2D list, and pass it to CSF.
  The following example shows how to use it with laspy.
  ```python

  import laspy
  import CSF
  import numpy as np

  inFile = laspy.read(r"in.las") # read a las file
  points = inFile.points
  xyz = np.vstack((inFile.x, inFile.y, inFile.z)).transpose() # extract x, y, z and put into a list

  csf = CSF.CSF()


  csf.params.bSloopSmooth = False
  csf.params.cloth_resolution = 0.5


  csf.setPointCloud(xyz)
  ground = CSF.VecInt()  # a list to indicate the index of ground points after calculation
  non_ground = CSF.VecInt() # a list to indicate the index of non-ground points after calculation
  csf.do_filtering(ground, non_ground) # do actual filtering.

  outFile = laspy.LasData(inFile.header)
  outFile.points = points[np.array(ground)] # extract ground points, and save it to a las file.
  out_file.write(r"out.las")
  ```

  **Reading data from txt file:**

  If the lidar data is stored in txt file (x y z for each line), it can also be imported directly.

  ```python
  import CSF

  csf = CSF.CSF()
  csf.readPointsFromFile('samp52.txt')

  csf.params.bSloopSmooth = False
  csf.params.cloth_resolution = 0.5

  ground = CSF.VecInt()  # a list to indicate the index of ground points after calculation
  non_ground = CSF.VecInt() # a list to indicate the index of non-ground points after calculation
  csf.do_filtering(ground, non_ground) # do actual filtering.
  csf.savePoints(ground,"ground.txt")
  ```


  Thanks to [@rjanvier](https://github.com/rjanvier)'s contribution. Now we can install CSF from pip as:
  ```python
  pip install cloth-simulation-filter
  ```


  see more details from file `demo_mex.m` under matlab folder.



  Thanks to the nice work of @Jean-Romain, through the collaboration, the CSF has been made as a R package, the details can be found in the [RCSF repository](https://github.com/Jean-Romain/RCSF). This package can be used easily with the [lidR package](https://github.com/Jean-Romain/lidR):

  ```r
  library(lidR)
  las  <- readLAS("file.las")
  las  <- lasground(las, csf())
  ```


  Now, CSF is built by CMake, it produces a static library, which can be used by other c++ programs.

  To build the library, run:
  ```bash
  mkdir build #or other name
  cd build
  cmake ..
  make
  sudo make install
  ```
  or if you want to build the library and the demo executable `csfdemo`

  ```bash
  mkdir build #or other name
  cd build
  cmake -DBUILD_DEMO=ON ..
  make
  sudo make install

  ```


  You can use CMake GUI to generate visual studio solution file.


  For binary release version, it can be downloaded at: http://ramm.bnu.edu.cn/projects/CSF/download/

  Note: This code has been changed a lot since the publication of the corresponding paper. A lot of optimizations have been made. We are still working on it, and wish it could be better.


  At last, if you are interested in Cloudcompare, there is a good news. our method has been implemented as a Cloudcompare plugin, you can refer to : https://github.com/cloudcompare/trunk


  A tool named `CSFTools` has been recently released, it is based on CSF, and provides dem/chm generation, normalization. Please refer to: https://github.com/jianboqi/CSFTools


  CSF is maintained and developed by Jianbo QI. It is now released under Apache 2.0.


pkgId: 705ad7a3300ff431fc00bf9294f002f10c05941be7cb6b992997c33d8db370c3
name: python-cloud-accelerator-diagnostics
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: Monitor, debug and profile the jobs running on Cloud accelerators like TPUs and GPUs.
url: https://github.com/google/cloud-accelerator-diagnostics
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-accelerator-diagnostics-0.1.0-1.src.rpm
checksum_type: sha256
description:
  Cloud Accelerator Diagnostics is a library to monitor, debug and profile the workloads running on Cloud accelerators like TPUs and GPUs. Additionally, this library provides a streamlined approach to automatically upload data to Tensorboard Experiments in Vertex AI. The package allows users to create a Tensorboard instance and Experiments in Vertex AI, and upload logs to them.


  To install the Cloud Accelerator Diagnostics package, run the following command:

   ```bash
   pip install cloud-accelerator-diagnostics
   ```


  Before creating and uploading logs to Vertex AI Tensorboard, you must enable [Vertex AI API](https://cloud.google.com/vertex-ai/docs/start/cloud-environment#enable_vertexai_apis) in your Google Cloud console. Also, make sure to assign the [Vertex AI User IAM role](https://cloud.google.com/vertex-ai/docs/general/access-control#aiplatform.user) to the service account that will call the APIs in `cloud-accelerator-diagnostics` package. This is required to create and access the Vertex AI Tensorboard in the Google Cloud console.


  To learn about Vertex AI Tensorboard, visit this [page](https://cloud.google.com/vertex-ai/docs/experiments/tensorboard-introduction).

  Here is an example script to create a Vertex AI Tensorboard instance with the name `test-instance` in Google Cloud Project `test-project`.

  Note: Vertex AI is available in only [these](https://cloud.google.com/vertex-ai/docs/general/locations#available-regions) regions.

  ```
  from cloud_accelerator_diagnostics import tensorboard

  instance_id = tensorboard.create_instance(project="test-project",
                                            location="us-central1",
                                            tensorboard_name="test-instance")
  print("Vertex AI Tensorboard created: ", instance_id)
  ```


  To learn about Vertex AI Experiments, visit this [page](https://cloud.google.com/vertex-ai/docs/experiments/intro-vertex-ai-experiments).

  The following script will create a Vertex AI Experiment named `test-experiment` in your Google Cloud Project `test-project`. Here's how it handles attaching a Tensorboard instance:

  **Scenario 1: Tensorboard Instance Exist**

  If a Tensorboard instance named `test-instance` already exists in your project, the script will attach it to the new Experiment.

  **Scenario 2: No Tensorboard Instance Present**

  If `test-instance` does not exist, the script will create a new Tensorboard instance with that name and attach it to the Experiment.

  ```
  from cloud_accelerator_diagnostics import tensorboard

  instance_id, tensorboard_url = tensorboard.create_experiment(project="test-project",
                                                               location="us-central1",
                                                               experiment_name="test-experiment",
                                                               tensorboard_name="test-instance")

  print("View your Vertex AI Tensorboard here: ", tensorboard_url)
  ```

  If a Vertex AI Experiment with the specified name exists, a new one will not be created, and the existing Experiment's URL will be returned.

  Note: You can attach multiple Vertex AI Experiments to a single Vertex AI Tensorboard.


  The following script will continuously monitor for new data in the directory (`logdir`), and uploads it to your Vertex AI Tensorboard Experiment. Note that after calling `start_upload_to_tensorboard()`, the thread will be kept alive even if an exception is thrown. To ensure the thread gets shut down, put any code after `start_upload_to_tensorboard()` and before `stop_upload_to_tensorboard()` in a `try` block, and call `stop_upload_to_tensorboard()` in `finally` block. This example shows how you can upload the [profile logs](https://jax.readthedocs.io/en/latest/profiling.html#programmatic-capture) collected for your JAX workload on Vertex AI Tensorboard.

  ```
  from cloud_accelerator_diagnostics import uploader

  uploader.start_upload_to_tensorboard(project="test-project",
                                       location="us-central1",
                                       experiment_name="test-experiment",
                                       tensorboard_name="test-instance",
                                       logdir="gs://test-directory/testing")
  try:
    jax.profiler.start_trace("gs://test-directory/testing")
    <your code goes here>
    jax.profiler.stop_trace()
  finally:
    uploader.stop_upload_to_tensorboard()
  ```


pkgId: efe5c45cbeb496098d81208be30db119a753389f78e3037ad4b91d9b28fa2200
name: python-cloud-accelerator-diagnostics
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: Monitor, debug and profile the jobs running on Cloud accelerators like TPUs and GPUs.
url: https://github.com/google/cloud-accelerator-diagnostics
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-accelerator-diagnostics-0.1.1-1.src.rpm
checksum_type: sha256
description:
  <!--
   Copyright 2023 Google LLC

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

        https://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   -->



  Cloud Accelerator Diagnostics is a library to monitor, debug and profile the workloads running on Cloud accelerators like TPUs and GPUs. Additionally, this library provides a streamlined approach to automatically upload data to Tensorboard Experiments in Vertex AI. The package allows users to create a Tensorboard instance and Experiments in Vertex AI, and upload logs to them.


  To install the Cloud Accelerator Diagnostics package, run the following command:

   ```bash
   pip install cloud-accelerator-diagnostics
   ```


  Before creating and uploading logs to Vertex AI Tensorboard, you must enable [Vertex AI API](https://cloud.google.com/vertex-ai/docs/start/cloud-environment#enable_vertexai_apis) in your Google Cloud console. Also, make sure to assign the [Vertex AI User IAM role](https://cloud.google.com/vertex-ai/docs/general/access-control#aiplatform.user) to the service account that will call the APIs in `cloud-accelerator-diagnostics` package. This is required to create and access the Vertex AI Tensorboard in the Google Cloud console.


  To learn about Vertex AI Tensorboard, visit this [page](https://cloud.google.com/vertex-ai/docs/experiments/tensorboard-introduction).

  Here is an example script to create a Vertex AI Tensorboard instance with the name `test-instance` in Google Cloud Project `test-project`.

  Note: Vertex AI is available in only [these](https://cloud.google.com/vertex-ai/docs/general/locations#available-regions) regions.

  ```
  from cloud_accelerator_diagnostics import tensorboard

  instance_id = tensorboard.create_instance(project="test-project",
                                            location="us-central1",
                                            tensorboard_name="test-instance")
  print("Vertex AI Tensorboard created: ", instance_id)
  ```


  To learn about Vertex AI Experiments, visit this [page](https://cloud.google.com/vertex-ai/docs/experiments/intro-vertex-ai-experiments).

  The following script will create a Vertex AI Experiment named `test-experiment` in your Google Cloud Project `test-project`. Here's how it handles attaching a Tensorboard instance:

  **Scenario 1: Tensorboard Instance Exist**

  If a Tensorboard instance named `test-instance` already exists in your project, the script will attach it to the new Experiment.

  **Scenario 2: No Tensorboard Instance Present**

  If `test-instance` does not exist, the script will create a new Tensorboard instance with that name and attach it to the Experiment.

  ```
  from cloud_accelerator_diagnostics import tensorboard

  instance_id, tensorboard_url = tensorboard.create_experiment(project="test-project",
                                                               location="us-central1",
                                                               experiment_name="test-experiment",
                                                               tensorboard_name="test-instance")

  print("View your Vertex AI Tensorboard here: ", tensorboard_url)
  ```

  If a Vertex AI Experiment with the specified name exists, a new one will not be created, and the existing Experiment's URL will be returned.

  Note: You can attach multiple Vertex AI Experiments to a single Vertex AI Tensorboard.


  The following script will continuously monitor for new data in the directory (`logdir`), and uploads it to your Vertex AI Tensorboard Experiment. Note that after calling `start_upload_to_tensorboard()`, the thread will be kept alive even if an exception is thrown. To ensure the thread gets shut down, put any code after `start_upload_to_tensorboard()` and before `stop_upload_to_tensorboard()` in a `try` block, and call `stop_upload_to_tensorboard()` in `finally` block. This example shows how you can upload the [profile logs](https://jax.readthedocs.io/en/latest/profiling.html#programmatic-capture) collected for your JAX workload on Vertex AI Tensorboard.

  ```
  from cloud_accelerator_diagnostics import uploader

  uploader.start_upload_to_tensorboard(project="test-project",
                                       location="us-central1",
                                       experiment_name="test-experiment",
                                       tensorboard_name="test-instance",
                                       logdir="gs://test-directory/testing")
  try:
    jax.profiler.start_trace("gs://test-directory/testing")
    <your code goes here>
    jax.profiler.stop_trace()
  finally:
    uploader.stop_upload_to_tensorboard()
  ```


pkgId: 9b5007f2a59d54406f6c874e6489fd8fb47cf99dd388607865713f0bf2e0d08c
name: python-cloud-auth-tpm
arch: src
version: 0.6.4
epoch: 0
release: 1
summary: Python TPM based Credentials for Cloud Providers
url: https://github.com/salrashid123/cloud_auth_tpm
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-auth-tpm-0.6.4-1.src.rpm
checksum_type: sha256
description:
  You need to first embed an RSA key into a TPM thats readable by [python-tss](https://github.com/tpm2-software/tpm2-pytss) or openssl and accessed using [PEM formatted TPM Keys](https://www.hansenpartnership.com/draft-bottomley-tpm2-keys.html).  To do that, see the [Using RSA Keys on TPM](#using-rsa-keys-on-tpm) section for options.

  ```python
  from google.cloud import storage
  from cloud_auth_tpm.gcp.gcpcredentials import GCPCredentials

  pc = GCPCredentials(
    tcti="device:/dev/tpmrm0",
    keyfile='/path/to/key.pem',   # TPM KEY: -----BEGIN TSS2 PRIVATE KEY-----
    ownerpassword=None,
    password=None,
    policy_impl=None,
    email="jwt-access-svc-account@$PROJECT_ID.iam.gserviceaccount.com")
  storage_client = storage.Client(project="$PROJECT_ID", credentials=pc)
  buckets = storage_client.list_buckets()
  for bkt in buckets:
      print(bkt.name)
  ```

  ```python
  import boto3
  from cloud_auth_tpm.aws.awscredentials import AWSCredentials

  pc = AWSCredentials(
    tcti="device:/dev/tpmrm0",
    keyfile='/path/to/key.pem',   # TPM KEY: -----BEGIN TSS2 PRIVATE KEY-----
    ownerpassword=None,
    password=None,
    policy_impl=None,
    public_certificate_file="certs/alice-cert.crt",
    region="us-east-2",
    duration_seconds=1000,
    trust_anchor_arn='arn:aws:rolesanywhere:us-east-2:291738886522:trust-anchor/a545a1fc-5d86-4032-8f4c-61cdd6ff92ac',
    session_name="foo",
    role_arn="arn:aws:iam::291738886522:role/rolesanywhere1",
    profile_arn="arn:aws:rolesanywhere:us-east-2:291738886522:profile/6f4943fb-13d4-4242-89c4-be367595c560")
  session = pc.get_session()
  s3 = session.resource('s3')
  for bucket in s3.buckets.all():
      print(bucket.name)
  ```

  ```python
  import boto3
  from cloud_auth_tpm.aws.awshmaccredentials import AWSHMACCredentials

  pc = AWSHMACCredentials(
    tcti="device:/dev/tpmrm0",
    keyfile='/path/to/key.pem',   # TPM KEY: -----BEGIN TSS2 PRIVATE KEY-----
    ownerpassword=None,
    password=None,
    policy_impl=None,
    access_key="AWS_ACCESS_KEY_ID",
    region="us-east-2",
    duration_seconds=1000,
    role_session_name="foo",
    assume_role_arn="arn:aws:iam::291738886522:role/gcpsts")
  session = pc.get_session()
  s3 = session.resource('s3')
  for bucket in s3.buckets.all():
      print(bucket.name)
  ```

  ```python
  from azure.storage.blob import BlobServiceClient
  from cloud_auth_tpm.azure.azurecredentials import AzureCredentials

  pc = AzureCredentials(
    tcti="device:/dev/tpmrm0",
    keyfile='/path/to/key.pem',   # TPM KEY: -----BEGIN TSS2 PRIVATE KEY-----
    ownerpassword=None,
    password=None,
    policy_impl=None,
    tenant_id="45243fbe-b73f-4f7d-8213-a104a99e428e",
    client_id="cffeaee2-5617-4784-8a4b-b647efd676e1",
    certificate_path="certs/azclient.crt")
  blob_service_client = BlobServiceClient(
      account_url="https://$STORAGE_ACCOUNT.blob.core.windows.net",
      credential=pc
  )
  container_client = blob_service_client.get_container_client('container_name')
  blob_list = container_client.list_blobs()
  for blob in blob_list:
      print(blob.name)


pkgId: 56a2cc681ea71166e971b274af7c0622c4de2b42e6384bf6f85f2afae3b64092
name: python-cloud-blobstore
arch: src
version: 3.2.0
epoch: 0
release: 1
summary: Abstraction layer for cloud blobstores.
url: https://github.com/chanzuckerberg/cloud-blobstore
rpm_license: Apache Software License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-blobstore-3.2.0-1.src.rpm
checksum_type: sha256
description:
  This library provides an abstraction layer for the most basic functionality provided by the cloud providers.  These are the basic functions required by the [Human Cell Atlas](https://www.humancellatlas.org/) [Data Storage Service](https://github.com/HumanCellAtlas/data-store).




  Before you start, you may wish to set up a [virtualenv](https://virtualenv.pypa.io/en/stable/).  Run `pip install -r requirements-dev.txt`. Then set up the following environment variables:

  | Environment variable    | Explanation |
  | ----------------------- | ----------- |
  | S3_BUCKET               | Points to the AWS S3 bucket where new files will be written.  It may be advisable to set up a cleanup policy for this bucket. |
  | S3_BUCKET_FIXTURES      | Points to the AWS S3 bucket where static fixtures are stored. |
  | S3_BUCKET_US_EAST_1     | Points to an AWS S3 bucket in the US_EAST_1 region.  This can overlap with one of the other buckets. |
  | S3_BUCKET_NON_US_EAST_1 | Points to an AWS S3 bucket _not_ in the US_EAST_1 region.  This can overlap with one of the other buckets. |
  | GS_BUCKET               | Points to the GCP GS bucket where new files will be written.  It may be advisable to set up a cleanup policy for this bucket. |
  | GS_BUCKET_FIXTURES      | Points to the GCP GS bucket where static fixtures are stored. |



  Run `python tests/fixtures/populate.py --s3-bucket $S3_BUCKET_FIXTURES --gs-bucket $GS_BUCKET_FIXTURES`


  Run `make test` in the top-level directory.


pkgId: 3ca3438c32e6fe1a5b8fe6c93b811fa045720f03a49d82ff275306dd653d8104
name: python-cloud-builder
arch: src
version: 1.0.7
epoch: 0
release: 1
summary: Cloud Builder
url: https://pypi.org/project/cloud-builder/
rpm_license: GPLv3+
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-builder-1.0.7-1.src.rpm
checksum_type: sha256
description:
  |GitHub CI Action|
  The Cloud Builder project provides a collection of services which
  allows you to stand up a package building backend to build software
  packages through a messaging API. Primarily **rpm** packages but also
  other package formats like **deb**, **pacman** and alike are possible.
  For more information see: https://osinside.github.io/cloud-builder


pkgId: 5cfb900effa8bfe035404706e163e6e3f59b35dd02c12badade598b8ba6830d3
name: python-cloud-composer-dag-test-utils
arch: src
version: 1.0.0
epoch: 0
release: 1
url: https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/composer/dag_test_utils
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-composer-dag-test-utils-1.0.0-1.src.rpm
checksum_type: sha256
summary:
  Utility used to unit test example Apache Airflow DAGs for Google Cloud Composer. This is not an officially supported Google product.

description:
  This package is used internally to unit test the validity of all Cloud Composer sample DAGs. It is not supported for external production use. The [latest release can be found on PyPI](https://pypi.org/project/cloud-composer-dag-test-utils/).



  Add the following to your `requirements-test.txt` file:

  `cloud_composer_dag_test_utils`

  Import the internal unit testing module

  ```python
  import internal_unit_testing
  ```

  Test your DAG

  ```python
  def test_dag_import():
      
      models.Variable.set('gcs_bucket', 'example_bucket')
      from . import my_dag as module
      
      internal_unit_testing.assert_has_valid_dag(module)
  ```

  For more examples, refer to the [`workflows`](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/composer/workflows) directory.


pkgId: 732e3b0860424ea2dcf94943373c522c68a87b5b85580aa9a42f853c2fa6c843
name: python-cloud-cost-allocation
arch: src
version: 1.0.14
epoch: 0
release: 1
summary: Python library for shared, hierarchical cost allocation based on user-defined usage metrics.
url: https://github.com/AmadeusITGroup/cloud-cost-allocation
rpm_license: MIT license
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-cost-allocation-1.0.14-1.src.rpm
checksum_type: sha256
description:
  This project provides tools for **shared, hierarchical cost allocation** based on user-defined usage metrics.


  **Mainstream** cloud cost management **tools** from the Cloud Service Providers or 3rd party vendors typically **rely on** the high level hierarchy of cloud objects (*Resource containers*, like **Projects** in *Google Cloud Platform*, or **Subscriptions** and *Resource Groups* in *Azure*) or **tags to allocate costs** to a given cost center or business unit.
  In addition, some tools support one level of cost re-allocation (e.g. based on fixed percentages, overall/specific costs of the consumers). Usually, this does not include the ability to use dynamic, custom defined metrics though.
  As a result, the cost allocation process of shared services is often rather:
  - **Imprecise**, thus unfair, since cost allocation is not done based on the actual consumption
  - **Incomplete**, since shared costs, especially if hierarchical, are simply not allocated to their consumers, thus requiring additional tooling on top
  - **Opaque** and thus hard to action, since neither the key cost drivers nor their actual consumption (and thus angles for optimization) are visible to the consumers


  ![Hierarchical cloud consumption example](https://github.com/AmadeusITGroup/cloud-cost-allocation/raw/main/puml/hierarchical-service-consumption-example.svg)

  In this example, classic, usage-based cost allocation would likely stop at the cloud resource level. Thus, only the container service would be visible. With additional instrumentation these costs could be split into the direct costs for each of the services running on it. But the costs of the shared monitoring or history service would not be properly allocated, let alone their contributions to the business services behind that.
  This might not be a problem as long as those costs are small and the hierarchy of services using each other is shallow. But in large production environments the key cost drivers for a given business service might thus be hidden making it very difficult to assess the total costs of a given service.
  Usually, the only way to resolve this issue is avoid sharing services by duplicating them. While this can work in some cases it often also results in higher overall costs, both for deploying and for managing these services.

  The goal of the cost allocation model proposed here is to support such complex consumption hierarchies in a usage-based fashion with custom (North Star) Metrics up the business service level.
  This does not only enable the more accurate and complete cost allocation required to make proper business decisions and forecasts, but also yields more actionable outputs thanks to the transparency on unit costs, consumption and their evolution over time.
  Furthermore, this also allows service owners to easily identify their main cost drivers in the service hierarchy. This in turn helps to ensure that optimization efforts can be focused on the most promising services as well as to simulate and later measure the actual benefits this can bring to all services along the consumption chain.

  ![Hierarchical cloud git commit -m cost allocation example](https://github.com/AmadeusITGroup/cloud-cost-allocation/raw/main/puml/hierarchical-service-cost-allocation-example.svg)



  | Term                  | Definition                                                                                                                                                       |
  |-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  | *Service*             | A technical workload, operated by DevOps, which can either run directly on the cloud, or consume other services, or both.                                        |
  | *Product*             | A business product, which relies on one or multiple services. Products are somehow commercial packaging of services under the control of Product Managers.       |
  | *Product Dimension*   | An optional dimension for the cost report of a product, for example: a product feature, a product flavor, a market or a market segment.                          |
  | *Provider Service*    | The role of a service when it is consumed by another other service or product, a.k.a. a shared service.                                                          |
  | *Consumer Service*    | The role of a service when it consumes another service.                                                                                                          |
  | *Instance*            | A running instance or a deployment of a service. If we think of *Services* as *Classes* in object-oriented programming, then *Instances* would be the *Objects*. |
  | *Dimension*           | An optional dimension in the cost allocation, for example an environment like Test or Production, or a component in the architecture of the service.             |
  | *Meter*               | A meter that measures the functional activity or throughput of a service or of a product.                                                                        |
  | *Amortized Cost*      | The billing cost incremented with the amortized cost of the commitment-based purchases (reservations, saving plans).                                             |
  | *On-demand Cost*      | The equivalent on-demand cost, i.e. as if no commitment-based purchase had been made.                                                                            |
  | *Cost Item*           | A cost that is either coming from cloud provider billing or allocated by a provider service.                                                                     |
  | *Cost Allocation Key* | A numerical value to allocate a share of a cost. Cost share = cost * key / total keys.                                                                           |



  Keep calm and drink coffee.

  ![Cloud cost allocation model](https://github.com/AmadeusITGroup/cloud-cost-allocation/raw/main/puml/cost-allocation-model.svg)



  1. The model relies solely on cloud resource tags in order to work transparently for all cloud providers
      * Note that policies can be used to propagate tags from cloud provider containers (GCP Projects, Azure Subscriptions or Resource Groups, ...) to individual resources if required
  2. On top of that, the model uses cost allocation data provided by the service owners
      * If a service owner provides no cost allocation data, the service becomes a leaf in the hierarchy and thus owns all costs allocated along the chain
      * Cost allocation data is based on keys: the cost of a service is split and dispatched proportionally to cost allocation keys
      * Ideally, all cloud costs should be allocated to products. This means every service owner should provide cost allocation data to allocate the service cost to consumer services and/or products
  3. Services, products and meters are discovered and linked through tags and through cost allocation data
      * It is strongly recommended to use policies or other means to cross-check these names against the relevant product and service catalogs
  4. The pivot of the cost allocation is the *Instance*: service cost allocation data is per instance
      * Service owners should design carefully service instances, in order to be able to generate cost allocation data for each of them
      * Naming conventions are recommended to reflect the design of service instance, and possibly to provide some information about every service instance
      * All other dimensions (e.g. environment) are not structuring for the cost allocation between instances, but they provide commonly used dimensions for cost reporting
  5. Both products and services have their meters
      * Product meters are defined by product owners (or mangers), while service meters are defined by service owners
      * A product meter measures the business volume served by the product
      * Product meters are used to monitor cost efficiency at product level, to perform cloud cost forecast in budget activities, to optimize pricing, and more generally to take data-driven business decisions
      * A service meter measures the usage of a provider service by consumer services and products, and so it must be reflected in cost allocation keys
      * Service meters are used to monitor cost efficiency, to detect drifts, to track the benefit of cloud cost optimizations, and more generally to serve as KPIs for service cloud costs
      * A given product or service can have more than one meter
          * Example 1: container service
              * A meter of a container service could be the combination of container CPU request and container Memory request
              * In this case the Cost Allocation Keys be computed out of the two metrics
          * Example 2: shared data lake
              * Here the cost driver could be the amount of data being stored
              * Since this volume is hard to predict and optimize, this could be further broken down into the daily volume stored + the retention time
  6. Cost items are tagged
      * Cost item tags comes from cloud resource tags and from provider services
      * Note that *Dimensions* can be seen conceptually as specific *tags* that have been promoted as first-class citizens in the model for cost reporting
      * The *ProviderTagSelector* field in cost allocation data enables a finer grained cost selection and allocation along additional axis (e.g. customer)
  7. A cost allocation key can allocate cost both to a service and to a product
      * Service cost allocation and product cost allocation actually work in parallel
          * The test `test2` illustrates how these cost allocation flows work together
      * Service cost allocation basically propagates costs through cost allocation keys
      * The cost of a service is the sum of the costs of cloud resources it uses directly and of the cost shares of the other services it consumes
      * Contrary to this, only the following costs are assigned to products from each service
          * The costs of cloud resources it uses directly and
          * Any costs from consumed services that did not report their costs to products
      * This ensures that there is no double counting of costs at product level
      * Assuming that all cloud resources are properly tagged and that services eventually allocate all their costs to products, then the costs of all cloud resources must be equal to the cost of all products
          * Similarly, the costs of a product that exclusively uses a single service would be equal to the total cost of that service
  8. On-demand costs and amortized costs are supported in parallel by the model
      * Reporting the two is useful to investigate whether cost variations come from commitment management or something else
      * Reporting the two is also useful for service owners and product managers alike to see the savings made thanks to the commitment-based purchases
      * Commitment savings = On-demand costs - amortized costs
  9. Cycles in the cost allocation can be broken by providing a *service precedence list*
      * Example: A monitoring system *M* running on top of a container service *C* is also used by the container service itself
          * In this case, part of the costs of *M* should be assigned back to *C*
          * Since the costs of *C* are allocated to *M* (in part), this creates a loop
          * This cost allocation cycle *C* -> *M* -> *C* can be broken by specifying a precedence list *C,M*. In this case, *C* is allocated no cost from *M*
      * As another example, see `test5`
      * The cost allocation could manage cycles in a more sophisticated way in the future
  10. As a general rule, the names of all model objects (products, services, instances, tags, ...) are normalized to lower case, in order avoid low-high case mistakes



  The standard way for a service to its allocate cost is to provide dynamic cost allocation data containing cost allocation keys.
  Three alternatives exist to this, and they should be used carefully:
  1. Use specific configurable *consumer service and product tags*
      * While providing an easy way to dynamically allocate costs, it does not offer any means to track usage and thus provides no hint to consumers on what drives their costs (black box)
      * See section *Consumer service and product tags* for details
  2. Use specific *cost allocation type* in cost allocation data
      * E.g. to allocate a cost share proportional to the amortized costs of the consumers
      * See section *Cost allocation types in cost allocation data* below for details
  3. Use a static cost allocation file
      * Instead of generating and using accurate consumption data, a static approach (potentially updated at certain intervals) might be sufficient in some cases and in crawl phase



  Specific configurable tags can be used by a service to allocate its cost to consumer services and to products.
  Consumer tags are convenient to get cost allocation keys generated automatically based on tagging.

  Technically, for every *CostItem* having consumer tags, a new *ConsumerCostItem* is created with:
  - *ProviderService* and *ProviderInstance*: the ones from the *CostItem*.
  - *ConsumerService* and *ConsumerInstance*: the ones from the consumer tags.
  - *Product*: the one from the product tag.
  - *ProviderTagSelector*: an expression matching the consumer tags.
  - *ProviderCostAllocationKey*: value 1.0.
  Examples are available in the tests `test3` and `test4`.



  The default value of *ProviderCostAllocationType* in cost allocation data is *'Key'*.
  Three other types of cost allocation are supported:
  1. *'CloudTagSelector'*
      * The consumer service instances are not explicitly specified in the cost allocation data
          * They are inferred as the ones consuming the cloud cost items whose tags match the *ProviderCostAllocationCloudTagSelector* expression
      * The cost allocation keys are set as the amortized costs of the matching cloud cost items
      * This type of cost allocation is convenient to allocate costs to consumer services that run directly on the cloud proportionally to their cloud costs
      * See example in the test `test3`
  2. *'Cost'*
      * The cost is allocated to the consumer services proportionally to their amortized costs
      * Technically, amortized costs are globally allocated to service instances in a first time, while ignoring this type of cost allocation
      * The amortized costs resulting from this cost allocation are used in a second pass as cost allocation keys to perform the actual cost allocation
      * Although this type of cost allocation is convenient to avoid bothering about cost allocation keys, it can produce results that are hardly predictable and understandable, depending on the complexity of the global cost allocation graph
      * See example in the test `test3`
  3. *'DefaultProduct'*
      * By default, the cost of the provider service is allocated to the specified product(s)
      * This type of cost allocation is convenient to implement centrally a default cost allocation to products, which is overriden by service owners when the latter provide cost allocation data
      * See example in the test `test8`

  Examples of *'CloudTagSelector'* and *'Cost'* cost allocation types are available in the test `test3`.

  In theory, an even more general type of cost allocation could be considered:
  - *'ConsumerTagSelector'*
      * Cost would be allocated to service instances whose cost items match the *ProviderCostAllocationConsumerTagSelector* expression proportionally to their amortized costs
      * While being more generic, this type of cost allocation can be even less predictable
      * This type of cost allocation has not been required and thus not implemented yet



  After cost allocation, custom amounts, which are called *further amounts*, can be allocated.
  Examples of *further amounts* are CO2 and electricity power.
  The *further amounts* to allocate must be first loaded into the cost items, before the allocation is run for them.
  The *further amounts* can be loaded into cloud cost items, or even into consumer cost items: in both cases, the further amounts are allocated along the cost allocation graph.
  Custom allocation keys can be used to allocate *further amounts*.



  Python `configparser` is used to manage the configuration. Here are the configuration parameters with examples:

  ```
  [General]




  DateFormat = %Y-%m-%d.


  DefaultService = x


  DefaultProduct = x


  Dimensions = Component,Environment


  NumberOfProviderMeters = 2


  NumberOfProductDimensions = 2


  NumberOfProductMeters = 3

  [TagKey]



  Service = service,svc
  Instance = instance



  Component = component,comp
  Environment = environment



  ConsumerService = consumer_service
  ConsumerInstance = consumer_instance
  ConsumerComponent = consumer_component
  ConsumerEnvironment = consumer_environment


  ConsumerServiceIgnoredValue = n/a



  Product = product

  [AzureEaAmortizedCost]


  UnusedReservationService = finops
  UnusedReservationInstance = unused-commitment
  UnusedReservationComponent = reservation


  UnusedSavingsPlanService = finops
  UnusedSavingsPlanInstance = unused-commitment
  UnusedSavingsPlanComponent = savings-plan

  [Cycles]



  ServicePrecedenceList = a,b,c



  MaxBreaks = 10

  [FurtherAmounts]


  Amounts = Co2,ElectricityPower


  AllocationKeys = Co2Key


  AmountAllocationKeys = Co2:Co2Key,ElectricityPower:ProviderCostAllocationKey
  ```



  Run the following command in the repository root directory:

  ```
  python -m unittest -v tests.test
  ```



  The code for a simple command line in `main.py` is a basic example to:
  - Read cloud costs
  - Read cost allocation keys
  - Allocate costs
  - Write allocated costs

  The `test.py` file in the `tests` directory illustrates how to add custom code and columns in the allocated costs.




  Bugs are both proofs of success and of failure: what do you think?
  Before submitting a bug, please check through the [GitHub issues](https://github.com/AmadeusITGroup/cloud-cost-allocation/issues),
  both open and closed, to confirm that the bug hasn't been reported before.


  If you think a feature is missing and could be useful in this module, feel free to raise a feature request through the
  [GitHub issues](<https://github.com/AmadeusITGroup/JumpSSH/issues>).
  Please keep in mind that the cost allocation model is intended to be as minimal as possible.


  When contributing code, please follow [this project-agnostic contribution guide](<http://contribution-guide.org/>).



  - Cost reader for FOCUS
  - Split and dispatch of the provider meter values when CloudTagSelector is used.
  - Support product dimension in cloud tags


pkgId: eca0c529d3fe3c06d7f3bfd05dd172d9b11bf00c84b3547a248a941711559125
name: python-cloud-foundry
arch: src
version: 0.0.15
epoch: 0
release: 1
url: https://pypi.org/project/cloud-foundry/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-foundry-0.0.15-1.src.rpm
checksum_type: sha256
summary:
  cloud-foundry is a curated set of cloud components that can be used to assemble cloud based applications.


pkgId: e136f9eb95222e124dc9f029ecab13c64df2a5872f20bf205c4115d8b961b362
name: python-cloud-governance
arch: src
version: 1.1.317
epoch: 0
release: 1
summary: Cloud Governance Tool
url: https://github.com/redhat-performance/cloud-governance
rpm_license: Apache License 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-governance-1.1.317-1.src.rpm
checksum_type: sha256
description:
  [![PyPI Latest Release](https://img.shields.io/pypi/v/cloud-governance.svg)](https://pypi.org/project/cloud-governance/)
  [![Container Repository on Quay](https://quay.io/repository/projectquay/quay/status "Container Repository on Quay")](https://quay.io/repository/cloud-governance/cloud-governance?tab=tags)
  [![Actions Status](https://github.com/redhat-performance/cloud-governance/actions/workflows/Build.yml/badge.svg)](https://github.com/redhat-performance/cloud-governance/actions)[![Coverage Status](https://coveralls.io/repos/github/redhat-performance/cloud-governance/badge.svg?branch=main)](https://coveralls.io/github/redhat-performance/cloud-governance?branch=main)
  [![Documentation Status](https://readthedocs.org/projects/cloud-governance/badge/?version=latest)](https://cloud-governance.readthedocs.io/en/latest/?badge=latest)
  [![python](https://img.shields.io/pypi/pyversions/cloud-governance.svg?color=%2334D058)](https://pypi.org/project/cloud-governance)
  [![License](https://img.shields.io/pypi/l/cloud-governance.svg)](https://github.com/redhat-performance/cloud-governance/blob/main/LICENSE)



  ![](images/cloud_governance.png)



  **Cloud Governance** tool provides a lightweight and flexible framework for deploying cloud management policies focusing
  on cost optimize and security.
  We have implemented several pruning policies. \
  When monitoring the resources, we found that most of the cost leakage is from available volumes, unused NAT gateways,
  and unattached Public IPv4 addresses (Starting from February 2024, public IPv4 addresses are chargeable whether they are
  used or not).

  This tool support the following policies:
  [policy](cloud_governance/policy)

  [AWS Polices](cloud_governance/policy/aws)

  * Real time Openshift Cluster cost, User cost
  * [instance_idle](cloud_governance/policy/aws/cleanup/instance_idle.py): Monitor the idle instances based on the
    instance metrics for the last 7 days.
      * CPU Percent < 2%
      * Network < 5KiB
  * [instance_run](cloud_governance/policy/aws/cleanup/instance_run.py): List the running ec2 instances.
  * [unattached_volume](cloud_governance/policy/aws/cleanup/unattached_volume.py): Identify and remove the available EBS
    volumes.
  * [zombie_cluster_resource](cloud_governance/policy/aws/zombie_cluster_resource.py): Identify the non-live cluster
    resource and delete those resources by resolving dependency. We are deleting more than 20 cluster resources.
      * Ebs, Snapshots, AMI, Load Balancer
      * VPC, Subnets, Route tables, DHCP, Internet Gateway, NatGateway, Network Interface, ElasticIp, Network ACL,
        Security Group, VPC Endpoint
      * S3
      * IAM User, IAM Role
  * [ip_unattached](cloud_governance/policy/aws/ip_unattached.py): Identify the unattached public IPv4 addresses.
  * [zombie_snapshots](cloud_governance/policy/aws/zombie_snapshots.py): Identify the snapshots, which are abandoned by
    the AMI.
  * [unused_nat_gateway](cloud_governance/policy/aws/cleanup/unused_nat_gateway.py): Identify the unused NatGateway by
    monitoring the active connection count.
  * [s3_inactive](cloud_governance/policy/aws/s3_inactive.py): Identify the empty s3 buckets, causing the resource quota
    issues.
  * [empty_roles](cloud_governance/policy/aws/empty_roles.py): Identify the empty roles that do not have any attached
    policies to them.
  * [ebs_in_use](cloud_governance/policy/aws/ebs_in_use.py): list in use volumes.
  * [tag_resources](cloud_governance/policy/policy_operations/aws/tag_cluster): Update cluster and non cluster resource
    tags fetching from the user tags or from the mandatory tags
  * [tag_non_cluster](cloud_governance/policy/policy_operations/aws/tag_non_cluster): tag ec2 resources (instance, volume,
    ami, snapshot) by instance name
  * [tag_iam_user](cloud_governance/policy/policy_operations/aws/tag_user): update the user tags from the csv file
  * [cost_explorer](cloud_governance/policy/aws/cost_explorer.py): Get data from cost explorer and upload to ElasticSearch

  * gitleaks: scan GitHub repository git leak (security scan)
  * [cost_over_usage](cloud_governance/policy/aws/cost_over_usage.py): send mail to aws user if over usage cost

  [Azure policies](cloud_governance/policy/azure)

  * [instance_idle](cloud_governance/policy/azure/cleanup/instance_idle.py): Monitor the idle instances based on the
    instance metrics.
      * CPU Percent < 2%
      * Network < 5KiB
  * [unattached_volume](cloud_governance/policy/azure/cleanup/unattached_volume.py): Identify and remove the available
    disks.
  * [ip_unattached](cloud_governance/policy/azure/cleanup/ip_unattached.py): Identify the unattached public IPv4
    addresses.
  * [unused_nat_gateway](cloud_governance/policy/azure/cleanup/unused_nat_gateway.py): Identify the unused NatGateway by
    monitoring the active connection count.

  [IBM policies](cloud_governance/policy/ibm)

  * [tag_baremetal](cloud_governance/policy/ibm/tag_baremetal.py): Tag IBM baremetal machines
  * [tag_vm](cloud_governance/policy/ibm/tag_vm.py): Tga IBM Virtual Machines machines

  ** You can write your own policy using [Cloud-Custodian](https://cloudcustodian.io/docs/quickstart/index.html)
  and run it (see 'custom cloud custodian policy' in [Policy workflows](#policy-workloads)).

  ![](images/cloud_governance1.png)
  ![](images/demo.gif)

  ![](images/cloud_governance2.png)

  Reference:

  * The cloud-governance package is placed in [PyPi](https://pypi.org/project/cloud-governance/)
  * The cloud-governance container image is placed in [Quay.io](https://quay.io/repository/ebattat/cloud-governance)
  * The cloud-governance readthedocs link is [ReadTheDocs](https://cloud-governance.readthedocs.io/en/latest/)
    ![](images/cloud_governance3.png)

  _**Table of Contents**_

  <!-- TOC -->

  - [Installation](#installation)
  - [Configuration](#configuration)
  - [Run AWS Policy Using Podman](#run-aws-policy-using-podman)
  - [Run IBM Policy Using Podman](#run-ibm-policy-using-podman)
  - [Run Policy Using Pod](#run-policy-using-pod)
  - [Pytest](#pytest)
  - [Post Installation](#post-installation)

  <!-- /TOC -->





  ```sh

  sudo podman pull quay.io/cloud-governance/cloud-governance
  ```



  (mandatory)AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID

  (mandatory)AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY



  (mandatory)policy=instance_idle / instance_run / ebs_unattached / ebs_in_use / tag_cluster_resource /
  zombie_cluster_resource / tag_ec2_resource



  (mandatory)policy_output=s3://redhat-cloud-governance/logs



  (mandatory policy:tag_cluster_resource)resource_name=ocs-test



  (mandatory policy:tag_cluster_resource)mandatory_tags="{'Owner': 'Name','Email': 'name@redhat.com','Purpose': 'test'}"



  (mandatory policy: gitleaks)git_access_token=$git_access_token
  (mandatory policy: gitleaks)git_repo=https://github.com/redhat-performance/cloud-governance
  (optional policy: gitleaks)several_repos=yes/no (default = no)



  (optional)AWS_DEFAULT_REGION=us-east-2/all (default = us-east-2)



  (optional)dry_run=yes/no (default = yes)



  (optional)log_level=INFO (default = INFO)



  LDAP_HOST_NAME=ldap.example.com



  GOOGLE_APPLICATION_CREDENTIALS=$pwd/service_account.json







  * Create user with [IAM](iam/clouds)
  * Create a logs bucket [create_bucket.sh](iam/clouds/aws/create_bucket.sh)



  * Create classic infrastructure API key



  ```sh

  sudo podman run --rm --name cloud-governance -e policy="instance_idle" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e dry_run="yes" -e policy_output="s3://bucket/logs" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="instance_run" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e dry_run="yes" -e policy_output="s3://bucket/logs" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="policy" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e dry_run="yes"  -e log_level="INFO" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="ebs_unattached" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e dry_run="yes" -e policy_output="s3://bucket/logs" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="ebs_in_use" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e dry_run="yes" -e policy_output="s3://bucket/logs" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="zombie_cluster_resource" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e dry_run="yes" -e resource="zombie_cluster_elastic_ip" -e cluster_tag="kubernetes.io/cluster/test-pd9qq" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="tag_resources" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e tag_operation="read/update/delete" -e mandatory_tags="{'Owner': 'Name','Email': 'name@redhat.com','Purpose': 'test'}" -e log_level="INFO" -v "/etc/localtime":"/etc/localtime" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="tag_non_cluster" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e tag_operation="read/update/delete" -e mandatory_tags="{'Owner': 'Name','Email': 'name@redhat.com','Purpose': 'test'}" -e log_level="INFO" -v "/etc/localtime":"/etc/localtime" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="tag_iam_user" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e user_tag_operation="read/update/delete" -e remove_tags="['Environment', 'Test']" -e username="test_username" -e file_name="tag_user.csv"  -e log_level="INFO" -v "/home/user/tag_user.csv":"/tmp/tag_user.csv" --privileged "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="cost_explorer" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e es_host="$elasticsearch_host" -e es_port="$elasticsearch_port" -e es_index="$elasticsearch_index" -e cost_metric=UnblendedCost -e start_date="$start_date" -e end_date="$end_date" -e granularity="DAILY" -e cost_explorer_tags="['User', 'Budget', 'Project', 'Manager', 'Owner', 'LaunchTime', 'Name', 'Email']" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance:latest"
  sudo podman run --rm --name cloud-governance -e policy="cost_explorer" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e es_index="elasticsearch_index" -e cost_metric="UnblendedCost" -e start_date="$start_date" -e end_date="$end_date" -e granularity="DAILY" -e cost_explorer_tags="['User', 'Budget', 'Project', 'Manager', 'Owner', 'LaunchTime', 'Name', 'Email']" -e file_name="cost_explorer.txt" -v "/home/cost_explorer.txt":"/tmp/cost_explorer.txt" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance:latest"


  sudo podman run --rm --name cloud-governance  -e policy="validate_iam_user_tags" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e validate_type="spaces/tags" -e user_tags="['Budget', 'User', 'Owner', 'Manager', 'Environment', 'Project']"   -e log_level="INFO" "quay.io/cloud-governance/cloud-governance:latest"


  sudo podman run --rm --name cloud-governance -e policy="gitleaks" -e git_access_token="$git_access_token" -e git_repo="https://github.com/redhat-performance/cloud-governance" -e several_repos="no" -e log_level="INFO" "quay.io/cloud-governance/cloud-governance"


  sudo podman run --rm --name cloud-governance -e policy="/custodian_policy/policy.yml" -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" -e AWS_DEFAULT_REGION="us-east-2" -e dry_run="yes" -e policy_output="s3://bucket/logs" -e log_level="INFO" -v "/home/user/custodian_policy":"/custodian_policy" --privileged "quay.io/cloud-governance/cloud-governance"

  ```



  ```sh

  podman run --rm --name cloud-governance -e policy="tag_baremetal" -e account="$account" -e IBM_API_USERNAME="$IBM_API_USERNAME" -e IBM_API_KEY="$IBM_API_KEY" -e SPREADSHEET_ID="$SPREADSHEET_ID" -e GOOGLE_APPLICATION_CREDENTIALS="$GOOGLE_APPLICATION_CREDENTIALS" -v $GOOGLE_APPLICATION_CREDENTIALS:$GOOGLE_APPLICATION_CREDENTIALS -e LDAP_USER_HOST="$LDAP_USER_HOST" -e tag_operation="update" -e log_level="INFO" -v "/etc/localtime":"/etc/localtime" "quay.io/cloud-governance/cloud-governance:latest"


  podman run --rm --name cloud-governance -e policy="tag_vm" -e account="$account" -e IBM_API_USERNAME="$IBM_API_USERNAME" -e IBM_API_KEY="$IBM_API_KEY" -e SPREADSHEET_ID="$SPREADSHEET_ID" -e GOOGLE_APPLICATION_CREDENTIALS="$GOOGLE_APPLICATION_CREDENTIALS" -v $GOOGLE_APPLICATION_CREDENTIALS:$GOOGLE_APPLICATION_CREDENTIALS -e LDAP_USER_HOST="$LDAP_USER_HOST" -e tag_operation="update" -e log_level="INFO" -v "/etc/localtime":"/etc/localtime" "quay.io/cloud-governance/cloud-governance:latest"

  ```



  ```shell
  cp example.yaml env.yaml
  ```

  Added the supported environment variables.
  example:

  ```yaml
  policy: instance_idle
  AWS_ACCESS_KEY_ID: ""
  AWS_SECRET_ACCESS_KEY: ""
  ```

  ```shell
  podman run --rm --name cloud-governance \
  -v "${PWD}/env.yaml":"/tmp/env.yaml" \
  "quay.io/cloud-governance/cloud-governance:latest"
  ```





  Job Pod: [cloud-governance.yaml](pod_yaml/cloud-governance.yaml)

  Configmaps: [cloud_governance_configmap.yaml](pod_yaml/cloud_governance_configmap.yaml)

  Quay.io Secret: [quayio_secret.sh](pod_yaml/quayio_secret.sh)

  AWS Secret: [cloud_governance_secret.yaml](pod_yaml/cloud_governance_secret.yaml)

      * Need to convert secret key to base64 [run_base64.py](pod_yaml/run_base64.py)





  ```sh
  python3 -m venv governance
  source governance/bin/activate
  (governance) $ python -m pip install --upgrade pip
  (governance) $ pip install coverage
  (governance) $ pip install pytest
  (governance) $ git clone https://github.com/redhat-performance/cloud-governance
  (governance) $ cd cloud-governance
  (governance) $ coverage run -m pytest
  (governance) $ deactivate
  rm -rf *governance*
  ```





  ```sh
  sudo podman rmi quay.io/cloud-governance/cloud-governance
  ```


pkgId: 9849d01b22dd51e20e024de91d72d0be0179d8410b7c6251ce76299d62b13cd7
name: python-cloud-governance
arch: src
version: 1.1.326
epoch: 0
release: 1
summary: Cloud Governance Tool
url: https://github.com/redhat-performance/cloud-governance
rpm_license: Apache License 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-governance-1.1.326-1.src.rpm
checksum_type: sha256
description:
  [![PyPI Latest Release](https://img.shields.io/pypi/v/cloud-governance.svg)](https://pypi.org/project/cloud-governance/)
  [![Container Repository on Quay](https://quay.io/repository/projectquay/quay/status "Container Repository on Quay")](https://quay.io/repository/cloud-governance/cloud-governance?tab=tags)
  [![Actions Status](https://github.com/redhat-performance/cloud-governance/actions/workflows/Build.yml/badge.svg)](https://github.com/redhat-performance/cloud-governance/actions)[![Coverage Status](https://coveralls.io/repos/github/redhat-performance/cloud-governance/badge.svg?branch=main)](https://coveralls.io/github/redhat-performance/cloud-governance?branch=main)
  [![Documentation Status](https://readthedocs.org/projects/cloud-governance/badge/?version=latest)](https://cloud-governance.readthedocs.io/en/latest/?badge=latest)
  [![python](https://img.shields.io/pypi/pyversions/cloud-governance.svg?color=%2334D058)](https://pypi.org/project/cloud-governance)
  [![License](https://img.shields.io/pypi/l/cloud-governance.svg)](https://github.com/redhat-performance/cloud-governance/blob/main/LICENSE)



  ![](images/cloud_governance.png)



  **Cloud Governance** tool provides a lightweight and flexible framework for deploying cloud management policies focusing
  on cost optimize and security.
  We have implemented several pruning policies. \
  When monitoring the resources, we found that most of the cost leakage is from available volumes, unused NAT gateways,
  and unattached Public IPv4 addresses (Starting from February 2024, public IPv4 addresses are chargeable whether they are
  used or not).

  | Providers | Disks   | NatGateway | PublicIp | Snapshots | InstanceIdle | TagResources | EC2Stop | ocp_cleanup | ClusterRun | EmptyBucket | EmptyRoles |
  |-----------|---------|------------|----------|-----------|--------------|--------------|---------|-------------|------------|-------------|------------|
  | AWS       | &check; | &check;    | &check;  | &check;   | &check;      | &check;      | &check; | &check;     | &check;    | &check;     | &check;    |
  | Azure     | &check; | &check;    | &check;  | &check;   | &check;      | &cross;      | &cross; | &cross;     | &check;    | &cross;     | &cross;    |

  List of Policies:



  - instance_idle
  - instance_run
  - unattached_volume
  - zombie_cluster_resource
  - ip_unattached
  - zombie_snapshots
  - unused_nat_gateway
  - s3_inactive
  - empty_roles
  - tag_resources
  - tag_iam_user
  - cost_over_usage
  - cluster_run



  - instance_idle
  - unattached_volume
  - ip_unattached
  - unused_nat_gateway



  - tag_baremetal
  - tag_vm
  - tag_resources

  Check out policy summary [here!](POLICIES.md)

  ![](images/cloud_governance1.png)
  ![](images/demo.gif)

  Reference:

  * Checkout
    blog: [Optimizing cloud resource management with cloud governance](https://www.redhat.com/en/blog/optimizing-cloud-resource-management-cloud-governance)
  * The cloud-governance package is placed in [PyPi](https://pypi.org/project/cloud-governance/)
  * The cloud-governance container image is placed in [Quay.io](https://quay.io/repository/ebattat/cloud-governance)
  * The cloud-governance readthedocs link is [ReadTheDocs](https://cloud-governance.readthedocs.io/en/latest/)

  [//]: # (  ![]&#40;images/cloud_governance3.png&#41;)

  _**Table of Contents**_

  <!-- TOC -->

  - [Installation](#installation)
  - [Configuration](#environment-variables-configurations)
  - [Run Policies](#run-policies)
  - [Run Policy Using Pod](#run-policy-using-pod)
  - [Pytest](#pytest)
  - [Post Installation](#post-installation)

  <!-- /TOC -->





  ```sh
  podman pull quay.io/cloud-governance/cloud-governance
  ```



  | Key                            | Value    | Description                                                                 |
  |--------------------------------|----------|:----------------------------------------------------------------------------|
  | AWS_ACCESS_KEY_ID              | required | AWS access key                                                              |
  | AWS_SECRET_ACCESS_KEY          | required | AWS Secret key                                                              |
  | AWS_DEFAULT_REGION             | required | AWS Region, default set to us-east-2                                        |
  | BUCKET_NAME                    | optional | Cloud bucket Name, to store data                                            |
  | policy                         | required | check [here](POLICIES.md) for policies list                                 |
  | dry_run                        | optional | default set to "yes", supported only two: yes/ no                           |
  | log_level                      | optional | default set to INFO                                                         |
  | LDAP_HOST_NAME                 | optional | ldap hostnames                                                              |
  | es_host                        | optional | Elasticsearch Host                                                          |
  | es_port                        | optional | Elasticsearch Port                                                          |
  | es_index                       | optional | Elasticsearch Index, to push the data. default to cloud-governance-es-index |
  | GOOGLE_APPLICATION_CREDENTIALS | optional | GCP creds, to access google resources. i.e Sheets, Docs                     |
  | AZURE_CLIENT_SECRET            | required | Azure Client Secret                                                         |
  | AZURE_TENANT_ID                |          | Azure Tenant Id                                                             |
  | AZURE_ACCOUNT_ID               |          | Azure Account Id                                                            |
  | AZURE_CLIENT_ID                |          | Azure Client Id                                                             |
  | GCP_DATABASE_NAME              |          | GCP BigQuery database name, used to generate cost reports                   |
  | GCP_DATABASE_TABLE_NAME        |          | GCP BigQuery TableName, used to generate cost reports                       |
  | IBM_API_USERNAME               |          | IBM Account Username                                                        |
  | IBM_API_KEY                    |          | IBM Account Classic Infrastructure key                                      |
  | IBM_CLOUD_API_KEY              |          | IBM Cloud API Key                                                           |
  | IBM_CUSTOM_TAGS_LIST           |          | pass string with separated with comma. i.e: "cost-center: test, env: test"  |



  Create IAM User with Read/Delete Permissions and create S3 bucket.

  - Follow the instructions [README.md](iam/clouds/aws/CloudGovernanceInfra/README.md).



  * Create classic infrastructure API key
  * Create IBM CLOUD API key to use tag_resources policy





  - Passing environment variables

  ```shell
    podman run --rm --name cloud-governance \
    -e policy="zombie_cluster_resource" \
    -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
    -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
    -e AWS_DEFAULT_REGION="us-east-2" \
    -e dry_run="yes"  \
     "quay.io/cloud-governance/cloud-governance"
  ```

  - Using involvement file config
  - Create env.yaml file, and mount it to /tmp/env.yaml else mount to anypath and pass env DEFAULT_CONFIG_PATH where you
    mounted

  ```yaml
  AWS_ACCESS_KEY_ID: ""
  AWS_SECRET_ACCESS_KEY: ""
  AWS_DEFAULT_REGION: "us-east-2"
  policy: "zombie_cluster_resource"
  dry_run: "yes"
  es_host: ""
  es_port: ""
  es_index: ""
  ```

  ```shell
    podman run --rm --name cloud-governance \
    -v "env.yaml":"/tmp/env.yaml" \
    --net="host" \
     "quay.io/cloud-governance/cloud-governance"
  ```





  Job Pod: [cloud-governance.yaml](pod_yaml/cloud-governance.yaml)

  Configmaps: [cloud_governance_configmap.yaml](pod_yaml/cloud_governance_configmap.yaml)

  Quay.io Secret: [quayio_secret.sh](pod_yaml/quayio_secret.sh)

  AWS Secret: [cloud_governance_secret.yaml](pod_yaml/cloud_governance_secret.yaml)

      * Need to convert secret key to base64 [run_base64.py](pod_yaml/run_base64.py)





  ```sh
  python3 -m venv governance
  source governance/bin/activate
  (governance) $ python -m pip install --upgrade pip
  (governance) $ pip install coverage
  (governance) $ pip install pytest
  (governance) $ git clone https://github.com/redhat-performance/cloud-governance
  (governance) $ cd cloud-governance
  (governance) $ coverage run -m pytest
  (governance) $ deactivate
  rm -rf *governance*
  ```





  ```sh
  sudo podman rmi quay.io/cloud-governance/cloud-governance
  ```


pkgId: 5171413231a9e46b9c1e1047d6256ab2e7a5ddc6dc44aea75c6bfe5ceefddefc
name: python-cloud-pak-operations-cli
arch: src
version: 0.7.3
epoch: 0
release: 1
summary: IBM Cloud Pak Operations CLI
url: https://pypi.org/project/cloud-pak-operations-cli/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-pak-operations-cli-0.7.3-1.src.rpm
checksum_type: sha256
description:
  <div align="center">
      <p>
          <a href="https://github.com/IBM/cloud-pak-operations-cli/blob/master/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/IBM/cloud-pak-operations-cli?style=for-the-badge"></a>
  	    <a href="https://github.com/IBM/cloud-pak-operations-cli/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/IBM/cloud-pak-operations-cli?style=for-the-badge"></a>
          <a href="https://github.com/IBM/cloud-pak-operations-cli/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/IBM/cloud-pak-operations-cli?style=for-the-badge"></a>
          <a href="https://github.com/IBM/cloud-pak-operations-cli/actions?query=workflow%3A%22Python+Testing%22+branch%3Amaster"><img alt="GitHub Workflow Status (branch)" src="https://img.shields.io/github/actions/workflow/status/IBM/cloud-pak-operations-cli/python-package.yml?branch=master&style=for-the-badge"></a>
      </p>
  </div>

  The IBM Cloud Pak Operations CLI provides basic functionality to manage Red Hat OpenShift clusters and IBM Cloud Pak for Data on various cloud platforms on top of the OpenShift CLI (oc) and the [IBM Cloud Pak for Data CLI](https://github.com/IBM/cpd-cli) (cpd-cli).

  Documentation can be found [here](https://ibm.github.io/cloud-pak-operations-cli/).


pkgId: 5648a5fff91f56957a6bdfc443ef2c9226c63bf77800efc08a40005e573b1846
name: python-cloud-radar
arch: src
version: 0.12.0
epoch: 0
release: 1
summary: Run functional tests on cloudformation stacks.
url: https://github.com/DontShaveTheYak/cloud-radar
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-radar-0.12.0-1.src.rpm
checksum_type: sha256
description:
  <!-- PROJECT SHIELDS -->
  <!--
  *** I'm using markdown "reference style" links for readability.
  *** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
  *** See the bottom of this document for the declaration of the reference variables
  *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
  *** https://www.markdownguide.org/basic-syntax/#reference-style-links
  -->
  [![Python][python-shield]][pypi-url]
  [![Latest][version-shield]][pypi-url]
  [![Tests][test-shield]][test-url]
  [![Coverage][codecov-shield]][codecov-url]
  [![License][license-shield]][license-url]
  <!-- [![Contributors][contributors-shield]][contributors-url]
  [![Forks][forks-shield]][forks-url]
  [![Stargazers][stars-shield]][stars-url]
  [![Issues][issues-shield]][issues-url] -->

  <!-- PROJECT LOGO -->
  <br />
  <p align="center">
    <!-- <a href="https://github.com/DontShaveTheYak/cloud-radar">
      <img src="images/logo.png" alt="Logo" width="80" height="80">
    </a> -->

    <h3 align="center">Cloud-Radar</h3>

    <p align="center">
      Write unit and functional tests for AWS Cloudformation.
      <!-- <br />
      <a href="https://github.com/DontShaveTheYak/cloud-radar"><strong>Explore the docs »</strong></a>
      <br /> -->
      <br />
      <!-- <a href="https://github.com/DontShaveTheYak/cloud-radar">View Demo</a>
      · -->
      <a href="https://github.com/DontShaveTheYak/cloud-radar/issues">Report Bug</a>
      ·
      <a href="https://github.com/DontShaveTheYak/cloud-radar/issues">Request Feature</a>
      ·
      <a href="https://la-tech.co/post/hypermodern-cloudformation/getting-started/">Guide</a>
    </p>
  </p>



  <!-- TABLE OF CONTENTS -->
  <details open="open">
    <summary>Table of Contents</summary>
    <ol>
      <li>
        <a href="#about-the-project">About The Project</a>
        <ul>
          <li><a href="#built-with">Built With</a></li>
        </ul>
      </li>
      <li>
        <a href="#getting-started">Getting Started</a>
        <ul>
          <li><a href="#prerequisites">Prerequisites</a></li>
          <li><a href="#installation">Installation</a></li>
        </ul>
      </li>
      <li><a href="#usage">Usage</a></li>
      <li><a href="#roadmap">Roadmap</a></li>
      <li><a href="#contributing">Contributing</a></li>
      <li><a href="#license">License</a></li>
      <li><a href="#contact">Contact</a></li>
      <li><a href="#acknowledgements">Acknowledgements</a></li>
    </ol>
  </details>



  <!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) -->

  Cloud-Radar is a python module that allows testing of Cloudformation Templates/Stacks using Python.



  You can now unit test the logic contained inside your Cloudformation template. Cloud-Radar takes your template, the desired region and some parameters. We render the template into its final state and pass it back to you.

  You can Test:
  * That Conditionals in your template evaluate to the correct value.
  * Conditional resources were created or not.
  * That resources have the correct properties.
  * That resources are named as expected because of `!Sub`.

  You can test all this locally without worrying about AWS Credentials.

  A number of these tests can be configured in a common way to apply to all templates through the use of the [hooks](./examples/unit/hooks/README.md) functionality.



  This project is a wrapper around Taskcat. Taskcat is a great tool for ensuring your Cloudformation Template can be deployed in multiple AWS Regions. Cloud-Radar enhances Taskcat by making it easier to write more complete functional tests.

  Here's How:
  * You can interact with the deployed resources directly with tools you already know like boto3.
  * You can control the lifecycle of the stack. This allows testing if resources were retained after the stacks were deleted.
  * You can run tests without hardcoding them in a taskcat config file.

  This project is new and it's possible not all features or functionality of Taskcat/Cloudformation are supported (see [Roadmap](#roadmap)). If you find something missing or have a use case that isn't covered then please let me know =)



  * [Taskcat](https://github.com/aws-quickstart/taskcat)
  * [cfn_tools from cfn-flip](https://github.com/awslabs/aws-cfn-template-flip)



  Cloud-Radar is available as an easy to install pip package.



  Cloud-Radar requires python >= 3.8



  1. Install with pip.
     ```sh
     pip install cloud-radar
     ```


  <details>
  <summary>Unit Testing <span style='font-size: .67em'>(Click to expand)</span></summary>

  Using Cloud-Radar starts by importing it into your test file or framework. We will use this [Template](./tests/templates/log_bucket/log_bucket.yaml) for an example shown below. More scenario based examples are currently being built up in the [examples/unit](./examples/unit) directory of this project.

  ```python
  from pathlib import Path
  from cloud_radar.cf.unit import Template

  template_path = Path("tests/templates/log_bucket/log_bucket.yaml")


  template = Template.from_yaml(template_path.resolve())

  params = {"BucketPrefix": "testing", "KeepBucket": "TRUE"}


  stack = template.create_stack(params, region="us-west-2")

  stack.no_resource("LogsBucket")

  bucket = stack.get_resource("RetainLogsBucket")

  assert "DeletionPolicy" in bucket

  assert bucket["DeletionPolicy"] == "Retain"

  bucket_name = bucket.get_property_value("BucketName")

  assert "us-west-2" in bucket_name
  ```

  The AWS [pseudo parameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html) are all class attributes and can be modified before rendering a template.
  ```python

  Template.AccountId = '8675309'
  ```
  _Note: Region should only be changed to change the default value. To change the region during testing pass the desired region to render(region='us-west-2')_

  The default values for pseudo parameters:

  | Name             | Default Value   |
  | ---------------- | --------------- |
  | AccountId        | "555555555555"  |
  | NotificationARNs | []              |
  | **NoValue**      | ""              |
  | **Partition**    | "aws"           |
  | Region           | "us-east-1"     |
  | **StackId**      | ""              |
  | **StackName**    | ""              |
  | **URLSuffix**    | "amazonaws.com" |
  _Note: Bold variables are not fully implemented yet see the [Roadmap](#roadmap)_

  At the point of creating the `Template` instance additional configuration is required to be provided if you are using certain approaches to resolving values.

  If you use [Fn::ImportValue](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html), a dictionary of key/value pairs is required containing all the keys that your template uses. If an import name is referenced by the template which is not included in this dictionary, an error will be raised.

  ```
  imports = {
    "FakeKey": "FakeValue"
  }

  template = Template(template_content, imports=imports)
  ```

  If you use [Dynamic References](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html), a dictionary containing the service and key/value pairs is required containing all the dynamic references that your template uses. If a dynamic reference is included in the template and not contained in the configuration object, an error will be raised.

  ```
  template_content = {
      "Resources": {
          "Foo": {
              "Type": "AWS::IAM::Policy",
              "Properties": {
                  "PolicyName": (
                      "mgt-{{resolve:ssm:/account/current/short_name}}-launch-role-pol"
                  ),
              },
          },
      },
  }

  dynamic_references = {
    "ssm": {
      "/account/current/short_name": "dummy"
    }
  }

  template = Template(template_content, dynamic_references=dynamic_references)
  ```

  A real unit testing example using Pytest can be seen [here](./tests/test_cf/test_examples/test_unit.py)

  </details>

  <details>
  <summary>Functional Testing <span style='font-size: .67em'>(Click to expand)</span></summary>
  Using Cloud-Radar starts by importing it into your test file or framework.

  ```python
  from pathlib import Path

  from cloud_radar.cf.e2e import Stack


  template_path = Path("tests/templates/log_bucket/log_bucket.yaml")
  params = {"BucketPrefix": "testing", "KeepBucket": "False"}
  regions = ['us-west-2']




  with Stack(template_path, params, regions) as stacks:
      

      for stack in stacks:
          
          

          print(f"Testing {stack.name}")

          bucket_name = ""

          for output in stack.outputs:

              if output.key == "LogsBucketName":
                  bucket_name = output.value
                  break

          assert "logs" in bucket_name

          assert stack.region.name in bucket_name

          print(f"Created bucket: {bucket_name}")


  ```

  You can use taskcat [tokens](https://aws.amazon.com/blogs/infrastructure-and-automation/a-deep-dive-into-testing-with-taskcat/) in your parameter values.

  ```python
  parameters = {
    "BucketPrefix": "taskcat-$[taskcat_random-string]",
    "KeepBucket": "FALSE",
  }
  ```

  You can skip the context manager. Here is an example for `unittest`

  ```python
  import unittest

  from cloud-radar.cf.e2e import Stack

  class TestLogBucket(unittest.TestCase):
      @classmethod
      def setUpClass(cls):
          template_path = Path("tests/templates/log_bucket/log_bucket.yaml")
          cls.test = Stack(template_path)
          cls.test.create()

      @classmethod
      def tearDownClass(cls):
          cls.test.delete()

      def test_bucket(self):
          stacks = self.__class__.test.stacks

          for stack in stacks:
              
  ```

  All the properties and methods of a [stack instance](https://github.com/aws-quickstart/taskcat/blob/main/taskcat/_cfn/stack.py#L188).

  A real functional testing example using Pytest can be seen [here](./tests/test_cf/test_examples/test_functional.py)

  </details>




  - Add Logo
  - Easier to pick regions for testing


  - Add full functionality to pseudo variables.
    * Variables like `Partition`, `URLSuffix` should change if the region changes.
    * Variables like `StackName` and `StackId` should have a better default than ""
  - Handle References to resources that shouldn't exist.
    * It's currently possible that a `!Ref` to a Resource stays in the final template even if that resource is later removed because of a conditional.


  - Add the ability to update a stack instance to Taskcat.

  See the [open issues](https://github.com/DontShaveTheYak/cloud-radar/issues) for a list of proposed features (and known issues).



  Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

  This project uses poetry to manage dependencies and pre-commit to run formatting, linting and tests. You will need to have both installed to your system as well as python 3.9.

  1. Fork the Project
  2. Setup environment (`poetry install`)
  3. Setup commit hooks (`pre-commit install`)
  2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
  3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
  4. Push to the Branch (`git push origin feature/AmazingFeature`)
  5. Open a Pull Request



  Distributed under the Apache-2.0 License. See [LICENSE.txt](./LICENSE.txt) for more information.



  Levi - [@shady_cuz](https://twitter.com/shady_cuz)

  <!-- ACKNOWLEDGEMENTS -->

  * [Taskcat](https://aws-quickstart.github.io/taskcat/)
  * [Hypermodern Python](https://cjolowicz.github.io/posts/hypermodern-python-01-setup/)
  * [Best-README-Template](https://github.com/othneildrew/Best-README-Template)
  * @dhutchison - He was the first contributor to this project and finished the last couple of features to make this project complete. Thank you!

  <!-- MARKDOWN LINKS & IMAGES -->
  <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
  [python-shield]: https://img.shields.io/pypi/pyversions/cloud-radar?style=for-the-badge
  [version-shield]: https://img.shields.io/pypi/v/cloud-radar?label=latest&style=for-the-badge
  [pypi-url]: https://pypi.org/project/cloud-radar/
  [test-shield]: https://img.shields.io/github/actions/workflow/status/DontShaveTheYak/cloud-radar/test.yml?label=Tests&style=for-the-badge
  [test-url]: https://github.com/DontShaveTheYak/cloud-radar/actions?query=workflow%3ATests+branch%3Amaster
  [codecov-shield]: https://img.shields.io/codecov/c/gh/DontShaveTheYak/cloud-radar?color=green&style=for-the-badge&token=NE5C92139X
  [codecov-url]: https://codecov.io/gh/DontShaveTheYak/cloud-radar
  [contributors-shield]: https://img.shields.io/github/contributors/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [contributors-url]: https://github.com/DontShaveTheYak/cloud-radar/graphs/contributors
  [forks-shield]: https://img.shields.io/github/forks/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [forks-url]: https://github.com/DontShaveTheYak/cloud-radar/network/members
  [stars-shield]: https://img.shields.io/github/stars/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [stars-url]: https://github.com/DontShaveTheYak/cloud-radar/stargazers
  [issues-shield]: https://img.shields.io/github/issues/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [issues-url]: https://github.com/DontShaveTheYak/cloud-radar/issues
  [license-shield]: https://img.shields.io/github/license/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [license-url]: https://github.com/DontShaveTheYak/cloud-radar/blob/master/LICENSE.txt
  [product-screenshot]: images/screenshot.png


pkgId: 200c8c166a1853e60d634f58fab9cecb55d3c862392330d004d482a901999189
name: python-cloud-radar
arch: src
version: 0.13.2
epoch: 0
release: 1
summary: Run functional tests on cloudformation stacks.
url: https://github.com/DontShaveTheYak/cloud-radar
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-radar-0.13.2-1.src.rpm
checksum_type: sha256
description:
  <!-- PROJECT SHIELDS -->
  <!--
  *** I'm using markdown "reference style" links for readability.
  *** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
  *** See the bottom of this document for the declaration of the reference variables
  *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
  *** https://www.markdownguide.org/basic-syntax/#reference-style-links
  -->
  [![Python][python-shield]][pypi-url]
  [![Latest][version-shield]][pypi-url]
  [![Tests][test-shield]][test-url]
  [![Coverage][codecov-shield]][codecov-url]
  [![License][license-shield]][license-url]
  <!-- [![Contributors][contributors-shield]][contributors-url]
  [![Forks][forks-shield]][forks-url]
  [![Stargazers][stars-shield]][stars-url]
  [![Issues][issues-shield]][issues-url] -->

  <!-- PROJECT LOGO -->
  <br />
  <p align="center">
    <!-- <a href="https://github.com/DontShaveTheYak/cloud-radar">
      <img src="images/logo.png" alt="Logo" width="80" height="80">
    </a> -->

    <h3 align="center">Cloud-Radar</h3>

    <p align="center">
      Write unit and functional tests for AWS Cloudformation.
      <!-- <br />
      <a href="https://github.com/DontShaveTheYak/cloud-radar"><strong>Explore the docs »</strong></a>
      <br /> -->
      <br />
      <!-- <a href="https://github.com/DontShaveTheYak/cloud-radar">View Demo</a>
      · -->
      <a href="https://github.com/DontShaveTheYak/cloud-radar/issues">Report Bug</a>
      ·
      <a href="https://github.com/DontShaveTheYak/cloud-radar/issues">Request Feature</a>
      ·
      <a href="https://la-tech.co/post/hypermodern-cloudformation/getting-started/">Guide</a>
    </p>
  </p>



  <!-- TABLE OF CONTENTS -->
  <details open="open">
    <summary>Table of Contents</summary>
    <ol>
      <li>
        <a href="#about-the-project">About The Project</a>
        <ul>
          <li><a href="#built-with">Built With</a></li>
        </ul>
      </li>
      <li>
        <a href="#getting-started">Getting Started</a>
        <ul>
          <li><a href="#prerequisites">Prerequisites</a></li>
          <li><a href="#installation">Installation</a></li>
        </ul>
      </li>
      <li><a href="#usage">Usage</a></li>
      <li><a href="#roadmap">Roadmap</a></li>
      <li><a href="#contributing">Contributing</a></li>
      <li><a href="#license">License</a></li>
      <li><a href="#contact">Contact</a></li>
      <li><a href="#acknowledgements">Acknowledgements</a></li>
    </ol>
  </details>



  <!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) -->

  Cloud-Radar is a python module that allows testing of Cloudformation Templates/Stacks using Python.



  You can now unit test the logic contained inside your Cloudformation template. Cloud-Radar takes your template, the desired region and some parameters. We render the template into its final state and pass it back to you.

  You can Test:
  * That Conditionals in your template evaluate to the correct value.
  * Conditional resources were created or not.
  * That resources have the correct properties.
  * That resources are named as expected because of `!Sub`.

  You can test all this locally without worrying about AWS Credentials.

  A number of these tests can be configured in a common way to apply to all templates through the use of the [hooks](./examples/unit/hooks/README.md) functionality.



  This project is a wrapper around Taskcat. Taskcat is a great tool for ensuring your Cloudformation Template can be deployed in multiple AWS Regions. Cloud-Radar enhances Taskcat by making it easier to write more complete functional tests.

  Here's How:
  * You can interact with the deployed resources directly with tools you already know like boto3.
  * You can control the lifecycle of the stack. This allows testing if resources were retained after the stacks were deleted.
  * You can run tests without hardcoding them in a taskcat config file.

  This project is new and it's possible not all features or functionality of Taskcat/Cloudformation are supported (see [Roadmap](#roadmap)). If you find something missing or have a use case that isn't covered then please let me know =)



  * [Taskcat](https://github.com/aws-quickstart/taskcat)
  * [cfn_tools from cfn-flip](https://github.com/awslabs/aws-cfn-template-flip)



  Cloud-Radar is available as an easy to install pip package.



  Cloud-Radar requires python >= 3.8



  1. Install with pip.
     ```sh
     pip install cloud-radar
     ```


  <details>
  <summary>Unit Testing <span style='font-size: .67em'>(Click to expand)</span></summary>

  Using Cloud-Radar starts by importing it into your test file or framework. We will use this [Template](./tests/templates/log_bucket/log_bucket.yaml) for an example shown below. More scenario based examples are currently being built up in the [examples/unit](./examples/unit) directory of this project.

  ```python
  from pathlib import Path
  from cloud_radar.cf.unit import Template

  template_path = Path("tests/templates/log_bucket/log_bucket.yaml")


  template = Template.from_yaml(template_path.resolve())

  params = {"BucketPrefix": "testing", "KeepBucket": "TRUE"}


  stack = template.create_stack(params, region="us-west-2")

  stack.no_resource("LogsBucket")

  bucket = stack.get_resource("RetainLogsBucket")

  assert "DeletionPolicy" in bucket

  assert bucket["DeletionPolicy"] == "Retain"

  bucket_name = bucket.get_property_value("BucketName")

  assert "us-west-2" in bucket_name
  ```

  The AWS [pseudo parameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html) are all class attributes and can be modified before rendering a template.
  ```python

  Template.AccountId = '8675309'
  ```
  _Note: Region should only be changed to change the default value. To change the region during testing pass the desired region to render(region='us-west-2')_

  The default values for pseudo parameters:

  | Name             | Default Value   |
  | ---------------- | --------------- |
  | AccountId        | "555555555555"  |
  | NotificationARNs | []              |
  | **NoValue**      | ""              |
  | **Partition**    | "aws"           |
  | Region           | "us-east-1"     |
  | **StackId**      | ""              |
  | **StackName**    | ""              |
  | **URLSuffix**    | "amazonaws.com" |
  _Note: Bold variables are not fully implemented yet see the [Roadmap](#roadmap)_

  At the point of creating the `Template` instance additional configuration is required to be provided if you are using certain approaches to resolving values.

  If you use [Fn::ImportValue](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html), a dictionary of key/value pairs is required containing all the keys that your template uses. If an import name is referenced by the template which is not included in this dictionary, an error will be raised.

  ```
  imports = {
    "FakeKey": "FakeValue"
  }

  template = Template(template_content, imports=imports)
  ```

  If you use [Dynamic References](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html), a dictionary containing the service and key/value pairs is required containing all the dynamic references that your template uses. If a dynamic reference is included in the template and not contained in the configuration object, an error will be raised.

  ```
  template_content = {
      "Resources": {
          "Foo": {
              "Type": "AWS::IAM::Policy",
              "Properties": {
                  "PolicyName": (
                      "mgt-{{resolve:ssm:/account/current/short_name}}-launch-role-pol"
                  ),
              },
          },
      },
  }

  dynamic_references = {
    "ssm": {
      "/account/current/short_name": "dummy"
    }
  }

  template = Template(template_content, dynamic_references=dynamic_references)
  ```

  A real unit testing example using Pytest can be seen [here](./tests/test_cf/test_examples/test_unit.py)

  </details>

  <details>
  <summary>Functional Testing <span style='font-size: .67em'>(Click to expand)</span></summary>
  Using Cloud-Radar starts by importing it into your test file or framework.

  ```python
  from pathlib import Path

  from cloud_radar.cf.e2e import Stack


  template_path = Path("tests/templates/log_bucket/log_bucket.yaml")
  params = {"BucketPrefix": "testing", "KeepBucket": "False"}
  regions = ['us-west-2']




  with Stack(template_path, params, regions) as stacks:
      

      for stack in stacks:
          
          

          print(f"Testing {stack.name}")

          bucket_name = ""

          for output in stack.outputs:

              if output.key == "LogsBucketName":
                  bucket_name = output.value
                  break

          assert "logs" in bucket_name

          assert stack.region.name in bucket_name

          print(f"Created bucket: {bucket_name}")


  ```

  You can use taskcat [tokens](https://aws.amazon.com/blogs/infrastructure-and-automation/a-deep-dive-into-testing-with-taskcat/) in your parameter values.

  ```python
  parameters = {
    "BucketPrefix": "taskcat-$[taskcat_random-string]",
    "KeepBucket": "FALSE",
  }
  ```

  You can skip the context manager. Here is an example for `unittest`

  ```python
  import unittest

  from cloud-radar.cf.e2e import Stack

  class TestLogBucket(unittest.TestCase):
      @classmethod
      def setUpClass(cls):
          template_path = Path("tests/templates/log_bucket/log_bucket.yaml")
          cls.test = Stack(template_path)
          cls.test.create()

      @classmethod
      def tearDownClass(cls):
          cls.test.delete()

      def test_bucket(self):
          stacks = self.__class__.test.stacks

          for stack in stacks:
              
  ```

  All the properties and methods of a [stack instance](https://github.com/aws-quickstart/taskcat/blob/main/taskcat/_cfn/stack.py#L188).

  A real functional testing example using Pytest can be seen [here](./tests/test_cf/test_examples/test_functional.py)

  </details>




  - Add Logo
  - Easier to pick regions for testing


  - Add full functionality to pseudo variables.
    * Variables like `Partition`, `URLSuffix` should change if the region changes.
    * Variables like `StackName` and `StackId` should have a better default than ""
  - Handle References to resources that shouldn't exist.
    * It's currently possible that a `!Ref` to a Resource stays in the final template even if that resource is later removed because of a conditional.


  - Add the ability to update a stack instance to Taskcat.

  See the [open issues](https://github.com/DontShaveTheYak/cloud-radar/issues) for a list of proposed features (and known issues).



  Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

  This project uses poetry to manage dependencies and pre-commit to run formatting, linting and tests. You will need to have both installed to your system as well as python 3.12.

  1. Fork the Project
  2. Setup environment (`poetry install`)
  3. Setup commit hooks (`pre-commit install`)
  2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
  3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
  4. Push to the Branch (`git push origin feature/AmazingFeature`)
  5. Open a Pull Request



  Distributed under the Apache-2.0 License. See [LICENSE.txt](./LICENSE.txt) for more information.



  Levi - [@shady_cuz](https://twitter.com/shady_cuz)

  <!-- ACKNOWLEDGEMENTS -->

  * [Taskcat](https://aws-quickstart.github.io/taskcat/)
  * [Hypermodern Python](https://cjolowicz.github.io/posts/hypermodern-python-01-setup/)
  * [Best-README-Template](https://github.com/othneildrew/Best-README-Template)
  * @dhutchison - He was the first contributor to this project and finished the last couple of features to make this project complete. Thank you!

  <!-- MARKDOWN LINKS & IMAGES -->
  <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
  [python-shield]: https://img.shields.io/pypi/pyversions/cloud-radar?style=for-the-badge
  [version-shield]: https://img.shields.io/pypi/v/cloud-radar?label=latest&style=for-the-badge
  [pypi-url]: https://pypi.org/project/cloud-radar/
  [test-shield]: https://img.shields.io/github/actions/workflow/status/DontShaveTheYak/cloud-radar/test.yml?label=Tests&style=for-the-badge
  [test-url]: https://github.com/DontShaveTheYak/cloud-radar/actions?query=workflow%3ATests+branch%3Amaster
  [codecov-shield]: https://img.shields.io/codecov/c/gh/DontShaveTheYak/cloud-radar?color=green&style=for-the-badge&token=NE5C92139X
  [codecov-url]: https://codecov.io/gh/DontShaveTheYak/cloud-radar
  [contributors-shield]: https://img.shields.io/github/contributors/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [contributors-url]: https://github.com/DontShaveTheYak/cloud-radar/graphs/contributors
  [forks-shield]: https://img.shields.io/github/forks/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [forks-url]: https://github.com/DontShaveTheYak/cloud-radar/network/members
  [stars-shield]: https://img.shields.io/github/stars/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [stars-url]: https://github.com/DontShaveTheYak/cloud-radar/stargazers
  [issues-shield]: https://img.shields.io/github/issues/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [issues-url]: https://github.com/DontShaveTheYak/cloud-radar/issues
  [license-shield]: https://img.shields.io/github/license/DontShaveTheYak/cloud-radar.svg?style=for-the-badge
  [license-url]: https://github.com/DontShaveTheYak/cloud-radar/blob/master/LICENSE.txt
  [product-screenshot]: images/screenshot.png


pkgId: d2e0b5e5c4f6db34eb07bf787955da7099b589b8968e4187ccc05b9bbd176256
name: python-cloud-select-tool
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: Tool for calculating costs and needs between cloud and HPC.
url: https://github.com/converged-computing/cloud-select
rpm_license: LICENSE
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-select-tool-0.1.0-1.src.rpm
checksum_type: sha256
description:
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
  [![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
  [![PyPI](https://img.shields.io/pypi/v/cloud-select-tool)](https://pypi.org/project/cloud-select-tool/)

  <a target="_blank" rel="noopener noreferrer" href="https://github.com/converged-computing/cloud-select/blob/main/docs/assets/img/logo-transparent.png">
      <img align="right" style="width: 250px; float: right; padding-left: 20px;" src="https://github.com/converged-computing/cloud-select/raw/main/docs/assets/img/logo-transparent.png" alt="Cloud Select Logo">
  </a>

  This is a tool that helps a user select a cloud. It will make it easy for an HPC user to say:

  > I need 4 nodes with these criteria, to run in the cloud.

  And then be given a set of options and prices for different clouds to choose from.
  There are some supporting packages that exist already (in Go for AWS) so we will
  start there.

  🚧️ **under development** 🚧️

  This tool is under development and is not ready for production use. See our

   - ⭐️ [Documentation](https://converged-computing.github.io/cloud-select/) ⭐️
   - 📦️ [Pypi Package](https://pypi.org/project/cloud-select-tool/) 📦️



  - [ ] should cache be organized by region to allow easier filter (data for AWS doesn't have that attribute)
  - [ ] go through list of instance features and implement remaining for Google (if possible)



  These are either "nice to have" or small details we can improve upon. Aka, not top priority.

  - should we allow currency outside USD? Probably not for now.
  - could eventually support different resource types (beyond compute or types of prices, e.g., pre-emptible vs. on demand)
  - aws instance listing (based on regions) should validate regions - an invalid regions simply returns no results



  We use the [all-contributors](https://github.com/all-contributors/all-contributors)
  tool to generate a contributors graphic below.

  <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
  <!-- prettier-ignore-start -->
  <!-- markdownlint-disable -->
  <table>
    <tbody>
      <tr>
        <td align="center" valign="top" width="14.28%"><a href="https://vsoch.github.io"><img src="https://avatars.githubusercontent.com/u/814322?v=4?s=100" width="100px;" alt="Vanessasaurus"/><br /><sub><b>Vanessasaurus</b></sub></a><br /><a href="https://github.com/converged-computing/cloud-select/commits?author=vsoch" title="Code">💻</a></td>
        <td align="center" valign="top" width="14.28%"><a href="https://github.com/xorJane"><img src="https://avatars.githubusercontent.com/u/10688871?v=4?s=100" width="100px;" alt="Jane Herriman"/><br /><sub><b>Jane Herriman</b></sub></a><br /><a href="https://github.com/converged-computing/cloud-select/commits?author=xorJane" title="Code">💻</a></td>
      </tr>
    </tbody>
  </table>

  <!-- markdownlint-restore -->
  <!-- prettier-ignore-end -->

  <!-- ALL-CONTRIBUTORS-LIST:END -->



  HPCIC DevTools is distributed under the terms of the MIT license.
  All new contributions must be made under this license.

  See [LICENSE](https://github.com/converged-computing/cloud-select/blob/main/LICENSE),
  [COPYRIGHT](https://github.com/converged-computing/cloud-select/blob/main/COPYRIGHT), and
  [NOTICE](https://github.com/converged-computing/cloud-select/blob/main/NOTICE) for details.

  SPDX-License-Identifier: (MIT)

  LLNL-CODE- 842614


pkgId: 874697b49db96e0906cf27c2d41d2197f4a1122906162920683a8738af8fa501
name: python-cloud-sql-python-connector
arch: src
version: 1.12.0
epoch: 0
release: 1
url: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-sql-python-connector-1.12.0-1.src.rpm
checksum_type: sha256
summary:
  The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL database without having to manually allowlist IPs or manage SSL certificates.

description:
  <p align="center">
      <a href="https://cloud.google.com/blog/topics/developers-practitioners/how-connect-cloud-sql-using-python-easy-way">
          <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-sql-python-connector/main/docs/images/cloud-sql-python-connector.png" alt="cloud-sql-python-connector image">
      </a>
  </p>

  <h1 align="center">Cloud SQL Python Connector</h1>

  [![Open In Colab][colab-badge]][colab-notebook]
  [![CI][ci-badge]][ci-build]
  [![pypi][pypi-badge]][pypi-docs]
  [![PyPI download month][pypi-downloads]][pypi-docs]
  [![python][python-versions]][pypi-docs]

  [colab-badge]: https://colab.research.google.com/assets/colab-badge.svg
  [colab-notebook]: https://colab.research.google.com/github/GoogleCloudPlatform/cloud-sql-python-connector/blob/main/samples/notebooks/postgres_python_connector.ipynb
  [ci-badge]: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/actions/workflows/tests.yml/badge.svg?event=push
  [ci-build]: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/actions/workflows/tests.yml?query=event%3Apush+branch%3Amain
  [pypi-badge]: https://img.shields.io/pypi/v/cloud-sql-python-connector
  [pypi-docs]: https://pypi.org/project/cloud-sql-python-connector
  [pypi-downloads]: https://img.shields.io/pypi/dm/cloud-sql-python-connector.svg
  [python-versions]: https://img.shields.io/pypi/pyversions/cloud-sql-python-connector

  The _Cloud SQL Python Connector_ is a Cloud SQL connector designed for use with the
  Python language. Using a Cloud SQL connector provides a native alternative to the
  [Cloud SQL Auth Proxy](https://cloud.google.com/sql/docs/mysql/sql-proxy) while
  providing the following benefits:

  * **IAM Authorization:** uses IAM permissions to control who/what can connect to
    your Cloud SQL instances
  * **Improved Security:** uses robust, updated TLS 1.3 encryption and
    identity verification between the client connector and the server-side proxy,
    independent of the database protocol.
  * **Convenience:** removes the requirement to use and distribute SSL
    certificates, as well as manage firewalls or source/destination IP addresses.
  * (optionally) **IAM DB Authentication:** provides support for
    [Cloud SQL’s automatic IAM DB AuthN][iam-db-authn] feature.

  [iam-db-authn]: https://cloud.google.com/sql/docs/postgres/authentication

  The Cloud SQL Python Connector is a package to be used alongside a database driver.
  Currently supported drivers are:
   - [`pymysql`](https://github.com/PyMySQL/PyMySQL) (MySQL)
   - [`pg8000`](https://github.com/tlocke/pg8000) (PostgreSQL)
   - [`asyncpg`](https://github.com/MagicStack/asyncpg) (PostgreSQL)
   - [`pytds`](https://github.com/denisenkom/pytds) (SQL Server)




  You can install this library with `pip install`, specifying the driver
  based on your database dialect.


  ```
  pip install "cloud-sql-python-connector[pymysql]"
  ```

  There are two different database drivers that are supported for the Postgres dialect:


  ```
  pip install "cloud-sql-python-connector[pg8000]"
  ```

  ```
  pip install "cloud-sql-python-connector[asyncpg]"
  ```

  ```
  pip install "cloud-sql-python-connector[pytds]"
  ```



  This package requires the following to successfully make Cloud SQL Connections:

  - IAM principal (user, service account, etc.) with the
  [Cloud SQL Client][client-role] role. This IAM principal will be used for
  [credentials](#credentials).
  - The [Cloud SQL Admin API][admin-api] to be enabled within your Google Cloud
  Project. By default, the API will be called in the project associated with
  the IAM principal.

  [admin-api]: https://console.cloud.google.com/apis/api/sqladmin.googleapis.com
  [client-role]: https://cloud.google.com/sql/docs/mysql/roles-and-permissions



  This library uses the [Application Default Credentials (ADC)][adc] strategy for
  resolving credentials. Please see [these instructions for how to set your ADC][set-adc]
  (Google Cloud Application vs Local Development, IAM user vs service account credentials),
  or consult the [google.auth][google-auth] package.

  To explicitly set a specific source for the credentials, see
  [Configuring the Connector](#configuring-the-connector) below.

  [adc]: https://cloud.google.com/docs/authentication#adc
  [set-adc]: https://cloud.google.com/docs/authentication/provide-credentials-adc
  [google-auth]: https://google-auth.readthedocs.io/en/master/reference/google.auth.html



  This package provides several functions for authorizing and encrypting
  connections. These functions are used with your database driver to connect to
  your Cloud SQL instance.

  The instance connection name for your Cloud SQL instance is always in the
  format "project:region:instance".



  To connect to Cloud SQL using the connector, inititalize a `Connector`
  object and call its `connect` method with the proper input parameters.

  The `Connector` itself creates connection objects by calling its `connect` method but does not manage database connection pooling. For this reason, it is recommended to use the connector alongside a library that can create connection pools, such as [SQLAlchemy](https://www.sqlalchemy.org/). This will allow for connections to remain open and be reused, reducing connection overhead and the number of connections needed.

  In the Connector's `connect` method below, input your connection string as the first positional argument and the name of the database driver for the second positional argument. Insert the rest of your connection keyword arguments like user, password and database. You can also set the optional `timeout` or `ip_type` keyword arguments.

  To use this connector with SQLAlchemy, use the `creator` argument for `sqlalchemy.create_engine`:

  ```python
  from google.cloud.sql.connector import Connector
  import sqlalchemy


  connector = Connector()


  def getconn() -> pymysql.connections.Connection:
      conn: pymysql.connections.Connection = connector.connect(
          "project:region:instance",
          "pymysql",
          user="my-user",
          password="my-password",
          db="my-db-name"
      )
      return conn


  pool = sqlalchemy.create_engine(
      "mysql+pymysql://",
      creator=getconn,
  )
  ```

  The returned connection pool engine can then be used to query and modify the database.

  ```python

  insert_stmt = sqlalchemy.text(
      "INSERT INTO my_table (id, title) VALUES (:id, :title)",
  )

  with pool.connect() as db_conn:
      
      db_conn.execute(insert_stmt, parameters={"id": "book1", "title": "Book One"})

      
      result = db_conn.execute(sqlalchemy.text("SELECT * from my_table")).fetchall()

      
      db_conn.commit()

      
      for row in result:
          print(row)
  ```

  To close the `Connector` object's background resources, call its `close()` method as follows:

  ```python
  connector.close()
  ```

  > [!NOTE]
  >
  > For more examples of using SQLAlchemy to manage connection pooling with the connector,
  > please see [Cloud SQL SQLAlchemy Samples](https://cloud.google.com/sql/docs/postgres/connect-connectors#python_1).



  If you need to customize something about the connector, or want to specify
  defaults for each connection to make, you can initialize a
  `Connector` object as follows:

  ```python
  from google.cloud.sql.connector import Connector


  connector = Connector(
      ip_type="public",  # can also be "private" or "psc"
      enable_iam_auth=False,
      timeout=30,
      credentials=custom_creds, # google.auth.credentials.Credentials
      refresh_strategy="lazy",  # can be "lazy" or "background"
  )
  ```



  The `Connector` object can also be used as a context manager in order to
  automatically close and cleanup resources, removing the need for explicit
  calls to `connector.close()`.

  Connector as a context manager:

  ```python
  from google.cloud.sql.connector import Connector
  import pymysql
  import sqlalchemy


  def init_connection_pool(connector: Connector) -> sqlalchemy.engine.Engine:
      
      def getconn() -> pymysql.connections.Connection:
          conn = connector.connect(
              "project:region:instance",
              "pymysql",
              user="my-user",
              password="my-password",
              db="my-db-name"
          )
          return conn

      
      pool = sqlalchemy.create_engine(
          "mysql+pymysql://",
          creator=getconn,
      )
      return pool


  with Connector() as connector:
      
      pool = init_connection_pool(connector)
      
      insert_stmt = sqlalchemy.text(
          "INSERT INTO my_table (id, title) VALUES (:id, :title)",
      )

      
      with pool.connect() as db_conn:
          
          db_conn.execute(insert_stmt, parameters={"id": "book1", "title": "Book One"})

          
          db_conn.commit()

          
          result = db_conn.execute(sqlalchemy.text("SELECT * from my_table")).fetchall()

          
          for row in result:
              print(row)
  ```



  The Connector's `refresh_strategy` argument can be set to `"lazy"` to configure
  the Python Connector to retrieve connection info lazily and as-needed.
  Otherwise, a background refresh cycle runs to retrive the connection info
  periodically. This setting is useful in environments where the CPU may be
  throttled outside of a request context, e.g., Cloud Run, Cloud Functions, etc.

  To set the refresh strategy, set the `refresh_strategy` keyword argument when
  initializing a `Connector`:

  ```python
  connector = Connector(refresh_strategy="lazy")
  ```



  The Cloud SQL Python Connector can be used to connect to Cloud SQL instances
  using both public and private IP addresses, as well as
  [Private Service Connect][psc] (PSC). To specify which IP address type to connect
  with, set the `ip_type` keyword argument when initializing a `Connector()` or when
  calling `connector.connect()`.

  Possible values for `ip_type` are `"public"` (default value),
  `"private"`, and `"psc"`.

  Example:

  ```python
  conn = connector.connect(
      "project:region:instance",
      "pymysql",
      ip_type="private"  # use private IP
  ... insert other kwargs ...
  )
  ```

  > [!IMPORTANT]
  >
  > If specifying Private IP or Private Service Connect (PSC), your application must be
  > attached to the proper VPC network to connect to your Cloud SQL instance. For most
  > applications this will require the use of a [VPC Connector][vpc-connector].

  [psc]: https://cloud.google.com/vpc/docs/private-service-connect
  [vpc-connector]: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access#create-connector



  Connections using [Automatic IAM database authentication](https://cloud.google.com/sql/docs/postgres/authentication#automatic) are supported when using Postgres or MySQL drivers.
  First, make sure to [configure your Cloud SQL Instance to allow IAM authentication](https://cloud.google.com/sql/docs/postgres/create-edit-iam-instances#configure-iam-db-instance)
  and [add an IAM database user](https://cloud.google.com/sql/docs/postgres/create-manage-iam-users#creating-a-database-user).

  Now, you can connect using user or service account credentials instead of a password.
  In the call to connect, set the `enable_iam_auth` keyword argument to true and the `user` argument to the appropriately formatted IAM principal.
  > Postgres: For an IAM user account, this is the user's email address. For a service account, it is the service account's email without the `.gserviceaccount.com` domain suffix.

  > MySQL: For an IAM user account, this is the user's email address, without the @ or domain name. For example, for `test-user@gmail.com`, set the `user` argument to `test-user`. For a service account, this is the service account's email address without the `@project-id.iam.gserviceaccount.com` suffix.

  Example:

  ```python
  conn = connector.connect(
       "project:region:instance",
       "pg8000",
       user="postgres-iam-user@gmail.com",
       db="my-db-name",
       enable_iam_auth=True,
   )
  ```



  > [!IMPORTANT]
  >
  > If your SQL Server instance is set to [enforce SSL connections](https://cloud.google.com/sql/docs/sqlserver/configure-ssl-instance#enforcing-ssl),
  > you need to download the CA certificate for your instance and include `cafile={path to downloaded certificate}`
  > and `validate_host=False`. This is a workaround for a [known issue](https://issuetracker.google.com/184867147).



  Active Directory authentication for SQL Server instances is currently only supported on Windows.
  First, make sure to follow [these steps](https://cloud.google.com/blog/topics/developers-practitioners/creating-sql-server-instance-integrated-active-directory-using-google-cloud-sql)
  to set up a Managed AD domain and join your Cloud SQL instance to the domain.
  [See here for more info on Cloud SQL Active Directory integration](https://cloud.google.com/sql/docs/sqlserver/ad).

  Once you have followed the steps linked above, you can run the following code to return a connection object:

  ```python
  conn = connector.connect(
      "project:region:instance",
      "pytds",
      db="my-db-name",
      active_directory_auth=True,
      server_name="public.[instance].[location].[project].cloudsql.[domain]",
  )
  ```

  Or, if using Private IP:

  ```python
  conn = connector.connect(
      "project:region:instance",
      "pytds",
      db="my-db-name",
      active_directory_auth=True,
      server_name="private.[instance].[location].[project].cloudsql.[domain]",
      ip_type="private"
  )
  ```



  The Python Connector can be used alongside popular Python web frameworks such
  as Flask, FastAPI, etc, to integrate Cloud SQL databases within your
  web applications.

  > [!NOTE]
  >
  > For serverless environments such as Cloud Functions, Cloud Run, etc, it may be
  > beneficial to initialize the `Connector` with the lazy refresh strategy.
  > i.e. `Connector(refresh_strategy="lazy")`
  >
  > See [Configuring a Lazy Refresh](#configuring-a-lazy-refresh-cloud-run-cloud-functions-etc)



  [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/)
  is an extension for [Flask](https://flask.palletsprojects.com/en/2.2.x/)
  that adds support for [SQLAlchemy](https://www.sqlalchemy.org/) to your
  application. It aims to simplify using SQLAlchemy with Flask by providing
  useful defaults and extra helpers that make it easier to accomplish
  common tasks.

  You can configure Flask-SQLAlchemy to connect to a Cloud SQL database from
  your web application through the following:

  ```python
  from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  from google.cloud.sql.connector import Connector



  connector = Connector()


  def getconn():
      conn = connector.connect(
          "project:region:instance-name", # Cloud SQL Instance Connection Name
          "pg8000",
          user="my-user",
          password="my-password",
          db="my-database",
          ip_type="public"  # "private" for private IP
      )
      return conn


  app = Flask(__name__)


  app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql+pg8000://"
  app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {
      "creator": getconn
  }


  db = SQLAlchemy()
  db.init_app(app)
  ```

  For more details on how to use Flask-SQLAlchemy, check out the
  [Flask-SQLAlchemy Quickstarts](https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/quickstart/)



  [FastAPI](https://fastapi.tiangolo.com/) is a modern, fast (high-performance),
  web framework for building APIs with Python based on standard Python type hints.

  You can configure FastAPI to connect to a Cloud SQL database from
  your web application using [SQLAlchemy ORM](https://docs.sqlalchemy.org/en/14/orm/)
  through the following:

  ```python
  from sqlalchemy import create_engine
  from sqlalchemy.engine import Engine
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import sessionmaker
  from google.cloud.sql.connector import Connector


  def init_connection_pool(connector: Connector) -> Engine:
      
      def getconn():
          conn = connector.connect(
              "project:region:instance-name", # Cloud SQL Instance Connection Name
              "pg8000",
              user="my-user",
              password="my-password",
              db="my-database",
              ip_type="public"  # "private" for private IP
          )
          return conn

      SQLALCHEMY_DATABASE_URL = "postgresql+pg8000://"

      engine = create_engine(
          SQLALCHEMY_DATABASE_URL , creator=getconn
      )
      return engine


  connector = Connector()


  engine = init_connection_pool(connector)


  SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

  Base = declarative_base()
  ```

  To learn more about integrating a database into your FastAPI application,
  follow along the [FastAPI SQL Database guide](https://fastapi.tiangolo.com/tutorial/sql-databases/#create-the-database-models).



  The Cloud SQL Connector is compatible with
  [asyncio](https://docs.python.org/3/library/asyncio.html) to improve the speed
  and efficiency of database connections through concurrency. You can use all
  non-asyncio drivers through the `Connector.connect_async` function, in addition
  to the following asyncio database drivers:
  - [asyncpg](https://magicstack.github.io/asyncpg) (Postgres)

  The Cloud SQL Connector has a helper `create_async_connector` function that is
  recommended for asyncio database connections. It returns a `Connector`
  object that uses the current thread's running event loop. This is different
  than `Connector()` which by default initializes a new event loop in a
  background thread.

  The `create_async_connector` allows all the same input arguments as the
  [Connector](#configuring-the-connector) object.

  Once a `Connector` object is returned by `create_async_connector` you can call
  its `connect_async` method, just as you would the `connect` method:

  ```python
  import asyncpg

  import sqlalchemy
  from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine

  from google.cloud.sql.connector import Connector, create_async_connector

  async def init_connection_pool(connector: Connector) -> AsyncEngine:
      
      async def getconn() -> asyncpg.Connection:
          conn: asyncpg.Connection = await connector.connect_async(
              "project:region:instance",  # Cloud SQL instance connection name
              "asyncpg",
              user="my-user",
              password="my-password",
              db="my-db-name"
              
          )
          return conn

      
      
      pool = create_async_engine(
          "postgresql+asyncpg://",
          async_creator=getconn,
      )
      return pool

  async def main():
      
      connector = await create_async_connector()

      
      pool = await init_connection_pool(connector)

      
      async with pool.connect() as conn:
          await conn.execute(sqlalchemy.text("SELECT NOW()"))

      
      await connector.close_async()

      
      await pool.dispose()
  ```

  For more details on additional database arguments with an `asyncpg.Connection`
  , please visit the
  [official documentation](https://magicstack.github.io/asyncpg/current/api/index.html).



  An alternative to using the `create_async_connector` function is initializing
  a `Connector` as an async context manager, removing the need for explicit
  calls to `connector.close_async()` to cleanup resources.

  > [!NOTE]
  >
  > This alternative requires that the running event loop be
  > passed in as the `loop` argument to `Connector()`.

  ```python
  import asyncio
  import asyncpg

  import sqlalchemy
  from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine

  from google.cloud.sql.connector import Connector

  async def init_connection_pool(connector: Connector) -> AsyncEngine:
      
      async def getconn() -> asyncpg.Connection:
              conn: asyncpg.Connection = await connector.connect_async(
                  "project:region:instance",  # Cloud SQL instance connection name
                  "asyncpg",
                  user="my-user",
                  password="my-password",
                  db="my-db-name"
                  
              )
              return conn

      
      
      pool = create_async_engine(
          "postgresql+asyncpg://",
          async_creator=getconn,
      )
      return pool

  async def main():
      
      loop = asyncio.get_running_loop()
      async with Connector(loop=loop) as connector:
          
          pool = await init_connection_pool(connector)

          
          async with pool.connect() as conn:
              await conn.execute(sqlalchemy.text("SELECT NOW()"))

          
          await pool.dispose()
  ```



  The Cloud SQL Python Connector uses the standard [Python logging module][python-logging]
  for debug logging support.

  Add the below code to your application to enable debug logging with the Cloud SQL
  Python Connector:

  ```python
  import logging

  logging.basicConfig(format="s [s]: s")
  logger = logging.getLogger(name="google.cloud.sql.connector")
  logger.setLevel(logging.DEBUG)
  ```

  For more details on configuring logging, please refer to the
  [Python logging docs][configure-logging].

  [python-logging]: https://docs.python.org/3/library/logging.html
  [configure-logging]: https://docs.python.org/3/howto/logging.html#configuring-logging





  This project uses [semantic versioning](https://semver.org/), and uses the
  following lifecycle regarding support for a major version:

  **Active** - Active versions get all new features and security fixes (that
  wouldn’t otherwise introduce a breaking change). New major versions are
  guaranteed to be "active" for a minimum of 1 year.
  **Deprecated** - Deprecated versions continue to receive security and critical
  bug fixes, but do not receive new features. Deprecated versions will be publicly
  supported for 1 year.
  **Unsupported** - Any major version that has been deprecated for >=1 year is
  considered publicly unsupported.



  We follow the [Python Version Support Policy][pyver] used by Google Cloud
  Libraries for Python. Changes in supported Python versions will be
  considered a minor change, and will be listed in the release notes.

  [pyver]: https://cloud.google.com/python/docs/supported-python-versions


  This project aims for a minimum monthly release cadence. If no new
  features or fixes have been added, a new PATCH version with the latest
  dependencies is released.



  We welcome outside contributions. Please see our
  [Contributing Guide](CONTRIBUTING.md) for details on how best to contribute.


pkgId: 9dfe4666e4099491c7c907fcc536bff5ea2e4d62225d91e7f7b0e8189ba8ba22
name: python-cloud-sql-python-connector
arch: src
version: 1.14.0
epoch: 0
release: 1
url: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-sql-python-connector-1.14.0-1.src.rpm
checksum_type: sha256
summary:
  The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL database without having to manually allowlist IPs or manage SSL certificates.

description:
  <p align="center">
      <a href="https://cloud.google.com/blog/topics/developers-practitioners/how-connect-cloud-sql-using-python-easy-way">
          <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-sql-python-connector/main/docs/images/cloud-sql-python-connector.png" alt="cloud-sql-python-connector image">
      </a>
  </p>

  <h1 align="center">Cloud SQL Python Connector</h1>

  [![Open In Colab][colab-badge]][colab-notebook]
  [![CI][ci-badge]][ci-build]
  [![pypi][pypi-badge]][pypi-docs]
  [![PyPI download month][pypi-downloads]][pypi-docs]
  [![python][python-versions]][pypi-docs]

  [colab-badge]: https://colab.research.google.com/assets/colab-badge.svg
  [colab-notebook]: https://colab.research.google.com/github/GoogleCloudPlatform/cloud-sql-python-connector/blob/main/samples/notebooks/postgres_python_connector.ipynb
  [ci-badge]: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/actions/workflows/tests.yml/badge.svg?event=push
  [ci-build]: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/actions/workflows/tests.yml?query=event%3Apush+branch%3Amain
  [pypi-badge]: https://img.shields.io/pypi/v/cloud-sql-python-connector
  [pypi-docs]: https://pypi.org/project/cloud-sql-python-connector
  [pypi-downloads]: https://img.shields.io/pypi/dm/cloud-sql-python-connector.svg
  [python-versions]: https://img.shields.io/pypi/pyversions/cloud-sql-python-connector

  The _Cloud SQL Python Connector_ is a Cloud SQL connector designed for use with the
  Python language. Using a Cloud SQL connector provides a native alternative to the
  [Cloud SQL Auth Proxy](https://cloud.google.com/sql/docs/mysql/sql-proxy) while
  providing the following benefits:

  * **IAM Authorization:** uses IAM permissions to control who/what can connect to
    your Cloud SQL instances
  * **Improved Security:** uses robust, updated TLS 1.3 encryption and
    identity verification between the client connector and the server-side proxy,
    independent of the database protocol.
  * **Convenience:** removes the requirement to use and distribute SSL
    certificates, as well as manage firewalls or source/destination IP addresses.
  * (optionally) **IAM DB Authentication:** provides support for
    [Cloud SQL’s automatic IAM DB AuthN][iam-db-authn] feature.

  [iam-db-authn]: https://cloud.google.com/sql/docs/postgres/authentication

  The Cloud SQL Python Connector is a package to be used alongside a database driver.
  Currently supported drivers are:
   - [`pymysql`](https://github.com/PyMySQL/PyMySQL) (MySQL)
   - [`pg8000`](https://github.com/tlocke/pg8000) (PostgreSQL)
   - [`asyncpg`](https://github.com/MagicStack/asyncpg) (PostgreSQL)
   - [`pytds`](https://github.com/denisenkom/pytds) (SQL Server)




  You can install this library with `pip install`, specifying the driver
  based on your database dialect.


  ```
  pip install "cloud-sql-python-connector[pymysql]"
  ```

  There are two different database drivers that are supported for the Postgres dialect:


  ```
  pip install "cloud-sql-python-connector[pg8000]"
  ```

  ```
  pip install "cloud-sql-python-connector[asyncpg]"
  ```

  ```
  pip install "cloud-sql-python-connector[pytds]"
  ```



  This package requires the following to successfully make Cloud SQL Connections:

  - IAM principal (user, service account, etc.) with the
  [Cloud SQL Client][client-role] role. This IAM principal will be used for
  [credentials](#credentials).
  - The [Cloud SQL Admin API][admin-api] to be enabled within your Google Cloud
  Project. By default, the API will be called in the project associated with
  the IAM principal.

  [admin-api]: https://console.cloud.google.com/apis/api/sqladmin.googleapis.com
  [client-role]: https://cloud.google.com/sql/docs/mysql/roles-and-permissions



  This library uses the [Application Default Credentials (ADC)][adc] strategy for
  resolving credentials. Please see [these instructions for how to set your ADC][set-adc]
  (Google Cloud Application vs Local Development, IAM user vs service account credentials),
  or consult the [google.auth][google-auth] package.

  To explicitly set a specific source for the credentials, see
  [Configuring the Connector](#configuring-the-connector) below.

  [adc]: https://cloud.google.com/docs/authentication#adc
  [set-adc]: https://cloud.google.com/docs/authentication/provide-credentials-adc
  [google-auth]: https://google-auth.readthedocs.io/en/master/reference/google.auth.html



  This package provides several functions for authorizing and encrypting
  connections. These functions are used with your database driver to connect to
  your Cloud SQL instance.

  The instance connection name for your Cloud SQL instance is always in the
  format "project:region:instance".



  To connect to Cloud SQL using the connector, inititalize a `Connector`
  object and call its `connect` method with the proper input parameters.

  The `Connector` itself creates connection objects by calling its `connect` method but does not manage database connection pooling. For this reason, it is recommended to use the connector alongside a library that can create connection pools, such as [SQLAlchemy](https://www.sqlalchemy.org/). This will allow for connections to remain open and be reused, reducing connection overhead and the number of connections needed.

  In the Connector's `connect` method below, input your connection string as the first positional argument and the name of the database driver for the second positional argument. Insert the rest of your connection keyword arguments like user, password and database. You can also set the optional `timeout` or `ip_type` keyword arguments.

  To use this connector with SQLAlchemy, use the `creator` argument for `sqlalchemy.create_engine`:

  ```python
  from google.cloud.sql.connector import Connector
  import sqlalchemy


  connector = Connector()


  def getconn() -> pymysql.connections.Connection:
      conn: pymysql.connections.Connection = connector.connect(
          "project:region:instance",
          "pymysql",
          user="my-user",
          password="my-password",
          db="my-db-name"
      )
      return conn


  pool = sqlalchemy.create_engine(
      "mysql+pymysql://",
      creator=getconn,
  )
  ```

  The returned connection pool engine can then be used to query and modify the database.

  ```python

  insert_stmt = sqlalchemy.text(
      "INSERT INTO my_table (id, title) VALUES (:id, :title)",
  )

  with pool.connect() as db_conn:
      
      db_conn.execute(insert_stmt, parameters={"id": "book1", "title": "Book One"})

      
      result = db_conn.execute(sqlalchemy.text("SELECT * from my_table")).fetchall()

      
      db_conn.commit()

      
      for row in result:
          print(row)
  ```

  To close the `Connector` object's background resources, call its `close()` method as follows:

  ```python
  connector.close()
  ```

  > [!NOTE]
  >
  > For more examples of using SQLAlchemy to manage connection pooling with the connector,
  > please see [Cloud SQL SQLAlchemy Samples](https://cloud.google.com/sql/docs/postgres/connect-connectors#python_1).



  If you need to customize something about the connector, or want to specify
  defaults for each connection to make, you can initialize a
  `Connector` object as follows:

  ```python
  from google.cloud.sql.connector import Connector


  connector = Connector(
      ip_type="public",  # can also be "private" or "psc"
      enable_iam_auth=False,
      timeout=30,
      credentials=custom_creds, # google.auth.credentials.Credentials
      refresh_strategy="lazy",  # can be "lazy" or "background"
  )
  ```



  The `Connector` object can also be used as a context manager in order to
  automatically close and cleanup resources, removing the need for explicit
  calls to `connector.close()`.

  Connector as a context manager:

  ```python
  from google.cloud.sql.connector import Connector
  import pymysql
  import sqlalchemy


  def init_connection_pool(connector: Connector) -> sqlalchemy.engine.Engine:
      
      def getconn() -> pymysql.connections.Connection:
          conn = connector.connect(
              "project:region:instance",
              "pymysql",
              user="my-user",
              password="my-password",
              db="my-db-name"
          )
          return conn

      
      pool = sqlalchemy.create_engine(
          "mysql+pymysql://",
          creator=getconn,
      )
      return pool


  with Connector() as connector:
      
      pool = init_connection_pool(connector)
      
      insert_stmt = sqlalchemy.text(
          "INSERT INTO my_table (id, title) VALUES (:id, :title)",
      )

      
      with pool.connect() as db_conn:
          
          db_conn.execute(insert_stmt, parameters={"id": "book1", "title": "Book One"})

          
          db_conn.commit()

          
          result = db_conn.execute(sqlalchemy.text("SELECT * from my_table")).fetchall()

          
          for row in result:
              print(row)
  ```



  The Connector's `refresh_strategy` argument can be set to `"lazy"` to configure
  the Python Connector to retrieve connection info lazily and as-needed.
  Otherwise, a background refresh cycle runs to retrive the connection info
  periodically. This setting is useful in environments where the CPU may be
  throttled outside of a request context, e.g., Cloud Run, Cloud Functions, etc.

  To set the refresh strategy, set the `refresh_strategy` keyword argument when
  initializing a `Connector`:

  ```python
  connector = Connector(refresh_strategy="lazy")
  ```



  The Cloud SQL Python Connector can be used to connect to Cloud SQL instances
  using both public and private IP addresses, as well as
  [Private Service Connect][psc] (PSC). To specify which IP address type to connect
  with, set the `ip_type` keyword argument when initializing a `Connector()` or when
  calling `connector.connect()`.

  Possible values for `ip_type` are `"public"` (default value),
  `"private"`, and `"psc"`.

  Example:

  ```python
  conn = connector.connect(
      "project:region:instance",
      "pymysql",
      ip_type="private"  # use private IP
  ... insert other kwargs ...
  )
  ```

  > [!IMPORTANT]
  >
  > If specifying Private IP or Private Service Connect (PSC), your application must be
  > attached to the proper VPC network to connect to your Cloud SQL instance. For most
  > applications this will require the use of a [VPC Connector][vpc-connector].

  [psc]: https://cloud.google.com/vpc/docs/private-service-connect
  [vpc-connector]: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access#create-connector



  Connections using [Automatic IAM database authentication](https://cloud.google.com/sql/docs/postgres/authentication#automatic) are supported when using Postgres or MySQL drivers.
  First, make sure to [configure your Cloud SQL Instance to allow IAM authentication](https://cloud.google.com/sql/docs/postgres/create-edit-iam-instances#configure-iam-db-instance)
  and [add an IAM database user](https://cloud.google.com/sql/docs/postgres/create-manage-iam-users#creating-a-database-user).

  Now, you can connect using user or service account credentials instead of a password.
  In the call to connect, set the `enable_iam_auth` keyword argument to true and the `user` argument to the appropriately formatted IAM principal.
  > Postgres: For an IAM user account, this is the user's email address. For a service account, it is the service account's email without the `.gserviceaccount.com` domain suffix.

  > MySQL: For an IAM user account, this is the user's email address, without the @ or domain name. For example, for `test-user@gmail.com`, set the `user` argument to `test-user`. For a service account, this is the service account's email address without the `@project-id.iam.gserviceaccount.com` suffix.

  Example:

  ```python
  conn = connector.connect(
       "project:region:instance",
       "pg8000",
       user="postgres-iam-user@gmail.com",
       db="my-db-name",
       enable_iam_auth=True,
   )
  ```



  > [!IMPORTANT]
  >
  > If your SQL Server instance is set to [enforce SSL connections](https://cloud.google.com/sql/docs/sqlserver/configure-ssl-instance#enforcing-ssl),
  > you need to download the CA certificate for your instance and include `cafile={path to downloaded certificate}`
  > and `validate_host=False`. This is a workaround for a [known issue](https://issuetracker.google.com/184867147).



  Active Directory authentication for SQL Server instances is currently only supported on Windows.
  First, make sure to follow [these steps](https://cloud.google.com/blog/topics/developers-practitioners/creating-sql-server-instance-integrated-active-directory-using-google-cloud-sql)
  to set up a Managed AD domain and join your Cloud SQL instance to the domain.
  [See here for more info on Cloud SQL Active Directory integration](https://cloud.google.com/sql/docs/sqlserver/ad).

  Once you have followed the steps linked above, you can run the following code to return a connection object:

  ```python
  conn = connector.connect(
      "project:region:instance",
      "pytds",
      db="my-db-name",
      active_directory_auth=True,
      server_name="public.[instance].[location].[project].cloudsql.[domain]",
  )
  ```

  Or, if using Private IP:

  ```python
  conn = connector.connect(
      "project:region:instance",
      "pytds",
      db="my-db-name",
      active_directory_auth=True,
      server_name="private.[instance].[location].[project].cloudsql.[domain]",
      ip_type="private"
  )
  ```



  The Python Connector can be used alongside popular Python web frameworks such
  as Flask, FastAPI, etc, to integrate Cloud SQL databases within your
  web applications.

  > [!NOTE]
  >
  > For serverless environments such as Cloud Functions, Cloud Run, etc, it may be
  > beneficial to initialize the `Connector` with the lazy refresh strategy.
  > i.e. `Connector(refresh_strategy="lazy")`
  >
  > See [Configuring a Lazy Refresh](#configuring-a-lazy-refresh-cloud-run-cloud-functions-etc)



  [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/)
  is an extension for [Flask](https://flask.palletsprojects.com/en/2.2.x/)
  that adds support for [SQLAlchemy](https://www.sqlalchemy.org/) to your
  application. It aims to simplify using SQLAlchemy with Flask by providing
  useful defaults and extra helpers that make it easier to accomplish
  common tasks.

  You can configure Flask-SQLAlchemy to connect to a Cloud SQL database from
  your web application through the following:

  ```python
  from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  from google.cloud.sql.connector import Connector



  connector = Connector()


  def getconn():
      conn = connector.connect(
          "project:region:instance-name", # Cloud SQL Instance Connection Name
          "pg8000",
          user="my-user",
          password="my-password",
          db="my-database",
          ip_type="public"  # "private" for private IP
      )
      return conn


  app = Flask(__name__)


  app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql+pg8000://"
  app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {
      "creator": getconn
  }


  db = SQLAlchemy()
  db.init_app(app)
  ```

  For more details on how to use Flask-SQLAlchemy, check out the
  [Flask-SQLAlchemy Quickstarts](https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/quickstart/)



  [FastAPI](https://fastapi.tiangolo.com/) is a modern, fast (high-performance),
  web framework for building APIs with Python based on standard Python type hints.

  You can configure FastAPI to connect to a Cloud SQL database from
  your web application using [SQLAlchemy ORM](https://docs.sqlalchemy.org/en/14/orm/)
  through the following:

  ```python
  from sqlalchemy import create_engine
  from sqlalchemy.engine import Engine
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import sessionmaker
  from google.cloud.sql.connector import Connector


  def init_connection_pool(connector: Connector) -> Engine:
      
      def getconn():
          conn = connector.connect(
              "project:region:instance-name", # Cloud SQL Instance Connection Name
              "pg8000",
              user="my-user",
              password="my-password",
              db="my-database",
              ip_type="public"  # "private" for private IP
          )
          return conn

      SQLALCHEMY_DATABASE_URL = "postgresql+pg8000://"

      engine = create_engine(
          SQLALCHEMY_DATABASE_URL , creator=getconn
      )
      return engine


  connector = Connector()


  engine = init_connection_pool(connector)


  SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

  Base = declarative_base()
  ```

  To learn more about integrating a database into your FastAPI application,
  follow along the [FastAPI SQL Database guide](https://fastapi.tiangolo.com/tutorial/sql-databases/#create-the-database-models).



  The Cloud SQL Connector is compatible with
  [asyncio](https://docs.python.org/3/library/asyncio.html) to improve the speed
  and efficiency of database connections through concurrency. You can use all
  non-asyncio drivers through the `Connector.connect_async` function, in addition
  to the following asyncio database drivers:
  - [asyncpg](https://magicstack.github.io/asyncpg) (Postgres)

  The Cloud SQL Connector has a helper `create_async_connector` function that is
  recommended for asyncio database connections. It returns a `Connector`
  object that uses the current thread's running event loop. This is different
  than `Connector()` which by default initializes a new event loop in a
  background thread.

  The `create_async_connector` allows all the same input arguments as the
  [Connector](#configuring-the-connector) object.

  Once a `Connector` object is returned by `create_async_connector` you can call
  its `connect_async` method, just as you would the `connect` method:



  ```python
  import asyncpg
  from google.cloud.sql.connector import Connector, create_async_connector

  async def main():
      
      connector = create_async_connector()

      
      async def getconn(instance_connection_name, **kwargs) -> asyncpg.Connection:
          return await connector.connect_async(
              instance_connection_name,
              "asyncpg",
              user="my-user",
              password="my-password",
              db="my-db",
              **kwargs, # ... additional asyncpg args
          )

      
      pool = await asyncpg.create_pool(
          "my-project:my-region:my-instance", connect=getconn
      )

      
      async with pool.acquire() as conn:
          res = await conn.fetch("SELECT NOW()")

      
      await connector.close_async()
  ```



  ```python
  import asyncpg

  import sqlalchemy
  from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine

  from google.cloud.sql.connector import Connector, create_async_connector

  async def init_connection_pool(connector: Connector) -> AsyncEngine:
      
      async def getconn() -> asyncpg.Connection:
          conn: asyncpg.Connection = await connector.connect_async(
              "project:region:instance",  # Cloud SQL instance connection name
              "asyncpg",
              user="my-user",
              password="my-password",
              db="my-db-name"
              
          )
          return conn

      
      
      pool = create_async_engine(
          "postgresql+asyncpg://",
          async_creator=getconn,
      )
      return pool

  async def main():
      
      connector = await create_async_connector()

      
      pool = await init_connection_pool(connector)

      
      async with pool.connect() as conn:
          await conn.execute(sqlalchemy.text("SELECT NOW()"))

      
      await connector.close_async()

      
      await pool.dispose()
  ```

  For more details on additional database arguments with an `asyncpg.Connection`
  , please visit the
  [official documentation](https://magicstack.github.io/asyncpg/current/api/index.html).



  An alternative to using the `create_async_connector` function is initializing
  a `Connector` as an async context manager, removing the need for explicit
  calls to `connector.close_async()` to cleanup resources.

  > [!NOTE]
  >
  > This alternative requires that the running event loop be
  > passed in as the `loop` argument to `Connector()`.



  ```python
  import asyncpg
  from google.cloud.sql.connector import Connector, create_async_connector

  async def main():
      
      loop = asyncio.get_running_loop()
      async with Connector(loop=loop) as connector:

          
          async def getconn(instance_connection_name, **kwargs) -> asyncpg.Connection:
              return await connector.connect_async(
                  instance_connection_name,
                  "asyncpg",
                  user="my-user",
                  password="my-password",
                  db="my-db",
                  **kwargs, # ... additional asyncpg args
              )

          
          pool = await asyncpg.create_pool(
              "my-project:my-region:my-instance", connect=getconn
          )

          
          async with pool.acquire() as conn:
              res = await conn.fetch("SELECT NOW()")
  ```



  ```python
  import asyncio
  import asyncpg

  import sqlalchemy
  from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine

  from google.cloud.sql.connector import Connector

  async def init_connection_pool(connector: Connector) -> AsyncEngine:
      
      async def getconn() -> asyncpg.Connection:
          conn: asyncpg.Connection = await connector.connect_async(
              "project:region:instance",  # Cloud SQL instance connection name
              "asyncpg",
              user="my-user",
              password="my-password",
              db="my-db-name"
              
          )
          return conn

      
      
      pool = create_async_engine(
          "postgresql+asyncpg://",
          async_creator=getconn,
      )
      return pool

  async def main():
      
      loop = asyncio.get_running_loop()
      async with Connector(loop=loop) as connector:
          
          pool = await init_connection_pool(connector)

          
          async with pool.connect() as conn:
              await conn.execute(sqlalchemy.text("SELECT NOW()"))

          
          await pool.dispose()
  ```



  The Cloud SQL Python Connector uses the standard [Python logging module][python-logging]
  for debug logging support.

  Add the below code to your application to enable debug logging with the Cloud SQL
  Python Connector:

  ```python
  import logging

  logging.basicConfig(format="s [s]: s")
  logger = logging.getLogger(name="google.cloud.sql.connector")
  logger.setLevel(logging.DEBUG)
  ```

  For more details on configuring logging, please refer to the
  [Python logging docs][configure-logging].

  [python-logging]: https://docs.python.org/3/library/logging.html
  [configure-logging]: https://docs.python.org/3/howto/logging.html#configuring-logging





  This project uses [semantic versioning](https://semver.org/), and uses the
  following lifecycle regarding support for a major version:

  **Active** - Active versions get all new features and security fixes (that
  wouldn’t otherwise introduce a breaking change). New major versions are
  guaranteed to be "active" for a minimum of 1 year.
  **Deprecated** - Deprecated versions continue to receive security and critical
  bug fixes, but do not receive new features. Deprecated versions will be publicly
  supported for 1 year.
  **Unsupported** - Any major version that has been deprecated for >=1 year is
  considered publicly unsupported.



  We follow the [Python Version Support Policy][pyver] used by Google Cloud
  Libraries for Python. Changes in supported Python versions will be
  considered a minor change, and will be listed in the release notes.

  [pyver]: https://cloud.google.com/python/docs/supported-python-versions


  This project aims for a minimum monthly release cadence. If no new
  features or fixes have been added, a new PATCH version with the latest
  dependencies is released.



  We welcome outside contributions. Please see our
  [Contributing Guide](CONTRIBUTING.md) for details on how best to contribute.


pkgId: 6b6d7ef59cf5b04e57d891ecb39fb21c820dfd510f8e007605e344eb260ec2ec
name: python-cloud-time-saver
arch: src
version: 0.3.8
epoch: 0
release: 1
summary: Python CLI tool that automates working on AWS enviorment without leaving the Terminal.
url: https://pypi.org/project/cloud-time-saver/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-time-saver-0.3.8-1.src.rpm
checksum_type: sha256
description:
  cloud_time_saver is a python command-line application, that lets us control our AWS environment automatically without leaving the terminal.
  It is designed to be used only on the Linux operating system.



  The goal of this application is to speed up and simplify working with AWS and thus save users a lot of time.

  In addition, it personally never suited me to use the AWS CLI, so I decided to do something similar, only my application was adapted for easier understanding and use.




  Before installation please make sure that you have python3 installed.

  After that one more thing. For this program to work you must have AWS account configured on your system.
  If you do not have a configured account, you must first install AWS CLI.
  Then create a new user in the AWS console. When done, run the AWS configure command and add credentials for the created user to it.
  On Ubuntu OS that should look similar to this:
  ```bash
   /* installing AWS CLI */

   sudo apt-get install awscli

   /* now create new user in AWS Console */

   /* running aws configure will prompt you for user credentials */

   aws configure
  ```
   <sub><sup>If you get errors when running application regarding to your AWS User settings, you can run: pip3 install --upgrade awscli</sup></sub>


  Now when we are done with configuring our account we can install cloud_time_saver with this command:
  ```bash
  pip install cloud-time-saver
  ```
  If you want to run the cloud_time_saver command globally you should consider adding the installation directory to your PATH variable.



  When you run cloud_time_saver you will have 3 options to choose from:
  1. run ( starts application )
  2. help ( provides you with documentation )
  3. exit ( exits application )


  I recommend running the help command first, and seeing what kind of commands we can run. At first glance, this app may be a bit confusing, but a good look at the documentation should resolve disagreements.
  This is how the help page looks like:
  ![image1](https://raw.githubusercontent.com/JaSamLudiMoskri/cloud_time_saver_prod/main/Screenshot%202021-11-27%20141217.png)

  ![image2](https://raw.githubusercontent.com/JaSamLudiMoskri/cloud_time_saver_prod/main/Screenshot%202021-12-01%20150122.png)


pkgId: d20661bcc451c3104cedace4544ad7e8a57b97e1cb2a88dc36ccd3c10104ac68
name: python-cloud-tpu-diagnostics
arch: src
version: 0.1.5
epoch: 0
release: 1
summary: Monitor, debug and profile the jobs running on Cloud TPU.
url: https://github.com/google/cloud-tpu-monitoring-debugging
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-tpu-diagnostics-0.1.5-1.src.rpm
checksum_type: sha256
description:
  This is a comprehensive library to monitor, debug and profile the jobs running on Cloud TPU.
  To learn about Cloud TPU, refer to the [full documentation](https://cloud.google.com/tpu/docs/intro-to-tpu).




  This module will dump the python traces when a fault such as Segmentation fault, Floating-point exception, Illegal operation exception occurs in the program. Additionally, it will also periodically collect stack traces to help debug when a program running on Cloud TPU is stuck or hung somewhere.


  To install the package, run the following command on TPU VM:

  ```
  pip install cloud-tpu-diagnostics
  ```


  To use this package, first import the module:

  ```
  from cloud_tpu_diagnostics import diagnostic
  from cloud_tpu_diagnostics.configuration import debug_configuration
  from cloud_tpu_diagnostics.configuration import diagnostic_configuration
  from cloud_tpu_diagnostics.configuration import stack_trace_configuration
  ```

  Then, create configuration object for stack traces. The module will only collect stack traces when `collect_stack_trace` parameter is set to `True`. There are following scenarios supported currently:



  ```
  stack_trace_config = stack_trace_configuration.StackTraceConfig(
                        collect_stack_trace=False)
  ```
  This configuration will prevent you from collecting stack traces in the event of a fault or process hang.



  ```
  stack_trace_config = stack_trace_configuration.StackTraceConfig(
                        collect_stack_trace=True,
                        stack_trace_to_cloud=False)
  ```
  If there is a fault or process hang, this configuration will show the stack traces on the console (stderr).



  ```
  stack_trace_config = stack_trace_configuration.StackTraceConfig(
                        collect_stack_trace=True,
                        stack_trace_to_cloud=True)
  ```
  This configuration will temporary collect stack traces inside `/tmp/debugging` directory on TPU host if there is a fault or process hang. Additionally, the traces collected in TPU host memory will be uploaded to Google Cloud Logging, which will make it easier to troubleshoot and fix the problems. You can view the traces in [Logs Explorer](https://cloud.google.com/logging/docs/view/logs-explorer-interface) using the following query:

  ```
  logName="projects/<project_name>/logs/tpu.googleapis.com%2Fruntime_monitor"
  jsonPayload.verb="stacktraceanalyzer"
  ```

  By default, stack traces will be collected every 10 minutes. In order to change the duration between two stack trace collection events, add the following configuration:

  ```
  stack_trace_config = stack_trace_configuration.StackTraceConfig(
                        collect_stack_trace=True,
                        stack_trace_to_cloud=True,
                        stack_trace_interval_seconds=300)
  ```
  This configuration will collect the stack traces on cloud after every 5 minutes.

  Then, create configuration object for debug.

  ```
  debug_config = debug_configuration.DebugConfig(
                  stack_trace_config=stack_trace_config)
  ```

  Then, create configuration object for diagnostic.

  ```
  diagnostic_config = diagnostic_configuration.DiagnosticConfig(
                        debug_config=debug_config)
  ```

  Finally, call the `diagnose()` method using `with` and wrap the statements inside the context manager for which you want to collect the stack traces.

  ```
  with diagnostic.diagnose(diagnostic_config):
      run_job(...)
  ```


pkgId: 6cf18fe2d6443c345fc1ddc3d66fad45ed6fa0269eae99ac65ea1ea183e776ba
name: python-cloud-volume
arch: src
version: 11.0.2
epoch: 0
release: 1
url: https://github.com/seung-lab/cloud-volume/
rpm_license: License :: OSI Approved :: BSD License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-volume-11.0.2-1.src.rpm
checksum_type: sha256
summary:
  A serverless client for reading and writing Neuroglancer Precomputed volumes both locally and on cloud services.

description:
  [![PyPI version](https://badge.fury.io/py/cloud-volume.svg)](https://badge.fury.io/py/cloud-volume) [![SfN 2018 Poster](https://img.shields.io/badge/poster-SfN%202018-blue.svg)](https://drive.google.com/open?id=1RKtaAGV2f7F13opnkQfbp6YBqmoD3fZi) [![codecov](https://img.shields.io/badge/codecov-link-%23d819a6)](https://codecov.io/gh/seung-lab/cloud-volume) [![DOI](https://zenodo.org/badge/98333149.svg)](https://zenodo.org/badge/latestdoi/98333149)



  ```python
  from cloudvolume import CloudVolume

  vol = CloudVolume('gs://mylab/mouse/image', parallel=True, progress=True)
  image = vol[:,:,:] # Download a whole image stack into a numpy array from the cloud
  vol[:,:,:] = image # Upload an entire image stack from a numpy array to the cloud

  label = 1
  mesh = vol.mesh.get(label)
  skel = vol.skeleton.get(label)
  ```

  CloudVolume is a serverless Python client for random access reading and writing of [Neuroglancer](https://github.com/google/neuroglancer/) volumes in "[Precomputed](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed)" format, a set of representations for arbitrarily large volumetric images, meshes, and skeletons. CloudVolume is typically paired with [Igneous](https://github.com/seung-lab/igneous), a Kubernetes compatible system for generating image hierarchies, meshes, skeletons, and other dependency free jobs that can be applied to petavoxel scale images.

  Precomputed volumes are typically stored on [AWS S3](https://aws.amazon.com/s3/), [Google Storage](https://cloud.google.com/storage/), or locally. CloudVolume can read and write to these object storage providers given a service account token with appropriate permissions. However, these volumes can be stored on any service, including an ordinary webserver or local filesystem, that supports key-value access.

  The combination of [Neuroglancer](https://github.com/google/neuroglancer/), [Igneous](https://github.com/seung-lab/igneous), and CloudVolume comprises a system for visualizing, processing, and sharing (via browser viewable URLs) petascale datasets within and between laboratories. A typical example usage would be to visualize raw electron microscope scans of mouse, fish, or fly brains up to a cubic millimeter in physical dimension. Neuroglancer and Igneous would enable you to visualize each step of the process of montaging the image, fine tuning alignment vector fields, creating segmentation layers, ROI masks, or performing other types of analysis. CloudVolume enables you to read from and write to each of these layers. Recently, we have introduced the ability to interact with the graph server ("PyChunkGraph") that backs proofreading automated segmentations via the `graphene://` format.

  You can find a collection of CloudVolume accessible and Neuroglancer viewable datasets at https://neurodata.io/project/ocp/, an open data project by some of our collaborators.



  - Random access to petavoxel Neuroglancer images, meshes, and skeletons.
  - Nearly all output is immediately visualizable using Neuroglancer.\*
  - Reads graph server backed proofreading volumes (via `graphene://`).
  - Serverless (except `graphene://`) and multi-cloud.



  - Supports `precomputed`, `graphene`, `zarr`, (read-only) `n5`, and `boss` formats.
  - Multi-threaded, supports multi-process and green threads.
  - Memory optimized, supports shared memory.
  - Lossless connectomics relevant codecs ([`compressed_segmentation`](https://github.com/seung-lab/compressedseg), [`compresso`](https://github.com/seung-lab/compresso), [`crackle`](https://github.com/seung-lab/crackle) (BETA), [`fpzip`](https://github.com/seung-lab/fpzip/), [`zfpc`](https://github.com/seung-lab/zfpc), [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics), and [`brotli`](https://en.wikipedia.org/wiki/Brotli))
  - Understands image hierarchies & anisotropic pixel resolutions.
  - Accomodates downloading missing tiles (`fill_missing=True`).
  - Accomodates uploading compressed black tiles to erasure coded file systems (`delete_black_uploads=True`).
  - Growing support for the Neuroglancer [sharded format](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed) which dramatically condenses the number of files required to represent petascale datasets, similar to [Cloud Optimized GeoTIFF](https://www.cogeo.org/), which can result in [dramatic cost savings](https://github.com/seung-lab/kimimaro/wiki/The-Economics:-Skeletons-for-the-People).
  - Reads Precomputed meshes and skeletons.
  - Includes viewers for small images, meshes, and skeletons.
  - Only 3 dimensions + RBG channels currently supported for images.
  - No data versioning.



  Cloud-volume is regularly tested on Ubuntu with 3.8, 3.9, 3.10, 3.11, and 3.12. We officially support Linux and Mac OS. Windows is community supported. After installation, you'll also need to set up your cloud credentials if you're planning on writing files or reading from a private dataset. Once you're finished setting up, you can try [reading from a public dataset](https://github.com/seung-lab/cloud-volume/wiki/Reading-Public-Data-Examples).



  ```bash
  pip install cloud-volume # standard installation
  ```

  CloudVolume depends on several PyPI packages which are Cython bindings for C++. We have provided compiled binaries for many platforms and python versions, however if you are on an unsupported system, pip will attempt to install from source. In that case, follow the instructions below.

  **Windows Note:** If you get errors related to a missing C++ compiler, this blog post might help you: https://www.scivision.dev/python-windows-visual-c-14-required/



  | Tag             | Description                             | Dependencies          |
  |-----------------|-----------------------------------------|-----------------------|
  | boss            | `boss://` format support                | intern, blosc                |
  | zarr            | `zarr://` format support                | blosc                 |
  | test            | Supports testing                        | pytest                |
  | mesh_viewer     | `mesh.viewer()` GUI                     | vtk                   |
  | skeleton_viewer | `skeleton.viewer()` GUI                 | matplotlib            |
  | all_viewers     | All viewers now and in the future.      | vtk, matplotlib       |
  | dask            | Supports converting to/from dask arrays | dask\[array\]         |
  | em_codecs       | Image codecs: JPEG, JPEG-XL, and PNG    | imagecodecs, simplejpeg, pyspng-seunglab |
  | seg_codecs      | Segmentation: compressed-segmentation, compresso, crackle | compressed-segmentation, compresso, crackle-codec         |
  | fp_codecs       | Floating point: fpzip, zfpc             | fpzip, zfpc           |
  | all_codecs      | Installs all optional compression codecs: em_codecs, seg_codecs, fp_codecs, blosc | see above         |

  Example:

  ```bash
  pip install cloud-volume[all_codecs,test,all_viewers]
  ```

  gzip, brotli, JPEG, and compressed-segmentation codecs are installed by default.



  *C++ compiler required.*

  ```bash
  sudo apt-get install g++ python3-dev
  pip install numpy
  pip install cloud-volume
  ```

  Due to packaging problems endemic to Python, Cython packages that depend on numpy require numpy header files be installed before attempting to install the package you want. The numpy headers are not recognized unless numpy is installed in a seperate process that runs first. There are hacks for this issue, but I haven't gotten them to work. If you think binaries should be available for your platform, please let us know by opening an issue.



  This can be desirable if you want to hack on CloudVolume itself.

  ```bash
  git clone git@github.com:seung-lab/cloud-volume.git
  cd cloud-volume


  mkvirtualenv cv
  workon cv

  virtualenv venv
  source venv/bin/activate

  sudo apt-get install g++ python3-dev
  pip install numpy # additional step needed for accelerated compressed_segmentation and fpzip
  pip install -e . # without optional dependencies
  pip install -e .[all_viewers] # with e.g. the all_viewers optional dependency
  ```



  By default, CloudVolume's configuration and cache files are stored in `$HOME/.cloudvolume` (or in `$HOME/.cloudfiles` since we use CloudFiles for the backend). You can configure where CloudVolume looks for these files with the environment variable `$CLOUD_VOLUME_DIR`.

  Credentials are stored in `$CLOUD_VOLUME_DIR/secrets`. You'll need credentials only for the services you'll use. If you plan to use the local filesystem, you won't need any. For Google Storage ([setup instructions here](https://github.com/seung-lab/cloud-volume/wiki/Setting-up-Google-Cloud-Storage)), default account credentials will be used if available and no service account is provided.

  If neither of those two conditions apply, you need a service account credential. If you have your credentials handy, you can provide them like so as a dict, JSON string, or a bare token if the service will accept that.

  ```python
  cv = CloudVolume(..., secrets=...)
  ```

  However, it may be simpler to save your credential to disk so you don't have to always provide it. `google-secret.json` is a service account credential for Google Storage, `aws-secret.json` is a service account for S3, etc. You can support multiple projects at once by prefixing the bucket you are planning to access to the credential filename. `google-secret.json` will be your defaut service account, but if you also want to also access bucket ABC, you can provide `ABC-google-secret.json` and you'll have simultaneous access to your ordinary buckets and ABC. The secondary credentials are accessed on the basis of the bucket name, not the project name.

  ```bash
  mkdir -p ~/.cloudvolume/secrets/
  mv aws-secret.json ~/.cloudvolume/secrets/ # needed for Amazon
  mv google-secret.json ~/.cloudvolume/secrets/ # needed for Google
  mv boss-secret.json ~/.cloudvolume/secrets/ # needed for the BOSS
  mv matrix-secret.json ~/.cloudvolume/secrets/ # needed for Matrix
  mv tigerdata-secret.json ~/.cloudvolume/secrets/ # needed for Tigerdata
  ```



  Create an [IAM user service account](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html) that can read, write, and delete objects from at least one bucket.

  ```json
  {
  	"AWS_ACCESS_KEY_ID": "$MY_AWS_ACCESS_KEY_ID",
  	"AWS_SECRET_ACCESS_KEY": "$MY_SECRET_ACCESS_TOKEN"
  }
  ```



  You can create the `google-secret.json` file [here](https://console.cloud.google.com/iam-admin/serviceaccounts). You don't need to manually fill in JSON by hand, the below example is provided to show you what the end result should look like. You should be able to read, write, and delete objects from at least one bucket.

  ```json
  {
    "type": "service_account",
    "project_id": "$YOUR_GOOGLE_PROJECT_ID",
    "private_key_id": "...",
    "private_key": "...",
    "client_email": "...",
    "client_id": "...",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": ""
  }
  ```



  *Note: used to be called chunkedgraph-secret.json. This is still supported but deprecated.*

  If you have a token from Graphene/Chunkedgraph server, create the `cave-secret.json` file as shown in the example below. You may also pass the token to `CloudVolume(..., secrets=token)`.

  ```json
  {
    "token": "<your_token>"
  }
  ```

  Note that to take advantage of multiple credential files, prepend the fully qualified domain name (FQDN) of the server instead of the bucket for GCS and S3. For example, `sudomain.domain.com-cave-secret.json`.



  CloudVolume supports reading and writing to Neuroglancer data layers on Amazon S3, Google Storage, The BOSS, and the local file system.

  Supported URLs are of the forms:

  `$FORMAT://$PROTOCOL://$BUCKET/$DATASET/$LAYER`

  The format or protocol fields may be omitted where required. In the case of the precomputed format, the format specifier is optional.

  | Format      | Protocols                                    | Default | Example                                |
  |-------------|----------------------------------------------|---------|----------------------------------------|
  | precomputed | gs, s3, http, https, file, matrix, tigerdata | Yes     | gs://mybucket/dataset/layer            |
  | graphene    | gs, s3, http, https, file, matrix, tigerdata |         | graphene://gs://mybucket/dataset/layer |
  | boss        | N/A                                          |         | boss://collection/experiment/channel   |
  | n5          | gs, s3, http, https, file, matrix, tigerdata |         | n5://gs://mybucket/dataset/layer       |
  | zarr        | gs, s3, http, https, file, matrix, tigerdata |         | zarr://gs://mybucket/dataset/layer     |



  * precomputed: Neuroglancer's native format. ([specification](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed))
  * graphene: Precomputed based format used by the PyChunkGraph server.
  * boss: The BOSS (https://docs.theboss.io/docs)
  * n5: Not HDF5 (https://github.com/saalfeldlab/n5) Read-only support. Supports raw, gzip, bz2, and xz but not lz4 compression. mode 0 datasets only.
  * [zarr](https://github.com/zarr-developers/zarr-python): Custom implementation supports reading and writing for 5D arrays, but limited support for the 5th dimension.



  * gs:   Google Storage
  * s3:   Amazon S3
  * http(s): (read-only) Ordinary Web Servers
  * file: Local File System (absolute path)
  * matrix: Princeton Internal System (run in large part by Seung Lab)
  * tigerdata: Princeton Internal System (run by Princeton OIT)

  CloudVolume also supports [alternative s3 aliases](https://github.com/seung-lab/cloud-files#alias-for-alternative-s3-endpoints) via CloudFiles.




  Neuroglancer relies on an [`info`](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed#info-json-file-specification) file located at the root of a dataset layer to tell it how to compute file locations and interpret the data in each file. CloudVolume piggy-backs on this functionality.

  In the below example, assume you are creating a new segmentation volume from a 3d numpy array "rawdata". Note Precomputed stores data in Fortran (column major, aka CZYX) order. You should do a small test to see if the image is written transposed. You can fix this by uploading `rawdata.T`. A more detailed example for uploading a local volume [is located here](https://github.com/seung-lab/cloud-volume/wiki/Example-Single-Machine-Dataset-Upload).

  ```python3
  from cloudvolume import CloudVolume

  info = CloudVolume.create_new_info(
      num_channels    = 1,
      layer_type      = 'segmentation',
      data_type       = 'uint64', # Channel images might be 'uint8'
      
      encoding        = 'raw',
      resolution      = [4, 4, 40], # Voxel scaling, units are in nanometers
      voxel_offset    = [0, 0, 0], # x,y,z offset in voxels from the origin
      mesh            = 'mesh',
      
      
      chunk_size      = [ 512, 512, 16 ], # units are voxels
      volume_size     = [ 250000, 250000, 25000 ], # e.g. a cubic millimeter dataset
  )
  vol = CloudVolume(cfg.path, info=info)
  vol.commit_info()
  vol[cfg.x: cfg.x + cfg.length, cfg.y:cfg.y + cfg.length, cfg.z: cfg.z + cfg.length] = rawdata[:,:,:]
  ```
  | Encoding                | Image Type                 | Lossless | Neuroglancer Viewable | Description                                                                              |
  |-------------------------|----------------------------|----------|-------------|------------------------------------------------------------------------------------------|
  | raw                     | Any                        | Y        | Y           | Serialized numpy arrays.                                                                 |
  | png                     | Image                      | Y        | Y           | Multiple slices stiched into a single PNG.                                               |
  | jpeg                    | Image                      | N        | Y           | Multiple slices stiched into a single JPEG.                                              |
  | compressed_segmentation | Segmentation               | Y        | Y           | Renumbered numpy arrays to reduce data width. Also used by Neuroglancer internally.      |
  | compresso               | Segmentation               | Y        | Y           | Lossless high compression algorithm for connectomics segmentation.                       |
  | crackle                 | Segmentation               | Y        | Y*           | Lossless high compression algorithm for connectomics segmentation.                       |
  | fpzip                   | Floating Point             | Y        | Y*           | Takes advantage of IEEE 754 structure + L1 Lorenzo predictor to get higher compression.  |
  | kempressed              | Anisotropic Z Floating Point | N**      | Y*           | Adds manipulations on top of fpzip to achieve higher compression.                        |
  | zfpc                    | Alignment Vector Fields    | N***     | Y*          | zfp stream container.                        |

  \* Not integrated into official Neuroglancer yet, but available on a [fork](https://allcodecs-dot-neuromancer-seung-import.appspot.com/) which can be seen on Github [here](https://github.com/william-silversmith/neuroglancer/tree/wms_combined_codecs).
  \*\* Lossless if your data can handle adding and then subtracting 2.
  \*\*\* Lossless by default, but you probably want to use the lossy mode.

  Note on `compressed_segmentation`: To use, make sure `compressed_segmentation_block_size` is specified (usually `[8,8,8]`. This field will appear in the `info` file in the relevant scale.

  Note on `zfpc`: To configure, use the fields `zfpc_rate`, `zfpc_precision`, `zfpc_tolerance`, `zfpc_correlated_dims` in the relevant scale of the `info` file.




  ```python

  vol = CloudVolume('gs://mybucket/retina/image')
  vol = CloudVolume('gs://mybucket/retina/image', secrets=token, dict or json)
  vol = CloudVolume('gs://bucket/dataset/channel', mip=0, bounded=True, fill_missing=False)
  vol = CloudVolume('gs://bucket/dataset/channel', mip=[ 8, 8, 40 ], bounded=True, fill_missing=False) # set mip at this resolution
  vol = CloudVolume('gs://bucket/datasset/channel', info=info) # New info file from scratch
  image = vol[:,:,:] # Download the entire image stack into a numpy array
  image = vol.download(bbox, mip=2, renumber=True) # download w/ smaller dtype
  image = vol.download(bbox, mip=2, label=777) # download binary image for label
  uniq = vol.unique(bbox, mip=0) # efficient extraction of unique labels
  listing = vol.exists( np.s_[0:64, 0:128, 0:64] ) # get a report on which chunks actually exist
  exists = vol.image.has_data(mip=0) # boolean check to see if any data is there
  listing = vol.delete( np.s_[0:64, 0:128, 0:64] ) # delete this region (bbox must be chunk aligned)
  vol[64:128, 64:128, 64:128] = image # Write a 64^3 image to the volume
  img = vol.download_point( (x,y,z), size=256, mip=3 ) # download region around (mip 0) x,y,z at mip 3
  pts = vol.scattered_points([ (x1,y1,z1), (x2,y2,z2) ]) # download voxel labels located at indicated points

  files = vol.download_files(bbox, mip, decompress=False)




  mem_vol = vol.image.memory_cutout(bbox, mip=1, encoding="compresso")


  vol.viewer() # launches neuroglancer compatible web server on http://localhost:1337


  img = vol[64:1028, 64:1028, 64:128]
  img.viewer() # launches web viewer on http://localhost:8080


  vol.mesh.save(12345) # save 12345 as ./12345.ply on disk
  vol.mesh.save([12345, 12346, 12347]) # merge three segments into one file
  vol.mesh.save(12345, file_format='obj') # 'ply' and 'obj' are both supported
  vol.mesh.get(12345) # return the mesh as vertices and faces instead of writing to disk
  vol.mesh.get([ 12345, 12346 ]) # return these two segids fused into a single mesh
  vol.mesh.get([ 12345, 12346 ], fuse=False) # return { 12345: mesh, 12346: mesh }
  vol.mesh.put(meshes) # works for unsharded legacy only
  vol.mesh.delete(segids) # works for unsharded meshes only

  mesh.viewer() # Opens GUI. Requires vtk.


  skel = vol.skeleton.get(12345)
  vol.skeleton.upload_raw(segid, skel.vertices, skel.edges, skel.radii, skel.vertex_types)
  vol.skeleton.upload(skel)


  skels = vol.skeleton.get_by_bbox( Bbox( (0,0,0), (500, 500, 500) ) )
  vol.skeleton.spatial_index # None if not available

  skel.empty() # boolean

  bytes = skel.encode() # encode to Precomputed format (bytes)
  skel = Skeleton.decode(bytes) # decode from PrecomputedFormat

  skel = skel.crop(slices or bbox) # eliminate vertices and edges outside bbox
  skel = skel.consolidate() # eliminate duplicate vertices and edges
  skel3 = skel.merge(skel2) # merge two skeletons into one
  skel = skel.clone() # create copy
  skel = Skeleton.from_swc(swcstr) # decode an SWC file
  skel_str = skel.to_swc() # convert to SWC file in string representation
  skel.viewer() # Opens GUI. Requires matplotlib

  skel.cable_length() # sum of all edge lengths
  skel = skel.downsample(2) # reduce size of skeleton by factor of 2
  skel = skel.average_smoothing(3) # rolling average, n=3

  skel1 == skel2 # check if contents of internal arrays match
  Skeleton.equivalent(skel1, skel2) # ...even if there are differences like differently numbered edges


  vol = CloudVolume('gs://mybucket/retina/image', parallel=True) # Use all cores
  vol.parallel = 4 # e.g. any number > 1, use this many cores
  data = vol[:] # uses shared memory to coordinate processes under the hood


  vol = CloudVolume(...)


  data = vol.download_to_shared_memory(np.s_[:], location='some-example')
  vol.unlink_shared_memory() # delete the shared memory associated with this cloudvolume
  vol.shared_memory_id # get/set the default shared memory location for this instance


  vol = CloudVolume(...)
  vol.upload_from_shared_memory('my-shared-memory-id', # do not prefix with /dev/shm
      bbox=Bbox( (0,0,0), (10000, 7500, 64) ))



  vol.download_to_file('/path/to/file', bbox=Bbox(...), mip=0) # bbox is the download region
  vol.upload_from_file('/path/to/file', bbox=Bbox(...), mip=0) # bbox is the region it represents


  vol = CloudVolume(...)


  vol.transfer_to('gs://bucket/dataset/layer', vol.bounds)




  vol = CloudVolume('gs://mybucket/retina/image', cache=True) # Basic Example
  image = vol[0:10,0:10,0:10] # Download partial image and cache
  vol[0:10,0:10,0:10] = image # Upload partial image and cache


  vol = CloudVolume(..., lru_bytes=num_bytes) # >= 0, 0 means disabled
  vol.image.lru.resize(num_bytes) # same
  vol.image.lru.clear()
  len(vol.image.lru) # number of items in lru
  vol.image.lru.nbytes # size in bytes (not counting LRU structures, nor recursive)
  vol.image.lru.items() # etc, also functions as a dict


  vol.cache.list() # list files in cache at this mip level
  vol.cache.list(mip=1) # list files in cache at mip 1
  vol.cache.list_meshes()
  vol.cache.list_skeletons()
  vol.cache.num_files() # number of files at this mip level
  vol.cache.num_bytes(all_mips=True) # Return num files for each mip level in a list
  vol.cache.num_bytes() # number of bytes taken up by files, size on disk can be bigger
  vol.cache.num_bytes(all_mips=True) # Return num bytes for each mip level in a list

  vol.cache.enabled = True/False # Turn the cache on/off
  vol.cache.path = Str # set the cache location
  vol.cache.compress = None/True/False # None: Link to cloud setting, Boolean: Force cache to compressed (True) or uncompressed (False)


  vol.cache.flush() # Delete local cache for this layer at this mip level
  vol.cache.flush(preserve=Bbox(...)) # Same, but preserve cache in a region of space
  vol.cache.flush_region(region=Bbox(...), mips=[...]) # Delete the cached files in this region at these mip levels (default all mips)
  vol.cache.flush_info()
  vol.cache.flush_provenance()


  import gevent.monkey
  gevent.monkey.patch_all(thread=False)

  cv = CloudVolume(..., green_threads=True)
  img = cv[...] # now green threads will be used


  arr = cv.to_dask()
  arr = cloudvolume.dask.from_cloudvolume(cloudpath) # same as to_dask
  res = cloudvolume.dask.to_cloudvolume(arr, cloudpath, compute=bool, return_store=bool)
  ```



  ```python3
  CloudVolume(
      cloudpath:str, mip:int=0, bounded:bool=True,
      autocrop:bool=False, fill_missing:bool=False, cache:CacheType=False,
      compress_cache:CompressType=None, cdn_cache:bool=True,
      progress:bool=INTERACTIVE, info:dict=None, provenance:dict=None,
      compress:CompressType=None, compress_level:Optional[int]=None,
      non_aligned_writes:bool=False, parallel:ParallelType=1, delete_black_uploads:bool=False,
      background_color:int=0, green_threads:bool=False, use_https:bool=False,
      max_redirects:int=10, mesh_dir:Optional[str]=None, skel_dir:Optional[str]=None,
      agglomerate:bool=False, secrets:SecretsType=None,
      spatial_index_db:Optional[str]=None, lru_bytes:int = 0,
      cache_locking:bool = True
  )
  ```


  *      agglomerate: (bool, graphene only) sets the default mode for downloading
          images to agglomerated (True) vs watershed (False).
  *      autocrop: (bool) If the specified retrieval bounding box exceeds the
            volume bounds, process only the area contained inside the volume.
            This can be useful way to ensure that you are staying inside the
            bounds when `bounded=False`.
  *      background_color: (number) Specifies what the "background value" of the
          volume is (traditionally 0). This is mainly for changing the behavior
          of delete_black_uploads.
  *      bounded: (bool) If a region outside of volume bounds is accessed:
            True: Throw an error
            False: Allow accessing the region. If no files are present, an error
                will still be thrown. Consider combining this option with
                `fill_missing=True`. However, this can be dangrous as it allows
                missing files and potentially network errors to be intepreted as
                zeros.
  *      cache: (bool or str) Store downs and uploads in a cache on disk
              and preferentially read from it before redownloading.
            - falsey value: no caching will occur.
            - True: cache will be located in a standard location.
            - non-empty string: cache is located at this file path

            After initialization, you can adjust this setting via:
            `cv.cache.enabled = ...` which accepts the same values.

            Note: This cache is totally separate from the LRU controlled by
            lru_bytes.
  *      cache_locking: (bool) The local cache will use file locks via fasteners to prevent issues with multi-process cache access. If this is not a concern, performance can be slightly improved by setting this to False. This uses CloudFiles' locking mechanism.
  *      cdn_cache: (int, bool, or str) Sets Cache-Control HTTP header on uploaded
          image files. Most cloud providers perform some kind of caching. As of
          this writing, Google defaults to 3600 seconds. Most of the time you'll
          want to go with the default.
          - int: number of seconds for cache to be considered fresh (max-age)
          - bool: True: max-age=3600, False: no-cache
          - str: set the header manually
  *      compress: (bool, str, None) pick which compression method to use.
  *          None: (default) gzip for raw arrays and no additional compression
              for compressed_segmentation and fpzip.
            bool:
              True=gzip,
              False=no compression, Overrides defaults
            str:
              'gzip': Extension so that we can add additional methods in the future
                      like lz4 or zstd.
              'br': Brotli compression, better compression rate than gzip
              '': no compression (same as False).
  *      compress_level: (int, None) level for compression. Higher number results
            in better compression but takes longer.
          Defaults to 9 for gzip (ranges from 0 to 9).
          Defaults to 5 for brotli (ranges from 0 to 11).
  *      compress_cache: (None or bool) If not None, override default compression
            behavior for the cache.
  *      delete_black_uploads: (bool) If True, on uploading an entirely black chunk,
            issue a DELETE request instead of a PUT. This can be useful for avoiding storing
            tiny files in the region around an ROI. Some storage systems using erasure coding
            don't do well with tiny file sizes.
  *      fill_missing: (bool) If a chunk file is unable to be fetched:
            True: Use a block of zeros
            False: Throw an error
  *      green_threads: (bool) Use green threads instead of preemptive threads. This
          can result in higher download performance for some compression types. Preemptive
          threads seem to reduce performance on multi-core machines that aren't densely
          loaded as the CPython threads are assigned to multiple cores and the thrashing
          + GIL reduces performance. You'll need to add the following code to the top
          of your program to use green threads:

              import gevent.monkey
              gevent.monkey.patch_all(threads=False)
  *      lru_bytes: (int) number of bytes used to cache recently used image
          tiles in memory. This is an in-memory cache and is completely separate from
          the `cache` parameter that handles disk IO. Tiles are stripped over only their
          second stage compression.
  *      info: (dict) In lieu of fetching a neuroglancer info file, use this one.
            This is useful when creating new datasets and for repeatedly initializing
            a new cloudvolume instance.
  *      max_redirects: (int) if > 0, allow up to this many redirects via info file 'redirect'
            data fields. If <= 0, allow no redirections and access the current info file directly
            without raising an error.
  *      mesh_dir: (str) if not None, override the info['mesh'] key before pulling the
          mesh info file.
  *      mip: (int or iterable) Which level of downsampling to read and write from.
            0 is the highest resolution. You can also specify the voxel resolution
            like mip=[6,6,30] which will search for the appropriate mip level.
  *      non_aligned_writes: (bool) Enable non-aligned writes. Not multiprocessing
            safe without careful design. When not enabled, a
            cloudvolume.exceptions.AlignmentError is thrown for non-aligned writes.

            https://github.com/seung-lab/cloud-volume/wiki/Advanced-Topic:-Non-Aligned-Writes

        parallel (int: 1, bool): Number of extra processes to launch, 1 means only
            use the main process. If parallel is True use the number of CPUs
            returned by multiprocessing.cpu_count(). When parallel > 1, shared
            memory (Linux) or emulated shared memory via files (other platforms)
            is used by the underlying download.
  *      progress: (bool) Show progress bars.
            Defaults to True in interactive python, False in script execution mode.
  *      provenance: (string, dict) In lieu of fetching a provenance
            file, use this one.
  *      secrets: (dict) provide per-instance authorization tokens. If not provided,
          defaults to looking in .cloudvolume/secrets for necessary tokens.
  *      skel_dir: (str) if not None, override the info['skeletons'] key before
          pulling the skeleton info file.
  *      spatial_index_db: (str) A path to an sqlite3 or mysql database that follows
          the following uri schema. sqlite is assumed if no scheme is present in
          the uri.
            [sqlite://]filename.db
            mysql://<username>:<password>@<host>:<port>/<db_name>

          Igneous generated datasets include a JSON based spatial
          database that tiles the dataset. This can be fast enough up to about 100 TVx
          datasets. Above that, a proper database is required for efficient queries.
          We provide multiple SQL database types that the index can be hosted on.
  *      use_https: (bool) maps gs:// and s3:// to their respective https paths. The
          https paths hit a cached, read-only version of the data and may be faster.



  Better documentation coming later, but for now, here's a summary of the most useful method calls. Use help(cloudvolume.CloudVolume.$method) for more info.

  * create_new_info (class method) - Helper function for creating info files for creating new data layers.
  * refresh_info - Repull the info file.
  * refresh_provenance - Repull the provenance file.
  * bbox_to_mip - Covert a bounding box or slice from one mip level to another.
  * slices_from_global_coords - *deprecated, why not use bbox_to_mip?* Find the CloudVolume slice from MIP 0 coordinates if you're on a different MIP. Often used in combination with neuroglancer.
  * reset_scales - Delete mips other than 0 in the info file. Does not autocommit.
  * add_scale - Generate a new mip level in the info property. Does not autocommit.
  * commit_info - Push the current info property into the cloud as a JSON file.
  * commit_provenance - Push the current provenance property into the cloud as a JSON file.
  * image - Access image operations directly.
    * download - Download bounding boxes from a given mip level.
    * upload - Upload images to bounding boxes at a given mip level.
    * transfer_to - Transfer data without painting a container array to avoid out of memory errors.
    * exists - Check which chunk files exist in a given bounding box.
    * delete - Delete chunks in a given bounding box at a given mip level.
  * mesh - Access mesh operations
  	* get - Download an object. Can merge multiple segmentids
  	* save - Download an object and save it in `.obj` format. You can combine equivialences into a single object too.
  * skeleton - Access Skeletons
    * get - Download an object.
    * upload - Save a skeleton object to the cloud.
  * cache - Access cache operations
  	* enabled - Boolean switch to enable/disable cache. If true, on reading, check local disk cache before downloading, and save downloaded chunks to cache. When writing, write to the cloud then save the chunks you wrote to cache. If false, bypass cache completely. The cache is located at `$HOME/.cloudvolume/cache`.
  	* path - Property that shows the current filesystem path to the cache
  	* list - List files in cache
  	* num_files - Number of files in cache at this mip level , use all_mips=True to get them all
  	* num_bytes - Return the number of bytes in cache at this mip level, all_mips=True to get them all
  	* flush - Delete the cache at this mip level, preserve=Bbox/slice to save a spatial region
  	* flush_region - Delete a spatial region at this mip level
  * exists - Generate a report on which chunks within a bounding box exist.
  * delete - Delete the chunks within this bounding box.
  * transfer_to - Transfer data from a bounding box to another data storage location. Does not allocate memory and transfers in blocks, so can transfer large volumes of data. May be less efficient than a dedicated tool like `gsutil` or `aws s3`.
  * unlink_shared_memory - Delete shared memory associated with this instance (`vol.shared_memory_id`)
  * generate_shared_memory_location - Create a new unique shared memory identifier string. No side effects.
  * download_to_shared_memory - Instead of using ordinary numpy memory allocations, download to shared memory.
      Be careful, shared memory is like a file and doesn't disappear unless explicitly unlinked. (`vol.unlink_shared_memory()`)
  * upload_from_shared_memory - Upload from a given shared memory block without making a copy.
  * download_point - Download the region around this mip 0 coordinate at a given mip level.



  Accessed as `vol.$PROPERTY` like `vol.mip`. Parens next to each property mean (data type:default, writability). (r) means read only, (w) means write only, (rw) means read/write.

  * mip (uint:0, rw) - Read from and write to this mip level (0 is highest res). Each additional increment in the number is typically a 2x reduction in resolution.
  * bounded (bool:True, rw) - If a region outside of volume bounds is accessed throw an error if True or Fill the region with black (useful for e.g. marching cubes's 1px boundary) if False.
  * autocrop (bool:False, rw) - If bounded is False and this option is True, automatically crop requested uploads and downloads to the volume boundary.
  * fill_missing (bool:False, rw) - If a file inside volume bounds is unable to be fetched use a block of zeros if True, else throw an error.
  * delete_black_uploads (bool:False, rw) - If True, issue a DELETE http request instead of a PUT when an individual uploaded chunk is all zeros.
  * info (dict, rw) - Python dict representation of Neuroglancer info JSON file. You must call `vol.commit_info()` to save your changes to storage.
  * provenance (dict-like, rw) - Data layer provenance file representation. You must call `vol.commit_provenance()` to save your changes to storage.
  * available_mips (list of ints, r) - Query which mip levels are defined for reading and writing.
  * dataset_name (str, rw) - Which dataset (e.g. test_v0, snemi3d_v0) on S3, GS, or FS you're reading and writing to. Known as an "experiment" in BOSS terminology. Writing to this property triggers an info refresh.
  * layer (str, rw) - Which data layer (e.g. image, segmentation) on S3, GS, or FS you're reading and writing to. Known as a "channel" in BOSS terminology. Writing to this property triggers an info refresh.
  * base_cloudpath (str, r) - The cloud path to the dataset e.g. s3://bucket/dataset/
  * layer_cloudpath (str, r) - The cloud path to the data layer e.g. gs://bucket/dataset/image
  * info_cloudpath (str, r) - Generate the cloud path to this data layer's info file.
  * scales (dict, r) - Shortcut to the 'scales' property of the info object
  * scale (dict, rw)* - Shortcut to the working scale of the current mip level
  * shape (Vec4, r)* - Like numpy.ndarray.shape for the entire data layer.
  * volume_size (Vec3, r)* - Like shape, but omits channel (x,y,z only).
  * num_channels (int, r) - The number of channels, the last element of shape.
  * layer_type (str, r) - The neuroglancer info type, 'image' or 'segmentation'.
  * dtype (str, r) - The info data_type of the volume, e.g. uint8, uint32, etc. Similar to numpy.ndarray.dtype.
  * encoding (str, r) - The neuroglancer info encoding. e.g. 'raw', 'jpeg', 'npz'
  * resolution (Vec3, r)* - The 3D physical resolution of a voxel in nanometers at the working mip level.
  * downsample_ratio (Vec3, r) - Ratio of the current resolution to the highest resolution mip available.
  * chunk_size (Vec3, r)* - Size of the underlying chunks that constitute the volume in storage. e.g. Vec(64, 64, 64)
  * key (str, r)* - The 'directory' we're accessing the current working mip level from within the data layer. e.g. '6_6_30'
  * bounds (Bbox, r)* - A Bbox object that represents the bounds of the entire volume.
  * shared_memory_id (str, rw) - Shared memory location used for parallel operation or for output.

  \* These properties can also be accessed with a function named like `vol.mip_$PROPERTY($MIP)`. By default they return the current mip level assigned to the CloudVolume, but any mip level can be accessed via the corresponding `mip_` function. Example: `vol.mip_resolution(2)` would return the resolution of mip 2.



  When you download an image using CloudVolume it gives you a `VolumeCutout`. These are `numpy.ndarray` subclasses that support a few extra properties to help make book keeping easier. The major advantage is `save_images()` which can help you view your dataset as PNG slices.

  * `dataset_name` - The dataset this image came from.
  * `layer` - Which layer it came from.
  * `mip` - Which mip it came from
  * `layer_type` - "image" or "segmentation"
  * `bounds` - The bounding box of the cutout
  * `num_channels` - Alias for `vol.shape[3]`
  * `save_images()` - Save Z slice PNGs of the current image to `./saved_images` for manual inspection
  * `viewer()` - Start a local web server (http://localhost:8080) that can view small volumes interactively. This was recently changed from `view` as `view` is a useful numpy method.



  If you have Precomputed volume onto local disk and would like to point neuroglancer to it:

  ```python
  vol = CloudVolume(...)
  vol.viewer()
  ```

  You can then point any version of neuroglancer at it using `precomputed://http://localhost:1337/NAME_OF_LAYER`.



  CloudVolume includes a built-in dependency free viewer for 3D volumetric datasets smaller than about 2GB uncompressed. It supports bool, uint8, uint16, uint32, float32, and float64 numpy data types for both images and segmentation and can render a composite overlay of image and segmentation.

  You can launch a viewer using the `.viewer()` method of a VolumeCutout object or by using the `view(...)` or `hyperview(...)` functions that come with the cloudvolume module. This launches a web server on `http://localhost:8080`. You can read more [on the wiki](https://github.com/seung-lab/cloud-volume/wiki/%CE%BCViewer).

  ```python3
  from cloudvolume import CloudVolume, view, hyperview

  channel_vol = CloudVolume(...)
  seg_vol = CloudVolume(...)
  img = vol[...]
  seg = vol[...]

  img.viewer() # works on VolumeCutouts
  seg.viewer() # segmentation type derived from info
  view(img) # alternative for arbitrary numpy arrays
  view(seg, segmentation=True)
  hyperview(img, seg) # img and seg shape must match

  >>> Viewer server listening to http://localhost:8080
  ```

  There are also seperate viewers for skeleton and mesh objects that can be invoked by calling `.viewer()` on either object. However, skeletons depend on `matplotlib` and meshes depend on `vtk` and OpenGL to function.

  ```bash
  pip install vtk matplotlib
  ```



  Python 2.7 is no longer supported by CloudVolume. Updated versions of `pip` will download the last supported release 1.21.1. You can read more on the policy page: https://github.com/seung-lab/cloud-volume/wiki/Policy#python-27-end-of-life



  1. [Igneous](https://github.com/seung-lab/igneous): Computational pipeline for visualizing neuroglancer volumes.
  2. [CloudVolume.jl](https://github.com/seung-lab/CloudVolume.jl): CloudVolume in Julia
  3. [fpzip](https://github.com/seung-lab/fpzip): A Python Package for the C++ code by Lindstrom et al.
  4. [compressed_segmentation](https://github.com/seung-lab/compressedseg): A Python Package wrapping the code for the compressed_segmentation format developed by Jeremy Maitin-Shepard and Stephen Plaza.
  5. [Kimimaro](https://github.com/seung-lab/kimimaro): High performance skeletonization of densely labeled 3D volumes.
  6. [compresso](https://github.com/seung-lab/compresso): High lossless compression of connectomics segmentation. Algorithm by and code derived from Matejek et al.
  7. [zfpc](https://github.com/seung-lab/zfpc): Optimized zfp multi-stream container for alignment vector fields (and similar floating point data).
  8. [crackle](https://github.com/seung-lab/crackle): Lossless high compression of connectomics segmentation. (BETA)



  Thank you to everyone that has contributed past or current to CloudVolume or the ecosystem it serves. We love you!

  Jeremy Maitin-Shepard created [Neuroglancer](https://github.com/google/neuroglancer) and defined the Precomputed format. Yann Leprince provided a [pure Python codec](https://github.com/HumanBrainProject/neuroglancer-scripts) for the compressed_segmentation format. Jeremy Maitin-Shepard and Stephen Plaza created C++ code defining the compression and decompression (respectively) protocol for [compressed_segmentation](https://github.com/janelia-flyem/compressedseg). Peter Lindstrom et al. created [the fpzip algorithm](https://computation.llnl.gov/projects/floating-point-compression), and contributed a C++ implementation and advice. Nico Kemnitz adapted our data to fpzip using the "Kempression" protocol (we named it, not him). Dan Bumbarger contributed code and information helpful for getting CloudVolume working on Windows. Fredrik Kihlander's [pure python implementation](https://github.com/wc-duck/pymmh3) of murmurhash3 and [Austin Appleby](https://github.com/aappleby/smhasher) developed murmurhash3 which is necessary for the sharded format. Ben Falk advocated for and did the bulk of the work on brotli compression. Some of the ideas in CloudVolume are based on work by Jingpeng Wu in [BigArrays.jl](https://github.com/seung-lab/BigArrays.jl).  Sven Dorkenwald, Manuel Castro, and Akhilesh Halageri contributed advice and code towards implementing the graphene interface. Oluwaseun Ogedengbe contributed documentation for the sharded format. Eric Perlman wrote the reader for Neuroglancer Multi-LOD meshes. Ignacio Tartavull and William Silversmith wrote the initial version of CloudVolume.


pkgId: 68f79c98d02e3cb3a0d8fae2c8025c00b4d51b223ee7320a51a24fe570374720
name: python-cloud-volume
arch: src
version: 11.1.0
epoch: 0
release: 1
url: https://github.com/seung-lab/cloud-volume/
rpm_license: License :: OSI Approved :: BSD License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-volume-11.1.0-1.src.rpm
checksum_type: sha256
summary:
  A serverless client for reading and writing Neuroglancer Precomputed volumes both locally and on cloud services.

description:
  [![PyPI version](https://badge.fury.io/py/cloud-volume.svg)](https://badge.fury.io/py/cloud-volume) [![SfN 2018 Poster](https://img.shields.io/badge/poster-SfN%202018-blue.svg)](https://drive.google.com/open?id=1RKtaAGV2f7F13opnkQfbp6YBqmoD3fZi) [![codecov](https://img.shields.io/badge/codecov-link-%23d819a6)](https://codecov.io/gh/seung-lab/cloud-volume) [![DOI](https://zenodo.org/badge/98333149.svg)](https://zenodo.org/badge/latestdoi/98333149)



  ```python
  from cloudvolume import CloudVolume

  vol = CloudVolume('gs://mylab/mouse/image', parallel=True, progress=True)
  image = vol[:,:,:] # Download a whole image stack into a numpy array from the cloud
  vol[:,:,:] = image # Upload an entire image stack from a numpy array to the cloud

  label = 1
  mesh = vol.mesh.get(label)
  skel = vol.skeleton.get(label)
  ```

  CloudVolume is a serverless Python client for random access reading and writing of [Neuroglancer](https://github.com/google/neuroglancer/) volumes in "[Precomputed](https://github.com/google/neuroglancer/tree/master/src/datasource/precomputed#readme)" format, a set of representations for arbitrarily large volumetric images, meshes, and skeletons. CloudVolume is typically paired with [Igneous](https://github.com/seung-lab/igneous), a Kubernetes compatible system for generating image hierarchies, meshes, skeletons, and other dependency free jobs that can be applied to petavoxel scale images.

  Precomputed volumes are typically stored on [AWS S3](https://aws.amazon.com/s3/), [Google Storage](https://cloud.google.com/storage/), or locally. CloudVolume can read and write to these object storage providers given a service account token with appropriate permissions. However, these volumes can be stored on any service, including an ordinary webserver or local filesystem, that supports key-value access.

  The combination of [Neuroglancer](https://github.com/google/neuroglancer/), [Igneous](https://github.com/seung-lab/igneous), and CloudVolume comprises a system for visualizing, processing, and sharing (via browser viewable URLs) petascale datasets within and between laboratories. A typical example usage would be to visualize raw electron microscope scans of mouse, fish, or fly brains up to a cubic millimeter in physical dimension. Neuroglancer and Igneous would enable you to visualize each step of the process of montaging the image, fine tuning alignment vector fields, creating segmentation layers, ROI masks, or performing other types of analysis. CloudVolume enables you to read from and write to each of these layers. Recently, we have introduced the ability to interact with the graph server ("PyChunkGraph") that backs proofreading automated segmentations via the `graphene://` format.

  You can find a collection of CloudVolume accessible and Neuroglancer viewable datasets at https://neurodata.io/project/ocp/, an open data project by some of our collaborators.



  - Random access to petavoxel Neuroglancer images, meshes, and skeletons.
  - Nearly all output is immediately visualizable using Neuroglancer.\*
  - Reads graph server backed proofreading volumes (via `graphene://`).
  - Serverless (except `graphene://`) and multi-cloud.



  - Supports `precomputed`, `graphene`, `zarr`, (read-only) `n5`, and `boss` formats.
  - Multi-threaded, supports multi-process and green threads.
  - Memory optimized, supports shared memory.
  - Lossless connectomics relevant codecs ([`compressed_segmentation`](https://github.com/seung-lab/compressedseg), [`compresso`](https://github.com/seung-lab/compresso), [`crackle`](https://github.com/seung-lab/crackle) (BETA), [`fpzip`](https://github.com/seung-lab/fpzip/), [`zfpc`](https://github.com/seung-lab/zfpc), [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics), and [`brotli`](https://en.wikipedia.org/wiki/Brotli))
  - Understands image hierarchies & anisotropic pixel resolutions.
  - Accomodates downloading missing tiles (`fill_missing=True`).
  - Accomodates uploading compressed black tiles to erasure coded file systems (`delete_black_uploads=True`).
  - Growing support for the Neuroglancer [sharded format](https://github.com/google/neuroglancer/blob/master/src/datasource/precomputed/sharded.md) which dramatically condenses the number of files required to represent petascale datasets, similar to [Cloud Optimized GeoTIFF](https://www.cogeo.org/), which can result in [dramatic cost savings](https://github.com/seung-lab/kimimaro/wiki/The-Economics:-Skeletons-for-the-People).
  - Reads Precomputed meshes and skeletons.
  - Includes viewers for small images, meshes, and skeletons.
  - Only 3 dimensions + RBG channels currently supported for images.
  - No data versioning.



  Cloud-volume is regularly tested on Ubuntu with 3.8, 3.9, 3.10, 3.11, and 3.12. We officially support Linux and Mac OS. Windows is community supported. After installation, you'll also need to set up your cloud credentials if you're planning on writing files or reading from a private dataset. Once you're finished setting up, you can try [reading from a public dataset](https://github.com/seung-lab/cloud-volume/wiki/Reading-Public-Data-Examples).



  ```bash
  pip install cloud-volume # standard installation
  ```

  CloudVolume depends on several PyPI packages which are Cython bindings for C++. We have provided compiled binaries for many platforms and python versions, however if you are on an unsupported system, pip will attempt to install from source. In that case, follow the instructions below.

  **Windows Note:** If you get errors related to a missing C++ compiler, this blog post might help you: https://www.scivision.dev/python-windows-visual-c-14-required/



  | Tag             | Description                             | Dependencies          |
  |-----------------|-----------------------------------------|-----------------------|
  | boss            | `boss://` format support                | intern, blosc                |
  | zarr            | `zarr://` format support                | blosc                 |
  | test            | Supports testing                        | pytest                |
  | mesh_viewer     | `mesh.viewer()` GUI                     | vtk                   |
  | skeleton_viewer | `skeleton.viewer()` GUI                 | matplotlib            |
  | all_viewers     | All viewers now and in the future.      | vtk, matplotlib       |
  | dask            | Supports converting to/from dask arrays | dask\[array\]         |
  | em_codecs       | Image codecs: JPEG, JPEG-XL, and PNG    | imagecodecs, simplejpeg, pyspng-seunglab |
  | seg_codecs      | Segmentation: compressed-segmentation, compresso, crackle | compressed-segmentation, compresso, crackle-codec         |
  | fp_codecs       | Floating point: fpzip, zfpc             | fpzip, zfpc           |
  | all_codecs      | Installs all optional compression codecs: em_codecs, seg_codecs, fp_codecs, blosc | see above         |

  Example:

  ```bash
  pip install cloud-volume[all_codecs,test,all_viewers]
  ```

  gzip, brotli, JPEG, and compressed-segmentation codecs are installed by default.



  *C++ compiler required.*

  ```bash
  sudo apt-get install g++ python3-dev
  pip install numpy
  pip install cloud-volume
  ```

  Due to packaging problems endemic to Python, Cython packages that depend on numpy require numpy header files be installed before attempting to install the package you want. The numpy headers are not recognized unless numpy is installed in a seperate process that runs first. There are hacks for this issue, but I haven't gotten them to work. If you think binaries should be available for your platform, please let us know by opening an issue.



  This can be desirable if you want to hack on CloudVolume itself.

  ```bash
  git clone git@github.com:seung-lab/cloud-volume.git
  cd cloud-volume


  mkvirtualenv cv
  workon cv

  virtualenv venv
  source venv/bin/activate

  sudo apt-get install g++ python3-dev
  pip install numpy # additional step needed for accelerated compressed_segmentation and fpzip
  pip install -e . # without optional dependencies
  pip install -e .[all_viewers] # with e.g. the all_viewers optional dependency
  ```



  By default, CloudVolume's configuration and cache files are stored in `$HOME/.cloudvolume` (or in `$HOME/.cloudfiles` since we use CloudFiles for the backend). You can configure where CloudVolume looks for these files with the environment variable `$CLOUD_VOLUME_DIR`.

  Credentials are stored in `$CLOUD_VOLUME_DIR/secrets`. You'll need credentials only for the services you'll use. If you plan to use the local filesystem, you won't need any. For Google Storage ([setup instructions here](https://github.com/seung-lab/cloud-volume/wiki/Setting-up-Google-Cloud-Storage)), default account credentials will be used if available and no service account is provided.

  If neither of those two conditions apply, you need a service account credential. If you have your credentials handy, you can provide them like so as a dict, JSON string, or a bare token if the service will accept that.

  ```python
  cv = CloudVolume(..., secrets=...)
  ```

  However, it may be simpler to save your credential to disk so you don't have to always provide it. `google-secret.json` is a service account credential for Google Storage, `aws-secret.json` is a service account for S3, etc. You can support multiple projects at once by prefixing the bucket you are planning to access to the credential filename. `google-secret.json` will be your defaut service account, but if you also want to also access bucket ABC, you can provide `ABC-google-secret.json` and you'll have simultaneous access to your ordinary buckets and ABC. The secondary credentials are accessed on the basis of the bucket name, not the project name.

  ```bash
  mkdir -p ~/.cloudvolume/secrets/
  mv aws-secret.json ~/.cloudvolume/secrets/ # needed for Amazon
  mv google-secret.json ~/.cloudvolume/secrets/ # needed for Google
  mv boss-secret.json ~/.cloudvolume/secrets/ # needed for the BOSS
  mv matrix-secret.json ~/.cloudvolume/secrets/ # needed for Matrix
  mv tigerdata-secret.json ~/.cloudvolume/secrets/ # needed for Tigerdata
  ```



  Create an [IAM user service account](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html) that can read, write, and delete objects from at least one bucket.

  ```json
  {
  	"AWS_ACCESS_KEY_ID": "$MY_AWS_ACCESS_KEY_ID",
  	"AWS_SECRET_ACCESS_KEY": "$MY_SECRET_ACCESS_TOKEN"
  }
  ```



  You can create the `google-secret.json` file [here](https://console.cloud.google.com/iam-admin/serviceaccounts). You don't need to manually fill in JSON by hand, the below example is provided to show you what the end result should look like. You should be able to read, write, and delete objects from at least one bucket.

  ```json
  {
    "type": "service_account",
    "project_id": "$YOUR_GOOGLE_PROJECT_ID",
    "private_key_id": "...",
    "private_key": "...",
    "client_email": "...",
    "client_id": "...",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": ""
  }
  ```



  *Note: used to be called chunkedgraph-secret.json. This is still supported but deprecated.*

  If you have a token from Graphene/Chunkedgraph server, create the `cave-secret.json` file as shown in the example below. You may also pass the token to `CloudVolume(..., secrets=token)`.

  ```json
  {
    "token": "<your_token>"
  }
  ```

  Note that to take advantage of multiple credential files, prepend the fully qualified domain name (FQDN) of the server instead of the bucket for GCS and S3. For example, `sudomain.domain.com-cave-secret.json`.



  CloudVolume supports reading and writing to Neuroglancer data layers on Amazon S3, Google Storage, The BOSS, and the local file system.

  Supported URLs are of the forms:

  `$FORMAT://$PROTOCOL://$BUCKET/$DATASET/$LAYER`

  The format or protocol fields may be omitted where required. In the case of the precomputed format, the format specifier is optional.

  | Format      | Protocols                                    | Default | Example                                |
  |-------------|----------------------------------------------|---------|----------------------------------------|
  | precomputed | gs, s3, http, https, file, matrix, tigerdata | Yes     | gs://mybucket/dataset/layer            |
  | graphene    | gs, s3, http, https, file, matrix, tigerdata |         | graphene://gs://mybucket/dataset/layer |
  | boss        | N/A                                          |         | boss://collection/experiment/channel   |
  | n5          | gs, s3, http, https, file, matrix, tigerdata |         | n5://gs://mybucket/dataset/layer       |
  | zarr        | gs, s3, http, https, file, matrix, tigerdata |         | zarr://gs://mybucket/dataset/layer     |



  * precomputed: Neuroglancer's native format. ([specification](https://github.com/google/neuroglancer/tree/master/src/datasource/precomputed#readme))
  * graphene: Precomputed based format used by the PyChunkGraph server.
  * boss: The BOSS (https://docs.theboss.io/docs)
  * n5: Not HDF5 (https://github.com/saalfeldlab/n5) Read-only support. Supports raw, gzip, bz2, and xz but not lz4 compression. mode 0 datasets only.
  * [zarr](https://github.com/zarr-developers/zarr-python): Custom implementation supports reading and writing for 5D arrays, but limited support for the 5th dimension.



  * gs:   Google Storage
  * s3:   Amazon S3
  * http(s): (read-only) Ordinary Web Servers
  * file: Local File System (absolute path)
  * matrix: Princeton Internal System (run in large part by Seung Lab)
  * tigerdata: Princeton Internal System (run by Princeton OIT)

  CloudVolume also supports [alternative s3 aliases](https://github.com/seung-lab/cloud-files#alias-for-alternative-s3-endpoints) via CloudFiles.




  Neuroglancer relies on an [`info`](https://github.com/google/neuroglancer/blob/master/src/datasource/precomputed/volume.md#info-json-file-specification) file located at the root of a dataset layer to tell it how to compute file locations and interpret the data in each file. CloudVolume piggy-backs on this functionality.

  In the below example, assume you are creating a new segmentation volume from a 3d numpy array "rawdata". Note Precomputed stores data in Fortran (column major, aka CZYX) order. You should do a small test to see if the image is written transposed. You can fix this by uploading `rawdata.T`. A more detailed example for uploading a local volume [is located here](https://github.com/seung-lab/cloud-volume/wiki/Example-Single-Machine-Dataset-Upload).

  ```python3
  from cloudvolume import CloudVolume

  info = CloudVolume.create_new_info(
      num_channels    = 1,
      layer_type      = 'segmentation',
      data_type       = 'uint64', # Channel images might be 'uint8'
      
      encoding        = 'raw',
      resolution      = [4, 4, 40], # Voxel scaling, units are in nanometers
      voxel_offset    = [0, 0, 0], # x,y,z offset in voxels from the origin
      mesh            = 'mesh',
      
      
      chunk_size      = [ 512, 512, 16 ], # units are voxels
      volume_size     = [ 250000, 250000, 25000 ], # e.g. a cubic millimeter dataset
  )
  vol = CloudVolume(cfg.path, info=info)
  vol.commit_info()
  vol[cfg.x: cfg.x + cfg.length, cfg.y:cfg.y + cfg.length, cfg.z: cfg.z + cfg.length] = rawdata[:,:,:]
  ```
  | Encoding                | Image Type                 | Lossless | Neuroglancer Viewable | Description                                                                              |
  |-------------------------|----------------------------|----------|-------------|------------------------------------------------------------------------------------------|
  | raw                     | Any                        | Y        | Y           | Serialized numpy arrays.                                                                 |
  | png                     | Image                      | Y        | Y           | Multiple slices stiched into a single PNG.                                               |
  | jpeg                    | Image                      | N        | Y           | Multiple slices stiched into a single JPEG.                                              |
  | jxl                     | Image                      | Optional | Y*          | Multiple slices stiched into a single JPEG-XL.                                           |
  | compressed_segmentation | Segmentation               | Y        | Y           | Renumbered numpy arrays to reduce data width. Also used by Neuroglancer internally.      |
  | compresso               | Segmentation               | Y        | Y           | Lossless high compression algorithm for connectomics segmentation.                       |
  | crackle                 | Segmentation               | Y        | Y*           | Lossless high compression algorithm for connectomics segmentation.                       |
  | fpzip                   | Floating Point             | Y        | Y*           | Takes advantage of IEEE 754 structure + L1 Lorenzo predictor to get higher compression.  |
  | kempressed              | Anisotropic Z Floating Point | N**      | Y*           | Adds manipulations on top of fpzip to achieve higher compression.                        |
  | zfpc                    | Alignment Vector Fields    | N***     | Y*          | zfp stream container.                        |

  \* Not integrated into official Neuroglancer yet, but available on a [fork](https://allcodecs-dot-neuromancer-seung-import.appspot.com/) which can be seen on Github [here](https://github.com/william-silversmith/neuroglancer/tree/wms_combined_codecs).
  \*\* Lossless if your data can handle adding and then subtracting 2.
  \*\*\* Lossless by default, but you probably want to use the lossy mode.

  Note on `compressed_segmentation`: To use, make sure `compressed_segmentation_block_size` is specified (usually `[8,8,8]`. This field will appear in the `info` file in the relevant scale.

  Note on `zfpc`: To configure, use the fields `zfpc_rate`, `zfpc_precision`, `zfpc_tolerance`, `zfpc_correlated_dims` in the relevant scale of the `info` file.




  ```python

  vol = CloudVolume('gs://mybucket/retina/image')
  vol = CloudVolume('gs://mybucket/retina/image', secrets=token, dict or json)
  vol = CloudVolume('gs://bucket/dataset/channel', mip=0, bounded=True, fill_missing=False)
  vol = CloudVolume('gs://bucket/dataset/channel', mip=[ 8, 8, 40 ], bounded=True, fill_missing=False) # set mip at this resolution
  vol = CloudVolume('gs://bucket/datasset/channel', info=info) # New info file from scratch
  image = vol[:,:,:] # Download the entire image stack into a numpy array
  image = vol.download(bbox, mip=2, renumber=True) # download w/ smaller dtype
  image = vol.download(bbox, mip=2, label=777) # download binary image for label
  uniq = vol.unique(bbox, mip=0) # efficient extraction of unique labels
  listing = vol.exists( np.s_[0:64, 0:128, 0:64] ) # get a report on which chunks actually exist
  exists = vol.image.has_data(mip=0) # boolean check to see if any data is there
  listing = vol.delete( np.s_[0:64, 0:128, 0:64] ) # delete this region (bbox must be chunk aligned)
  vol[64:128, 64:128, 64:128] = image # Write a 64^3 image to the volume
  img = vol.download_point( (x,y,z), size=256, mip=3 ) # download region around (mip 0) x,y,z at mip 3
  pts = vol.scattered_points([ (x1,y1,z1), (x2,y2,z2) ]) # download voxel labels located at indicated points

  files = vol.download_files(bbox, mip, decompress=False)




  mem_vol = vol.image.memory_cutout(bbox, mip=1, encoding="compresso")


  vol.viewer() # launches neuroglancer compatible web server on http://localhost:1337


  img = vol[64:1028, 64:1028, 64:128]
  img.viewer() # launches web viewer on http://localhost:8080


  vol.mesh.save(12345) # save 12345 as ./12345.ply on disk
  vol.mesh.save([12345, 12346, 12347]) # merge three segments into one file
  vol.mesh.save(12345, file_format='obj') # 'ply' and 'obj' are both supported
  vol.mesh.get(12345) # return the mesh as vertices and faces instead of writing to disk
  vol.mesh.get([ 12345, 12346 ]) # return these two segids fused into a single mesh
  vol.mesh.get([ 12345, 12346 ], fuse=False) # return { 12345: mesh, 12346: mesh }
  vol.mesh.put(meshes) # works for unsharded legacy only
  vol.mesh.delete(segids) # works for unsharded meshes only

  mesh.viewer() # Opens GUI. Requires vtk.


  skel = vol.skeleton.get(12345)
  vol.skeleton.upload_raw(segid, skel.vertices, skel.edges, skel.radii, skel.vertex_types)
  vol.skeleton.upload(skel)


  skels = vol.skeleton.get_by_bbox( Bbox( (0,0,0), (500, 500, 500) ) )
  vol.skeleton.spatial_index # None if not available

  skel.empty() # boolean

  bytes = skel.encode() # encode to Precomputed format (bytes)
  skel = Skeleton.decode(bytes) # decode from PrecomputedFormat

  skel = skel.crop(slices or bbox) # eliminate vertices and edges outside bbox
  skel = skel.consolidate() # eliminate duplicate vertices and edges
  skel3 = skel.merge(skel2) # merge two skeletons into one
  skel = skel.clone() # create copy
  skel = Skeleton.from_swc(swcstr) # decode an SWC file
  skel_str = skel.to_swc() # convert to SWC file in string representation
  skel.viewer() # Opens GUI. Requires matplotlib

  skel.cable_length() # sum of all edge lengths
  skel = skel.downsample(2) # reduce size of skeleton by factor of 2
  skel = skel.average_smoothing(3) # rolling average, n=3

  skel1 == skel2 # check if contents of internal arrays match
  Skeleton.equivalent(skel1, skel2) # ...even if there are differences like differently numbered edges


  vol = CloudVolume('gs://mybucket/retina/image', parallel=True) # Use all cores
  vol.parallel = 4 # e.g. any number > 1, use this many cores
  data = vol[:] # uses shared memory to coordinate processes under the hood


  vol = CloudVolume(...)


  data = vol.download_to_shared_memory(np.s_[:], location='some-example')
  vol.unlink_shared_memory() # delete the shared memory associated with this cloudvolume
  vol.shared_memory_id # get/set the default shared memory location for this instance


  vol = CloudVolume(...)
  vol.upload_from_shared_memory('my-shared-memory-id', # do not prefix with /dev/shm
      bbox=Bbox( (0,0,0), (10000, 7500, 64) ))



  vol.download_to_file('/path/to/file', bbox=Bbox(...), mip=0) # bbox is the download region
  vol.upload_from_file('/path/to/file', bbox=Bbox(...), mip=0) # bbox is the region it represents


  vol = CloudVolume(...)


  vol.transfer_to('gs://bucket/dataset/layer', vol.bounds)




  vol = CloudVolume('gs://mybucket/retina/image', cache=True) # Basic Example
  image = vol[0:10,0:10,0:10] # Download partial image and cache
  vol[0:10,0:10,0:10] = image # Upload partial image and cache


  vol = CloudVolume(..., lru_bytes=num_bytes) # >= 0, 0 means disabled
  vol.image.lru.resize(num_bytes) # same
  vol.image.lru.clear()
  len(vol.image.lru) # number of items in lru
  vol.image.lru.nbytes # size in bytes (not counting LRU structures, nor recursive)
  vol.image.lru.items() # etc, also functions as a dict



  vol = CloudVolume(..., lru_bytes=num_bytes, lru_encoding='raw')


  vol.cache.list() # list files in cache at this mip level
  vol.cache.list(mip=1) # list files in cache at mip 1
  vol.cache.list_meshes()
  vol.cache.list_skeletons()
  vol.cache.num_files() # number of files at this mip level
  vol.cache.num_bytes(all_mips=True) # Return num files for each mip level in a list
  vol.cache.num_bytes() # number of bytes taken up by files, size on disk can be bigger
  vol.cache.num_bytes(all_mips=True) # Return num bytes for each mip level in a list

  vol.cache.enabled = True/False # Turn the cache on/off
  vol.cache.path = Str # set the cache location
  vol.cache.compress = None/True/False # None: Link to cloud setting, Boolean: Force cache to compressed (True) or uncompressed (False)


  vol.cache.flush() # Delete local cache for this layer at this mip level
  vol.cache.flush(preserve=Bbox(...)) # Same, but preserve cache in a region of space
  vol.cache.flush_region(region=Bbox(...), mips=[...]) # Delete the cached files in this region at these mip levels (default all mips)
  vol.cache.flush_info()
  vol.cache.flush_provenance()


  import gevent.monkey
  gevent.monkey.patch_all(thread=False)

  cv = CloudVolume(..., green_threads=True)
  img = cv[...] # now green threads will be used


  arr = cv.to_dask()
  arr = cloudvolume.dask.from_cloudvolume(cloudpath) # same as to_dask
  res = cloudvolume.dask.to_cloudvolume(arr, cloudpath, compute=bool, return_store=bool)
  ```



  ```python3
  CloudVolume(
      cloudpath:str, mip:int=0, bounded:bool=True,
      autocrop:bool=False, fill_missing:bool=False, cache:CacheType=False,
      compress_cache:CompressType=None, cdn_cache:bool=True,
      progress:bool=INTERACTIVE, info:dict=None, provenance:dict=None,
      compress:CompressType=None, compress_level:Optional[int]=None,
      non_aligned_writes:bool=False, parallel:ParallelType=1, delete_black_uploads:bool=False,
      background_color:int=0, green_threads:bool=False, use_https:bool=False,
      max_redirects:int=10, mesh_dir:Optional[str]=None, skel_dir:Optional[str]=None,
      agglomerate:bool=False, secrets:SecretsType=None,
      spatial_index_db:Optional[str]=None, lru_bytes:int = 0,
      cache_locking:bool = True
  )
  ```


  *      agglomerate: (bool, graphene only) sets the default mode for downloading
          images to agglomerated (True) vs watershed (False).
  *      autocrop: (bool) If the specified retrieval bounding box exceeds the
            volume bounds, process only the area contained inside the volume.
            This can be useful way to ensure that you are staying inside the
            bounds when `bounded=False`.
  *      background_color: (number) Specifies what the "background value" of the
          volume is (traditionally 0). This is mainly for changing the behavior
          of delete_black_uploads.
  *      bounded: (bool) If a region outside of volume bounds is accessed:
            True: Throw an error
            False: Allow accessing the region. If no files are present, an error
                will still be thrown. Consider combining this option with
                `fill_missing=True`. However, this can be dangrous as it allows
                missing files and potentially network errors to be intepreted as
                zeros.
  *      cache: (bool or str) Store downs and uploads in a cache on disk
              and preferentially read from it before redownloading.
            - falsey value: no caching will occur.
            - True: cache will be located in a standard location.
            - non-empty string: cache is located at this file path

            After initialization, you can adjust this setting via:
            `cv.cache.enabled = ...` which accepts the same values.

            Note: This cache is totally separate from the LRU controlled by
            lru_bytes.
  *      cache_locking: (bool) The local cache will use file locks via fasteners to prevent issues with multi-process cache access. If this is not a concern, performance can be slightly improved by setting this to False. This uses CloudFiles' locking mechanism.
  *      cdn_cache: (int, bool, or str) Sets Cache-Control HTTP header on uploaded
          image files. Most cloud providers perform some kind of caching. As of
          this writing, Google defaults to 3600 seconds. Most of the time you'll
          want to go with the default.
          - int: number of seconds for cache to be considered fresh (max-age)
          - bool: True: max-age=3600, False: no-cache
          - str: set the header manually
  *      compress: (bool, str, None) pick which compression method to use.
  *          None: (default) gzip for raw arrays and no additional compression
              for compressed_segmentation and fpzip.
            bool:
              True=gzip,
              False=no compression, Overrides defaults
            str:
              'gzip': Extension so that we can add additional methods in the future
                      like lz4 or zstd.
              'br': Brotli compression, better compression rate than gzip
              '': no compression (same as False).
  *      compress_level: (int, None) level for compression. Higher number results
            in better compression but takes longer.
          Defaults to 9 for gzip (ranges from 0 to 9).
          Defaults to 5 for brotli (ranges from 0 to 11).
  *      compress_cache: (None or bool) If not None, override default compression
            behavior for the cache.
  *      delete_black_uploads: (bool) If True, on uploading an entirely black chunk,
            issue a DELETE request instead of a PUT. This can be useful for avoiding storing
            tiny files in the region around an ROI. Some storage systems using erasure coding
            don't do well with tiny file sizes.
  *      fill_missing: (bool) If a chunk file is unable to be fetched:
            True: Use a block of zeros
            False: Throw an error
  *      green_threads: (bool) Use green threads instead of preemptive threads. This
          can result in higher download performance for some compression types. Preemptive
          threads seem to reduce performance on multi-core machines that aren't densely
          loaded as the CPython threads are assigned to multiple cores and the thrashing
          + GIL reduces performance. You'll need to add the following code to the top
          of your program to use green threads:

              import gevent.monkey
              gevent.monkey.patch_all(threads=False)
  *      lru_bytes: (int) number of bytes used to cache recently used image
          tiles in memory. This is an in-memory cache and is completely separate from
          the `cache` parameter that handles disk IO. Tiles are stripped over only their
          second stage compression.
  *      info: (dict) In lieu of fetching a neuroglancer info file, use this one.
            This is useful when creating new datasets and for repeatedly initializing
            a new cloudvolume instance.
  *      max_redirects: (int) if > 0, allow up to this many redirects via info file 'redirect'
            data fields. If <= 0, allow no redirections and access the current info file directly
            without raising an error.
  *      mesh_dir: (str) if not None, override the info['mesh'] key before pulling the
          mesh info file.
  *      mip: (int or iterable) Which level of downsampling to read and write from.
            0 is the highest resolution. You can also specify the voxel resolution
            like mip=[6,6,30] which will search for the appropriate mip level.
  *      non_aligned_writes: (bool) Enable non-aligned writes. Not multiprocessing
            safe without careful design. When not enabled, a
            cloudvolume.exceptions.AlignmentError is thrown for non-aligned writes.

            https://github.com/seung-lab/cloud-volume/wiki/Advanced-Topic:-Non-Aligned-Writes

        parallel (int: 1, bool): Number of extra processes to launch, 1 means only
            use the main process. If parallel is True use the number of CPUs
            returned by multiprocessing.cpu_count(). When parallel > 1, shared
            memory (Linux) or emulated shared memory via files (other platforms)
            is used by the underlying download.
  *      progress: (bool) Show progress bars.
            Defaults to True in interactive python, False in script execution mode.
  *      provenance: (string, dict) In lieu of fetching a provenance
            file, use this one.
  *      secrets: (dict) provide per-instance authorization tokens. If not provided,
          defaults to looking in .cloudvolume/secrets for necessary tokens.
  *      skel_dir: (str) if not None, override the info['skeletons'] key before
          pulling the skeleton info file.
  *      spatial_index_db: (str) A path to an sqlite3 or mysql database that follows
          the following uri schema. sqlite is assumed if no scheme is present in
          the uri.
            [sqlite://]filename.db
            mysql://<username>:<password>@<host>:<port>/<db_name>

          Igneous generated datasets include a JSON based spatial
          database that tiles the dataset. This can be fast enough up to about 100 TVx
          datasets. Above that, a proper database is required for efficient queries.
          We provide multiple SQL database types that the index can be hosted on.
  *      use_https: (bool) maps gs:// and s3:// to their respective https paths. The
          https paths hit a cached, read-only version of the data and may be faster.



  Better documentation coming later, but for now, here's a summary of the most useful method calls. Use help(cloudvolume.CloudVolume.$method) for more info.

  * create_new_info (class method) - Helper function for creating info files for creating new data layers.
  * refresh_info - Repull the info file.
  * refresh_provenance - Repull the provenance file.
  * bbox_to_mip - Covert a bounding box or slice from one mip level to another.
  * slices_from_global_coords - *deprecated, why not use bbox_to_mip?* Find the CloudVolume slice from MIP 0 coordinates if you're on a different MIP. Often used in combination with neuroglancer.
  * reset_scales - Delete mips other than 0 in the info file. Does not autocommit.
  * add_scale - Generate a new mip level in the info property. Does not autocommit.
  * commit_info - Push the current info property into the cloud as a JSON file.
  * commit_provenance - Push the current provenance property into the cloud as a JSON file.
  * image - Access image operations directly.
    * download - Download bounding boxes from a given mip level.
    * upload - Upload images to bounding boxes at a given mip level.
    * transfer_to - Transfer data without painting a container array to avoid out of memory errors.
    * exists - Check which chunk files exist in a given bounding box.
    * delete - Delete chunks in a given bounding box at a given mip level.
  * mesh - Access mesh operations
  	* get - Download an object. Can merge multiple segmentids
  	* save - Download an object and save it in `.obj` format. You can combine equivialences into a single object too.
  * skeleton - Access Skeletons
    * get - Download an object.
    * upload - Save a skeleton object to the cloud.
  * cache - Access cache operations
  	* enabled - Boolean switch to enable/disable cache. If true, on reading, check local disk cache before downloading, and save downloaded chunks to cache. When writing, write to the cloud then save the chunks you wrote to cache. If false, bypass cache completely. The cache is located at `$HOME/.cloudvolume/cache`.
  	* path - Property that shows the current filesystem path to the cache
  	* list - List files in cache
  	* num_files - Number of files in cache at this mip level , use all_mips=True to get them all
  	* num_bytes - Return the number of bytes in cache at this mip level, all_mips=True to get them all
  	* flush - Delete the cache at this mip level, preserve=Bbox/slice to save a spatial region
  	* flush_region - Delete a spatial region at this mip level
  * exists - Generate a report on which chunks within a bounding box exist.
  * delete - Delete the chunks within this bounding box.
  * transfer_to - Transfer data from a bounding box to another data storage location. Does not allocate memory and transfers in blocks, so can transfer large volumes of data. May be less efficient than a dedicated tool like `gsutil` or `aws s3`.
  * unlink_shared_memory - Delete shared memory associated with this instance (`vol.shared_memory_id`)
  * generate_shared_memory_location - Create a new unique shared memory identifier string. No side effects.
  * download_to_shared_memory - Instead of using ordinary numpy memory allocations, download to shared memory.
      Be careful, shared memory is like a file and doesn't disappear unless explicitly unlinked. (`vol.unlink_shared_memory()`)
  * upload_from_shared_memory - Upload from a given shared memory block without making a copy.
  * download_point - Download the region around this mip 0 coordinate at a given mip level.



  Accessed as `vol.$PROPERTY` like `vol.mip`. Parens next to each property mean (data type:default, writability). (r) means read only, (w) means write only, (rw) means read/write.

  * mip (uint:0, rw) - Read from and write to this mip level (0 is highest res). Each additional increment in the number is typically a 2x reduction in resolution.
  * bounded (bool:True, rw) - If a region outside of volume bounds is accessed throw an error if True or Fill the region with black (useful for e.g. marching cubes's 1px boundary) if False.
  * autocrop (bool:False, rw) - If bounded is False and this option is True, automatically crop requested uploads and downloads to the volume boundary.
  * fill_missing (bool:False, rw) - If a file inside volume bounds is unable to be fetched use a block of zeros if True, else throw an error.
  * delete_black_uploads (bool:False, rw) - If True, issue a DELETE http request instead of a PUT when an individual uploaded chunk is all zeros.
  * info (dict, rw) - Python dict representation of Neuroglancer info JSON file. You must call `vol.commit_info()` to save your changes to storage.
  * provenance (dict-like, rw) - Data layer provenance file representation. You must call `vol.commit_provenance()` to save your changes to storage.
  * available_mips (list of ints, r) - Query which mip levels are defined for reading and writing.
  * dataset_name (str, rw) - Which dataset (e.g. test_v0, snemi3d_v0) on S3, GS, or FS you're reading and writing to. Known as an "experiment" in BOSS terminology. Writing to this property triggers an info refresh.
  * layer (str, rw) - Which data layer (e.g. image, segmentation) on S3, GS, or FS you're reading and writing to. Known as a "channel" in BOSS terminology. Writing to this property triggers an info refresh.
  * base_cloudpath (str, r) - The cloud path to the dataset e.g. s3://bucket/dataset/
  * layer_cloudpath (str, r) - The cloud path to the data layer e.g. gs://bucket/dataset/image
  * info_cloudpath (str, r) - Generate the cloud path to this data layer's info file.
  * scales (dict, r) - Shortcut to the 'scales' property of the info object
  * scale (dict, rw)* - Shortcut to the working scale of the current mip level
  * shape (Vec4, r)* - Like numpy.ndarray.shape for the entire data layer.
  * volume_size (Vec3, r)* - Like shape, but omits channel (x,y,z only).
  * num_channels (int, r) - The number of channels, the last element of shape.
  * layer_type (str, r) - The neuroglancer info type, 'image' or 'segmentation'.
  * dtype (str, r) - The info data_type of the volume, e.g. uint8, uint32, etc. Similar to numpy.ndarray.dtype.
  * encoding (str, r) - The neuroglancer info encoding. e.g. 'raw', 'jpeg', 'npz'
  * resolution (Vec3, r)* - The 3D physical resolution of a voxel in nanometers at the working mip level.
  * downsample_ratio (Vec3, r) - Ratio of the current resolution to the highest resolution mip available.
  * chunk_size (Vec3, r)* - Size of the underlying chunks that constitute the volume in storage. e.g. Vec(64, 64, 64)
  * key (str, r)* - The 'directory' we're accessing the current working mip level from within the data layer. e.g. '6_6_30'
  * bounds (Bbox, r)* - A Bbox object that represents the bounds of the entire volume.
  * shared_memory_id (str, rw) - Shared memory location used for parallel operation or for output.

  \* These properties can also be accessed with a function named like `vol.mip_$PROPERTY($MIP)`. By default they return the current mip level assigned to the CloudVolume, but any mip level can be accessed via the corresponding `mip_` function. Example: `vol.mip_resolution(2)` would return the resolution of mip 2.



  When you download an image using CloudVolume it gives you a `VolumeCutout`. These are `numpy.ndarray` subclasses that support a few extra properties to help make book keeping easier. The major advantage is `save_images()` which can help you view your dataset as PNG slices.

  * `dataset_name` - The dataset this image came from.
  * `layer` - Which layer it came from.
  * `mip` - Which mip it came from
  * `layer_type` - "image" or "segmentation"
  * `bounds` - The bounding box of the cutout
  * `num_channels` - Alias for `vol.shape[3]`
  * `save_images()` - Save Z slice PNGs of the current image to `./saved_images` for manual inspection
  * `viewer()` - Start a local web server (http://localhost:8080) that can view small volumes interactively. This was recently changed from `view` as `view` is a useful numpy method.



  If you have Precomputed volume onto local disk and would like to point neuroglancer to it:

  ```python
  vol = CloudVolume(...)
  vol.viewer()
  ```

  You can then point any version of neuroglancer at it using `precomputed://http://localhost:1337/NAME_OF_LAYER`.



  CloudVolume includes a built-in dependency free viewer for 3D volumetric datasets smaller than about 2GB uncompressed. It supports bool, uint8, uint16, uint32, float32, and float64 numpy data types for both images and segmentation and can render a composite overlay of image and segmentation.

  You can launch a viewer using the `.viewer()` method of a VolumeCutout object or by using the `view(...)` or `hyperview(...)` functions that come with the cloudvolume module. This launches a web server on `http://localhost:8080`. You can read more [on the wiki](https://github.com/seung-lab/cloud-volume/wiki/%CE%BCViewer).

  ```python3
  from cloudvolume import CloudVolume, view, hyperview

  channel_vol = CloudVolume(...)
  seg_vol = CloudVolume(...)
  img = vol[...]
  seg = vol[...]

  img.viewer() # works on VolumeCutouts
  seg.viewer() # segmentation type derived from info
  view(img) # alternative for arbitrary numpy arrays
  view(seg, segmentation=True)
  hyperview(img, seg) # img and seg shape must match

  >>> Viewer server listening to http://localhost:8080
  ```

  There are also seperate viewers for skeleton and mesh objects that can be invoked by calling `.viewer()` on either object. However, skeletons depend on `matplotlib` and meshes depend on `vtk` and OpenGL to function.

  ```bash
  pip install vtk matplotlib
  ```



  Python 2.7 is no longer supported by CloudVolume. Updated versions of `pip` will download the last supported release 1.21.1. You can read more on the policy page: https://github.com/seung-lab/cloud-volume/wiki/Policy#python-27-end-of-life



  1. [Igneous](https://github.com/seung-lab/igneous): Computational pipeline for visualizing neuroglancer volumes.
  2. [CloudVolume.jl](https://github.com/seung-lab/CloudVolume.jl): CloudVolume in Julia
  3. [fpzip](https://github.com/seung-lab/fpzip): A Python Package for the C++ code by Lindstrom et al.
  4. [compressed_segmentation](https://github.com/seung-lab/compressedseg): A Python Package wrapping the code for the compressed_segmentation format developed by Jeremy Maitin-Shepard and Stephen Plaza.
  5. [Kimimaro](https://github.com/seung-lab/kimimaro): High performance skeletonization of densely labeled 3D volumes.
  6. [compresso](https://github.com/seung-lab/compresso): High lossless compression of connectomics segmentation. Algorithm by and code derived from Matejek et al.
  7. [zfpc](https://github.com/seung-lab/zfpc): Optimized zfp multi-stream container for alignment vector fields (and similar floating point data).
  8. [crackle](https://github.com/seung-lab/crackle): Lossless high compression of connectomics segmentation. (BETA)



  Thank you to everyone that has contributed past or current to CloudVolume or the ecosystem it serves. We love you!

  Jeremy Maitin-Shepard created [Neuroglancer](https://github.com/google/neuroglancer) and defined the Precomputed format. Yann Leprince provided a [pure Python codec](https://github.com/HumanBrainProject/neuroglancer-scripts) for the compressed_segmentation format. Jeremy Maitin-Shepard and Stephen Plaza created C++ code defining the compression and decompression (respectively) protocol for [compressed_segmentation](https://github.com/janelia-flyem/compressedseg). Peter Lindstrom et al. created [the fpzip algorithm](https://computation.llnl.gov/projects/floating-point-compression), and contributed a C++ implementation and advice. Nico Kemnitz adapted our data to fpzip using the "Kempression" protocol (we named it, not him). Dan Bumbarger contributed code and information helpful for getting CloudVolume working on Windows. Fredrik Kihlander's [pure python implementation](https://github.com/wc-duck/pymmh3) of murmurhash3 and [Austin Appleby](https://github.com/aappleby/smhasher) developed murmurhash3 which is necessary for the sharded format. Ben Falk advocated for and did the bulk of the work on brotli compression. Some of the ideas in CloudVolume are based on work by Jingpeng Wu in [BigArrays.jl](https://github.com/seung-lab/BigArrays.jl).  Sven Dorkenwald, Manuel Castro, and Akhilesh Halageri contributed advice and code towards implementing the graphene interface. Oluwaseun Ogedengbe contributed documentation for the sharded format. Eric Perlman wrote the reader for Neuroglancer Multi-LOD meshes. Ignacio Tartavull and William Silversmith wrote the initial version of CloudVolume.


  Please cite the Igneous paper if you used this package in your research:

  [Igneous: Distributed dense 3D segmentation meshing, neuron skeletonization, and hierarchical downsampling](https://www.frontiersin.org/journals/neural-circuits/articles/10.3389/fncir.2022.977700/full)


pkgId: 823969ec787487b64f4ee1625abd363815e52d5fce8f74989d247eed9be5f151
name: python-cloud-workstation
arch: src
version: 0.3.0
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://pypi.org/project/cloud-workstation/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud-workstation-0.3.0-1.src.rpm
checksum_type: sha256
description:
  <p align="center">
  <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg"></a>
  </p>

  Please see the docs [here](https://square.github.io/cloud-workstation/).


pkgId: 926e2b45c92e2ec9c880f84de638f4c79ba339f767c8e0f87da42c177628344d
name: python-cloud4rpi
arch: src
version: 1.1.2
epoch: 0
release: 1
summary: Cloud4RPi client library
url: https://github.com/cloud4rpi/cloud4rpi
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud4rpi-1.1.2-1.src.rpm
checksum_type: sha256
description:
  |Build Status|
  This package provides a client library that simplifies the connection to
  the `Cloud4RPi <https://cloud4rpi.io/>`__ service.


pkgId: 8bd08f5dc17b01370c083b9026a3fa660daa7f04413ccc60705529b46fc2970c
name: python-cloud_sptheme
arch: src
version: 1.10.1.post20200504175005
epoch: 0
release: 1
summary: a nice sphinx theme named 'Cloud', and some related extensions
url: https://cloud-sptheme.readthedocs.io
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloud_sptheme-1.10.1.post20200504175005-1.src.rpm
checksum_type: sha256
description:
  This is a small package containing a Sphinx theme named "Cloud",
  along with some related Sphinx extensions. To see an example
  of the theme in action, check out it's documentation
  at `<https://cloud-sptheme.readthedocs.io>`_.


pkgId: a65f50f3fc6c2e8d9fb9d8baa581d141e6b6592f98c0087b3225ad82e04dcce0
name: python-cloudant
arch: src
version: 2.15.0
epoch: 0
release: 1
summary: Cloudant / CouchDB Client Library
url: https://github.com/cloudant/python-cloudant
rpm_license: Apache Software License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudant-2.15.0-1.src.rpm
checksum_type: sha256
description:
  **This library is now deprecated and will be end-of-life on Dec 31 2021.**

  The library remains supported until the end-of-life date,
  but will receive only _critical_ maintenance updates.

  Please see the [Migration Guide](./MIGRATION.md) for advice
  about migrating to our replacement library
  [cloudant-python-sdk](https://github.com/IBM/cloudant-python-sdk).

  For FAQs and additional information please refer to the
  [Cloudant blog](https://blog.cloudant.com/2021/06/30/Cloudant-SDK-Transition.html).



  [![Build Status](https://travis-ci.org/cloudant/python-cloudant.svg?branch=master)](https://travis-ci.org/cloudant/python-cloudant)
  [![Readthedocs](https://readthedocs.org/projects/pip/badge/)](http://python-cloudant.readthedocs.io)
  [![Compatibility](https://img.shields.io/badge/python-3.5-blue.svg)](http://python-cloudant.readthedocs.io/en/latest/compatibility.html)
  [![pypi](https://img.shields.io/pypi/v/cloudant.svg)](https://pypi.python.org/pypi/cloudant)

  This is the official Cloudant library for Python.

  * [Installation and Usage](#installation-and-usage)
  * [Getting Started](#getting-started)
  * [API Reference](http://python-cloudant.readthedocs.io/en/latest/cloudant.html)
  * [Related Documentation](#related-documentation)
  * [Development](#development)
      * [Contributing](CONTRIBUTING.md)
      * [Test Suite](CONTRIBUTING.md#running-the-tests)
      * [Using in Other Projects](#using-in-other-projects)
      * [License](#license)
      * [Issues](#issues)
  * [Migrating to `cloudant-python-sdk` library](#migrating-to-cloudant-python-sdk-library)




  Released versions of this library are [hosted on PyPI](https://pypi.python.org/pypi/cloudant) and can be installed with `pip`.

  In order to install the latest version, execute

      pip install cloudant



  See [Getting started (readthedocs.io)](http://python-cloudant.readthedocs.io/en/latest/getting_started.html)



  See [API reference docs (readthedocs.io)](http://python-cloudant.readthedocs.io/en/latest/cloudant.html)



  * [Cloudant Python client library docs (readthedocs.io)](http://python-cloudant.readthedocs.io)
  * [Cloudant documentation](https://console.bluemix.net/docs/services/Cloudant/cloudant.html#overview)
  * [Cloudant Learning Center](https://developer.ibm.com/clouddataservices/cloudant-learning-center/)
  * [Tutorial for creating and populating a database on IBM Cloud](https://console.bluemix.net/docs/services/Cloudant/tutorials/create_database.html#creating-and-populating-a-simple-cloudant-nosql-db-database-on-ibm-cloud)



  See [CONTRIBUTING.md](https://github.com/cloudant/python-cloudant/blob/master/CONTRIBUTING.md)



  The preferred approach for using `python-cloudant` in other projects is to use the PyPI as described above.



  [Getting Started with Python Flask on IBM Cloud](https://github.com/IBM-Cloud/get-started-python)

  [Movie Recommender Demo](https://github.com/snowch/movie-recommender-demo):
  - [Update and check if documents exist](https://github.com/snowch/movie-recommender-demo/blob/master/web_app/app/dao.py#L162-L168)
  - [Connect to Cloudant using 429 backoff with 10 retries](https://github.com/snowch/movie-recommender-demo/blob/master/web_app/app/cloudant_db.py#L17-L18)

  [Watson Recipe Bot](https://github.com/ibm-watson-data-lab/watson-recipe-bot-python-cloudant):
  - [Use Cloudant Query to find design docs](https://github.com/ibm-watson-data-lab/watson-recipe-bot-python-cloudant/blob/master/souschef/cloudant_recipe_store.py#L33-L77)



  Copyright © 2015 IBM. All rights reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.



  Before opening a new issue please consider the following:
  * Only the latest release is supported. If at all possible please try to reproduce the issue using
  the latest version.
  * Please check the [existing issues](https://github.com/cloudant/python-cloudant/issues)
  to see if the problem has already been reported. Note that the default search
  includes only open issues, but it may already have been closed.
  * Cloudant customers should contact Cloudant support for urgent issues.
  * When opening a new issue [here in github](../../issues) please complete the template fully.


  We have a newly supported Cloudant Python SDK named [cloudant-python-sdk](https://github.com/IBM/cloudant-python-sdk).
  For advice on migrating from this module see [MIGRATION.md](MIGRATION.md).


pkgId: 000b85dd2fd72f7128c8d37b549e2aab5262c634286b6cd1b0adba4e9a3b534f
name: python-cloudauthz
arch: src
version: 0.6.0
epoch: 0
release: 1
summary: Implements means of authorization delegation on cloud-based resource providers.
url: https://github.com/galaxyproject/cloudauthz
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudauthz-0.6.0-1.src.rpm
checksum_type: sha256
description:
  Install the latest release from PyPi:

      pip install cloudauthz




  CloudAuthz can authorize access to [Amazon Web Services (AWS)](#amazon-web-services), [Microsoft Azure](#microsoft-azure), and [Google Cloud Platform (GCP)](#google-cloud-platform). An example for each provider is given in the following.

  - ### Amazon Web Services

      ```python
      from cloudauthz import *

      cloudauthz = CloudAuthz()
      config = {
          "id_token": " ... ",
          "role_arn": " ... "
      }
      credentials = cloudauthz.authorize("aws", config)
      ```

      The `credentials` object is a dictionary as the following:

      ```json
      {
        "SecretAccessKey": " ... ",
        "SessionToken": " ... ",
        "Expiration": "2019-05-28T02:12:45Z",
        "AccessKeyId": " ... "
      }
      ```

  - ### Microsoft Azure

      ```python
      from cloudauthz import *

      cloudauthz = CloudAuthz()
      config = {
          "tenant_id": " ... ",
          "client_id": " ... ",
          "client_secret": " ... "
      }
      credentials = cloudauthz.authorize("azure", config)
      ```

      The `credentials` object is a dictionary as the following:

      ```json
      {
          "expiresIn": 3599,
          "_authority": "https://login.microsoftonline.com/TENANT_ID",
          "resource": "https://storage.azure.com/",
          "tokenType": "Bearer",
          "expiresOn": "2018-06-28 12:30:24.895661",
          "isMRRT": true,
          "_clientId": " ... ",
          "accessToken": " ... ",
      }
      ```

  - ### Google Cloud Platform

      ```python
      from cloudauthz import *

      cloudauthz = CloudAuthz()
      config = {
          "project_id": "...",
          "private_key_id": "...",
          "private_key": "...",
          "client_email": "...",
          "client_id": "..."
      }
      credentials = cloudauthz.authorize("gcp", config)
      ```

      The `credentials` object is a dictionary containing the following keys:

      ```json
      {
        "type": "service_account",
        "project_id": "...",
        "private_key_id": "...",
        "private_key": "...",
        "client_email": "...",
        "client_id": "...",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_x509_cert_url": "..."
      }
      ```


pkgId: 0cf5d1981ffd4eafaa97bf108c153fb249c215b9de06fa5dbf38d7f587fdea23
name: python-cloudbees-openfeature-provider-python
arch: src
version: 0.1.5
epoch: 0
release: 1
summary: CloudBees.com OpenFeature SDK
url: https://pypi.org/project/cloudbees-openfeature-provider-python/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudbees-openfeature-provider-python-0.1.5-1.src.rpm
checksum_type: sha256
description:
  [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
  [![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
  [![OpenFeature Specification](https://img.shields.io/static/v1?label=OpenFeature%20Specification&message=v0.3.0&color=red)](https://github.com/open-feature/spec/tree/v0.3.0)
  [![OpenFeature SDK](https://img.shields.io/static/v1?label=OpenFeature%20SDK&message=v1.0.0&color=green)](https://github.com/open-feature/python-sdk/)
  [![CloudBees Rox SDK](https://img.shields.io/static/v1?label=Rox%20SDK&message=v5.0.10&color=green)](https://pypi.org/project/rox/)

  This is the [CloudBees](https://www.cloudbees.com/products/feature-management) provider implementation for [OpenFeature](https://openfeature.dev/) for the [Python SDK](https://github.com/open-feature/python-sdk).

  OpenFeature provides a vendor-agnostic abstraction layer on Feature Flag management.

  This provider allows the use of CloudBees Feature Management as a backend for Feature Flag configurations.


  - python 3.8 or higher





  ```bash
  pip install cloudbees-openfeature-provider-python
  ```


  ```bash
  pip install openfeature-sdk
  ```




  Follow the instructions on the [Python SDK project](https://github.com/open-feature/python-sdk) for how to use the Python SDK.

  You can configure the CloudBees provider by doing the following:

  ```python
  from openfeature import api
  from openfeature.api import EvaluationContext
  from cloudbees.provider import CloudbeesProvider

  appKey = 'INSERT_APP_KEY_HERE'
  provider = CloudbeesProvider(appKey)
  api.set_provider(provider)
  client = api.get_client()
  value = client.get_boolean_value("enabled-new-feature", False)
  ```


pkgId: 0c9ee365d260db78c5760b023a3570f532127fd6fe2a134b9ab42bdc5ca48242
name: python-cloudbuild-validator
arch: src
version: 0.1.0
epoch: 0
release: 1
url: https://pypi.org/project/cloudbuild-validator/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudbuild-validator-0.1.0-1.src.rpm
checksum_type: sha256
summary:
  A robust and extensible tool for validating Google Cloud Build YAML configuration files against schema specifications and custom rules.

description:
  A robust and extensible tool for validating Google Cloud Build YAML configuration files against [schema specifications](https://cloud.google.com/build/docs/build-config-file-schema) and custom rules.
  By providing a comprehensive set of validation checks and the ability to extend its functionality, this program helps ensure the correctness and consistency of your Cloud Build configuration files, potentially saving time and resources in your CI/CD pipeline



  The Cloud Build YAML Validator performs comprehensive checks on your configuration files:

  - **YAML Syntax**: Ensures the file is a valid YAML document.
  - **Schema Compliance**: Validates the YAML structure against Cloud Build specifications.
  - **Duplicate Step IDs**: Identifies duplicate step IDs within the configuration file.
  - **Step Dependencies**: Verifies that all `waitFor` references point to valid step IDs.
  - **Substitution Variables**: Checks for unreferenced substitution variables and ensures they start with an underscore (`_`).
  - **Custom Validations**: Easily extendable with additional custom validation rules.



  You can install the Cloud Build YAML Validator using `pip`, `uv`, or your preferred Python package manager:

  ```bash
  git clone https://github.com/alimasri/google-cloudbuild-yaml-validator
  cd google-cloudbuild-yaml-validator
  pip install -e .
  ```





  The validator can be run from the command line with the following syntax:

  ```bash
  cloudbuild-validator [-h] [-s SCHEMA] -f FILE
  ```


  - `-h, --help`: Show the help message and exit
  - `-s SCHEMA, --schema SCHEMA`: Path to the schema file to validate against
  - `-f FILE, --file FILE`: Path to the content file to validate



  ```bash
  cloudbuild-validator -f /path/to/cloudbuild.yaml
  ```



  You can also use the validator as a Python library:

  ```python
  from cloudbuild_validator.core import CloudbuildValidator

  validator = CloudbuildValidator(speficifactions_file="/path/to/specifications/file.yaml")
  validator.validate_file('/path/to/cloudbuild.yaml')
  ```



  The validator enforces schema specifications for Google Cloud Build YAML configuration files, based on the official Cloud Build documentation. Users can provide a custom schema file using the `-s` or `--schema` option. The default schema file is located at `src/cloudbuild_validator/data/cloudbuild-specifcations.yaml`, which can be used as a reference for creating custom schemas.

  By adhering to this schema, users ensure their Cloud Build configuration files are valid and correctly interpreted by the Cloud Build service. Example modifications could include adding organization-specific patterns for image names, environment variables, or other configuration options.







  The validator automatically discovers and executes all `Validator` subclasses in the `validators.py` file. To add a new validation rule:

  1. Create a new class that inherits from `cloudbuild_validator.validators.Validator`
  2. Implement the `validate` method

  The `validate` method should accept a dictionary representing the Cloud Build configuration file and raise a `cloudbuild_validator.exceptions.CloudBuildValidationError` if the validation fails.



  ```python
  class StepIdPrefixValidator(Validator):
      """Ensures that step IDs start with a specific prefix."""

      def __init__(self, prefix: str):
          super().__init__()
          self.prefix = prefix

      def validate(self, content: dict) -> None:
          for step in content.get('steps', []):
              step_id = step.get('id', '')
              if not step_id.startswith(self.prefix):
                  raise CloudBuildValidationError(f"Step ID '{step_id}' does not start with the expected prefix '{self.prefix}'.")
  ```



  The `CloudbuildValidator` class provides an `add_validator` method that allows users to add custom validation rules. This method accepts a `Validator` subclass and adds it to the list of validators that will be executed during the validation process.



  ```python
  from cloudbuild_validator import CloudbuildValidator
  from cloudbuild_validator.validators import Validator

  class CustomValidator(Validator):
      def validate(self, content: dict) -> None:
          
          pass

  validator = CloudbuildValidator()
  validator.add_validator(CustomValidator())
  ```



  Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.



  This project is distributed under the MIT License. See the [LICENSE](LICENSE) file for more information.


pkgId: fbfccd0efda62bed5b6b1df81fb2347e775d12529ccf02d0832146c7db3a84d2
name: python-cloudbuild-validator
arch: src
version: 0.1.1
epoch: 0
release: 1
url: https://pypi.org/project/cloudbuild-validator/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudbuild-validator-0.1.1-1.src.rpm
checksum_type: sha256
summary:
  A robust and extensible tool for validating Google Cloud Build YAML configuration files against schema specifications and custom rules.

description:
  A robust and extensible tool for validating Google Cloud Build YAML configuration files against [schema specifications](https://cloud.google.com/build/docs/build-config-file-schema) and custom rules.
  By providing a comprehensive set of validation checks and the ability to extend its functionality, this program helps ensure the correctness and consistency of your Cloud Build configuration files, potentially saving time and resources in your CI/CD pipeline



  The Cloud Build YAML Validator performs comprehensive checks on your configuration files:

  - **YAML Syntax**: Ensures the file is a valid YAML document.
  - **Schema Compliance**: Validates the YAML structure against Cloud Build specifications.
  - **Duplicate Step IDs**: Identifies duplicate step IDs within the configuration file.
  - **Step Dependencies**: Verifies that all `waitFor` references point to valid step IDs.
  - **Substitution Variables**: Checks for unreferenced substitution variables and ensures they start with an underscore (`_`).
  - **Custom Validations**: Easily extendable with additional custom validation rules.



  You can install the Cloud Build YAML Validator using `pip`, `uv`, or your preferred Python package manager:

  ```bash
  git clone https://github.com/alimasri/google-cloudbuild-yaml-validator
  cd google-cloudbuild-yaml-validator
  pip install -e .
  ```





  The validator can be run from the command line with the following syntax:

  ```bash
  usage: cloudbuild-validator [-h] [-s SCHEMA] file

  positional arguments:
    file                  Path to the content file to validate

  options:
    -h, --help            show this help message and exit
    -s SCHEMA, --schema SCHEMA
                          Path to the schema file to validate against
  ```



  ```bash
  cloudbuild-validator /path/to/cloudbuild.yaml
  ```



  You can also use the validator as a Python library:

  ```python
  from cloudbuild_validator.core import CloudbuildValidator

  validator = CloudbuildValidator(speficifactions_file="/path/to/specifications/file.yaml")
  validator.validate_file('/path/to/cloudbuild.yaml')
  ```



  The validator enforces schema specifications for Google Cloud Build YAML configuration files, based on the official Cloud Build documentation. Users can provide a custom schema file using the `-s` or `--schema` option. The default schema file is located at `src/cloudbuild_validator/data/cloudbuild-specifcations.yaml`, which can be used as a reference for creating custom schemas.

  By adhering to this schema, users ensure their Cloud Build configuration files are valid and correctly interpreted by the Cloud Build service. Example modifications could include adding organization-specific patterns for image names, environment variables, or other configuration options.







  The validator automatically discovers and executes all `Validator` subclasses in the `validators.py` file. To add a new validation rule:

  1. Create a new class that inherits from `cloudbuild_validator.validators.Validator`
  2. Implement the `validate` method

  The `validate` method should accept a dictionary representing the Cloud Build configuration file and raise a `cloudbuild_validator.exceptions.CloudBuildValidationError` if the validation fails.



  ```python
  class StepIdPrefixValidator(Validator):
      """Ensures that step IDs start with a specific prefix."""

      def __init__(self, prefix: str):
          super().__init__()
          self.prefix = prefix

      def validate(self, content: dict) -> None:
          for step in content.get('steps', []):
              step_id = step.get('id', '')
              if not step_id.startswith(self.prefix):
                  raise CloudBuildValidationError(f"Step ID '{step_id}' does not start with the expected prefix '{self.prefix}'.")
  ```



  The `CloudbuildValidator` class provides an `add_validator` method that allows users to add custom validation rules. This method accepts a `Validator` subclass and adds it to the list of validators that will be executed during the validation process.



  ```python
  from cloudbuild_validator import CloudbuildValidator
  from cloudbuild_validator.validators import Validator

  class CustomValidator(Validator):
      def validate(self, content: dict) -> None:
          
          pass

  validator = CloudbuildValidator()
  validator.add_validator(CustomValidator())
  ```



  Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.



  This project is distributed under the MIT License. See the [LICENSE](LICENSE) file for more information.


pkgId: 8743b0ae6fd347508af100f4557b4f1ce902f21a196b8f5aba5be01ade38fb7e
name: python-cloudcheck
arch: src
version: 5.0.1.595
epoch: 0
release: 1
summary: Check whether an IP address belongs to a cloud provider
url: https://github.com/blacklanternsecurity/cloudcheck
rpm_license: GPL-3.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcheck-5.0.1.595-1.src.rpm
checksum_type: sha256
description:
  A simple Python utility to check whether an IP address or hostname belongs to a cloud provider.

  `cloud_providers.json` contains lists of domains and up-to-date CIDRs for each cloud provider (updated daily via CI/CD).

  Used by [Bighuge BLS OSINT Tool (BBOT)](https://github.com/blacklanternsecurity/bbot).


  ~~~bash
  pip install cloudcheck
  ~~~


  ~~~bash
  $ cloudcheck 168.62.20.37
  168.62.20.37 belongs to Azure (cloud) (168.62.0.0/19)

  $ cloudcheck test.evilcorp.azurewebsites.net
  test.evilcorp.azurewebsites.net belongs to Azure (cloud) (azurewebsites.net)
  ~~~


  ~~~python
  import cloudcheck

  provider, provider_type, subnet = cloudcheck.check("168.62.20.37")
  print(provider) # "Azure"
  print(provider_type) # "cloud"
  print(subnet) # IPv4Network('168.62.0.0/19')
  ~~~


  - Amazon ([source](https://ip-ranges.amazonaws.com/ip-ranges.json))
  - Azure ([source](https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519))
  - Google ([source](https://www.gstatic.com/ipranges/cloud.json))
  - Oracle Cloud ([source](https://docs.cloud.oracle.com/en-us/iaas/tools/public_ip_ranges.json))
  - DigitalOcean ([source](http://digitalocean.com/geo/google.csv))
  - Cloudflare ([source](https://api.cloudflare.com/client/v4/ips))
  - Akamai ([source](https://techdocs.akamai.com/property-manager/pdfs/akamai_ipv4_ipv6_CIDRs-txt.zip))
  - Github ([source](https://api.github.com/meta))
  - Zoho ([source](https://github.com/blacklanternsecurity/cloudcheck/blob/master/cloudcheck/providers/zoho.py))
  - Fastly ([source](https://api.fastly.com/public-ip-list))


pkgId: cfa91b883a38d67304deaf77e05b294ce25dcb9b23cc948e297a85fd847ecdaa
name: python-cloudcheck
arch: src
version: 6.0.0.638
epoch: 0
release: 1
summary: Check whether an IP address belongs to a cloud provider
url: https://github.com/blacklanternsecurity/cloudcheck
rpm_license: GPL-3.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcheck-6.0.0.638-1.src.rpm
checksum_type: sha256
description:
  A simple Python utility to check whether an IP address or hostname belongs to a cloud provider.

  `cloud_providers.json` contains lists of domains and up-to-date CIDRs for each cloud provider (updated daily via CI/CD).

  Used by [Bighuge BLS OSINT Tool (BBOT)](https://github.com/blacklanternsecurity/bbot).


  ~~~bash
  pip install cloudcheck
  ~~~


  ~~~bash
  $ cloudcheck 168.62.20.37
  168.62.20.37 belongs to Azure (cloud) (168.62.0.0/19)

  $ cloudcheck test.evilcorp.azurewebsites.net
  test.evilcorp.azurewebsites.net belongs to Azure (cloud) (azurewebsites.net)
  ~~~


  ~~~python
  import cloudcheck

  provider, provider_type, subnet = cloudcheck.check("168.62.20.37")
  print(provider) # "Azure"
  print(provider_type) # "cloud"
  print(subnet) # IPv4Network('168.62.0.0/19')
  ~~~


  - Amazon ([source](https://ip-ranges.amazonaws.com/ip-ranges.json))
  - Azure ([source](https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519))
  - Google ([source](https://www.gstatic.com/ipranges/cloud.json))
  - Oracle Cloud ([source](https://docs.cloud.oracle.com/en-us/iaas/tools/public_ip_ranges.json))
  - DigitalOcean ([source](http://digitalocean.com/geo/google.csv))
  - Cloudflare ([source](https://api.cloudflare.com/client/v4/ips))
  - Akamai ([source](https://techdocs.akamai.com/property-manager/pdfs/akamai_ipv4_ipv6_CIDRs-txt.zip))
  - Github ([source](https://api.github.com/meta))
  - Zoho ([source](https://github.com/blacklanternsecurity/cloudcheck/blob/master/cloudcheck/providers/zoho.py))
  - Fastly ([source](https://api.fastly.com/public-ip-list))
  - Imperva ([source](https://my.imperva.com/api/integration/v1/ips))


pkgId: eaf0aaf3e3e51b203f25b5388c0bac124052460716e860d003812e96e5f811a0
name: python-cloudcheck
arch: src
version: 6.0.0.661
epoch: 0
release: 1
summary: Check whether an IP address belongs to a cloud provider
url: https://github.com/blacklanternsecurity/cloudcheck
rpm_license: GPL-3.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcheck-6.0.0.661-1.src.rpm
checksum_type: sha256
description:
  A simple Python utility to check whether an IP address or hostname belongs to a cloud provider.

  `cloud_providers.json` contains lists of domains and up-to-date CIDRs for each cloud provider (updated daily via CI/CD).

  Used by [Bighuge BLS OSINT Tool (BBOT)](https://github.com/blacklanternsecurity/bbot).


  ~~~bash
  pip install cloudcheck
  ~~~


  ~~~bash
  $ cloudcheck 168.62.20.37
  168.62.20.37 belongs to Azure (cloud) (168.62.0.0/19)

  $ cloudcheck test.evilcorp.azurewebsites.net
  test.evilcorp.azurewebsites.net belongs to Azure (cloud) (azurewebsites.net)
  ~~~


  ~~~python
  import cloudcheck

  provider, provider_type, subnet = cloudcheck.check("168.62.20.37")
  print(provider) # "Azure"
  print(provider_type) # "cloud"
  print(subnet) # IPv4Network('168.62.0.0/19')
  ~~~


  - Akamai ([source](https://techdocs.akamai.com/property-manager/pdfs/akamai_ipv4_ipv6_CIDRs-txt.zip))
  - Amazon ([source](https://ip-ranges.amazonaws.com/ip-ranges.json))
  - Arvancloud ([source](https://www.arvancloud.ir/en/ips.txt))
  - Azure ([source](https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519))
  - Cloudflare ([source](https://api.cloudflare.com/client/v4/ips))
  - Cloudfront ([source](https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips))
  - DigitalOcean ([source](http://digitalocean.com/geo/google.csv))
  - Fastly ([source](https://api.fastly.com/public-ip-list))
  - Github ([source](https://api.github.com/meta))
  - Google ([source](https://www.gstatic.com/ipranges/cloud.json))
  - Imperva ([source](https://my.imperva.com/api/integration/v1/ips))
  - Oracle Cloud ([source](https://docs.cloud.oracle.com/en-us/iaas/tools/public_ip_ranges.json))
  - Zoho ([source](https://github.com/blacklanternsecurity/cloudcheck/blob/master/cloudcheck/providers/zoho.py))


pkgId: bce5bd027074a6762b237897fc96e01ee093ba559870273725d0f28a44cb3ec0
name: python-cloudcix
arch: src
version: 0.14.3
epoch: 0
release: 1
summary: Python3 bindings and utils for CloudCIX API.
url: https://python-cloudcix.readthedocs.io/en/latest/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcix-0.14.3-1.src.rpm
checksum_type: sha256
description:
  ``cloudcix`` is a Python client for the CloudCIX REST API for rapidly building secure, scalable CloudCIX applications.
  For more information about CloudCIX, see `here <https://www.cloudcix.com/>`__.

rpm_license:
  Copyright 2015 CloudCIX  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


pkgId: 4bd973d5f1334af7917589d62288eb845af33d35af6be7687435f9e1342c69c9
name: python-cloudcomponents.cdk-blue-green-container-deployment
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Blue green container deployment with CodeDeploy
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-blue-green-container-deployment-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-blue-green-container-deployment)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-blue-green-container-deployment/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > Blue green container deployment with CodeDeploy



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-blue-green-container-deployment
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-blue-green-container-deployment
  ```



  ```python
  import { EcsService, DummyTaskDefinition, EcsDeploymentGroup, PushImageProject } from '@cloudcomponents/cdk-blue-green-container-deployment';
  import { ImageRepository } from '@cloudcomponents/cdk-container-registry';
  import { Duration, Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeBuildAction, CodeCommitSourceAction, CodeDeployEcsDeployAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Vpc, Port } from 'aws-cdk-lib/aws-ec2';
  import { Cluster } from 'aws-cdk-lib/aws-ecs';
  import { ApplicationLoadBalancer, ApplicationTargetGroup, TargetType } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
  import { Construct } from 'constructs';

  export class BlueGreenContainerDeploymentStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const vpc = new Vpc(this, 'Vpc', {
        maxAzs: 2,
      });

      const cluster = new Cluster(this, 'Cluster', {
        vpc,
        clusterName: 'blue-green-cluster',
      });

      const loadBalancer = new ApplicationLoadBalancer(this, 'LoadBalancer', {
        vpc,
        internetFacing: true,
      });

      const prodListener = loadBalancer.addListener('ProfListener', {
        port: 80,
      });

      const testListener = loadBalancer.addListener('TestListener', {
        port: 8080,
      });

      const prodTargetGroup = new ApplicationTargetGroup(this, 'ProdTargetGroup', {
        port: 80,
        targetType: TargetType.IP,
        vpc,
      });

      prodListener.addTargetGroups('AddProdTg', {
        targetGroups: [prodTargetGroup],
      });

      const testTargetGroup = new ApplicationTargetGroup(this, 'TestTargetGroup', {
        port: 8080,
        targetType: TargetType.IP,
        vpc,
      });

      testListener.addTargetGroups('AddTestTg', {
        targetGroups: [testTargetGroup],
      });

      // Will be replaced by CodeDeploy in CodePipeline
      const taskDefinition = new DummyTaskDefinition(this, 'DummyTaskDefinition', {
        image: 'nginx',
        family: 'blue-green',
      });

      const ecsService = new EcsService(this, 'EcsService', {
        cluster,
        serviceName: 'blue-green-service',
        desiredCount: 2,
        taskDefinition,
        prodTargetGroup,
        testTargetGroup,
      });

      ecsService.connections.allowFrom(loadBalancer, Port.tcp(80));
      ecsService.connections.allowFrom(loadBalancer, Port.tcp(8080));

      const deploymentGroup = new EcsDeploymentGroup(this, 'DeploymentGroup', {
        applicationName: 'blue-green-application',
        deploymentGroupName: 'blue-green-deployment-group',
        ecsServices: [ecsService],
        targetGroups: [prodTargetGroup, testTargetGroup],
        prodTrafficListener: prodListener,
        testTrafficListener: testListener,
        terminationWaitTime: Duration.minutes(100),
      });

      // @see files: ./blue-green-repository for example content
      const repository = new Repository(this, 'CodeRepository', {
        repositoryName: 'blue-green-repository',
      });

      const imageRepository = new ImageRepository(this, 'ImageRepository', {
        forceDelete: true, //Only for tests
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
      });

      const imageArtifact = new Artifact('ImageArtifact');
      const manifestArtifact = new Artifact('ManifestArtifact');

      const pushImageProject = new PushImageProject(this, 'PushImageProject', {
        imageRepository,
        taskDefinition,
      });

      const buildAction = new CodeBuildAction({
        actionName: 'PushImage',
        project: pushImageProject,
        input: sourceArtifact,
        outputs: [imageArtifact, manifestArtifact],
      });

      const deployAction = new CodeDeployEcsDeployAction({
        actionName: 'CodeDeploy',
        taskDefinitionTemplateInput: manifestArtifact,
        appSpecTemplateInput: manifestArtifact,
        containerImageInputs: [
          {
            input: imageArtifact,
            taskDefinitionPlaceholder: 'IMAGE1_NAME',
          },
        ],
        deploymentGroup,
      });

      new Pipeline(this, 'Pipeline', {
        pipelineName: 'blue-green-pipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Build',
            actions: [buildAction],
          },
          {
            stageName: 'Deploy',
            actions: [deployAction],
          },
        ],
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-blue-green-container-deployment/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-blue-green-container-deployment//LICENSE)


pkgId: f169662253ee3c4ad12934a3028391a11b15e855a9c5bf958ce914d52fc3db11
name: python-cloudcomponents.cdk-chatops
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Constructs for chattool integration: #slack / msteams
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-chatops-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-chatops)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-chatops/)

  > Constructs for chattool integration: #slack / msteams



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-chatops
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-chatops
  ```



  ```python
  import {
    RepositoryNotificationRule,
    PipelineNotificationRule,
    RepositoryEvent,
    PipelineEvent,
    SlackChannel,
    MSTeamsIncomingWebhook,
  } from '@cloudcomponents/cdk-developer-tools-notifications';
  import {
    SlackChannelConfiguration,
    MSTeamsIncomingWebhookConfiguration,
    AccountLabelMode,
  } from '@cloudcomponents/cdk-chatops';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeCommitSourceAction, ManualApprovalAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Construct } from 'constructs';

  export class NotificationsStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'notifications-repository',
      });

      const slackChannel = new SlackChannelConfiguration(this, 'SlackChannel', {
        slackWorkspaceId: process.env.SLACK_WORKSPACE_ID as string,
        configurationName: 'notifications',
        slackChannelId: process.env.SLACK_CHANNEL_ID as string,
      });

      const webhook = new MSTeamsIncomingWebhookConfiguration(
        this,
        'MSTeamsWebhook',
        {
          url: process.env.INCOMING_WEBHOOK_URL as string,
          accountLabelMode: AccountLabelMode.ID_AND_ALIAS,
          themeColor: '#FF0000',
        },
      );

      new RepositoryNotificationRule(this, 'RepoNotifications', {
        name: 'notifications-repository',
        repository,
        events: [
          RepositoryEvent.COMMENTS_ON_COMMITS,
          RepositoryEvent.PULL_REQUEST_CREATED,
          RepositoryEvent.PULL_REQUEST_MERGED,
        ],
        targets: [
          new SlackChannel(slackChannel),
          new MSTeamsIncomingWebhook(webhook),
        ],
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
      });

      const approvalAction = new ManualApprovalAction({
        actionName: 'Approval',
      });

      const pipeline = new Pipeline(this, 'Pipeline', {
        pipelineName: 'notifications-pipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Approval',
            actions: [approvalAction],
          },
        ],
      });

      new PipelineNotificationRule(this, 'PipelineNotificationRule', {
        name: 'pipeline-notification',
        pipeline,
        events: [
          PipelineEvent.PIPELINE_EXECUTION_STARTED,
          PipelineEvent.PIPELINE_EXECUTION_FAILED,
          PipelineEvent.PIPELINE_EXECUTION_SUCCEEDED,
          // PipelineEvent.ACTION_EXECUTION_STARTED,
          // PipelineEvent.ACTION_EXECUTION_SUCCEEDED,
          // PipelineEvent.ACTION_EXECUTION_FAILED,
          PipelineEvent.MANUAL_APPROVAL_NEEDED,
          PipelineEvent.MANUAL_APPROVAL_SUCCEEDED,
          // PipelineEvent.MANUAL_APPROVAL_FAILED,
          // PipelineEvent.STAGE_EXECUTION_STARTED,
          // PipelineEvent.STAGE_EXECUTION_SUCCEEDED,
          // PipelineEvent.STAGE_EXECUTION_FAILED,
        ],
        targets: [
          new SlackChannel(slackChannel),
          new MSTeamsIncomingWebhook(webhook),
        ],
      });
    }
  }
  ```



  [Add incoming webhook](https://docs.microsoft.com/de-de/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook):

  1. Navigate to the channel where you want to add the webhook and select (•••) More Options from the top navigation bar.
  2. Choose Connectors from the drop-down menu and search for Incoming Webhook.
  3. Select the Configure button, provide a name, and, optionally, upload an image avatar for your webhook.
  4. The dialog window will present a unique URL that will map to the channel. Make sure that you copy and save the URL—you will need to provide it to the outside service.
  5. Select the Done button. The webhook will be available in the team channel.



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-chatops/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-chatops/LICENSE)


pkgId: 5e278f7910a1a193c5d57faa25f27583611a796e93ff98d0b721942ce8c75429
name: python-cloudcomponents.cdk-cloudfront-authorization
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: CloudFront with Cognito authentication using Lambda@Edge
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-cloudfront-authorization-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-cloudfront-authorization)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-cloudfront-authorization/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > CloudFront with Cognito authentication using Lambda@Edge

  This construct is based on https://github.com/aws-samples/cloudfront-authorization-at-edge.



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-cloudfront-authorization
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-cloudfront-authorization
  ```



  ```python
  import { SpaAuthorization, SpaDistribution } from '@cloudcomponents/cdk-cloudfront-authorization';
  import { Stack, StackProps, aws_cognito } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class CloudFrontAuthorizationStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const userPool = new aws_cognito.UserPool(this, 'UserPool', {
        selfSignUpEnabled: false,
        userPoolName: 'cloudfront-authorization-userpool',
      });

      // UserPool must have a domain!
      userPool.addDomain('Domain', {
        cognitoDomain: {
          domainPrefix: 'cloudcomponents',
        },
      });

      const authorization = new SpaAuthorization(this, 'Authorization', {
        userPool,
      });

      new SpaDistribution(this, 'Distribution', {
        authorization,
      });
    }
  }
  ```



  ```python
  import { SpaAuthorization, SpaDistribution } from '@cloudcomponents/cdk-cloudfront-authorization';
  import { Stack, StackProps, aws_cognito } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class CloudFrontAuthorizationStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const userPool = new aws_cognito.UserPool(this, 'UserPool', {
        selfSignUpEnabled: false,
        userPoolName: 'cloudfront-authorization-userpool',
      });

      // UserPool must have a domain!
      userPool.addDomain('Domain', {
        cognitoDomain: {
          domainPrefix: 'cloudcomponents',
        },
      });

      const authorization = new StaticSiteAuthorization(this, 'Authorization', {
        userPool,
      });

      new StaticSiteDistribution(this, 'Distribution', {
        authorization,
      });
    }
  }
  ```



  Identity providers can be specified in the authorization object. To make sure that the user pool client is created after the identity provider, please specify a dependency using "addDependency".

  ```python
  const identityProvider = UserPoolIdentityProviderAmazon(this, "IdentityProvider", {
    // ...
  })
  const authorization = new SpaAuthorization(this, 'Authorization_SPA', {
    // ...
    identityProviders: [cognito.UserPoolClientIdentityProvider.AMAZON],
  };
  authorization.userPoolClient.node.addDependency(identityProvider);
  ```





  * User Pool client does not use a client secret
  * The cookies with JWT's are not "http only", so that they can be read and used by the SPA (e.g. to display the user name, or to refresh tokens)
  * 404's (page not found on S3) will return index.html, to enable SPA-routing



  * Enforce use of a client secret
  * Set cookies to be http only by default (unless you've provided other cookie settings explicitly)
  * No special error handling



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-cloudfront-authorization/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-cloudfront-authorization/LICENSE)


pkgId: 422eb717c4bbb691f136378ca03c2b09c22323dd367bb4217f1146b6d3c137db
name: python-cloudcomponents.cdk-codecommit-backup
arch: src
version: 2.2.0
epoch: 0
release: 1
summary: Backup CodeCommit repositories to S3
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-codecommit-backup-2.2.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-codecommit-backup)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-codecommit-backup/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > Backup CodeCommit repositories to S3



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-codecommit-backup
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-codecommit-backup
  ```



  ```python
  import { BackupBucket, S3CodeCommitBackup } from '@cloudcomponents/cdk-codecommit-backup';
  import { Duration, Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Schedule } from 'aws-cdk-lib/aws-events';
  import { SnsTopic } from 'aws-cdk-lib/aws-events-targets';
  import { Topic } from 'aws-cdk-lib/aws-sns';
  import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
  import { Construct } from 'constructs';

  export class CodeCommitBackupStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      if (typeof process.env.REPOSITORY_NAME === 'undefined') {
        throw new Error('environment variable REPOSITORY_NAME undefined');
      }
      const repository = Repository.fromRepositoryName(this, 'Repository', process.env.REPOSITORY_NAME);

      const backupBucket = new BackupBucket(this, 'BackupBuckt', {
        retentionPeriod: Duration.days(90),
      });

      // The following example runs a task every day at 4am
      const backup = new S3CodeCommitBackup(this, 'S3CodeCommitBackup', {
        backupBucket,
        repository,
        schedule: Schedule.cron({
          minute: '0',
          hour: '4',
        }),
      });

      const backupTopic = new Topic(this, 'BackupTopic');

      if (process.env.DEVSECOPS_TEAM_EMAIL) {
        backupTopic.addSubscription(new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL));
      }

      backup.onBackupStarted('started', {
        target: new SnsTopic(backupTopic),
      });

      backup.onBackupSucceeded('succeeded', {
        target: new SnsTopic(backupTopic),
      });

      backup.onBackupFailed('failed', {
        target: new SnsTopic(backupTopic),
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codecommit-backup/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codecommit-backup/LICENSE)


pkgId: 987cf3e0a31ae0de9045ffc2d359a36b7c5185260ca6d92d9945231c13f3d2f1
name: python-cloudcomponents.cdk-codepipeline-anchore-inline-scan-action
arch: src
version: 2.3.0
epoch: 0
release: 1
summary: CodePipeline action to integrate Anchore Engine into your pipeline
url: https://github.com/cloudcomponents/cdk-components
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-codepipeline-anchore-inline-scan-action-2.3.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-codepipeline-anchore-inline-scan-action)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-codepipeline-anchore-inline-scan-action/)

  > CodePipeline action to integrate [Anchore Engine](https://docs.anchore.com/current/) into your pipeline



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-codepipeline-anchore-inline-scan-action
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-codepipeline-anchore-inline-scan-action
  ```



  ```python
  import { CodePipelineAnchoreInlineScanAction } from '@cloudcomponents/cdk-codepipeline-anchore-inline-scan-action';
  import { CodePipelineDockerfileLinterAction } from '@cloudcomponents/cdk-codepipeline-dockerfile-linter-action';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeCommitSourceAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Construct } from 'constructs';

  export class ContainerAuditStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'container-audit-repository',
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
        branch: 'master',
      });

      const linterAction = new CodePipelineDockerfileLinterAction({
        actionName: 'Linter',
        input: sourceArtifact,
      });

      const vulnScanAction = new CodePipelineAnchoreInlineScanAction({
        actionName: 'VulnScan',
        input: sourceArtifact,
      });

      new Pipeline(this, 'Pipeline', {
        pipelineName: 'container-audit-pipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Audit',
            actions: [linterAction, vulnScanAction],
          },
        ],
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-anchore-inline-scan-action/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-anchore-inline-scan-action/LICENSE)


pkgId: e475b8b5a4f7c5c8f84121fbaf4a34a9473916066a92e54314ade9c6cdac0ae8
name: python-cloudcomponents.cdk-codepipeline-check-parameter-action
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Cdk component that checks if system parameters are set correctly
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-codepipeline-check-parameter-action-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-codepipeline-check-parameter-action)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-codepipeline-check-parameter-action/)

  > Cdk component that checks if system parameters are set correctly



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-codepipeline-check-parameter-action
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-codepipeline-check-parameter-action
  ```



  ```python
  import { CodePipelineCheckParameterAction } from '@cloudcomponents/cdk-codepipeline-check-parameter-action';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeCommitSourceAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Construct } from 'constructs';

  export class CodePipelineCheckParameterActionStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'MyRepositoryName',
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
        branch: 'master',
      });

      const checkAction = new CodePipelineCheckParameterAction({
        actionName: 'Check',
        parameterName: '/test',
        regExp: /^The.*Spain$/,
        logParameter: true,
      });

      new Pipeline(this, 'MyPipeline', {
        pipelineName: 'MyPipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Check',
            actions: [checkAction],
          },
        ],
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-check-parameter-action/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-check-parameter-action/LICENSE)


pkgId: a1ee593c04ad18bb3e610b19f5fdc4d29f71799f3f90033c74ceae5d4e04c86e
name: python-cloudcomponents.cdk-codepipeline-dockerfile-linter-action
arch: src
version: 2.3.0
epoch: 0
release: 1
summary: CodePipeline action to lint dockerfiles with hadolint
url: https://github.com/cloudcomponents/cdk-components
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-codepipeline-dockerfile-linter-action-2.3.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-codepipeline-dockerfile-linter-action)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-codepipeline-dockerfile-linter-action/)

  > CodePipeline action to lint dockerfiles with [hadolint](https://github.com/hadolint/hadolint)



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-codepipeline-dockerfile-linter-action
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-codepipeline-dockerfile-linter-action
  ```



  ```python
  import { CodePipelineAnchoreInlineScanAction } from '@cloudcomponents/cdk-codepipeline-anchore-inline-scan-action';
  import { CodePipelineDockerfileLinterAction } from '@cloudcomponents/cdk-codepipeline-dockerfile-linter-action';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeCommitSourceAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Construct } from 'constructs';

  export class ContainerAuditStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'container-audit-repository',
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
        branch: 'master',
      });

      const linterAction = new CodePipelineDockerfileLinterAction({
        actionName: 'Linter',
        input: sourceArtifact,
      });

      const vulnScanAction = new CodePipelineAnchoreInlineScanAction({
        actionName: 'VulnScan',
        input: sourceArtifact,
      });

      new Pipeline(this, 'Pipeline', {
        pipelineName: 'container-audit-pipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Audit',
            actions: [linterAction, vulnScanAction],
          },
        ],
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-dockerfile-linter-action/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-dockerfile-linter-action/LICENSE)


pkgId: 76d600555f00558f6d9ffc0398b3e97cdcabe06376f04b470fe77de4edf909cd
name: python-cloudcomponents.cdk-codepipeline-merge-action
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Cdk component that automatically merge branches in codepipelines
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-codepipeline-merge-action-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-codepipeline-merge-action)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-codepipeline-merge-action/)

  > Cdk component that automatically merge branches in codepipelines



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-codepipeline-merge-action
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-codepipeline-merge-action
  ```



  ```python
  import { CodePipelineMergeAction } from '@cloudcomponents/cdk-codepipeline-merge-action';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeCommitSourceAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Construct } from 'constructs';

  export class CodePipelineMergeActionStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'merge-action-repository',
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
        branch: 'next',
      });

      const mergeAction = new CodePipelineMergeAction({
        actionName: 'Merge',
        repository,
        sourceCommitSpecifier: 'next',
        destinationCommitSpecifier: 'master',
      });

      new Pipeline(this, 'Pipeline', {
        pipelineName: 'merge-action-pipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Merge',
            actions: [mergeAction],
          },
        ],
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-merge-action/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-merge-action/LICENSE)


pkgId: d7e473201f21cfa30ba517a8483b7630736a21fdef99882dd8724ed7366616a4
name: python-cloudcomponents.cdk-codepipeline-slack
arch: src
version: 2.4.0
epoch: 0
release: 1
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-codepipeline-slack-2.4.0-1.src.rpm
checksum_type: sha256
summary:
  Cdk component that provisions a #slack approval workflow and notification messages on codepipeline state changes

description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-codepipeline-slack)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-codepipeline-slack/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > Cdk component that provisions a #slack approval workflow and notification messages on codepipeline state changes

  ![Approval Workflow](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/packages/cdk-codepipeline-slack/assets/approval_workflow.png)

  ![Review Dialog](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/packages/cdk-codepipeline-slack/assets/review_dialog.png)



  TypeScript/JavaScript:

  ```bash
  npm install --save @cloudcomponents/cdk-codepipeline-slack
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-codepipeline-slack
  ```



  ```python
  import { SlackApprovalAction, SlackNotifier } from '@cloudcomponents/cdk-codepipeline-slack';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeCommitSourceAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Construct } from 'constructs';

  export class CodePipelineSlackApprovalStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'MyRepositoryName',
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
      });

      if (typeof process.env.SLACK_BOT_TOKEN === 'undefined') {
        throw new Error('environment variable SLACK_BOT_TOKEN undefined');
      }
      const slackBotToken = process.env.SLACK_BOT_TOKEN;

      if (typeof process.env.SLACK_SIGNING_SECRET === 'undefined') {
        throw new Error('environment variable SLACK_SIGNING_SECRET undefined');
      }
      const slackSigningSecret = process.env.SLACK_SIGNING_SECRET;

      if (typeof process.env.SLACK_CHANNEL_NAME === 'undefined') {
        throw new Error('environment variable SLACK_CHANNEL_NAME undefined');
      }
      const slackChannel = process.env.SLACK_CHANNEL_NAME;

      const approvalAction = new SlackApprovalAction({
        actionName: 'SlackApproval',
        slackBotToken,
        slackSigningSecret,
        slackChannel,
        externalEntityLink: 'http://cloudcomponents.org',
        additionalInformation: 'Would you like to promote the build to production?',
      });

      const pipeline = new Pipeline(this, 'MyPipeline', {
        pipelineName: 'MyPipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Approval',
            actions: [approvalAction],
          },
        ],
      });

      new SlackNotifier(this, 'SlackNotifier', {
        pipeline,
        slackBotToken,
        slackSigningSecret,
        slackChannel,
      });
    }
  }
  ```



  Create an app that’s just for your workspace



  Grant the `channels::history`-Scope to the Bot in your app and Add the Bot to the configured Slack-Channel

  Select Permission Scopes:

  ![OAuth Scopes](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/packages/cdk-codepipeline-slack/assets/oauth_scope.png)



  Enter the url of your api from the AWS Api Gateway and append `/slack/actions`:

  ![Interactive Components](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/packages/cdk-codepipeline-slack/assets/interactive_components.png)



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-slack/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-codepipeline-slack/LICENSE)


pkgId: 17d3e148a521e2e51850d34071ca89b269e8d1a6044520fc8d5c00756cae8c58
name: python-cloudcomponents.cdk-container-registry
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Registry for container images
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-container-registry-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-container-registry)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-container-registry/)

  > Registry for container images



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-container-registry
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-container-registry
  ```



  ```python
  import { ImageRepository, Severity } from '@cloudcomponents/cdk-container-registry';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Topic } from 'aws-cdk-lib/aws-sns';
  import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
  import { Construct } from 'constructs';

  export class ImageRepositoryStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const alarmTopic = new Topic(this, 'Topic');

      alarmTopic.addSubscription(
        new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL as string),
      );

      const imageRepository = new ImageRepository(this, 'ImageRepository', {
        forceDelete: true, //Only for tests
        imageScanOnPush: true,
      });

      imageRepository.onFinding('finding', {
        severity: Severity.HIGH,
        alarmTopic,
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-container-registry/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-container-registry/LICENSE)


pkgId: 40503bea617d1380b2fceb0526675aca4e9624225530402bcb7fbb716e7d9949
name: python-cloudcomponents.cdk-contentful-webhook
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Create, update and delete contentful webhooks with your app deployment
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-contentful-webhook-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-contentful-webhook)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-contentful-webhook/)

  > Create, update and delete contentful webhooks with your app deployment



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-contentful-webhook
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-contentful-webhook
  ```



  ```python
  import { ContentfulWebhook } from '@cloudcomponents/cdk-contentful-webhook';
  import { SecretKey } from '@cloudcomponents/cdk-secret-key';
  import { Stack, StackProps, aws_apigateway } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class ContentfulWebhookStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const api = new aws_apigateway.RestApi(this, 'Endpoint');
      api.root.addMethod('POST');

      if (typeof process.env.ACCESS_TOKEN === 'undefined') {
        throw new Error('environment variable ACCESS_TOKEN undefined');
      }
      const accessToken = SecretKey.fromPlainText(process.env.ACCESS_TOKEN);

      if (typeof process.env.SPACE_ID === 'undefined') {
        throw new Error('environment variable SPACE_ID undefined');
      }
      const spaceId = process.env.SPACE_ID;

      const topics = ['Entry.create'];

      new ContentfulWebhook(this, 'ContentfulWebhook', {
        accessToken,
        spaceId,
        name: 'ExampleWebhook',
        url: api.url,
        topics,
        logLevel: 'debug',
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-contentful-webhook/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-contentful-webhook/LICENSE)


pkgId: c7be00f3e8fc28f90cbfed7940621ca97da1247be43e7db68821256489b92a8c
name: python-cloudcomponents.cdk-deletable-bucket
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Bucket with content cleanup to allow bucket deletion when the stack will be destroyed
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-deletable-bucket-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-deletable-bucket)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-deletable-bucket/)

  > Bucket with content cleanup to allow bucket deletion when the stack will be destroyed



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-deletable-bucket
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-deletable-bucket
  ```



  ```python
  import { DeletableBucket } from '@cloudcomponents/cdk-deletable-bucket';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class DeletableBucketStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      new DeletableBucket(this, 'DeletableBucket', {
        bucketName: 'bucket2delete',
        forceDelete: true,
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-deletable-bucket/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-deletable-bucket/LICENSE)


pkgId: 1b3a4228f5e78a92a79a60011945c4b2a1d5478c3eec14238ed72ac1d9580dd9
name: python-cloudcomponents.cdk-dependency-check
arch: src
version: 2.3.0
epoch: 0
release: 1
summary: OWASP dependency-check for codecommit repositories
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-dependency-check-2.3.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-dependency-check)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-dependency-check/)

  > [OWASP dependency-check](https://owasp.org/www-project-dependency-check/) for codecommit repositories



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-dependency-check
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-dependency-check
  ```



  ```python
  import { CodeCommitDependencyCheck } from '@cloudcomponents/cdk-dependency-check';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Schedule } from 'aws-cdk-lib/aws-events';
  import { SnsTopic } from 'aws-cdk-lib/aws-events-targets';
  import { Bucket } from 'aws-cdk-lib/aws-s3';
  import { Topic } from 'aws-cdk-lib/aws-sns';
  import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
  import { Construct } from 'constructs';

  export class DependencyCheckStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      if (typeof process.env.REPOSITORY_NAME === 'undefined') {
        throw new Error('environment variable REPOSITORY_NAME undefined');
      }

      const repository = Repository.fromRepositoryName(this, 'Repository', process.env.REPOSITORY_NAME);

      const reportsBucket = new Bucket(this, 'Bucket');

      // The following example runs a task every day at 4am
      const check = new CodeCommitDependencyCheck(this, 'CodeCommitDependencyCheck', {
        repository,
        reportsBucket,
        preCheckCommand: 'npm i',
        schedule: Schedule.cron({
          minute: '0',
          hour: '4',
        }),
      });

      const checkTopic = new Topic(this, 'CheckTopic');

      if (process.env.DEVSECOPS_TEAM_EMAIL) {
        checkTopic.addSubscription(new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL));
      }

      check.onCheckStarted('started', {
        target: new SnsTopic(checkTopic),
      });

      check.onCheckSucceeded('succeeded', {
        target: new SnsTopic(checkTopic),
      });

      check.onCheckFailed('failed', {
        target: new SnsTopic(checkTopic),
      });
    }
  }
  ```



  ```python
  const reportsBucket = new Bucket(this, 'Bucket');

  // The following example runs a task every day at 4am
  const check = new CodeCommitDependencyCheck(this, 'CodeCommitDependencyCheck', {
    repository,
    reportsBucket,
    preCheckCommand: 'npm i',
    schedule: Schedule.cron({
      minute: '0',
      hour: '4',
    }),
  });
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-dependency-check/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-dependency-check/LICENSE)


pkgId: 89d13f29fd13b1a24e06725ae19917b194f71b59e252cd0da03ac6ac4c1afdd0
name: python-cloudcomponents.cdk-developer-tools-notifications
arch: src
version: 2.4.0
epoch: 0
release: 1
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-developer-tools-notifications-2.4.0-1.src.rpm
checksum_type: sha256
summary:
  #slack / msteams / email notifications for developer tools: CodeCommit, CodeBuild, CodeDeploy, CodePipeline

description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-developer-tools-notifications)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-developer-tools-notifications/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > #slack / msteams / email notifications for developer tools: CodeCommit, CodeBuild, CodeDeploy, CodePipeline



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-developer-tools-notifications
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-developer-tools-notifications
  ```



  [Add incoming webhook](https://docs.microsoft.com/de-de/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook):

  1. Navigate to the channel where you want to add the webhook and select (•••) More Options from the top navigation bar.
  2. Choose Connectors from the drop-down menu and search for Incoming Webhook.
  3. Select the Configure button, provide a name, and, optionally, upload an image avatar for your webhook.
  4. The dialog window will present a unique URL that will map to the channel. Make sure that you copy and save the URL—you will need to provide it to the outside service.
  5. Select the Done button. The webhook will be available in the team channel.

  ![codepipeline message](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/packages/cdk-developer-tools-notifications/assets/codepipeline-message.png)



  [Notifications for AWS developer tools](https://docs.aws.amazon.com/chatbot/latest/adminguide/related-services.html#codeserviceevents)



  ```python
  import { SlackChannelConfiguration, MSTeamsIncomingWebhookConfiguration, AccountLabelMode } from '@cloudcomponents/cdk-chatops';
  import {
    RepositoryNotificationRule,
    PipelineNotificationRule,
    RepositoryEvent,
    PipelineEvent,
    SlackChannel,
    MSTeamsIncomingWebhook,
  } from '@cloudcomponents/cdk-developer-tools-notifications';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Pipeline, Artifact } from 'aws-cdk-lib/aws-codepipeline';
  import { CodeCommitSourceAction, ManualApprovalAction } from 'aws-cdk-lib/aws-codepipeline-actions';
  import { Construct } from 'constructs';

  export class NotificationsStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'notifications-repository',
      });

      if (typeof process.env.SLACK_WORKSPACE_ID === 'undefined') {
        throw new Error('environment variable SLACK_WORKSPACE_ID undefined');
      }
      if (typeof process.env.SLACK_CHANNEL_ID === 'undefined') {
        throw new Error('environment variable SLACK_CHANNEL_ID undefined');
      }
      const slackChannel = new SlackChannelConfiguration(this, 'SlackChannel', {
        slackWorkspaceId: process.env.SLACK_WORKSPACE_ID,
        configurationName: 'notifications',
        slackChannelId: process.env.SLACK_CHANNEL_ID,
      });

      if (typeof process.env.INCOMING_WEBHOOK_URL === 'undefined') {
        throw new Error('environment variable INCOMING_WEBHOOK_URL undefined');
      }
      const webhook = new MSTeamsIncomingWebhookConfiguration(this, 'MSTeamsWebhook', {
        url: process.env.INCOMING_WEBHOOK_URL,
        accountLabelMode: AccountLabelMode.ID_AND_ALIAS,
        themeColor: '#FF0000',
      });

      new RepositoryNotificationRule(this, 'RepoNotifications', {
        name: 'notifications-repository',
        repository,
        events: [RepositoryEvent.COMMENTS_ON_COMMITS, RepositoryEvent.PULL_REQUEST_CREATED, RepositoryEvent.PULL_REQUEST_MERGED],
        targets: [new SlackChannel(slackChannel), new MSTeamsIncomingWebhook(webhook)],
      });

      const sourceArtifact = new Artifact();

      const sourceAction = new CodeCommitSourceAction({
        actionName: 'CodeCommit',
        repository,
        output: sourceArtifact,
      });

      const approvalAction = new ManualApprovalAction({
        actionName: 'Approval',
      });

      const pipeline = new Pipeline(this, 'Pipeline', {
        pipelineName: 'notifications-pipeline',
        stages: [
          {
            stageName: 'Source',
            actions: [sourceAction],
          },
          {
            stageName: 'Approval',
            actions: [approvalAction],
          },
        ],
      });

      new PipelineNotificationRule(this, 'PipelineNotificationRule', {
        name: 'pipeline-notification',
        pipeline,
        events: [
          PipelineEvent.PIPELINE_EXECUTION_STARTED,
          PipelineEvent.PIPELINE_EXECUTION_FAILED,
          PipelineEvent.PIPELINE_EXECUTION_SUCCEEDED,
          // PipelineEvent.ACTION_EXECUTION_STARTED,
          // PipelineEvent.ACTION_EXECUTION_SUCCEEDED,
          // PipelineEvent.ACTION_EXECUTION_FAILED,
          PipelineEvent.MANUAL_APPROVAL_NEEDED,
          PipelineEvent.MANUAL_APPROVAL_SUCCEEDED,
          // PipelineEvent.MANUAL_APPROVAL_FAILED,
          // PipelineEvent.STAGE_EXECUTION_STARTED,
          // PipelineEvent.STAGE_EXECUTION_SUCCEEDED,
          // PipelineEvent.STAGE_EXECUTION_FAILED,
        ],
        targets: [new SlackChannel(slackChannel), new MSTeamsIncomingWebhook(webhook)],
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-developer-tools-notifications/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-developer-tools-notifications/LICENSE)


pkgId: dba3d503972b00ccf8098edb786fc7a8cb534c436025204b125af3ccaac1b456
name: python-cloudcomponents.cdk-dynamodb-seeder
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: A seeder for dynamodb tables
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-dynamodb-seeder-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-dynamodb-seeder)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-dynamodb-seeder/)

  > A seeder for dynamodb tables



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-dynamodb-seeder
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-dynamodb-seeder
  ```



  ```python
  import * as path from 'path';
  import { DynamoDBSeeder, Seeds } from '@cloudcomponents/cdk-dynamodb-seeder';
  import { Stack, StackProps, RemovalPolicy } from 'aws-cdk-lib';
  import { Table, AttributeType } from 'aws-cdk-lib/aws-dynamodb';
  import { Bucket } from 'aws-cdk-lib/aws-s3';
  import { Construct } from 'constructs';

  export class DynamoDBSeederStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const table = new Table(this, 'Table', {
        partitionKey: {
          name: 'id',
          type: AttributeType.NUMBER,
        },
        removalPolicy: RemovalPolicy.DESTROY,
      });

      new DynamoDBSeeder(this, 'JsonFileSeeder', {
        table,
        seeds: Seeds.fromJsonFile(path.join(__dirname, '..', 'seeds.json')),
      });

      new DynamoDBSeeder(this, 'InlineSeeder', {
        table,
        seeds: Seeds.fromInline([
          {
            id: 3,
            column: 'foo',
          },
          {
            id: 4,
            column: 'bar',
          },
        ]),
      });

      const seedsBucket = Bucket.fromBucketName(
        this,
        'SeedsBucket',
        'my-seeds-bucket',
      );

      new DynamoDBSeeder(this, 'BucketSeeder', {
        table,
        seeds: Seeds.fromBucket(seedsBucket, 'seeds.json'),
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-dynamodb-seeder/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-dynamodb-seeder/LICENSE)


pkgId: 527178a5610303fb20234438836141f77ccef4ddab543cb4dacc3ebb9464e0db
name: python-cloudcomponents.cdk-github-webhook
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Create, update and delete github webhooks with your app deployment
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-github-webhook-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-github-webhook)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-github-webhook/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > Create, update and delete github webhooks with your app deployment



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-github-webhook
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-github-webhook
  ```



  ```python
  import { GithubWebhook } from '@cloudcomponents/cdk-github-webhook';
  import { SecretKey } from '@cloudcomponents/cdk-secret-key';
  import { Stack, StackProps, aws_apigateway } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class GithubWebhookStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const api = new aws_apigateway.RestApi(this, 'github-webhook');
      api.root.addMethod('POST');

      if (typeof process.env.API_TOKEN === 'undefined') {
        throw new Error('environment variable API_TOKEN undefined');
      }
      const githubApiToken = SecretKey.fromPlainText(process.env.API_TOKEN);

      // @example https://github.com/cloudcomponents/cdk-constructs
      if (typeof process.env.REPO_URL === 'undefined') {
        throw new Error('environment variable REPO_URL undefined');
      }
      const githubRepoUrl = process.env.REPO_URL;

      // @see https://developer.github.com/v3/activity/events/types/
      const events = ['*'];

      new GithubWebhook(this, 'GithubWebhook', {
        githubApiToken,
        githubRepoUrl,
        payloadUrl: api.url,
        events,
        logLevel: 'debug',
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-github-webhook/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-github-webhook/LICENSE)


pkgId: 7216daa4732edd56d0bed2a16b47c815c350e5917c4ada41f33fd23722f8b54c
name: python-cloudcomponents.cdk-lambda-at-edge-pattern
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: CDK Constructs for Lambda@Edge pattern: HttpHeaders
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-lambda-at-edge-pattern-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-lambda-at-edge-pattern)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-lambda-at-edge-pattern/)

  > CDK Constructs for Lambda@Edge pattern: HttpHeaders



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-lambda-at-edge-pattern
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-lambda-at-edge-pattern
  ```



  ```python
  import { StaticWebsite } from '@cloudcomponents/cdk-static-website';
  import { OriginMutation } from '@cloudcomponents/cdk-lambda-at-edge-pattern';
  import { RemovalPolicy, Stack, StackProps, aws_route53 } from 'aws-cdk-lib';

  import { Construct } from 'constructs';

  export class StaticWebsiteStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const hostedZone = aws_route53.HostedZone.fromLookup(this, 'HostedZone', {
        domainName: 'cloudcomponents.org',
      });

      // Create a lambda at edge
      const originMutation = new OriginMutation(stack, 'OriginMutation');

      new StaticWebsite(this, 'StaticWebsite', {
        hostedZone,
        domainNames: ['cloudcomponents.org', 'www.cloudcomponents.org'],
        edgeLambdas: [originMutation],
        removalPolicy: RemovalPolicy.DESTROY,
      });
    }
  }
  ```



  ```python
  new cloudfront.Distribution(this, 'myDist', {
    defaultBehavior: {
      origin: new origins.S3Origin(myBucket),
      edgeLambdas: [httpHeaders],
    },
  });
  ```



  ```python
  const httpHeaders = new HttpHeaders(this, 'HttpHeaders', {
    httpHeaders: {
      'Content-Security-Policy':
        "default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self'",
      'Strict-Transport-Security':
        'max-age=31536000; includeSubdomains; preload',
      'Referrer-Policy': 'same-origin',
      'X-XSS-Protection': '1; mode=block',
      'X-Frame-Options': 'DENY',
      'X-Content-Type-Options': 'nosniff',
      'Cache-Control': 'no-cache',
    },
  });
  ```



  https://chrisschuld.com/2020/05/gatsby-hosting-on-cloudfront/

  ```python
  const originMutation = new OriginMutation(stack, 'OriginMutation');
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-lambda-at-edge-pattern/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-lambda-at-edge-pattern/LICENSE)


pkgId: ceb66ca493ea4295c3be9233e0cfb7243bd48ab3c58c1a86952ec396c20556db
name: python-cloudcomponents.cdk-pull-request-approval-rule
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: CodeCommit pull request approval rules to enforcing your pull request workflow
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-pull-request-approval-rule-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-pull-request-approval-rule)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-pull-request-approval-rule/)

  > CodeCommit pull request approval rules to enforcing your pull request workflow



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-pull-request-approval-rule
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-pull-request-approval-rule
  ```



  ```python
  import { ApprovalRuleTemplate, ApprovalRuleTemplateRepositoryAssociation } from '@cloudcomponents/cdk-pull-request-approval-rule';
  import { PullRequestCheck } from '@cloudcomponents/cdk-pull-request-check';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { BuildSpec } from 'aws-cdk-lib/aws-codebuild';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Construct } from 'constructs';

  export class PullRequestStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'pr-check-repository',
      });

      const { approvalRuleTemplateName } = new ApprovalRuleTemplate(this, 'ApprovalRuleTemplate', {
        approvalRuleTemplateName: 'template-name',
        template: {
          approvers: {
            numberOfApprovalsNeeded: 1,
          },
        },
      });

      new ApprovalRuleTemplateRepositoryAssociation(this, 'ApprovalRuleTemplateRepositoryAssociation', {
        approvalRuleTemplateName,
        repository,
      });

      new PullRequestCheck(this, 'PullRequestCheck', {
        repository,
        buildSpec: BuildSpec.fromSourceFilename('prcheck.yml'),
      });
    }
  }
  ```



  ```python
  import { ApprovalRuleTemplate, ApprovalRuleTemplateRepositoryAssociation } from '@cloudcomponents/cdk-pull-request-approval-rule';
  import { PullRequestCheck } from '@cloudcomponents/cdk-pull-request-check';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { BuildSpec } from 'aws-cdk-lib/aws-codebuild';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { SnsTopic } from 'aws-cdk-lib/aws-events-targets';
  import { Topic } from 'aws-cdk-lib/aws-sns';
  import { Construct } from 'constructs';

  export class PullRequestStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'pr-check-repository',
      });

      const { approvalRuleTemplateName } = new ApprovalRuleTemplate(
        this,
        'ApprovalRuleTemplate',
        {
          approvalRuleTemplateName: 'template-name',
          template: {
            approvers: {
              numberOfApprovalsNeeded: 1,
            },
          },
        },
      );

      const ruleAsscociation = new ApprovalRuleTemplateRepositoryAssociation(
        stack,
        'ApprovalRuleTemplateRepositoryAssociation',
        {
            approvalRuleTemplateName,
            repository,
        },
      );

      const topic = new Topic(stack, 'Topic');

      ruleAsscociation.onOverridden('overridden', {
          target: new SnsTopic(topic),
      });

      // Approves the pull request
      new PullRequestCheck(this, 'PullRequestCheck', {
          repository,
          buildSpec: BuildSpec.fromSourceFilename('prcheck.yml'),
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-pull-request-approval-rule/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-pull-request-approval-rule/LICENSE)


pkgId: a076b0bb278492867cf59f19760799c494b63c8e03a1c452c29d21d5383ffa6a
name: python-cloudcomponents.cdk-pull-request-check
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Cdk component that automatically check pull requests
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-pull-request-check-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-pull-request-check)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-pull-request-check/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > Cdk component that automatically check pull requests



  TypeScript/JavaScript:

  ```bash
  npm install --save @cloudcomponents/cdk-pull-request-check
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-pull-request-check
  ```



  ```python
  import { PullRequestCheck } from '@cloudcomponents/cdk-pull-request-check';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { BuildSpec } from 'aws-cdk-lib/aws-codebuild';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Construct } from 'constructs';

  export class CodePipelineStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'MyRepositoryName',
      });

      // CodePipeline etc.

      new PullRequestCheck(this, 'PullRequestCheck', {
        repository,
        buildSpec: BuildSpec.fromSourceFilename('prcheck.yml'),
      });
    }
  }
  ```



  ```python
  import { ApprovalRuleTemplate, ApprovalRuleTemplateRepositoryAssociation } from '@cloudcomponents/cdk-pull-request-approval-rule';
  import { PullRequestCheck } from '@cloudcomponents/cdk-pull-request-check';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { BuildSpec } from 'aws-cdk-lib/aws-codebuild';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { Construct } from 'constructs';

  export class PullRequestStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'pr-check-repository',
      });

      const { approvalRuleTemplateName } = new ApprovalRuleTemplate(this, 'ApprovalRuleTemplate', {
        approvalRuleTemplateName: 'template-name',
        template: {
          approvers: {
            numberOfApprovalsNeeded: 1,
          },
        },
      });

      new ApprovalRuleTemplateRepositoryAssociation(this, 'ApprovalRuleTemplateRepositoryAssociation', {
        approvalRuleTemplateName,
        repository,
      });

      new PullRequestCheck(this, 'PullRequestCheck', {
        repository,
        buildSpec: BuildSpec.fromSourceFilename('prcheck.yml'),
      });
    }
  }
  ```



  The component comments the pull request and sets the approval state by default. Custom notifications can be set up this way

  ```python
  import { PullRequestCheck } from '@cloudcomponents/cdk-pull-request-check';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { BuildSpec } from 'aws-cdk-lib/aws-codebuild';
  import { Repository } from 'aws-cdk-lib/aws-codecommit';
  import { SnsTopic } from 'aws-cdk-lib/aws-events-targets';
  import { Topic } from 'aws-cdk-lib/aws-sns';
  import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
  import { Construct } from 'constructs';

  export class CodePipelineStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);

      const repository = new Repository(this, 'Repository', {
        repositoryName: 'MyRepositoryName',
        description: 'Some description.', // optional property
      });

      // Your CodePipeline...

      const prCheck = new PullRequestCheck(this, 'PullRequestCheck', {
        repository,
        buildSpec: BuildSpec.fromSourceFilename('buildspecs/prcheck.yml'),
      });

      const prTopic = new Topic(this, 'PullRequestTopic');

      prTopic.addSubscription(
        new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL as string),
      );

      prCheck.onCheckStarted('started', {
        target: new SnsTopic(prTopic),
      });

      prCheck.onCheckSucceeded('succeeded', {
        target: new SnsTopic(prTopic),
      });

      prCheck.onCheckFailed('failed', {
        target: new SnsTopic(prTopic),
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-pull-request-check/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-pull-request-check/LICENSE)


pkgId: 661b85ddf4c98d4b0bc10bcbcab2c025e8d5879e215772f779892337941cae43
name: python-cloudcomponents.cdk-responsive-email-template
arch: src
version: 2.3.0
epoch: 0
release: 1
summary: Responsive email template for aws ses
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-responsive-email-template-2.3.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-responsive-email-template)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-responsive-email-template/)

  > Responsive [mjml](https://documentation.mjml.io/) email template for aws ses



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-responsive-email-template
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-responsive-email-template
  ```



  ```python
  import { ResponsiveEmailTemplate, TemplatePart } from '@cloudcomponents/cdk-responsive-email-template';
  import { Stack, StackProps } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class ResponsiveEmailTemplateStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      new ResponsiveEmailTemplate(this, 'EmailTemplate', {
        templateName: 'demo',
        subjectPart: 'cloudcomponents - {{ title }}',
        textPart: TemplatePart.fromInline('text message'),
        htmlPart: TemplatePart.fromInline(`<mjml>
      <mj-head>
        <mj-title>cloudcomponents - {{ title }}</mj-title>
      </mj-head>
      <mj-body>
        <mj-section>
          <mj-column>
            <mj-text>
              Hello {{ name }}!
            </mj-text>
          </mj-column>
        </mj-section>
      </mj-body>
    </mjml>`),
        parsingOptions: {
          beautify: true,
        },
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-responsive-email-template/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-responsive-email-template/LICENSE)


pkgId: 4320555c74f1debffbc7368c48706fb1cb24368e4d44ddf45f2a1f5bb1072296
name: python-cloudcomponents.cdk-s3-antivirus
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: Antivirus for Amazon S3
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-s3-antivirus-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-s3-antivirus)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-s3-antivirus/)

  > Antivirus for Amazon S3



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-s3-antivirus
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-s3-antivirus
  ```



  ```python
  import { Scanner } from '@cloudcomponents/cdk-s3-antivirus';
  import { RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
  import { SnsDestination } from 'aws-cdk-lib/aws-lambda-destinations';
  import { Bucket } from 'aws-cdk-lib/aws-s3';
  import { Topic } from 'aws-cdk-lib/aws-sns';
  import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
  import { Construct } from 'constructs';

  export class S3AntivirusStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const bucket = new Bucket(this, 'Bucket', {
        autoDeleteObjects: true,
        removalPolicy: RemovalPolicy.DESTROY,
      });

      const topic = new Topic(this, 'Topic');
      if (process.env.DEVSECOPS_TEAM_EMAIL) {
        topic.addSubscription(new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL));
      }

      const scanner = new Scanner(this, 'Scanner', {
        onResult: new SnsDestination(topic),
        onError: new SnsDestination(topic),
      });

      scanner.addSourceBucket(bucket);
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-s3-antivirus/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-s3-antivirus/LICENSE)


pkgId: 933a6d7d0fdd9c4826f496fb53bc51e73d094d35144ad28816973843a7bf8b8c
name: python-cloudcomponents.cdk-static-website
arch: src
version: 2.2.0
epoch: 0
release: 1
url: https://github.com/cloudcomponents/cdk-constructs
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-cloudcomponents.cdk-static-website-2.2.0-1.src.rpm
checksum_type: sha256
summary:
  Cdk component that creates a static website using S3, configures CloudFront (CDN) and maps a custom domain via Route53 (DNS)

description:
  [![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)



  [![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
  [![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
  [![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-static-website)
  [![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-static-website/)
  [![Mentioned in Awesome CDK](https://awesome.re/mentioned-badge.svg)](https://github.com/kolomied/awesome-cdk)

  > Cdk component that creates a static website using S3, configures CloudFront (CDN) and maps a custom domain via Route53 (DNS)



  TypeScript/JavaScript:

  ```bash
  npm i @cloudcomponents/cdk-static-website
  ```

  Python:

  ```bash
  pip install cloudcomponents.cdk-static-website
  ```



  ```python
  import { StaticWebsite } from '@cloudcomponents/cdk-static-website';
  import { RemovalPolicy, Stack, StackProps, aws_route53 } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class StaticWebsiteStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const hostedZone = aws_route53.HostedZone.fromLookup(this, 'HostedZone', {
        domainName: 'cloudcomponents.org',
      });

      new StaticWebsite(this, 'StaticWebsite', {
        hostedZone,
        domainNames: ['cloudcomponents.org', 'www.cloudcomponents.org'],
        removalPolicy: RemovalPolicy.DESTROY,
      });
    }
  }
  ```



  ```python
  import { StaticWebsite } from '@cloudcomponents/cdk-static-website';
  import { RemovalPolicy, Stack, StackProps, aws_route53 } from 'aws-cdk-lib';
  import { Construct } from 'constructs';

  export class StaticWebsiteStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const hostedZone = aws_route53.HostedZone.fromLookup(this, 'HostedZone', {
        domainName: 'cloudcomponents.org',
      });

      new StaticWebsite(this, 'StaticWebsite', {
        hostedZone,
        domainNames: ['cloudcomponents.org', 'www.cloudcomponents.org'],
        errorResponses: [
          {
            httpStatus: 404,
            responseHttpStatus: 200,
            ttl: props.ttl ?? Duration.seconds(300),
            responsePagePath: '/index.html',
          },
        ],
        removalPolicy: RemovalPolicy.DESTROY,
      });
    }
  }
  ```



  ```python
  import { StaticWebsite } from '@cloudcomponents/cdk-static-website';
  import { OriginMutation } from '@cloudcomponents/cdk-lambda-at-edge-pattern';
  import { RemovalPolicy, Stack, StackProps, aws_route53 } from 'aws-cdk-lib';

  import { Construct } from 'constructs';

  export class StaticWebsiteStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
      super(scope, id, props);

      const hostedZone = aws_route53.HostedZone.fromLookup(this, 'HostedZone', {
        domainName: 'cloudcomponents.org',
      });

      const originMutation = new OriginMutation(stack, 'OriginMutation');

      new StaticWebsite(this, 'StaticWebsite', {
        hostedZone,
        domainNames: ['cloudcomponents.org', 'www.cloudcomponents.org'],
        edgeLambdas: [originMutation],
        removalPolicy: RemovalPolicy.DESTROY,
      });
    }
  }
  ```



  See [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-static-website/API.md).



  See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).



  [MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-static-website/LICENSE)


