# packages

pkgId: 4ac421459f467304f8afa6a93b5b59665a63971327e0522f706718f4a14134b1
name: python-aiwolf-nlp-common
arch: src
version: 0.2.1
epoch: 0
release: 1
summary: aiwolf-nlp-common
url: https://aiwolf.org
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aiwolf-nlp-common-0.2.1-1.src.rpm
checksum_type: sha256
description:
  人狼知能コンテスト（自然言語部門） のエージェント向けの共通パッケージです。
  ゲームサーバから送信されるJSON形式のデータをオブジェクトに変換するためのパッケージです。

  ゲームサーバから送信されたJSON形式の文字列から、以下のオブジェクトを生成します。

  ```python
  from aiwolf_nlp_common.protocol import CommunicationProtocol

  recv:str = """{"request":"INITIALIZE","info":{"statusMap":{"Agent[01]":"ALIVE","Agent[02]":"ALIVE","Agent[03]":"ALIVE","Agent[04]":"ALIVE","Agent[05]":"ALIVE"},"roleMap":{"Agent[02]":"SEER"},"remainTalkMap":{},"remainWhisperMap":{},"day":0,"agent":"Agent[02]"},"setting":{"roleNumMap":{"BODYGUARD":0,"MEDIUM":0,"POSSESSED":0,"SEER":1,"VILLAGER":3,"WEREWOLF":1},"maxTalk":3,"maxTalkTurn":15,"maxWhisper":3,"maxWhisperTurn":15,"maxSkip":3,"isEnableNoAttack":true,"isVoteVisible":false,"isTalkOnFirstDay":true,"responseTimeout":90000,"actionTimeout":60000,"maxRevote":1,"maxAttackRevote":1}}"""
  protocol = CommunicationProtocol.initialize_from_json(received_str=recv)

  print(protocol.request)
  print(protocol.info.agent)
  ```

  ```
  INITIALIZE
  Agent[02]
  ```

  詳細については下記のプロトコルの説明やゲームサーバのソースコードを参考にしてください。
  [プロトコルの実装について](https://github.com/kano-lab/aiwolf-nlp-server/blob/main/doc/protocol.md)



  ```
  pip install aiwolf-nlp-common
  ```

  > [!WARNING]
  > `pip install aiwolf-nlp-common` に失敗する場合は、以下の手順を試してください。

  ```
  pip install --upgrade pip
  pip install --upgrade setuptools
  pip install -i https://test.pypi.org/simple/ aiwolf-nlp-common
  ```

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


pkgId: eca4efb541594e662f06172441062c2b8e66765f58dc2931f908688028dadfe4
name: python-aiwolf-nlp-json-converter
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: aiwolf-nlp-json-converter
url: https://aiwolf.org
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aiwolf-nlp-json-converter-0.1.0-1.src.rpm
checksum_type: sha256
description:
  人狼知能コンテスト自然言語処理部門は**2024冬季 国内大会**からゲームサーバの変更を行いました。 \
  これに伴い、情報伝達を行う際に[旧サーバプログラム](https://github.com/aiwolfdial/AIWolfNLPServer)とは異なるJsonが使用されるようになりました。\
  このプログラムは[新規サーバプログラム](https://github.com/kano-lab/aiwolf-nlp-server)から伝達される情報を[旧サーバプログラム](https://github.com/aiwolfdial/AIWolfNLPServer)から伝達される情報に変換するプログラムです。


  人狼知能コンテスト2024冬季**以前**に人狼知能コンテスト(自然言語処理部門)の大会に参加された方で、過去のプログラムを流用したい方。

  > [!WARNING]
  > このプログラムは2024冬季大会の開催告知から開催までの期間が短いため作成しました。 \
  > 今後のアップデートや2025年春大会以降の13人人狼に必要な情報に対応しない可能性があります。


  ゲームサーバから受け取った文字列の情報をそのまま`AIWolfNLPJsonConverter`に渡すことで、旧ゲームサーバから伝達される情報に変換します。
  ```python
  from aiwolf_nlp_json_converter import AIWolfNLPJsonConverter

  recv:str = """{"request":"INITIALIZE","info":{"day":0,"agent":"Agent[05]","statusMap":{"Agent[01]":"ALIVE","Agent[02]":"ALIVE","Agent[03]":"ALIVE","Agent[04]":"ALIVE","Agent[05]":"ALIVE"},"roleMap":{"Agent[05]":"VILLAGER"}},"setting":{"playerNum":5,"maxTalk":5,"maxTalkTurn":20,"maxWhisper":5,"maxWhisperTurn":20,"maxSkip":0,"isEnableNoAttack":false,"isVoteVisible":false,"isTalkOnFirstDay":true,"responseTimeout":120000,"actionTimeout":60000,"maxRevote":1,"maxAttackRevote":1,"roleNumMap":{"BODYGUARD":0,"MEDIUM":0,"POSSESSED":1,"SEER":1,"VILLAGER":2,"WEREWOLF":1}}}"""
  json_data = AIWolfNLPJsonConverter.get_json_dict(received_str=recv)

  print(type(json_data))
  print(json_data)
  ```


  ```
  <class 'dict'>
  {'request': 'INITIALIZE', 'gameInfo': {'agent': 'Agent[05]', 'attackVoteList': [], 'attackedAgent': None, 'day': 0, 'divineResult': None, 'executedAgent': None, 'lastDeadAgentList': [], 'roleMap': {'Agent[05]': 'VILLAGER'}, 'statusMap': {'Agent[02]': 'ALIVE', 'Agent[04]': 'ALIVE', 'Agent[01]': 'ALIVE', 'Agent[03]': 'ALIVE', 'Agent[05]': 'ALIVE'}, 'voteList': []}, 'gameSetting': {'enableNoAttack': False, 'enableNoExecution': False, 'maxAttackRevote': 1, 'maxRevote': 1, 'maxSkip': 0, 'maxTalk': 5, 'maxTalkTurn': 20, 'maxWhisper': 5, 'maxWhisperTurn': 20, 'playerNum': 5, 'roleNumMap': {'SEER': 1, 'VILLAGER': 2, 'MEDIUM': 0, 'BODYGUARD': 0, 'POSSESSED': 1, 'WEREWOLF': 1}, 'talkOnFirstDay': True, 'responseTimeout': 120, 'actionTimeout': 60, 'voteVisible': False}, 'talkHistory': [], 'whisperHistory': []}
  ```


  [旧ゲームサーバ](https://github.com/aiwolfdial/AIWolfNLPServer)から与えられる情報の内、本プログラムではいくつか含まれていない情報が存在します。 \
  下記に詳細を記載しますので、ご確認の上ご使用ください。


  - `cursedFox`: 妖狐は5人、13人人狼で使用しない予定の役職なので対応していません。
  - `englishTalkList`: 過去にここに割り当てられていた内容が`TalkList`と同一であったため、不要と判断し対応していません。
  - `existingRoleList`: `gameSetting`の`roleNumMap`から把握できる内容であるため不要と判断し対応していません。
  - `guardedAgent`: 騎士は5人人狼で使用しない予定の役職なので対応していません。
  - `latestAttackVoteList`: 5人人狼において使用されない項目の上、`attackVoteList`から確認できる内容であるため不要と判断し対応していません。
  - `latestExecutedAgent`: `executedAgent`の値から確認できる内容であるため不要と判断し対応していません。
  - `latestVoteList`: `voteList`から確認できる内容であるため不要と判断し対応していません。
  - `mediumResult`: 5人人狼において使用されない項目であるため不要と判断し対応していません。
  - `remainTalkMap`: 旧サーバにおいて`INITIALIZE`,`DAILY_INITIALIZE`でのみ付与されていた情報である上、`maxTalk`から取得可能な内容であるため不要と判断し対応していません。
  - `remainWhisperMap`: 5人人狼において`whisper`は行われないため不要と判断し対応していません。
  - `talkList`:  旧サーバにおいて`INITIALIZE`,`DAILY_INITIALIZE`でのみ付与されていた情報である上、`talkHistory`から取得可能な内容であるため不要と判断し対応していません。
  - `whisperList`: 5人人狼において使用されない項目であるため不要と判断し対応していません。


  - `enableRoleRequest`: 新サーバにおいて削除された機能であるため対応していません。
  - `validateUtterance`: 新サーバにおいて削除された機能であるため対応していません。
  - `votableInFirstDay`: 大会において初日は挨拶の日であり、その人に投票は行わないため対応していません。
  - `whisperBeforeRevote`: 5人人狼において使用されない項目であるため不要と判断し対応していません。


  [旧ゲームサーバ](https://github.com/aiwolfdial/AIWolfNLPServer)から与えられる情報の内、本プログラムでは情報が少し変形された格納されている情報が存在します。 \
  下記に詳細を記載しますので、ご確認の上ご使用ください。


  - `responseTimeout`: ゲームサーバからは`ms`で渡されますが、本プログラムを使用した場合、`s`に変換されて返却されます。
  - `actionTimeout`: ゲームサーバからは`ms`で渡されますが、本プログラムを使用した場合、`s`に変換されて返却されます。

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


pkgId: 9900c155f64f41aad030a54d12a07d5b6c6e639771dceda5a9328d66142aee8b
name: python-aixnet-beta
arch: src
version: 0.2.5
epoch: 0
release: 1
summary: The official package of AI-X-Net.
url: https://pypi.org/project/aixnet-beta/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aixnet-beta-0.2.5-1.src.rpm
checksum_type: sha256
description:
  AIXNet Beta is a powerful and user-friendly Python package designed to streamline interactions with the OpenAI and Together AI APIs. By offering an intuitive interface, AIXNet allows developers to quickly integrate advanced AI models like OpenAI's GPT and Meta LLaMA into their applications. Whether you're building conversational agents, automated assistants, or just experimenting with AI-driven solutions, AIXNet simplifies the process by requiring only your API key and a well-structured payload to get started.

  AIXNet Beta is particularly useful for developers looking to work with cutting-edge AI models without the complexity of directly interfacing with APIs. With support for various models and interactive chat sessions, it's a great solution for anyone seeking to integrate AI seamlessly into their workflows.



  To install the package, use:

  ```bash
  pip install aixnet-beta
  ```

  This will install the latest version of the AIXNet Beta package, making it easy to start using the features immediately.



  Here's a sample usage to demonstrate how easy it is to get started with AIXNet Beta:

  ```python

  from aixnet_beta.fm import AzureFM


  azure_fm = AzureFM(
      model="meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
      api_key="REQUEST_FOR_API_KEY",
      protocol="You are a helpful assistant.")


  azure_fm.start_chat()
  ```

  With the `start_chat` method, AIXNet allows for a smooth and interactive chat session, where users can engage directly with AI models in a conversational format. The AI model listens to user prompts and responds accordingly. Here’s an example of how the chat session might unfold:

  ```
  🤖 Start chatting with us! Enter 'EXIT' to quit. 🛑
  🧑 Human: tell me a joke
  🤖 Bot: A man walked into a library and asked the librarian, "Do you have any books on Pavlov's dogs and Schrödinger's cat?"

  The librarian replied, "It rings a bell, but I'm not sure if it's here or not."
  🧑 Human: EXIT
  🙌 Thank you for using the chatbot! Have a great day! 🌟
  ```



  AIXNet Beta comes with a number of helpful features for working with AI models. Here are a few of them:



  You can easily list all available models using the `list_models()` method. This is helpful for developers who need to quickly see what models are supported and choose the best one for their use case.

  ```python

  azure_fm.list_models()
  ```

  Expected output:

  ```
  Available models: ['gpt-3.5-turbo', 'meta-llama/Llama-3-8b-chat-hf', 'meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo']
  ```



  The AIXNet Beta package also allows for managing conversation history, enabling developers to track the interactions between the user and the model. You can clear, view, or add messages to the history for better control and customization.



  ```python

  azure_fm.add_message(role="user", content="What is AI?")
  ```

  This feature can be useful in scenarios where conversation context needs to be preserved or reviewed.



  The `invoke_api` method has built-in error handling that ensures your application won't crash even if something goes wrong during the API request. AIXNet Beta is designed to gracefully manage exceptions and provide informative error messages to help developers quickly debug and resolve issues.



  - **Simplicity**: AIXNet Beta abstracts away the complexities of API requests and payload construction, letting developers focus on building the actual functionality of their applications.
  - **Flexibility**: Supports multiple AI models, allowing you to experiment with different configurations for various use cases.
  - **Interactive Chat**: Provides an easy way to start AI-powered conversations, perfect for building chatbots, virtual assistants, or interactive tools.
  - **Error-Resilient**: With built-in error handling, your application stays robust even when unexpected issues arise.



  This project is licensed under the MIT License, making it free and open to modification and redistribution. You can freely use it in your own projects, including commercial applications, with minimal restrictions.


pkgId: 8c3cf67fc2acb3b4b05af5b40a7541ffacb60c5b709d7730450a8fb238d4a568
name: python-aiyc1v1
arch: src
version: 0.0.45
epoch: 0
release: 1
summary: AI悦创·编程一对一教学代码库,长期招收编程一对一学员,微信:Jiabcdefh
url: https://github.com/AndersonHJB/aiyc1v1
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aiyc1v1-0.0.45-1.src.rpm
checksum_type: sha256
description:
  带编程一对一学员学习 Python 所开发的库，便于零基础小白学习。和部分实用功能，目前拥有：

  - [x] 简单的 NLP

  - [x] 类游戏
  - [x] NoteSearch：[https://github.com/AndersonHJB/aiyc1v1/tree/main/aiyc1v1/NoteSearch](https://github.com/AndersonHJB/aiyc1v1/tree/main/aiyc1v1/NoteSearch)
  - [x] 爬虫延迟插件「DelayWait」：[https://github.com/AndersonHJB/aiyc1v1/tree/main/aiyc1v1/DelayWait](https://github.com/AndersonHJB/aiyc1v1/tree/main/aiyc1v1/DelayWait)

  如果，你有想要实现的功能，迟迟未实现，可以提交 issue 给我。[https://github.com/AndersonHJB/aiyc1v1/issues](https://github.com/AndersonHJB/aiyc1v1/issues)





  如果你换源了，请用下面的命令获取最新版本：

  ```python
  pip install aiyc1v1 -i https://pypi.org/simple
  ```

  国内镜像源同步，比较缓慢，一般需要一天左右才会同步。

  ```python
  pip install aiy1v1
  ```



  版本在快速的迭代中，所以如果需要最新版本的话，请用下面的命令。

  ```python
  pip3 install --upgrade aiyc1v1 -i https://pypi.org/simple
  ```

  ```python
  pip3 install --upgrade aiyc1v1
  ```





  本部分是对已有的项目进行详细介绍，自行点入进行阅读。

  - NoteSearch：[README](https://github.com/AndersonHJB/aiyc1v1/blob/main/aiyc1v1/NoteSearch/README.md)
  - 爬虫延迟插件：





  本项目的 GitHub 地址：[https://github.com/AndersonHJB/aiyc1v1](https://github.com/AndersonHJB/aiyc1v1)





  - [x] SimpleNLP:简单的自然语言处理代码「仅仅支持英文」——词频分析、词云生成。文档：[SimpleNLP.md](./docs/SimpleNLP.md)
  - [x] GameBase:基础文字对话游戏
  - [x] NoteSearch:[文档](./aiyc1v1/NoteSearch/README.md)
  - [x] DelayWait: 智能爬虫插件「2023年01月07日」





  ```python
  from aiyc1v1 import DataManger, Search_Engine

  abs_path = "your/project/path"
  d = DataManger(path=abs_path)

  s = Search_Engine(language="zh_CN")
  s.search("专栏")
  ```





  更智能的延迟请求插件，使你摆脱单纯使用 `time.sleep()`。具体实现逻辑，我也会在该插件文档中为你解答。

  ```python
  from aiyc1v1 import DelayWait
  import requests
  if __name__ == '__main__':
      urls = ["https://bornforthis.cn"] * 10
      d = DelayWait()
      for url in urls:
          html = requests.get(url)
          d.wait(url)
          print(html.status_code)
  ```




  ```python
  numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('float64'), dtype('<U1')) -> None
  ```

  预测是 dataframe to str 的错误，直接把读取到的结果，强制转换成 str

  ```python
  self.content = str(pd.read_csv(self.path))
  self.content = str(pd.read_excel(self.path))
  ```







  - Bug Fixes：bug 修复
  -  ⚠ BREAKING CHANGES：⚠ 重大变化
  - Features：特征
  - Reverts：还原
  - Performance Improvements：性能改进





  - 文件读取，过程中，编码问题。



  - 多语言支持
  - 询问用户：查询到 xx 条数据，请问要返回几条？、全部「all」
  -





  - [x] 正式发布可用的 NoteSearch
  - [x] 初步解决编写代码，文档中搜索问题



  1. 修改用户输入提示
  ```python
  template = "您选择使用默认路径:%s, \n如果确认请输入回车或者 yes(否则:no):"
  ```
  to
  ```python
  template = "您选择使用路径:%s, \n如果确认请输入回车或者 yes(否则:no):"
  ```


  欢迎关注我公众号：AI悦创，有更多更好玩的等你发现！

  ![](https://bornforthis.cn/gzh.jpg)



  AI悦创·推出辅导班啦，包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发」，全部都是一对一教学：一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然，还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线，随时响应！微信：Jiabcdefh

  C++ 信息奥赛题解，长期更新！长期招收一对一中小学信息奥赛集训，莆田、厦门地区有机会线下上门，其他地区线上。微信：Jiabcdefh

  方法一：[QQ](http://wpa.qq.com/msgrd?v=3&uin=1432803776&site=qq&menu=yes)

  方法二：微信：Jiabcdefh


  ![](https://bornforthis.cn/zsxq.jpg)

  [![Security Status](https://www.murphysec.com/platform3/v3/badge/1610659414206361600.svg?t=1)](https://www.murphysec.com/accept?code=6e60439b6c9115849c8c231139adc3f5&type=1&from=2&t=2)


pkgId: 2b517872342b58fce713b14773bb8dfa0ec190e5f1d22436214e8dbba1805e01
name: python-aiycsnlp
arch: src
version: 0.0.14
epoch: 0
release: 1
summary: AIYC SimpleNLP
url: https://github.com/AndersonHJB/aiyc-snlp
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aiycsnlp-0.0.14-1.src.rpm
checksum_type: sha256
description:
  带编程一对一学员类基础练习所创建的代码，功能主要有：传入英文文本「.txt」，并调用，生成词云。



  ```python
  pip install aiycsnlp -i https://pypi.org/simple
  ```



  [https://github.com/AndersonHJB/aiyc-snlp](https://github.com/AndersonHJB/aiyc-snlp)






  欢迎关注我公众号：AI悦创，有更多更好玩的等你发现！

  ![](https://bornforthis.cn/gzh.jpg)



  AI悦创·推出辅导班啦，包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发」，全部都是一对一教学：一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然，还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线，随时响应！微信：Jiabcdefh

  C++ 信息奥赛题解，长期更新！长期招收一对一中小学信息奥赛集训，莆田、厦门地区有机会线下上门，其他地区线上。微信：Jiabcdefh

  方法一：[QQ](http://wpa.qq.com/msgrd?v=3&uin=1432803776&site=qq&menu=yes)

  方法二：微信：Jiabcdefh


  ![](https://bornforthis.cn/zsxq.jpg)


pkgId: 04af303c3dd58cd2539cab72147eefe85b0cf07dda05a0e1ad5ed2d93c0a38ef
name: python-ajallaan
arch: src
version: 2023.4.2
epoch: 0
release: 1
summary: In due time (Finnish: ajallaan) - reporting on worklog entries of some ticket system.
url: https://git.sr.ht/~sthagen/ajallaan
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ajallaan-2023.4.2-1.src.rpm
checksum_type: sha256
description:
  In due time (Finnish: ajallaan) - reporting on worklog entries of some ticket system.

  [License: MIT](https://git.sr.ht/~sthagen/ajallaan/tree/default/item/LICENSE)

  Third party dependencies are documented in the folder [third-party](docs/third-party/README.md).

  [![version](https://img.shields.io/pypi/v/ajallaan.svg?style=flat)](https://pypi.python.org/pypi/ajallaan/)
  [![downloads](https://pepy.tech/badge/ajallaan/month)](https://pepy.tech/project/ajallaan)
  [![wheel](https://img.shields.io/pypi/wheel/ajallaan.svg?style=flat)](https://pypi.python.org/pypi/ajallaan/)
  [![supported-versions](https://img.shields.io/pypi/pyversions/ajallaan.svg?style=flat)](https://pypi.python.org/pypi/ajallaan/)
  [![supported-implementations](https://img.shields.io/pypi/implementation/ajallaan.svg?style=flat)](https://pypi.python.org/pypi/ajallaan/)



  User and developer [documentation of ajallaan](https://codes.dilettant.life/docs/ajallaan).



  Any feature requests or bug reports shall go to the [todos of ajallaan](https://todo.sr.ht/~sthagen/ajallaan).



  The main source of `ajallaan` is on a mountain in central Switzerland.
  We use distributed version control (git).
  There is no central hub.
  Every clone can become a new source for the benefit of all.
  The preferred public clones of `ajallaan` are:

  * [on codeberg](https://codeberg.org/sthagen/ajallaan) - a democratic community-driven, non-profit software development platform operated by Codeberg e.V.
  * [at sourcehut](https://git.sr.ht/~sthagen/ajallaan) - a collection of tools useful for software development.



  Please do not submit "pull requests" (I found no way to disable that "feature" on GitHub).
  If you like to share small changes under the repositories license please kindly do so by sending a patchset.
  You can either send such a patchset per email using [git send-email](https://git-send-email.io) or
  if you are a sourcehut user by selecting "Prepare a patchset" on the summary page of your fork at [sourcehut](https://git.sr.ht/).



  Experimental.

  **Note**: The default branch is `default`.


pkgId: 812c014c8fc9b0efb36d0d2e53cf2c051d631555f2558c70df9c4da63c642721
name: python-ajax-views
arch: src
version: 0.7.0
epoch: 0
release: 1
summary: A simple Django application to easily use AJAX views with JavaScript.
url: https://github.com/dldevinc/ajax-views
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ajax-views-0.7.0-1.src.rpm
checksum_type: sha256
description:
  A simple Django application to easily use AJAX views with JavaScript.

  [![PyPI](https://img.shields.io/pypi/v/ajax-views.svg)](https://pypi.org/project/ajax-views/)
  [![Build Status](https://github.com/dldevinc/ajax-views/actions/workflows/tests.yml/badge.svg)](https://github.com/dldevinc/ajax-views)
  [![Software license](https://img.shields.io/pypi/l/ajax-views.svg)](https://pypi.org/project/ajax-views/)



  -   `django` >= 3.2
  -   `python` >= 3.7



  -   Ability to expose your AJAX URLs to JavaScript
  -   Supported Function-Based and Class-Based Views
  -   One URL pattern ~~to rule them all~~ for all AJAX views
  -   Jinja2 support



  Install the package via Pip:

  ```
  pip install ajax-views
  ```

  Add it to your `INSTALLED_APPS` list:

  ```python
  INSTALLED_APPS = (
      
      "ajax_views",
      
  )
  ```

  Add `ajax_views.urls` to your URLconf:

  ```python
  from django.urls import include, path

  urlpatterns = [
      path("ajax/", include("ajax_views.urls")),
  ]
  ```





  Use this decorator to register your views (Function-Based or Class-Based).

  ```python
  from ajax_views.decorators import ajax_view

  @ajax_view("myapp.form")
  def form_view(request):
      ...

  @ajax_view("myapp.form_cbv")
  class AjaxFormView(FormView):
      ...
  ```

  **NOTE**: The specified name has to be unique.

  You can combine `ajax_view` with other decorators:

  ```python
  @csrf_exempt
  @require_POST
  @ajax_view("myapp.contact_form")
  def csrf_exempt_view(request):
      
  ```



  Template tag to output registered URLs as JSON.

  ```djangotemplate
  {% load ajax_views %}

  <script>
      window.ajax_views = {% ajax_views_json %};
  </script>
  ```

  Now you can use the declared object to refer to the corresponding urls like this:

  ```javascript
  $.ajax({
      url: window.ajax_views.myapp.form,
      ...
  });
  ```



  This tag is used to add AJAX URLs in the template files:

  ```djangotemplate
  {% load ajax_views %}

  <form action="{% ajax_url 'myapp.form' %}" method="post">
      ...
  </form>
  ```



  You can have multiple names for the same view:

  ```python
  from ajax_views.decorators import ajax_view

  @ajax_view(["myapp.form", "myapp.fallback"])
  def example_view(request):
      ...
  ```



  Enable Jinja2 extension

  ```python
  TEMPLATES = [
      {
          "BACKEND": "django.template.backends.jinja2.Jinja2",
          "OPTIONS": {
              "extensions": [
                  
                  "ajax_views.templatetags.ajax_views.AjaxViewsExtension",
              ]
          }
      }
  ]
  ```

  **NOTE**: If you are using [django-jinja](https://niwinz.github.io/django-jinja/latest/), you don't need to do this.

  The usage is similar to Django, except that `ajax_url` is a global function:

  ```jinja2
  <form action="{{ ajax_url('myapp.form') }}" method="post">
      ...
  </form>
  ```



  After cloning the Git repository, you should install this
  in a virtualenv and set up for development:

  ```shell script
  virtualenv .venv
  source .venv/bin/activate
  pip install -r ./requirements.txt
  pre-commit install
  ```


pkgId: 923e56e8cd6d725f96ebaed696e14b7cc84ff69d04157da4c73133d3c4147fb5
name: python-ajc27-freemocap-blender-addon
arch: src
version: 2024.9.1024
epoch: 0
release: 1
summary: A Blender Add-on for working with Freemocap Data (based on @ajc27's addon)
url: https://freemocap.org
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ajc27-freemocap-blender-addon-2024.9.1024-1.src.rpm
checksum_type: sha256
description:
  <p align="center">
      <img src="https://github.com/freemocap/freemocap/assets/15314521/da1af7fe-f808-43dc-8f59-c579715d6593" height="240" alt="Project Logo">
  </p>


  <h3 align="center">FreeMoCap Blender Addon</h3>



  <p align="center">

  <a href="https://doi.org/10.5281/zenodo.7233714">
      <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.7233714.svg" alt=DOI-via-Zenodo.org>
    </a>

  <a href="https://github.com/psf/black">
      <img alt="https://img.shields.io/badge/code%20style-black-000000.svg" src="https://img.shields.io/badge/code%20style-black-000000.svg">
    </a>

  <a href="https://github.com/freemocap/freemocap_blender_addon/releases/latest">
          <img src="https://img.shields.io/github/release/freemocap/freemocap_blender_addon.svg" alt="Latest Release">
      </a>

  <a href="https://github.com/freemocap/freemocap/blob/main/LICENSE">
          <img src="https://img.shields.io/badge/license-AGPL-blue.svg" alt="AGPLv3">
      </a>

  <a href="https://github.com/freemocap/freemocap/issues">
          <img src="https://img.shields.io/badge/contributions-welcome-ff69b4.svg" alt="Contributions Welcome">
      </a>

  <a href="https://github.com/psf/black">
      <img alt="https://img.shields.io/badge/code%20style-black-000000.svg" src="https://img.shields.io/badge/code%20style-black-000000.svg">
    </a>

  <a href="https://discord.gg/SgdnzbHDTG">
      <img alt="Discord Community Server" src="https://dcbadge.vercel.app/api/server/SgdnzbHDTG?style=flat">
    </a>


  </p>

  This is a Blender add-on for loading and visualizing the output of the [freemocap](https://freemocap.org) software.

  The core functionality is run automatically at the end of a standard freemocap recording session, but this add-on allows for manual loading and visualization of the pre-processed `freemocap` recording data in Blender.

  ![image](https://github.com/freemocap/freemocap_blender_addon/assets/15314521/94d482c1-9fa7-4c66-8354-34cf5707af9f)


  1. Download the `freemocap_blender_addon.zip` ([from the latest release](https://github.com/freemocap/freemocap_blender_addon/releases/latest))
  1. Open [Blender]()
  1. `Edit` > `Preferences` > `Add-ons` > `Install...`
  1. Select the `freemocap_blender_addon.zip` (likely from your `Downloads/` folder)
  1. Verify installation by searching `freemocap` in the addon tab and ensuring the box next to `freemocap_blender_addon` is checked


  > NOTE - *We strongly recommend activating your System Console before running this addon, as it will show oodles of valuable information about the underlying process. On Windows, you can toggle this console on from the `Window` menu in a running instance of Blender. On Mac/Linux, you must **launch** blender from a Terminal by typing `blender` into a terminal after install.*


  You must have should have a fully processed [freemocap](https://freemocap.org) recording folder on your computer somewhere.

  If you are processing a recording from the `freemocap` software, it will probably in in `[path_to_your_home_directory]/freemocap_data/recording_sessions/[recording_name]`

  If you have downloaded and processed the `test` data from the `Data` dropdown in the menu bar of the `freemoap` software, the addon should detect that automatically and set that path as the default.

  You may download a pre-processed `freemocap_test_data` recording on the [`freemocap==1.3.0` release notes](https://github.com/freemocap/freemocap/releases/download/v1.3.0/):
  > https://github.com/freemocap/freemocap/releases/download/v1.3.0/freemocap_test_data_processed_with_freemocap_v1.3.0.zip



  1. In the `3D viewport` window, press `n` to show the sidebar
  2. Select the `💀FreeMoCap` tab
  3. Set the path to the FreeMoCap recording you want to load (path should point to the directory that contains the `output_data/` and `annotated_videos/` folders)
  4. Press the `RUN_ALL` (keep an eye on the terminal window for useful output)


  If all went well, there should now be a friendly spooky skeleton in your scene along with the annotated images-as-planes, and a new `.blend` file saved to the specified recording folder named `[recording_folder_name].blend` (i.e. the same way it comes out of a standard `freemocap` recording session)


  ___


  - The rig has a TPose as rest pose for easier retargeting.
  - For best results, your recording should include a few seconds where the particapant is standing still with their feet clearly visible flat on the ground.
  - If the data comes out rotated relative to gravity, it can be globally manipulated using the parent `empty`
   object (usually named `[recording_name]_parent_empty`) in the scene.
  - This is a Work-In-Progress with significant refactors/overhauls planned for the near future. You will always be able to re-process old freemocap recordings using new versions of software, but things like naming conventions, armature configuration, etc may change without notice! Save your work often and back up your data often :D


   Special thanks to @ajc27-git for the original work developing this addon and supporting the `freemocap` community! Check out their work at:  https://www.youtube.com/@fluxrenders


  Click this link to join the our community Discord server - https://discord.gg/XpRQJnqZxf


pkgId: 5199702ce9f02241210e082cdf36a67b7232b544a7b91d9f2e4db3c006375735
name: python-ajsonrpc
arch: src
version: 1.2.0
epoch: 0
release: 1
summary: Async JSON-RPC 2.0 protocol + server powered by asyncio
url: https://github.com/pavlov99/ajsonrpc
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ajsonrpc-1.2.0-1.src.rpm
checksum_type: sha256
description:
  [![Python package status](https://github.com/pavlov99/ajsonrpc/workflows/Python%20package/badge.svg)](https://github.com/pavlov99/ajsonrpc/actions?query=workflow%3A%22Python+package%22)
  [![security status](https://github.com/pavlov99/ajsonrpc/workflows/CodeQL/badge.svg)](https://github.com/pavlov99/ajsonrpc/actions?query=workflow%3ACodeQL)
  [![pypi version](https://img.shields.io/pypi/v/ajsonrpc.svg)](https://pypi.org/project/ajsonrpc/)

  Lightweight JSON-RPC 2.0 protocol implementation and asynchronous server powered by asyncio. This library is a successor of json-rpc and written by the same team.

  Features:
  * Full JSON-RPC 2.0 Implementation.
  * Async request manager that handles the protocol.
  * Vanilla Python, no dependencies.
  * API server setup in 1 min.
  * Same development team as `json-rpc`, largely compatible code.


  ```
  $ pip install ajsonrpc
  ```


  This package contains core JSON-RPC 2.0 primitives (request, response, etc.) and convenient backend-independent abstractions on top of them: dispatcher and request manager. These modules mirror implementation in the original json-rpc package with minor changes and improvements. Below is a summary of each module.


  Consists of JSON-RPC 2.0 primitives: request, batch request, response, batch response, error. It also defines base classes for custom errors and exceptions.

  Development principles:
  * If python object is created or modified without exceptions, it contains valid data.
  * Private state `<object>._body` contains the single source of truth. It is accessible and modifiable via getters (properties) and setters that ensure validation.
  * `body` is always a dictionary with primitive keys and values (the only exception is `response.result` that could hold any value defined by the application).
  * Constructor, getters and setters operate with JSON-RPC defined types, e.g. `response.error` always has `JSONRPC20Error` type. Most of other types are strings and numbers.

  Unlike json-rpc package, core module does not deal with serialization/de-serialization, this logic was moved to manager.


  Dispatcher is a dict-like object that maps method names to executables. One can think of it as an inproved dictionary, in fact it is inherited from `MutableMapping`. Some of the ways to add methods to dispatcher:

  ```python

  d = Dispatcher({"sum": lambda a, b: a + b})


  d["max"] = lambda a, b: max(a, b)


  @d.add_function
  def add(x, y):
      return x + y


  class Math:
      def sum(self, a, b):
          return a + b

      def diff(self, a, b):
          return a - b

  d.add_class(Math)
  d.add_object(Math())
  d.add_dict({"min": lambda a, b: min(a, b)})


  d.add_function(add, name="my_add")


  d.add_class(Math, prefix="get_")
  ```


  Manager generates a response for a request. It handles common routines: request parsing, exception handling and error generation, parallel request execution for batch requests, serialization/de-serialization. Manager is asynchronous and dackend agnostic, it exposes following common methods:

  ```python

  async def get_response_for_request(
      self, request: JSONRPC20Request
      ) -> Optional[JSONRPC20Response]


  async def get_response_for_payload(
      self, payload: str
      ) -> Optional[Union[JSONRPC20Response, JSONRPC20BatchResponse]]


  async def get_payload_for_payload(self, payload: str) -> str
  ```


  This package comes with an asyncio [Protocol-based](https://docs.python.org/3/library/asyncio-protocol.html) minimalistic server script `async-json-rpc-server`. One could think of it as a bottle-py of API servers.

  This was an experiment turned prototype: unlike json-rpc that requires some "shell" like Django or Flask to work, this package relies on asyncio and therefore could build on top of its [TCP server](https://docs.python.org/3/library/asyncio-protocol.html#tcp-echo-server). Indeed, JSON-RPC 2.0 is intentionally simple: server does not require views, has only one endpoint (routing is not required), only deals with json. Hence, vanilla code would be not only sufficient but likely faster than any framework.

  This idea of self-sufficient server was extended further: what would be the minimum interface that allows to plug application code? What if zero integration is required? Likely, this was possible with runtime method introspection: `async-json-rpc-server` parses given file with methods and exposes all of them. Let's consider an example:

  ```python

  import asyncio

  def echo(s='pong'):
      return s

  def mul2(a, b):
      return a * b

  async def say_after(delay, what):
      await asyncio.sleep(delay)
      return what
  ```

  To launch a server based on above methods, simply run:

  ```
  $ async-json-rpc-server examples/methods.py --port=8888
  ```
  (Ctrl+C stops the server).

  Single request example:
  ```
  $ curl -H 'Content-Type: application/json' \
      -d '{"jsonrpc": "2.0", "method": "echo", "id": 0}' \
      http://127.0.0.1:8888

  {"jsonrpc": "2.0", "id": 0, "result": "pong"}
  ```

  Batch request example:
  ![server-example-batch](https://raw.githubusercontent.com/pavlov99/ajsonrpc/master/docs/_static/server-example-postman.png)


  Backend support is a syntactic sugar that wraps dispatcher and manager under one api class and provides convenient boilerplate, such as handler generation. Currently supported frameworks:
  * Tornado
  * Sanic
  * Quart


pkgId: 3fa522ec3bf1cdbffc5f363b1c32a8341fe2ee05bdb11fb4579abdb4cc492e60
name: python-ak_selenium
arch: src
version: 0.1.9
epoch: 0
release: 1
summary: Selenium package with requests integration and anti-bot detection measures
url: https://pypi.org/project/ak_selenium/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ak_selenium-0.1.9-1.src.rpm
checksum_type: sha256
description:
  <!--- Heading --->
  <div align="center">
    <h1>ak_selenium</h1>
    <p>
      Selenium package with requests integration and anti-bot detection measures
    </p>
  <h4>
      <a href="https://github.com/rpakishore/ak_selenium">Documentation</a>
    <span> · </span>
      <a href="https://github.com/rpakishore/ak_selenium/issues/">Report Bug</a>
    <span> · </span>
      <a href="https://github.com/rpakishore/ak_selenium/issues/">Request Feature</a>
    </h4>
  </div>
  <br />

  ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/rpakishore/ak_selenium)
  ![GitHub last commit](https://img.shields.io/github/last-commit/rpakishore/ak_selenium)
  [![tests](https://github.com/rpakishore/ak_selenium/actions/workflows/test.yml/badge.svg)](https://github.com/rpakishore/ak_selenium/actions/workflows/test.yml)

  <!-- Table of Contents -->
  <h2>Table of Contents</h2>

  - [1. About the Project](#1-about-the-project)
    - [1.1. Features](#11-features)
  - [2. Getting Started](#2-getting-started)
    - [2.1. Installation](#21-installation)
      - [2.1.1. Production](#211-production)
      - [2.1.2. Development](#212-development)
  - [3. Usage](#3-usage)
    - [3.1. Additional Options](#31-additional-options)
  - [4. Roadmap](#4-roadmap)
  - [5. License](#5-license)
  - [6. Contact](#6-contact)
  - [7. Acknowledgements](#7-acknowledgements)

  <!-- About the Project -->


  `ak_selenium` is a Python package that provides an interface for automating browser tasks using Selenium. It comes with built-in functionalities for handling common tasks such as form filling, scrolling, and waiting for elements to load. Additionally, it has a built-in requests session that handles retries and timeouts, making it easier to send HTTP requests.

  <!-- Features -->


  - Chrome browser automation using Selenium WebDriver.
  - Built-in methods for form filling, scrolling, and waiting for elements.
  - Anti-bot detection measures
  - Pass selenium headers/cookies to requests library
  - Built-in requests session with retries and timeouts.
  - Ability to use Chrome user data for browser automation.
  - RAM optimization for browser options.
  - Integrates [Helium](https://github.com/mherrmann/helium) for easier automation

  <!-- Getting Started -->


  <!-- Installation -->




  Install with flit

  ```bash
  pip install flit
  flit install --deps production
  ```

  Alternatively, you can use pip

  ```bash
  pip install ak_selenium
  ```



  Install with flit

  ```bash
  flit install --pth-file
  ```

  <!-- Usage -->


  ```python
  from ak_selenium import Chrome, By, Keys

  chrome = Chrome(headless=True)                  # Create a new Chrome browser instance
  driver = chrome.driver                          #Get Chromedriver
  chrome.get("https://example.com")               # Navigate to a webpage


  locator = (By.TAG_NAME, "h1")
  chrome.wait_for_locator(locator)

  s = chrome.session                              # Pass selenium session to requests
  s.get("https://www.iana.org/domains/reserved")  # Get a website



  s.bulk_get(["https://www.iana.org/domains/reserved", "https://www.example.com"])

  ```

  Integrated with [Helium](https://github.com/mherrmann/helium) to make it easier to set up automation.

  Helium methods and functions can be used as intended in the [original documentation](https://github.com/mherrmann/helium/blob/master/README.md)

  Example:

  ```python
  import helium
  helium.wait_until(helium.Button('Download').exists)
  ```

  Alternatively, helium methods and classes have been collected into two classes `Element` and `Action` for convinience

  `Element` exposes the following classes: `Alert`, `Button`, `CheckBox`, `ComboBox`, `Image`, `Link`, `ListItem`, `RadioButton`, `Text`, `TextField` and the method `find_all`

  `Action` exposes the following methods: `highlight`, `wait_until`, `refresh`, `attach_file`, `drag_file`, `combobox_select`, `hover`, `write`.
  `Action` also incorporates a `Mouse` sub-class that collect mouse-related methods.

  Example:

  ```python
  from ak_selenium import Element, Action, Keys
  import helium

  chrome.get('https://google.com')                      #Go to website
  Action.write('helium selenium github')                #Enter text into text field
  helium.press(Keys.ENTER)                              #Press Enter
  Action.Mouse.click('mherrmann/helium')                #Click
  chrome.get('https://github.com/login')                #Goto github
  Action.write('username', into='Username')             #Enter Username into Username field
  Action.write('password', into='Password')             #Enter Password into Password field
  Action.Mouse.click('Sign in')                         #Click Sign-in
  Action.Mouse.scroll(direction='down', num_pixels=100) #Scroll down 100px
  helium.kill_browser()                                 #Close the browser
  ```



  ```python


  chrome.USERAGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) \
                      AppleWebKit/537.36 (KHTML, like Gecko) \
                      Chrome/83.0.4103.53 Safari/537.36'


  chrome.IMPLICITLY_WAIT_TIME = 3 #seconds
  chrome.MAX_WAIT_TIME = 5 #seconds


  s.MIN_REQUEST_GAP = 0.9 #seconds between requests
  ```

  <!-- Roadmap -->


  - [ ] Add beautifulsoup integration
  - [ ] Proxy

  <!-- License -->


  See LICENSE for more information.

  <!-- Contact -->


  Arun Kishore - [@rpakishore](mailto:pypi@rpakishore.co.in)

  Project Link: [https://github.com/rpakishore/ak_selenium](https://github.com/rpakishore/ak_selenium)

  <!-- Acknowledgments -->


  - [Awesome README Template](https://github.com/Louis3797/awesome-readme-template/blob/main/README-WITHOUT-EMOJI.md)
  - [Shields.io](https://shields.io/)
  - [Helium](https://github.com/mherrmann/helium)


pkgId: 335191d8a3ac1041386f89941141cae02b62d5087f49b1291d12b34783caa054
name: python-ak_transcribe
arch: src
version: 0.0.4
epoch: 0
release: 1
summary: Transcribe Media Files
url: https://pypi.org/project/ak_transcribe/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ak_transcribe-0.0.4-1.src.rpm
checksum_type: sha256
description:
  <!--- Heading --->
  <div align="center">
    <h1>ak_transcribe</h1>
  </div>
  <br />

  <!-- Table of Contents -->
  <h2>Table of Contents</h2>

  - [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Installation](#installation)
  - [Usage](#usage)
  - [License](#license)
  - [Contact](#contact)

  <!-- Getting Started -->


  <!-- Prerequisites -->


  Python 3.11 or above

  **Note for Ubuntu/Debian:**
  This project uses `python-magic` to identify file types. So the libmagic C library needs to be installed need to be installed. See [python-magic](https://pypi.org/project/python-magic/) for more information.

  For Debian/Ubuntu systems:

  - `sudo apt-get install libmagic1`

  For OSX:

  - When using Homebrew: `brew install libmagic`
  - When using macports: `port install file`

  For Windows:

  - _No additional requirements_

  <!-- Installation -->


  ```bash
    pip install ak_transcribe
  ```

  Check configs

  ```python
    import ak_transcribe
    ak_transcribe.test_configs()
  ```
  <!-- Usage -->



  ```python
  from ak_transcribe import Transcriber
  from pathlib import Path
  res = Transcriber.process(filepath=Path("path/to/media/file"))


  with open(filepath.with_suffix('.json'), 'w', encoding='utf-8') as f:
      f.write(res.json)


  res.srt


  res.embed_srt(filepath=Path("path/to/media/file"))


  res.txt


  from ak_transcribe import converter
  converter.srt_to_txt("path/to/srt/file")


  from ak_transcribe import TranscribedContent
  TranscribedContent = Path("path/to/JSON/file")


  import json
  with open(Path("path/to/JSON/file"), "r", encoding="utf-8") as f:
      return TranscribedContent(results=json.load(f))
  ```

  <!-- License -->


  See [LICENSE](/LICENSE) for more information.

  <!-- Contact -->


  Arun Kishore - [@rpakishore](mailto:pypi@rpakishore.co.in)

  Project Link: [https://github.com/rpakishore/ak_transcribe](https://github.com/rpakishore/ak_transcribe)


pkgId: 6654e7b9eca0040f1da1dbaecc0c0315a40b98e42707464b1d1ed240e9e09c49
name: python-akademy
arch: src
version: 0.1.51
epoch: 0
release: 1
summary: akademy: A Reinforcement Learning Framework
url: https://github.com/alphazwest/akademy
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akademy-0.1.51-1.src.rpm
checksum_type: sha256
description:
  Akademy is a module containing composable object classes for developing
  reinforcement learning algorithms focused on quantitative trading and
  time-series forecasting. This module is a work-in-progress and should, at no
  time, be assumed to be designed well or be free of bugs.


  Akademy is designed using an `Agent`-`Environment` model such that `Agent`-class
  objects ingest information from `Environment`-class objects (`Env`), produce
  an `Action`, which is then applied to the `Environment` which results in a
  change in `State` and possible reward to offer feedback to the agent.

  *Note*: this module does not provide any training routines -- only the object class
  that can be used to support the implementation of custom training routines.



  To install `akademy` use the following command in the desired Python 3.7+
  environment:

  `pip install akademy`

  Once installed, developers will have access to `Agent`, `TradeEnv`, and `Network`
  class objects in which to design Reinforcement Learning algorithms to train models.

  Sample training routine:

  ```python
  from akademy.models.envs import TradeEnv
  from akademy.models.agents import DQNAgent
  from akademy.common.utils import load_spy_daily


  data = load_spy_daily(count=2500)


  env = TradeEnv(
      data=data,
      window=50,
      asset="spy",
  )


  agent = DQNAgent(
      action_count=env.action_space.n,
      state_shape=env.observation_space.shape
  )


  training_routine(
      agent=agent,
      env=env
  )
  ```


  Unit testing can be run via the following command:

  `python -m unittest`

  For detailed information the `--verbose` flag can be used. For more detailed
  usage consult the `unittest` module documentation.


  This module comes with minimal data for Agents and Environments to train on.
  The current data available is listed below, along with sources for the most
  up-to-date versions as well:


  Location: `/data/SPY.CSV`\
  Start:  `1993-01-29`\
  End:    `2023-01-23`\
  Total Rows: `7,454` (excludes header)\
  Header: `Date,Open,High,Low,Close,Adj Close,Volume`\
  Source: https://finance.yahoo.com/quote/SPY/history?p=SPY

  *note*: Any data can be used easily enough via conversion into a Pandas DataFrame
  object, but must contain information for `date` and pricing data for
  `open`, `high`, `low`, and `close` as well as `volume` such that each row has
  at least those 6 features or the latter 5 and an index representative of date.




  The `Gym` project by OpenAI has been sunset and now maintained as `Gymnasium`
  by the [Farama-Foundation](https://github.com/Farama-Foundation/Gymnasium). The
  `Env` classes present here make use of the newer `Gymnasium` package which, among
  other differences, produces an extra item in the `step` method indicating whether
  an environment has been truncated. [See here](https://github.com/Farama-Foundation/Gymnasium/blob/main/gymnasium/core.py#L63)


  PyTorch requires some additional consideration for setup depending on use-case.
  Akademy uses an approach whereby CPU-based training and inferences are possible
  via parameterized function calls. However, GPU use (e.g. CUDA) requires local
  considerations. [See here] (https://pytorch.org/get-started/locally/) for a more
  in-depth discussion and guide.

  This module currently uses the 1.* version, though a 2.* version release
  is imminent and an upgrade to that version is planned.


pkgId: 69b1af58a960ccc35a0c1c7b7a9c649d151440d1536430d74ddfece2f9d2b1b0
name: python-akamai-edgeauth
arch: src
version: 0.3.2
epoch: 0
release: 1
summary: Akamai Edge Authorization Token for Property Manager Behavior
url: https://github.com/akamai/EdgeAuth-Token-Python
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akamai-edgeauth-0.3.2-1.src.rpm
checksum_type: sha256
description:
  EdgeAuth-Token-Python is Akamai Edge Authorization Token in the HTTP Cookie, Query String, and Header for a client.
  You can configure it in the Property Manager at https://control.akamai.com.
  It's a behavior which is Auth Token 2.0 Verification.
  EdgeAuth-Token-Python supports Python 2.6–2.7 & 3.3–3.6 and runs great on PyPy.


pkgId: 965a338baf35c694ad7bbc04ad029eff0cc70da1b56ccee3ab9ef43ab8b52d88
name: python-akamai-network-lists
arch: src
version: 0.0.4
epoch: 0
release: 1
summary: An Akamai CLI package for interacting with the Network Lists API
url: https://github.com/ryanlinnit-sky/akamai-cli-network-lists
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akamai-network-lists-0.0.4-1.src.rpm
checksum_type: sha256
description:
  A package for [Akamai CLI](https://github.com/akamai/cli) to interact with the Network Lists API.
  An API summary can be found [here](https://techdocs.akamai.com/network-lists/reference/api-summary).



  ```
  Usage: akamai_network_lists [OPTIONS] COMMAND [ARGS]...

  Options:
    -e, --edgerc        Location of the credentials file [$AKAMAI_EDGERC]
    -s, --section       Section of the credentials file [$AKAMAI_EDGERC_SECTION]
    -a, --account-key   Account Key
    --version           Show the version and exit.
    -h, --help          Show this message and exit.

  Commands:
    activate             Activate Network List
    activation-snapshot  Get Activation Snapshot
    activation-status    Get Activation Status
    add-element          Add Network List Element
    append               Append Elements to Network List
    create               Create Network List
    delete               Delete Network List
    help                 Show help information
    list                 List Network Lists
    remove-element       Remove Network List Element
    retrieve             Retrieve Network List
    update               Update Network List
    update-details       Update Network List details
  ```



  This project is using [hatch](https://hatch.pypa.io/latest/) as it's build system. For this reason I also used it to manage the development environment. The following commands can be used to create and activate a virtual environment. Alternatively you're free to use the Python `venv` module.

  You may need to [install](https://hatch.pypa.io/latest/install/) `hatch` (`pip install hatch`)

  ```bash
  hatch env create
  hatch shell
  ```


  The main "binary" is located in `bin/akamai-network-lists.py`. The reason is because the akamai-cli tool has it's own format a python module must adhere to. It [looks for files](https://github.com/akamai/cli/blob/20c6521bfe3cb129bc5a41c81e206bba27e40efd/pkg/commands/command.go#L372) under the `bin` directory that [match the pattern](https://github.com/akamai/cli/blob/20c6521bfe3cb129bc5a41c81e206bba27e40efd/pkg/commands/command.go#L286) of `akamai-command-name`.

  We also [need to list our dependencies](https://github.com/akamai/cli/blob/20c6521bfe3cb129bc5a41c81e206bba27e40efd/pkg/packages/python.go#L128) in a `requirements.txt` file, as we are using `pyproject.toml` to define our build system requirements and dependencies, this means we have only included `akamai-network-lists` in `requirements.txt` and this module will be installed from [PyPi](https://pypi.org/project/akamai-network-lists/).

  There is some information in the [README.md](https://github.com/akamai/cli/blob/20c6521bfe3cb129bc5a41c81e206bba27e40efd/README.md#command-package-metadata) for akamai-cli, but a lot of the specifics seem un-written..



  ```bash
  python3 -m pip install --upgrade build
  python3 -m pip install --upgrade twine

  python3 -m build
  python3 -m twine upload dist/*
  ```




  ```bash



  python3.11 -m venv test_venv
  source test_venv/bin/activate
  PYTHONUSERBASE="test_venv/lib/python3.11/site-packages"

  akamai install https://github.com/ryanlinnit-sky/akamai-cli-network-lists.git

  akamai network-lists
  ```


pkgId: 37c8bf06e5e908827d0f52a65176131847c3d1d1278c62ae79fb5ed673aa9537
name: python-akamai_purge_cache
arch: src
version: 2.0.1
epoch: 0
release: 1
summary: Marriott CDN Team Fastpurge POC script
url: https://pypi.org/project/akamai_purge_cache/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akamai_purge_cache-2.0.1-1.src.rpm
checksum_type: sha256
description:
  ```python
  """Module to invoke Akamai Fastpurge via simple CLI utility."""
  import os
  import click
  from fastpurge import FastPurgeClient


  @click.command()
  @click.option(
      "paths",
      "--path",
      "-p",
      multiple=True,
      help="A single URL to Purge (This option is repeatable for additional URLs)",
  )
  @click.option(
      "--dryrun",
      "-d",
      is_flag=True,
      help="Just print the command and args that will be run and exit",
  )
  def mgpurge(paths: list[str], dryrun: bool) -> None:
      """
      Module to invoke Akamai Fastpurge via simple CLI utility.
      :param list[str] paths: List of paths to purge from Akamai cache.
      :param bool dryrun: Just print the command and args that will be run and exit
      """
      
      

      
      client = FastPurgeClient(
          auth={
              "client_secret": os.environ["AKAMAI_DEFAULT_CLIENT_SECRET"],
              "host": os.environ["AKAMAI_DEFAULT_HOST"],
              "access_token": os.environ["AKAMAI_DEFAULT_ACCESS_TOKEN"],
              "client_token": os.environ["AKAMAI_DEFAULT_CLIENT_TOKEN"],
          }
      )
      if dryrun:
          print("These paths will be purged:")
          for path in paths:
              click.echo(message=path)
          return
          
      
      
      purge_cmd = client.purge_by_url(urls=paths)
      
      
      result = purge_cmd.result()
      print("Purge completed:", result)


  if __name__ == "__main__":
      
      mgpurge()

  ```


  - Document local installation
  - Document local run
  - Document building
  - Document publishing to PY-Pi
  - Document remote installation and usage


pkgId: 7c641f6b49f59198407ddce12015ca4d7eabf9036594f26982124e2d86d461b1
name: python-akanekopy
arch: src
version: 1.1.4
epoch: 0
release: 1
summary: Akaneko for Python 3 and above
url: https://github.com/RaphielHS/akaneko-wrapper
rpm_license: MIT license
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akanekopy-1.1.4-1.src.rpm
checksum_type: sha256
description:
  lewdNeko | NSFW Neko Girls (Cat Girls)
  lewdBomb(n) | Sends (n) amount of lewds! :3

  Example:
  ```python
  akaneko.module.function() # Format
  akaneko.sfw.foxgirl()     # Awoo!~ Another example!
  akaneko.sfw.neko()        # Meow! An Example!
  ```


pkgId: cf53fe6fed3425b57173621b850ebe5582278f99ade8331acb0e653f03753c0d
name: python-akantu-geomechanical-solver
arch: src
version: 0.3.0
epoch: 0
release: 1
summary: Geomechanical simulator based on the open-source FEM library Akantu.
url: https://gitlab.com/emil.gallyamov/akantu-geomechanical-solver
rpm_license: GPL
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akantu-geomechanical-solver-0.3.0-1.src.rpm
checksum_type: sha256
description:
  _Python package containing a geomechanical simulator based on the open-source FEM library [Akantu](https://gitlab.com/akantu/akantu)_

  [![PyPI version](https://badge.fury.io/py/akantu-geomechanical-solver.svg)](https://badge.fury.io/py/akantu-geomechanical-solver)
  [![Project Status](https://img.shields.io/badge/status-under%20development-yellow)](https://gitlab.com/emil.gallyamov/akantu-geomechanical-solver)
  [![GitLab License](https://img.shields.io/gitlab/license/emil.gallyamov%2Fakantu-geomechanical-solver)](https://img.shields.io/gitlab/license/emil.gallyamov%2Fakantu-geomechanical-solver)

  See the package documentation on [GitLab Pages](https://akantu-geomechanical-solver-emil-gallyamov-1511fed408434e70bb06.gitlab.io/)







  ``` bash
  pip install akantu-geomechanical-solver[serial] --index-url https://gitlab.com/api/v4/projects/15663046/packages/pypi/simple
  ```



  To use the parallel version of  Akantu for the geomechanical simulator, a Docker image can be pulled and used out of the box, or build Akantu from source.



  To use the Docker image including a parallel version of the geomechanical solver, follow these steps:

  1. Make sure you have Docker installed on your system.
  2. Pull the Docker image from the registry using the following command:

  ```bash
  docker pull registry.gitlab.com/emil.gallyamov/akantu-geomechanical-solver/parallel-gms-images:main
  ```

  3. Once the image is pulled, you can run a container using the image with the following command:

  ```bash
  docker run -it registry.gitlab.com/emil.gallyamov/akantu-geomechanical-solver/parallel-gms-images:main /bin/bash
  ```

  This will start a container and give you an interactive bash shell inside it.

  4. You can now use the Docker image for your desired purposes.





  In order to compile Akantu, some libraries are required:

  * CMake
  * Boost
  * LAPACK
  * BLAS
  * MPI
  * Scotch
  * MUMPS
  * Gmsh

  Please note that the compilation from source will only work with a gcc version < 13

  **On `.deb` based systems**

  ```bash
  > sudo apt install cmake libboost-devl iblapack-dev libblas-dev zlib1g-dev  gmsh
  > sudo apt install libopenmpi-dev openmpi-bin libscotch-dev libmumps-dev
  ```



  Clone the repository, for instance using

  ```bash
  git clone git@gitlab.com:emil.gallyamov/akantu-geomechanical-solver.git
  ```

  Use the `installation.sh` script to build the parallel version of hydromechanical coupling branch of Akantu used by the geomechanical solver on your machine. This will create an `akantu` subfolder in the `akantu-geomechanical-solver` folder. Once this is done, add three Akantu path to `PYTHONPATH` variable

  ```bash
  export PYTHONPATH="${PYTHONPATH}:${PWD}/akantu/build/python:${PWD}/akantu/test:${PWD}/akantu/test/test_fe_engine"
  ```

  You can then install the parallel version version of the geomechanical solver via pip.

  ``` bash
  pip install .[parallel]
  ```


pkgId: 210753788aebb720e8e82e7a8872c65e18a23422b70fa8bceaf8917d0b5a93da
name: python-akasha-py
arch: src
version: 0.2.8
epoch: 0
release: 1
summary: Async API wrapper for akasha.cv written in Python
url: https://github.com/seriaati/akasha-py
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akasha-py-0.2.8-1.src.rpm
checksum_type: sha256
description:
  akasha-py is an async API wrapper for [akasha.cv](https://akasha.cv/) written in Python.
  akasha.cv is a Genshin Impact leaderboard website.
  Developing something for Hoyoverse games? You might be interested in [other API wrappers](https://github.com/seriaati#api-wrappers) written by me.
  > Note: I am not the developer of akasha.cv.



  A couple things I want to address:

  - This wrapper is currently in-progress, some features may not work as expected, many features are also missing.
  - The developer of akasha.cv mentioned to me that they change their API very frequently (and without notice), so this wrapper may break at any time.
  - This wrapper was made because I wanted to integrate akasha into my [Discord bot](https://github.com/seriaati/hoyo-buddy), but I eventually stopped working on it. Therefore, this wrapper is not my current priority, but I will fix issues if you submit them.



  ```bash

  poetry add akasha-py


  pip install akasha-py
  ```



  Interact with the API using the `akasha.AkashaAPI` class.
  You can find all available methods that `AkashaAPI` provides in the [client.py](https://github.com/seriaati/akasha-py/blob/main/akasha/client.py) file.
  A quick example is provided below:

  ```py
  import asyncio

  import akasha


  async def main() -> None:
      uid = 901211014
      async with akasha.AkashaAPI(akasha.Language.CHINESE_SIMPLIFIED) as api:
          

          characters = await api.get_calculations_for_user(uid)
          for character in characters:
              calc = character.calculations[0]

              print(f"Character: {character.name}")
              print(f"Weapon: {calc.weapon.name}")
              print(f"Top {calc.top_percent:.2f}% ({calc.ranking}/{calc.out_of})")
              print(f"Damage: {round(calc.result)}")
              print()

              print("Leaderboard top 3:")
              async for board in api.get_leaderboards(calc.id, max_page=1, page_size=3):
                  print(
                      f"{board.rank}. {board.owner.nickname} | Damage: {round(board.calculation.result)}"
                  )
              print(f"Leadboard URL: https://akasha.cv/leaderboards/{calc.id}")

              print("=" * 50)


  asyncio.run(main())
  ```



  Whether you want to make any bug reports, feature requests, or contribute to the wrapper, simply open an issue or pull request in this repository.
  If GitHub is not your type, you can find me on [Discord](https://discord.com/invite/b22kMKuwbS), my username is @seria_ati.

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


pkgId: f74ad3ee0eac6a29edd83fc7f49b82bbf2f333155763d327949412cc048b02e2
name: python-akatest
arch: src
version: 0.4
epoch: 0
release: 1
summary: A simple package to send a webhook request to a URL
url: https://github.com/noama163/akatest
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akatest-0.4-1.src.rpm
checksum_type: sha256
description:
  A simple Python package that sends a `GET` request to a webhook URL (`/ImBad`).



  To install the package, run:

  ```bash
  pip install .
  ```


pkgId: 6ad06fa428d389ef9c14199eebfa129460ee2d17e6adcc62cb8d76b94e41e1e2
name: python-akello
arch: src
version: 0.0.24
epoch: 0
release: 1
summary: FastAPI server akello.io
url: https://akello.io
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akello-0.0.24-1.src.rpm
checksum_type: sha256
description:
  This package includes all the backend API services needed for Akello. You can extend from the base server and add new endpoints to override any behavior.



  Make sure the following dependencies are met with your system
  * Docker is running
  * AWS cli is configured (needed for Cognito and DynamoDB docker containers)

  ```shell
  pip install akello
  akello start server
  ```

  After the script completes you will be able to access the API on http://localhost:8000


pkgId: 5b912c1ff852a1d8b13aace7450c1178e7e4df22f0f6a806d6ca9a13f3f452d7
name: python-akeneo-api-client
arch: src
version: 1.2.1
epoch: 0
release: 1
summary: REST API client for Akeneo
url: https://github.com/asimlqt/akeneo-api-python-client
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akeneo-api-client-1.2.1-1.src.rpm
checksum_type: sha256
description:
  A simple Python client for the Akeneo PIM API



  ```commandline
  pip install akeneo-api-client
  ```





  ```python
  from akeneo_api_client.client_builder import ClientBuilder
  from akeneo_api_client.client.akeneo_api_error import AkeneoApiError

  cb = ClientBuilder(uri)
  api = cb.build_authenticated_by_password(username, password, client_id, secret)
  ```

  Or if you already have a cached version of the token you can use:

  ```python
  api = cb.build_authenticated_by_token(client_id, secret, token, refresh_token)
  ```



  ```python
  try:
      response = api.product_uuid_api.get(uuid)
      print(response)
  except AkeneoApiError as e:
      print(e.response.status_code)
      print(e.response_body)
  ```



  ```python
  from akeneo_api_client.search.search_builder import SearchBuilder

  sb = SearchBuilder()
  sb.add_filter('updated', '>', '2023-11-29 00:00:00')
  sb.add_filter('completeness', '=', 100, {"scope": "ecommerce"})
  sb.add_filter('enabled', '=', True)
  search = sb.get_filters()

  try:
      for page in api.product_uuid_api.all(query_params={"search": search}):
          for item in page:
              print(item["uuid"])
  except AkeneoApiError as e:
      print(e.message)
  ```



  ```python
  try:
      response = api.product_uuid_api.create(data={"family":"my_family"})
      print(response.headers.get("location"))
  except AkeneoApiError as e:
      print(e.response_body)
  ```



  This call will create a product if it doesn't exist or update it if it does

  ```python
  data = {
      "values": {
          "Product_name": [
              {"scope": None, "locale": "en_GB", "data": "My product"}
          ]
      }
  }

  try:
      api.product_uuid_api.upsert(uuid, data)
  except AkeneoApiError as e:
      print(e.message)
  ```



  ```python
  products = [
      {
          "uuid": str(uuid.uuid4()),
          "values": {
              "Product_name": [
                  {"scope": None, "locale": "en_GB", "data": "Product 1"}
              ]
          }
      },
      {
          "values": {
              "Product_name": [
                  {"scope": None, "locale": "en_GB", "data": "Product 2"}
              ]
          }
      }
  ]

  try:
      response = api.product_uuid_api.upsert_list(products)
      for item in response:
          if item['status_code'] >= 400:
              print(item)
  except AkeneoApiError as e:
      print(e.response.reason)
  ```



  ```python
  try:
      api.product_uuid_api.delete(uuid)
  except AkeneoApiError as e:
      print(e.response_body)
  ```


pkgId: f0a2d2b2a063164f4d3dd3b1b519d28dcf6c66a650f94af452100a82b65fd05f
name: python-akenoai
arch: src
version: 1.3.0
epoch: 0
release: 1
summary: AkenoAi Python Wrapper For Plus+
url: https://pypi.org/project/akenoai/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akenoai-1.3.0-1.src.rpm
checksum_type: sha256
description:
  - install : `pip3 install akenoai[porno]`


  > performance high speed API
  > `google_video_to_text`
  > `google_audio_to_text`

  > params string optional: `prompt`, `mime_type`


  ```python
  import akenoai as dev

  file_path = "example.jpg"

  api = dev.AkenoPlus(key=...)

  response = await api.google_image_to_text(files_open=file_path)

  print(response)
  ```


  > method `paal_see`

  > params string optional: `lang="en"` and `is_trans="True"`


  ```python
  import akenoai as dev

  file_path = "example.jpg"
  api = dev.AkenoPlus(key=...)
  response = await api.paal_see(files_open=file_path)
  print(response)

  response_2 = await api.paal_text_to_image(prompt="cat beautiful")
  print(response_2)
  ```


  ```python

  import akenoai as ak
  _ = ak.AkenoPlus(key=...)
  _.download_now(data)
  _.clean(file_path)
  _.terabox(link)
  _.terabox_v2(link)
  _.chatgpt_old(query)
  _.chatgpt_mode_web(query)
  _.sites_torrens_all()
  _.search_for_torrents(params)
  _.get_torrent_from_url(params)
  _.get_recent(params)
  _.get_category(params)
  _.paal_see(files_open, params)
  _.google_video_to_text(files_open, params)
  _.google_image_to_text(files_open, params)
  _.google_audio_to_text(files_open, params)
  _.blackbox(query)
  _.fbdown(link)
  _.fdownloader(link)
  _.capcut(link)



  import akenoai as ak
  _ = ak.Pornohub(key=...)
  _.x_search(query)
  _.x_download(query)
  _.x_download(url, is_stream=True)
  ```


  [![License](https://www.gnu.org/graphics/agplv3-155x51.png)](LICENSE)
  TeamKillerX is licensed under [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) v3 or later.

  <h4 align="center">Copyright (C) 2019 - 2024 The AkenoAI <a href="https://github.com/TeamKillerX">TeamKillerX</a>
  <a href="https://t.me/xtdevs">@xtdevs</a>
  </h4>

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.

  Project [RyuzakiLib](https://github.com/TeamKillerX/) 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: 3ea6c731844019aad71b4319738e39d222636fd2c37a356af5d33e8b028ed938
name: python-akerbp-mlops
arch: src
version: 4.1.0
epoch: 0
release: 1
summary: AkerBP MLOps framework
url: https://github.com/AkerBP/expres-ml-mlops
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akerbp-mlops-4.1.0-1.src.rpm
checksum_type: sha256
description:
  model_name: model2
  human_friendly_model: 'My Second Model'
  model_file: model_code/model2.py
  (...)
  ```

  All the model code and files should be under a single folder, e.g. `model_code`.
  **Required** files in this folder:
  - `model.py`: implements the standard model interface
  - `test_model.py`: tests to verify that the model code is correct and to verify
    correct deployment
  - `requirements.model`: libraries needed (with specific **version numbers**),
    can't be called `requirements.txt`. Add the MLOps framework like this:
    ```bash
    
    (...) # your other reqs
    akerbp-mlops==MLOPS_VERSION
    ```
    During deployment, `MLOPS_VERSION` will be automatically replaced by the
    specific version **that you have installed locally**. Make sure you have the latest release on your local machine prior to model deployment.
  For the prediction service we require the model interface to have the following class and function
    - initialization(), with required arguments
      - path to artifact folder
      - secrets
        - these arguments can safely be set to None, and the framework will handle everything under the hood.
        - only set path to artifact folder as None if not using any artifacts
    - predict(), with required arguments
      - data
      - init_object (output from initialization() function)
      - secrets
        - You can safely put the secrets argument to None, and the framework will handle the secrets under the hood.
    - ModelException class with inheritance from an Exception base class
  For the training service we require the model interface to have the following class and function
    - train(), with required arguments
      - folder_path
        - path to store model artifacts to be consumed by the prediction service
    - ModelException class with inheritance from an Exception base class
  The following structure is recommended for projects with multiple models:
  - `model_code/model1/`
  - `model_code/model2/`
  - `model_code/common_code/`
  This is because when deploying a model, e.g. `model1`, the top folder in the
  path (`model_code` in the example above) is copied and deployed, i.e.
  `common_code` folder (assumed to be needed by `model1`) is included. Note that
  `model2` folder would also be deployed (this is assumed to be unnecessary but
  harmless).

  The repo's root folder is the base folder when importing. For example, assume
  you have these files in the folder with model code:
   - `model_code/model.py`
   - `model_code/helper.py`
   - `model_code/data.csv`
  If `model.py` needs to import `helper.py`, use: `import model_code.helper`. If
  `model.py` needs to read `data.csv`, the right path is
  `os.path.join('model_code', 'data.csv')`.
  It's of course possible to import from the Mlops package, e.g. its logger:
  ``` python
  from akerbp.mlops.core import logger
  logging=logger.get_logger("logger_name")
  logging.debug("This is a debug log")
  ```

  We consider two types of services: prediction and training.
  Deployed services can be called with
  ```python
  from akerbp.mlops.xx.helpers import call_function
  output = call_function(external_id, data)
  ```
  Where `xx` is either `'cdf'` or `'gc'`, and `external_id` follows the
  structure `model-service-model_env`:
   - `model`: model name given by the user (settings file)
   - `service`: either `training` or `prediction`
   - `model_env`: either `dev`, `test` or `prod` (depending on the deployment
     environment)
  The output has a status field (`ok` or `error`). If they are 'ok', they have
  also a `prediction` and `prediction_file` or `training` field (depending on the type of service). The
  former is determined by the `predict` method of the model, while the latter
  combines artifact metadata and model metadata produced by the `train` function.
  Prediction services have also a `model_id` field to keep track of which model
  was used to predict.
  See below for more details on how to call prediction services hosted in CDF.

  Model services (described below) can be deployed to CDF, i.e. Cognite Data Fusion or Google Cloud Run. The deployment platform is specified in the settings file.
  CDF Functions include metadata when they are called. This information can be
  used to redeploy a function (specifically, the `file_id` field). Example:
  ```python
  import akerbp.mlops.cdf.helpers as cdf
  human_readable_name = "My model"
  external_id = "my_model-prediction-test"
  cdf.set_up_cdf_client('deploy')
  cdf.redeploy_function(
    human_readable_name
    external_id,
    file_id,
    'Description',
    'your@email.com'
  )
  ```
  Note that the external-id of a function needs to be unique, as this is used to distinguish functions between services and hosting environment.
  It's possible to query available functions (can be filtered by environment
  and/or tags). Example:
  ```python
  import akerbp.mlops.cdf.helpers as cdf
  cdf.set_up_cdf_client('deploy')
  all_functions = cdf.list_functions()
  test_functions = cdf.list_functions(model_env="test")
  tag_functions = cdf.list_functions(tags=["well_interpretation"])
  ```
  Functions can be deleted. Example:
  ```python
  import akerbp.mlops.cdf.helpers as cdf
  cdf.set_up_cdf_client('deploy')
  cdf.delete_service("my_model-prediction-test")
  ```
  Functions can be called in parallel. Example:
  ```python
  from akerbp.mlops.cdf.helpers import call_function_parallel
  function_name = 'my_function-prediction-prod'
  data = [dict(data='data_call_1'), dict(data='data_call_2')]
  response1, response2 = call_function_parallel(function_name, data)
  ```


  Model Manager is the module dedicated to managing the model artifacts used by
  prediction services (and generated by training services). This module uses CDF
  Files as backend.
  Model artifacts are versioned and stored together with user-defined metadata.
  Uploading a new model increases the version count by 1 for that model and
  environment. When deploying a prediction service, the latest model version is
  chosen. It would be possible to extend the framework to allow deploying specific
  versions or filtering by metadata.
  Model artifacts are segregated by environment (e.g. only production artifacts
  can be deployed to production). Model artifacts have to be uploaded manually to
  test (or dev) environment before deployment. Code example:
  ```python
  import akerbp.mlops.model_manager as mm
  metadata = train(model_dir, secrets) # or define it directly
  mm.setup()
  folder_info = mm.upload_new_model_version(
    model_name,
    model_env,
    folder_path,
    metadata
  )
  ```
  If there are multiple models, you need to do this one at at time. Note that
  `model_name` corresponds to one of the elements in `model_names` defined in
  `mlops_settings.py`, `model_env` is the target environment (where the model should be
  available), `folder_path` is the local model artifact folder and `metadata` is a
  dictionary with artifact metadata, e.g. performance, git commit, etc.
  Model artifacts needs to be promoted to the production environment (i.e. after
  they have been deployed successfully to test environment) so that a prediction
  service can be deployed in production.
  ```python

  import akerbp.mlops.model_manager as mm
  mm.setup()
  mm.promote_model('model', 'version')
  ```

  Each model artifact upload/promotion increments a version number (environment dependent)
  available in Model Manager. However, this doesn't modify the model
  artifacts used in existing prediction services (i.e. nothing changes in CDF
  Functions). To reflect the newly uploaded/promoted model artifacts in the existing services one need to deploy the services again. Note that we dont have to specify the artifact version explicitly if we want to deploy using the latest artifacts, as this is done by default.
  Recommended process to update a model artifact and prediction service:
  1. New model features implemented in a feature branch
  2. New artifact generated and uploaded to test environment
  3. Feature branch merged with master
  4. Test deployment is triggered automatically: prediction service is deployed to
     test environment with the latest artifact version (in test)
  5. Prediction service in test is verified
  6. Artifact version is promoted manually from command line whenever suitable
  7. Production deployment is triggered manually from GitHub: prediction
     service is deployed to production with the latest artifact version (in prod)
  It's possible to get an overview of the model artifacts managed by Model
  Manager. Some examples (see `get_model_version_overview` documentation for other
  possible queries):
  ```python
  import akerbp.mlops.model_manager as mm
  mm.setup()

  folder_info = mm.get_model_version_overview()

  folder_info = mm.get_model_version_overview(model_name='xx')
  ```
  If the overview shows model artifacts that are not needed, it is possible to
  remove them. For example if artifact "my_model/dev/5" is not needed:
  ```python
  model_to_remove = "my_model/dev/5"
  mm.delete_model_version(model_to_remove)
  ```
  Model Manager will by default show information on the artifact to delete and ask
  for user confirmation before proceeding. It's possible (but not recommended) to
  disable this check. There's no identity check, so it's possible to delete any
  model artifact (from other data scientist). Be careful!
  It's possible to download a model artifact (e.g. to verify its content). For
  example:
  ```python
  mm.download_model_version('model_name', 'test', 'artifact_folder', version=5)
  ```
  If no version is specified, the latest one is downloaded by default.
  By default, Model Manager assumes artifacts are stored in the `mlops` dataset.
  If your project uses a different one, you need to specify during setup (see
  `setup` function).
  Further information:
  - Model Manager requires specific environmental variables (see next
    section) or a suitable secrets to be passed to the `setup` function.
  - In projects with a training service, you can rely on it to upload a first
    version of the model. The first prediction service deployment will fail, but
    you can deploy again after the training service has produced a model.
  - When you deploy from the development environment (covered later in this
    document), the model artifacts in the settings file can point to existing
    local folders. These will then be used for the deployment. Version is then
    fixed to `model_name/dev/1`. Note that these artifacts are not uploaded to CDF
    Files.
  - Prediction services are deployed with model artifacts (i.e. the artifact is
    copied to the project file used to create the CDF Function) so that they are
    available at prediction time. Downloading artifacts at run time would require
    waiting time, and files written during run time consume ram memory).

  To allow for model versioning and rolling back to previous model deployments, the external id of the functions (in CDF) includes a version number that is reflected by the latest artifact version number when deploying the function (see above).
  Everytime we upload/promote new model artifacts and deploy our services, the version number of the external id of the functions representing the services are incremented (just as the version number for the artifacts).
  To distinguish the latest model from the remaining model versions, we redeploy the latest model version using a predictable external id that does not contain the version number. By doing so we relieve the clients need of dealing with version numbers, and they will call the latest model by default. For every new deployment, we will thus have two model deployments - one with the version number, and one without the version number in the external id.  However, the predictable external id is persisted across new model versions, so when deploying a new version the latest one, with the predictable external id, is simply overwritten.
  We are thus concerned with two structures for the external id
  - ```<model_name>-<service>-<model_env>-<version>``` for rolling back to previous versions, and
  - ```<model_name>-<service>-<model_env>``` for the latest deployed model
  For the latest model with a predictable external id, we tag the description of the model to specify that the model is in fact the latest version, and add the version number to the function metadata.
  We can now list out multiple models with the same model name and external id prefix, and choose to make predictions and do inference with a specific model version. An example is shown below.
  ```python

  from akerbp.mlops.cdf.helpers import get_client
  client = get_client(client_id=<client_id>, client_secret=<client_secret>)
  my_models = client.functions.list(name="My Model", external_id_prefix="mymodel-prediction-test")
  my_model_specific_version = my_models[0]
  ```

  This section describes how you can call deployed models and obtain predictions for doing inference.
  We have two options for calling a function in CDF, either using the MLOps framework directly or by using the Cognite SDK. Independent of how you call your model, you have to pass the data as a dictionary with a key "data" containing a dictionary with your data, where the keys of the inner dictionary specifies the columns, and the values are list of samples for the corresponding columns.
  First, load your data and transform it to a dictionary as assumed by the framework. Note that the data dictionary you pass to the function might vary based on your model interface. Make sure to align with what you specified in your `model.py` interface.
  ```python
  import pandas as pd
  data = pd.read_csv("path_to_data")
  input_data = data.drop(columns=[target_variables])
  data_dict = {"data": input_data.to_dict(orient=list), "to_file": True}
  ```
  The "to_file" key of the input data dictionary specifies how the predictions can be extracted downstream. More details are provided below
  Calling deployed model using MLOps:
  1. Set up a cognite client with sufficient access rights
  2. Extract the response directly by specifying the external id of the model and passing your data as a dictionary
      - Note that the external id is on the form
        - ```"<model_name>-<service>-<model_env>-<version>"```, and
        - ```"<model_name>-<service>-<model_env>"```
  Use the latter external id if you want to call the latest model. The former external id can be used if you want to call a previous version of your model.
  ```python
  from akerbp.mlops.cdf.helpers import set_up_cdf_client, call_function
  set_up_cdf_client(context="deploy") #access CDF data, files and functions with deploy context
  response = call_function(function_name="<model_name>-prediction-<model_env>", data=data_dict)
  ```
  Calling deployed model using the Cognite SDK:
  1. set up cognite client with sufficient access rights
  2. Retreive model from CDF by specifying the external-id of the model
  3. Call the function
  4. Extract the function call response from the function call
  ```python
  from akerbp.mlops.cdf.helpers import get_client
  client = get_client(client_id=<client_id>, client_secret=<client_secret>)
  client = CogniteClient(config=cnf)
  function = client.functions.retrieve(external_id="<model_name>-prediction-<model_env>")
  function_call = function.call(data=data_dict)
  response = function_call.get_response()
  ```
  Depending on how you specified the input dictionary, the predictions are available directly from the response or needs to be extracted from Cognite Files.
  If the input data dictionary contains a key "to_file" with value True, the predictions are uploaded to cognite Files, and the 'prediction_file' field in the response will contain a reference to the file containing the predictions. If "to_file" is set to False, or if the input dictionary does not contain such a key-value pair, the predictions are directly available through the function call response.
  If "to_file" = True, we can extract the predictions using the following code-snippet
  ```python
  file_id = response["prediction_file"]
  bytes_data = client.files.download_bytes(external_id=file_id)
  predictions_df = pd.DataFrame.from_dict(json.loads(bytes_data))
  ```
  Otherwise, the predictions are directly accessible from the response as follows.
  ```python
  predictions = response["predictions"]
  ```

  Once a model is deployed, a user can extract potentially valuable metadata as follows.
  ```python
  my_function = client.functions.retrieve(external_id="my_model-prediction-test")
  metadata = my_function.metadata
  ```
  Where the metadata corresponds to whatever you specified in the mlops_settings.yaml file. For this example we get the following metadata
  ```
  {'cat_filler': 'UNKNOWN',
   'imputed': 'True',
   'input_types': '[int, float, string]',
   'num_filler': '-999.15',
   'output_curves': '[AC]',
   'output_unit': '[s/ft]',
   'petrel_exposure': 'False',
   'required_input': '[ACS, RDEP, DEN]',
   'training_wells': '[3/1-4]',
   'units': '[s/ft, 1, kg/m3]'}
  ```

  It's possible to tests the functions locally, which can help you debug errors
  quickly. This is recommended before a deployment.
  Define the following environmental variables (e.g. in `.bashrc`):
  ```bash
  export MODEL_ENV=dev
  export COGNITE_OIDC_BASE_URL=https://api.cognitedata.com
  export COGNITE_TENANT_ID=<tenant id>
  export COGNITE_CLIENT_ID_WRITE=<write access client id>
  export COGNITE_CLIENT_SECRET_WRITE=<write access client secret>
  export COGNITE_CLIENT_ID_READ=<read access client id>
  export COGNITE_CLIENT_SECRET_READ=<read access client secret>
  ```
  From your repo's root folder:
  - `python -m pytest model_code` (replace `model_code` by your model code folder
    name)
  - `deploy_prediction_service`
  - `deploy_training_service` (if there's a training service)
  The first one will run your model tests. The last two run model tests but also
  the service tests implemented in the framework and simulate deployment.
  If you want to run tests only you need to set `TESTING_ONLY=True` before calling the deployment script.

  Deployments to the test environment are triggered by commits (you need to push
  them). Deployments to the production environment are enabled manually from the
  Bitbucket pipeline dashboard. Branches that match 'deploy/*' behave as master.
  Branches that match `feature/*` run tests only (i.e. do not deploy).
  It is assumed that most projects won't include a training service. A branch that
  matches 'mlops/*' deploys both prediction and training services. If a project
  includes both services, the pipeline file could instead be edited so that master
  deployed both services.
  It is possible to schedule the training service in CDF, and then it can make
  sense to schedule the deployment pipeline of the model service (as often as new
  models are trained)
  NOTE: Previous version of akerbp-mlops assumes that calling
  `LOCAL_DEPLOYMENT=True deploy_prediction_service` will not deploy models and run tests.
  The package is now refactored to only trigger tests when the environment variable
  `TESTING_ONLY` is set to `True`.
  Make sure to update the pipeline definition for branches with prefix `feature/`to call
  `TESTING_ONLY=True deploy_prediction_service` instead.

  The following environments need to be defined in `repository settings >
  deployments`:
  - `dev`: where two environment variables are defined
    - `MODEL_ENV=dev`
    - `SERVICE_NAME=prediction`
  - `test`: where two environment variables are defined
    - `MODEL_ENV=test`
    - `SERVICE_NAME=prediction`
  - `prod`: where two environment variables are defined
    - `MODEL_ENV=prod`
    - `SERVICE_NAME=predictione`
  The following secrets need to be defined in `repository settings >
  Secrets and variables > Actions > Repository secrets`:
  - `COGNITE_CLIENT_ID_WRITE`
  - `COGNITE_CLIENT_SECRET_WRITE`
  - `COGNITE_CLIENT_ID_READ`
  - `COGNITE_CLIENT_SECRET_READ`
  - `COGNITE_OIDC_BASE_URL`
  - `COGNITE_TENANT_ID`
  (these should be CDF client id and secrets for respective read and write access).
  GitHub Actions need to be enabled on the repo.

  This package is managed using [poetry](https://python-poetry.org/). Please refer to the [poetry documentation](https://python-poetry.org/docs/) for more information on how to use poetry and install it

  To install the package, run the following command from the root folder of the repo
  ```bash
  poetry install -E cdf --with=dev,pre-commit,version,test
  ```
  Poetry uses [groups](https://python-poetry.org/docs/dependency-specification/#groups) to manage dependencies. The above command installs the package with all the defined groups in the toml file.

  The versioning of the package follows [SemVer](https://semver.org/), using the `MAJOR.MINOR.PATCH` structure. We are thus updating the package version using the following convention
  1. Increment MAJOR when making incompatible API changes
  2. Increment MINOR when adding backwards compatible functionality
  3. Increment PATCH when making backwards compatible bug-fixes
  The version is updated based on the latest commit to the repo, and we are currently using the following rules.
  - The MAJOR version is incremented if the commit message includes the word `major`
  - The MINOR version is incremented if the commit message includes the word `minor`
  - The PATCH number is incremented if neither `major` nor `minor` if found in the commit message
  - If the commit message includes the phrase `prerelease`, the package version is extended with `a`, thus taking the form `MAJOR.MINOR.PATCHa`.
  Note that the above keywords are **not** case sensitive. Moreover, `major` takes precedence over `minor`, so if both keywords are found in the commit message, the MAJOR version is incremented and the MINOR version is kept unchanged.
  In dev and test environment, we release the package using the pre-release tag, and the package takes the following version number `MAJOR.MINOR.PATCH-alpha.PRERELEASE`.
  The version number is automatically generated by combining [poetry-dynamic-versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) with the `increment_package_version.py` script and is based off git tagging and the incremental version numbering system mentioned above.

  These are the files and folders in the MLOps repo:
  - `src` contains the MLOps framework package
  - `mlops_settings.yaml` contains the user settings for the dummy model
  - `model_code` is a model template included to show the model interface. It is
    not needed by the framework, but it is recommended to become familiar with it.
  - `model_artifact` stores the artifacts for the model shown in  `model_code`.
    This is to help to test the model and learn the framework.
  - `.github/*` describes all the relevant configurations for the CI/CD pipeline run by GitHub Actions
  - `build.sh` is the script to build and upload the package
  - `pyproject.toml` is the project's configuration file
  - `LICENSE` is the package's license

  In order to control access to the artifacts:
  1. Set up a CDF Dataset with `write_protected=True` and a `external_id`, which
     by default is expected to be `mlops`.
  2. Create a group of owners (CDF Dashboard), i.e. those that should have write
     access

  To perform local testing of before pushing to GITHUB, you can run the following
  commands:
  ```bash
  poetry run python -m pytest
  ```
  (assuming you have first run `poetry install -E cdf --with=dev,pre-commit,version,test"` in the same environment)

  Create an account in pypi, then create a token and a `$HOME/.pypirc` file if you want to deploy from local. Edit
  `pyproject.toml` file and note the following:
  - Dependencies need to be registered
  - Bash scripts will be installed in a `bin` folder in the `PATH`.
  The pipeline is setup to build the library, but it's possible to
  build and upload the library from the development environment as well (as long as you have the `PYPI_TOKEN` environment variable set). To do so, run:
  ```bash
  bash build.sh
  ```
  In order to authenticate to GitHub to deploy to pypi you need to setup a token. Copy its content and add that to the secured repository secret `PYPI_TOKEN`.

  Service testing happens in an independent process (subprocess library) to avoid
  setup problems:
   - When deploying multiple models the service had to be reloaded before testing
     it, otherwise it would be the first model's service. Model initialization in
     the prediction service is designed to load artifacts only once in the process
   - If the model and the MLOps framework rely on different versions of the same
     library, the version would be changed during runtime, but the
     upgraded/downgraded version would not be available for the current process


pkgId: 523ea3be668c8b4a7119e6fa1c352ce00c0e9f9960219819c09f206a35a3fac3
name: python-akerbp-mlpet
arch: src
version: 4.1.0
epoch: 0
release: 1
summary: Package to prepare well log data for ML projects.
url: https://github.com/AkerBP/expres-ml-mlpet
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akerbp-mlpet-4.1.0-1.src.rpm
checksum_type: sha256
description:
  Preprocessing tools for Petrophysics ML projects at Eureka



  Install the package by running the following (requires python 3.8 or later)

          pip install akerbp.mlpet




  For a short example of how to use the mlpet Dataset class for pre-processing data see below. Please refer to the tests folder of this repository for more examples as well as some examples of the `settings.yaml` file:

          import os
          from akerbp.mlpet import Dataset
          from akerbp.mlpet import utilities

          
          ds = Dataset(
                  settings=os.path.abspath("settings.yaml"), # Absolute file paths are required
                  folder_path=os.path.abspath(r"./"), # Absolute file paths are required
          )

          
          ds.load_from_pickle(r"data.pkl") # Absolute file paths are preferred

          
          print(ds.df_original.head())

          
          df_train, df_test = utilities.train_test_split(
                  df=ds.df_original,
                  target_column=ds.label_column,
                  id_column=ds.id_column,
                  test_size=0.3,
          )

          
          
          df_preprocessed = ds.preprocess(df_train)


  The procedure will be exactly the same for any other dataset class. The only difference will be in the "settings". For a full list of possible settings keys see either the [built documentation](docs/build/html/akerbp.mlpet.html) or the akerbp.mlpet.Dataset class docstring. Make sure that the curve names are consistent with those in the dataset.

  The loaded data is NOT mapped at load time but rather at preprocessing time (i.e. when preprocess is called).



  Due to the operations performed by certain preprocessing methods in akerbp.mlpet, the order in which the different preprocessing steps can sometimes be important for achieving the desired results. Below is a simple guide that should be followed for most use cases:
  1. Misrepresented missing data should always be handled first (using `set_as_nan`)
  2. This should then be followed by data cleaning methods (e.g. `remove_outliers`, `remove_noise`, `remove_small_negative_values`)
  3. Depending on your use case, once the data is clean you can then impute missing values (see `imputers.py`). Note however that some features depend on the presence of missing values to provide better estimates (e.g. `calculate_VSH`)
  4. Add new features (using methods from `feature_engineering.py`) or using `process_wells` from `preprocessors.py` if the features should be well specific.
  5. Fill missing values if any still exist or were created during step 4. (using `fillna_with_fillers`)
  6. Scale whichever features you want (using `scale_curves` from `preprocessors.py`). In some use cases this step could also come before step 5.
  7. Encode the GROUP & FORMATION column if you want to use it for training. (using `encode_columns` from `preprocessors.py`)
  8. Select or drop the specific features you want to keep for model training. (using `select_columns` or `drop_columns` from `preprocessors.py`)

  > **_NOTE:_**  The dataset class **drops** all input columns that are not explicitly named in your settings.yaml or settings dictionary passed to the Dataset class at instantiation. This is to ensure that the data is not polluted with features that are not used. Therefore, if you have features that are being loaded into the Dataset class but are not being preprocessed, these need to be explicitly defined in your settings.yaml or settings dictionary under the keyword argument `keep_columns`.



  Full API documentaion of the package can be found under the [docs](docs/build/html/index.html) folder once you have run the make html command.



  - to make the API documentation, from the root directory of the project run (assuming you have installed all development dependencies)

          cd docs/
          make html

  - to install mlpet in editable mode for use in another project, there are two
    possible solutions dependent on the tools being used:
     1. If the other package uses poetry, please refer to this [guide](https://github.com/python-poetry/poetry/discussions/1135#discussioncomment-145756)
     2. If you are not using poetry (using conda, pyenv or something else), just revert to using `pip install -e .` from within the root directory (Note: you need to have pip version >= 21.3).


  akerbp.mlpet Copyright 2021 AkerBP ASA

  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](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: 53027f324d30cbd58eaef47f5817efff1e0d8cb9833a8d31d95b5760080440be
name: python-akeyless-auth-api
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: Auth - Application API
url: https://www.akeyless.io/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akeyless-auth-api-0.1.1-1.src.rpm
checksum_type: sha256
description:
  Auth manages access for services that need accesses management for their clients. Auth also issues temporary credentials for the services&#39; clients and validates them for the services  # noqa: E501


pkgId: 9e99b8e8c17323f5e430aacf25866e069ca8f1fce0f1964ab6369deb98edfe24
name: python-akeyless-kfm-api
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: KFM - Application API
url: https://www.akeyless.io/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akeyless-kfm-api-0.1.1-1.src.rpm
checksum_type: sha256
description:
  KFM manages and stores key fragments. The core operations of each KFM instance are as follows: Creating secure random encryption keys which will be used as an encryption key fragment. Managing data storage for key fragments. Performing a key fragment derivation function, which generates a derived fragment from the original key fragment.  # noqa: E501


pkgId: 9e7cfbf6cedfab863386ba6f7d172ab2d7ecb347616763bdb3635c261942e6a2
name: python-akhdefo-functions
arch: src
version: 2.5.71
epoch: 0
release: 1
summary: Land Deformation Monitoring Using Optical and SAR Satellite Imagery
url: https://github.com/mahmudsfu/AkhDefo
rpm_license: Academic Free License (AFL)
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akhdefo-functions-2.5.71-1.src.rpm
checksum_type: sha256
description:
  This guide provides step-by-step instructions on how to create a Conda environment using the provided [ENV_Win.yml](ENV_Win.yml) file. This file specifies all the necessary packages, including their versions, required for the project.

  - **Conda**: Make sure you have either Anaconda or Miniconda installed on your system. If you do not have Conda installed, you can download it from the [official Anaconda website](https://www.anaconda.com/products/individual) or the [Miniconda website](https://docs.conda.io/en/latest/miniconda.html).

  1. **Download the YAML File**: Ensure you have the `ENV_Win.yml` [Click Here to Download](ENV_Win.yml) file saved on your computer. This file should be in the directory where you intend to set up the environment, or you should note its path.
  2. **Open a Terminal**: Open your terminal (or Command Prompt/PowerShell on Windows) and navigate to the directory containing the [ENV_Win.yml](ENV_Win.yml) file. You can navigate to the directory using the `cd` command followed by the path to the directory.
  3. **Create the Environment**: Execute the following command in your terminal:
  ***Make sure to activate conda base environment***
  ```bash
  conda activate base # if base environment not activated
  conda env create -f ENV_Win.yml
  ```
  This command instructs Conda to create a new environment with the name specified in the YAML file (`akhdefo_env`) and install all the listed packages along with their dependencies.
  4. **Activate the Environment**: After the environment has been successfully created, you can activate it using the following command:
  ```bash
  conda activate akhdefo_env
  ```
  Activating the environment will set up your terminal session to use the packages and their specific versions installed in this environment.

  To ensure that the environment has been set up correctly and all packages are installed, you can list the installed packages using:
  ```bash
  conda list
  ```
  This command displays a list of all packages installed in the active conda environment.

  If you encounter any issues during the installation process, make sure you have the latest version of Conda installed, and try updating Conda using the following command:
  ```bash
  conda update conda
  ```
  If problems persist, refer to the [official Conda documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file) for more detailed information on managing environments with YAML files.


pkgId: 94d3c523e1e49b7458dabed87880c92c01959501e2d4d7391c3f17a6e2a61739
name: python-akiFlagger
arch: src
version: 1.0.10
epoch: 0
release: 1
summary: Flag patients with acute kidney injury as per the KDIGO guidelines.
url: https://github.com/isaranwrap/StandardizingAKI
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akiFlagger-1.0.10-1.src.rpm
checksum_type: sha256
description:
  Acute Kidney Injury (AKI) is a sudden onset of kidney failure and damage marked by an increase in the serum creatinine levels (amongst other biomarkers) of the patient. Kidney Disease Improving Global Outcomes (KDIGO) has a set of guidelines and standard definitions of AKI:

  * *Stage 1*: 50% increase in creatinine in < 7 days or 0.3 increase in creatinine in < 48 hours

  * *Stage 2*: 100% increase in (or doubling of) creatinine in < 48 hours

  * *Stage 3*: 200% increase in (or tripling of) creatinine in < 48 hours

  This package contains a flagger to determine if a patient has developed AKI based on longitudinal data of serum creatinine measurements. More information about the specific data input format can be found in the documentation under the *Getting Started* section.



  You can install the flagger with ``pip``. Simply type the following into command line and the
  package should install properly.

  ```python
  pip install akiFlagger
  ```

  To ensure that it is working properly, you can open a Python session and test it with.

  ```python
  import akiFlagger

  print(akiFlagger.__version__)

  >> '1.0.0'
  ```

  Alternatively, you can download the source and wheel files to build manually from https://pypi.org/project/akiFlagger/.




  There is a [walk-through notebook](https://colab.research.google.com/github/isaranwrap/StandardizingAKI/blob/master/GettingStarted.ipynb) available on Github to introduce the necessary components and parameters of the flagger. The notebook can be accessed via Google Colab notebooks. The notebook has also been adapted in the [documentation](https://akiflagger.readthedocs.io/en/latest/).



  **Version 0.1.x** - Function-based implementation of flagger.

  **Version 0.2.x** - Switched to class-based implementation (OOP approach).

  **Version 0.3.x** - Switched to single-column output for AKI column.

  **Version 0.4.x** - Removed encounter and admission as optional columns.


pkgId: fd6295980a7e69ea049dc1f65c8561c2472e05c5f79c9d6ea59df5730f4363f2
name: python-akida-models
arch: src
version: 1.6.1
epoch: 0
release: 1
summary: Akida Models
url: https://doc.brainchipinc.com
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akida-models-1.6.1-1.src.rpm
checksum_type: sha256
description:
  This package contains a zoo of TensorFlow/Keras defined models that can be
  quantized and that are compatible for Akida conversion.


pkgId: d780318c759985b134cfe66afbacf38dc1bf04fa45b6501b22196b262c8c98f7
name: python-akimbo
arch: src
version: 2024.12.0
epoch: 0
release: 1
summary: Awkward Array Extension for Dataframes
url: https://github.com/intake/akimbo
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akimbo-2024.12.0-1.src.rpm
checksum_type: sha256
description:
  Support for this work was provided by NSF grant [OAC-2103945](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2103945).


pkgId: 63dee6f414965e0868a83042f082036410d2788e65e1c3ab8b07c83345f04e47
name: python-akimous
arch: src
version: 0.9.0
epoch: 0
release: 1
summary: An intelligent Python IDE
url: https://akimous.com
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akimous-0.9.0-1.src.rpm
checksum_type: sha256
description:
  [![PyPI version](https://badge.fury.io/py/akimous.svg)](https://pypi.python.org/pypi/akimous/) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/akimous.svg)](https://pypi.python.org/pypi/akimous/) [![CircleCI](https://circleci.com/gh/akimous/akimous/tree/master.svg?style=svg)](https://circleci.com/gh/akimous/akimous/tree/master)

  Akimous is a Python IDE with unique features boosting developers' productivity.



  * Machine-learning-assisted/NLP-assisted context-aware auto completion
  * Beautifully rendered function documentation
  * Layered keyboard control (a more intuitive key binding than vim and Emacs)
  * Real-time code formatter
  * Interactive console (integration with IPython kernel)

  <img src="https://raw.githubusercontent.com/akimous/akimous/master/images/screenshot.png" alt="Screenshot" style="max-width:100%">

  For more information and documentation, visit the official website.





  * Python 3.7 or 3.8 (with pip)
  * Git (for version control integration)
  * C/C++ compiler (may be required by some dependencies during installation)
  * A modern browser



  The recommended way for installing Akimous is through PyPI.

  ```sh
  pip install -U akimous
  ```



  Start it in the terminal. The browser should be automatically opened.

  ```sh
  akimous
  ```

  * To see available arguments, do `akimous --help`.



  If you have difficulty installing, or you are running in a cloud environment, try the prebuilt docker image.

  ```sh
  docker run --mount type=bind,source=$HOME,target=/home/user -p 127.0.0.1:3179:3179 -it red8012/akimous akimous
  ```



  Start the app by typing in the terminal (the browser will automatically open if available):

  ```sh
  akimous
  ```



  * `--help`: show help message and exit.
  * `--host HOST`: specify the host for Akimous server to listen on. (default to 0.0.0.0 if inside docker, otherwise 127.0.0.1)
  * `--port PORT`: The port number for Akimous server to listen on. (default=3179)
  * `--no-browser`: Do not open the IDE in a browser after startup.
  * `--verbose`: Print extra debug messages.



  Make sure you have recent version of the following build dependencies installed.

  * Node (12+)
  * Python (3.7+)
  * [Poetry](https://poetry.eustace.io)
  * [Yarn](https://yarnpkg.com/)
  * Make
  * [Zopfli](https://github.com/google/zopfli)
  * [Parallel](https://www.gnu.org/software/parallel/)

  Run the following commands according to your need.

  ```sh
  make # build everything
  make test # run tests
  make lint # run linters
  make install # (re)install the package
  ```

  Running `make` will install all Python and Javascript dependencies listed in `pyproject.toml` and `ui/package.json` automatically.



  This program is at pre-alpha stage. Please do report issues if you run into some problems. Contributions of any kind are welcome, including feature requests or pull requests (can be as small as correcting spelling errors) .



  [BSD-3-Clause](LICENSE)



  * [Official website](https://akimous.com)
  * [PyPI](https://pypi.org/project/akimous/)
  * [Docker Hub](https://hub.docker.com/r/red8012/akimous)


pkgId: 9d1dbf9ee1d8bd9be0230c79e58f4a38cad199cacfe8810c6f493436e8dd0e0a
name: python-akinaka
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Useful AWS CLI Extras
url: https://github.com/afrazkhan/akinaka
rpm_license: GNU General Public License v3 or later (GPLv3+)
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akinaka-1.0.1-1.src.rpm
checksum_type: sha256
description:
  This is a general all-purpose tool for managing things in AWS that Terraform is not responsible for -- you can think of it as an extension to the `aws` CLI.

  At the moment it only does three things; blue/green deploys for plugging into Gitlab, AMI cleanups, and RDS copies to other accounts.

  - [Akinaka](#akinaka)
    - [Installation](#installation)
    - [Requirements and Presumptions](#requirements-and-presumptions)
    - [A Note on Role Assumption](#a-note-on-role-assumption)
    - [Deploys](#deploys)
    - [Cleanups](#cleanups)
      - [AMIs](#amis)
      - [EBS Volumes](#ebs-volumes)
      - [RDS Snapshots](#rds-snapshots)
    - [RDS](#rds)
      - [Copy](#copy)
    - [Disaster Recovery](#disaster-recovery)
      - [Transfer](#transfer)
    - [Container](#container)
    - [Billing](#billing)
    - [Contributing](#contributing)



      pip3 install akinaka



  Format of ASG names: "whatever-you-like*-blue/green*" — the part in bold is necessary, i.e. you must have two ASGs, one ending with "-blue" and one ending with "-green".

  The following permissions are necessary for the IAM role / user that will be running Akinaka:

      sts:AssumeRole

  _NOTE: Going forward, IAM policies will be listed separately for their respective subcommands (as is already the case for [Transfer](#transfer)). For now however, the following single catch-all policy can be used, attach it to the IAM profile that Akinaka will be assuming:_

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "2018121701",
                  "Effect": "Allow",
                  "Action": [
                      "ec2:AuthorizeSecurityGroupIngress",
                      "ec2:DescribeInstances",
                      "ec2:CreateKeyPair",
                      "ec2:CreateImage",
                      "ec2:CopyImage",
                      "ec2:DescribeSnapshots",
                      "elasticloadbalancing:DescribeLoadBalancers",
                      "ec2:DeleteVolume",
                      "ec2:ModifySnapshotAttribute",
                      "autoscaling:DescribeAutoScalingGroups",
                      "ec2:DescribeVolumes",
                      "ec2:DetachVolume",
                      "ec2:DescribeLaunchTemplates",
                      "ec2:CreateTags",
                      "ec2:RegisterImage",
                      "autoscaling:DetachLoadBalancerTargetGroups",
                      "ec2:RunInstances",
                      "ec2:StopInstances",
                      "ec2:CreateVolume",
                      "autoscaling:AttachLoadBalancerTargetGroups",
                      "elasticloadbalancing:DescribeLoadBalancerAttributes",
                      "ec2:GetPasswordData",
                      "elasticloadbalancing:DescribeTargetGroupAttributes",
                      "elasticloadbalancing:DescribeAccountLimits",
                      "ec2:DescribeImageAttribute",
                      "elasticloadbalancing:DescribeRules",
                      "ec2:DescribeSubnets",
                      "ec2:DeleteKeyPair",
                      "ec2:AttachVolume",
                      "autoscaling:DescribeAutoScalingInstances",
                      "ec2:DeregisterImage",
                      "ec2:DeleteSnapshot",
                      "ec2:DescribeRegions",
                      "ec2:ModifyImageAttribute",
                      "elasticloadbalancing:DescribeListeners",
                      "ec2:CreateSecurityGroup",
                      "ec2:CreateSnapshot",
                      "elasticloadbalancing:DescribeListenerCertificates",
                      "ec2:ModifyInstanceAttribute",
                      "elasticloadbalancing:DescribeSSLPolicies",
                      "ec2:TerminateInstances",
                      "elasticloadbalancing:DescribeTags",
                      "ec2:DescribeTags",
                      "ec2:DescribeLaunchTemplateVersions",
                      "ec2:DescribeSecurityGroups",
                      "ec2:DescribeImages",
                      "ec2:DeleteSecurityGroup",
                      "elasticloadbalancing:DescribeTargetHealth",
                      "elasticloadbalancing:DescribeTargetGroups"
                  ],
                  "Resource": "*"
              },
              {
                  "Sid": "2018121702",
                  "Effect": "Allow",
                  "Action": [
                      "ssm:PutParameter",
                      "ssm:GetParameter",
                      "autoscaling:UpdateAutoScalingGroup",
                      "ec2:ModifyLaunchTemplate",
                      "ec2:CreateLaunchTemplateVersion",
                      "autoscaling:AttachLoadBalancerTargetGroups"
                  ],
                  "Resource": [
                      "arn:aws:autoscaling:*:*:autoScalingGroup:*:autoScalingGroupName/*",
                      "arn:aws:ssm:eu-west-1:[YOUR_ACCOUNT]:parameter/deploying-status-*",
                      "arn:aws:ec2:*:*:launch-template/*"
                  ]
              }
          ]
      }



  Akinaka uses IAM roles to gain access into multiple accounts. Most commands require you to specify a list of roles you wish to perform a task for, and that role must have the [sts:AssumeRole](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_enable-create.html) permission. This is not only good security, it's helpful for ensuring you're doing things to the accounts you think you're doing things for ;)



  Done with the `update` parent command, and then the `asg` and `targetgroup` subcommands (`update targetgroup` is only needed for blue/green deploys).

  Example:

      
      akinaka update \
        --region eu-west-1 \
        --role-arn arn:aws:iam::123456789100:role/management_assumable \
      asg \
        --asg workers \
        --ami ami-000000

      
      akinaka update \
        --region eu-west-1 \
        --role-arn arn:aws:iam::123456789100:role/management_assumable \
      asg \
        --lb lb-asg-ext \
        --ami ami-000000

      
      akinaka update \
        --region eu-west-1 \
        --role-arn arn:aws:iam::123456789100:role/management_assumable \
      asg \
        --target-group application-1a \
        --ami ami-000000

  For blue/green deploys, the next step is to check the health of your new ASG.
  For the purposes of Gitlab CI/CD pipelines, this will be printed out as the only
  output, so that it can be used in the next job.

  Once the new ASG is confirmed to be working as expected:

      akinaka update --region eu-west-1 --role-arn arn:aws:iam::123456789100:role/management_assumable asg --new blue

  The value of `--role-arn` is used to assume a role in the target account with enough
  permissions to perform the actions of modifying ASGs and Target Groups. As such,
  `akinaka` is able to do cross-account deploys. It will deliberately error if you
  do not supply an IAM Role ARN, in order to ensure you are deploying to the account
  you think you are.



  Currently AMI, EBS, and RDS snapshot cleanups are supported.

  Common option:

  `--role-arns` is a space separated list of IAM ARNs that can be assumed by the token you are using
  to run this command. The AMIs for the running instances found in these accounts will not be deleted. Not to be confused with `--role-arn`, accepted for the `update` parent command, for deploys.



  Cleans up AMIs and their snapshots based on a specified retention period, and deduced AMI usage (will
  not delete AMIs that are currently in use). You can optionally specify an AMI name pattern, and it will
  keep the latest version of all the AMIs it finds for it.

  Usage:

      akinaka cleanup \
          --region eu-west-1 \
          --role-arns "arn:aws:iam::198765432100:role/management_assumable arn:aws:iam::123456789100:role/management_assumable" \
          ami \
              --exceptional-amis cib-base-image-*
              --retention 7

  The above will delete all AMIs and their snapshots, _except for those which:_

  1. Are younger than 7 days AND
  2. Are not in use by AWS accounts "123456789100" or "198765432100" AND
  3. WHERE the AMI name matches the pattern "cib-base-image-*", there is more than one match AND it is the oldest one

  `--exceptional-amis` is a space seperated list of exact names or patterns for which to keep the latest
  version of an AMI for. For example, the pattern "cib-base-image-*" will match with normal globbing, and
  if there is more than one match, only the latest one will not be deleted (else there is no effect).

  `--retention` is the retention period you want to exclude from deletion. For example; `--retention 7`
  will keep all AMIs found within 7 days, if they are not in the `--exceptional-amis` list.



  Delete all EBS volumes that are not attached to an instance (stopped or not):

      akinaka cleanup \
          --region eu-west-1 \
          --role-arns "arn:aws:iam::198765432100:role/management_assumable arn:aws:iam::123456789100:role/management_assumable" \
          ebs



      This will delete all snapshots tagged "akinaka-made":

      akinaka cleanup \
          --not-dry-run \
          --region eu-west-1 \
          --role-arns "arn:aws:iam::876521782800:role/OlinDataAssumedAdministrator" \
          rds \
              --tags "akinaka-made"



  Perform often necessary but complex tasks with RDS.



  Copy encrypted RDS instances between accounts:

      akinaka copy --region eu-west-1 \
          rds \
              --source-role-arn arn:aws:iam::198765432100:role/management_assumable \
              --target-role-arn arn:aws:iam::123456789100:role/management_assumable \
              --snapshot-style running_instance \
              --source-instance-name DB_FROM_ACCOUNT_198765432100 \
              --target-instance-name DB_FROM_ACCOUNT_123456789100 \
              --target-security-group SECURITY_GROUP_OF_TARGET_RDS \
              --target-db-subnet SUBNET_OF_TARGET_RDS \

  `--region` is optional because it will default to the environment variable `AWS_DEFAULT_REGION`.



  Akinaka has limited functionality for backing up and restoring data for use in disaster recovery.



  Transfer data from S3, RDS, and RDS Aurora into a backup account:

      akinaka dr \
        --region eu-west-1 \
        --source-role-arn arn:aws:iam::[LIVE_ACCOUNT_ID]:role/[ROLE_NAME] \
        --destination-role-arn arn:aws:iam::[BACKUP_ACCOUNT_ID]:role/[ROLE_NAME] \
        transfer \
          --service s3

  Omitting `--service` will include all supported services.

  You can optionally specify the name of the instance to transfer with `--names` in a comma separated list, e.g. `--names 'database-1, database-2`. This can be for either RDS instances, or S3 buckets, but not both at the same time. Future versions may remove `--service` and replace it with a subcommand instead, i.e. `akinaka dr transfer rds`, so that those service can have `--names` to themselves.

  A further limitation is that only a single region can be handled at a time for S3 buckets. If you wish to backup all S3 buckets in an account, and they are in different regions, you will have to specify them per run, using the appropriate region each time. Future versions will work the bucket regions out automatically, and remove this limitation.

  Akinaka must be run from either an account or instance profile which can use sts:assume to assume both the `source-role-arn` and `destination-role-arn`. This is true even if you are running on the account that `destination-role-arn` is on. You will therefore need this policy attached to the user/role that's doing the assuming:

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "akinakaassume",
                  "Effect": "Allow",
                  "Action": "sts:AssumeRole",
                  "Resource": [
                      "arn:aws:iam::[DESTINATION_ACCOUNT]:role/[ROLE_TO_ASSUME]",
                      "arn:aws:iam::[SOURCE_ACCOUNT]:role/[ROLE_TO_ASSUME]"
                  ]
              }
          ]
      }

  **Note:** A period of 4 hours (469822 seconds) is hardcoded into the sts:assume call made in the RDS snapshot class, since snapshot creation can take a very long time. This must therefore be the minimum value for the role's `max-session-duration`.

  The following policy is needed for usage of this subcommand, attach it to the role you'll be assuming:

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "KMSEncrypt",
                  "Effect": "Allow",
                  "Action": [
                      "kms:GetPublicKey",
                      "kms:ImportKeyMaterial",
                      "kms:Decrypt",
                      "kms:UntagResource",
                      "kms:PutKeyPolicy",
                      "kms:GenerateDataKeyWithoutPlaintext",
                      "kms:Verify",
                      "kms:ListResourceTags",
                      "kms:GenerateDataKeyPair",
                      "kms:GetParametersForImport",
                      "kms:TagResource",
                      "kms:Encrypt",
                      "kms:GetKeyRotationStatus",
                      "kms:ReEncryptTo",
                      "kms:DescribeKey",
                      "kms:Sign",
                      "kms:CreateGrant",
                      "kms:ListKeyPolicies",
                      "kms:UpdateKeyDescription",
                      "kms:ListRetirableGrants",
                      "kms:GetKeyPolicy",
                      "kms:GenerateDataKeyPairWithoutPlaintext",
                      "kms:ReEncryptFrom",
                      "kms:RetireGrant",
                      "kms:ListGrants",
                      "kms:UpdateAlias",
                      "kms:RevokeGrant",
                      "kms:GenerateDataKey",
                      "kms:CreateAlias"
                  ],
                  "Resource": [
                      "arn:aws:kms:*:*:alias/*",
                      "arn:aws:kms:*:*:key/*"
                  ]
              },
              {
                  "Sid": "KMSCreate",
                  "Effect": "Allow",
                  "Action": [
                      "kms:DescribeCustomKeyStores",
                      "kms:ListKeys",
                      "kms:GenerateRandom",
                      "kms:UpdateCustomKeyStore",
                      "kms:ListAliases",
                      "kms:CreateKey",
                      "kms:ConnectCustomKeyStore",
                      "kms:CreateCustomKeyStore"
                  ],
                  "Resource": "*"
              }
          ]
      }

  The following further policies need to be attached to the assume roles to backup each service:



      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "RDSBackup",
                  "Effect": "Allow",
                  "Action": [
                      "rds:DescribeDBClusterSnapshotAttributes",
                      "rds:AddTagsToResource",
                      "rds:RestoreDBClusterFromSnapshot",
                      "rds:DescribeDBSnapshots",
                      "rds:DescribeGlobalClusters",
                      "rds:CopyDBSnapshot",
                      "rds:CopyDBClusterSnapshot",
                      "rds:DescribeDBSnapshotAttributes",
                      "rds:ModifyDBSnapshot",
                      "rds:ListTagsForResource",
                      "rds:CreateDBSnapshot",
                      "rds:DescribeDBClusterSnapshots",
                      "rds:DescribeDBInstances",
                      "rds:CreateDBClusterSnapshot",
                      "rds:ModifyDBClusterSnapshotAttribute",
                      "rds:ModifyDBSnapshotAttribute",
                      "rds:DescribeDBClusters",
                      "rds:DeleteDBSnapshot",
                      "rds:DeleteDBClusterSnapshot"
                  ],
                  "Resource": "*"
              }
          ]
      }



      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "S3RW",
                  "Effect": "Allow",
                  "Action": [
                      "s3:ListBucketMultipartUploads",
                      "s3:GetObjectRetention",
                      "s3:GetObjectVersionTagging",
                      "s3:ListBucketVersions",
                      "s3:CreateBucket",
                      "s3:ListBucket",
                      "s3:GetBucketVersioning",
                      "s3:GetBucketAcl",
                      "s3:GetObjectAcl",
                      "s3:GetObject",
                      "s3:GetEncryptionConfiguration",
                      "s3:ListAllMyBuckets",
                      "s3:PutLifecycleConfiguration",
                      "s3:GetObjectVersionAcl",
                      "s3:GetObjectTagging",
                      "s3:GetObjectVersionForReplication",
                      "s3:HeadBucket",
                      "s3:GetBucketLocation",
                      "s3:PutBucketVersioning",
                      "s3:GetObjectVersion",
                      "s3:PutObject",
                      "s3:PutObjectAcl",
                      "s3:PutEncryptionConfiguration",
                      "s3:PutBucketPolicy"
                  ],
                  "Resource": "*"
              }
          ]
      }



  Limited functionality for interactive with EKS and ECR. At the moment it's just getting a docker login via an assumed role to another assumed role:

      akinaka container --region eu-west-1 --role-arn arn:aws:iam::0123456789:role/registry-rw get-ecr-login --registry 0123456789

  The above will assume the role `arn:aws:iam::0123456789:role/registry-rw` in the account with the registry, and spit out a `docker login` line for you to use — exactly like `aws ecr get-login`, but working for assumed roles.



  Get a view of your daily AWS estimated bill for the x number of days. Defaults to today's estimated bill.

      akinaka reporting --region us-east-1 \
        --role-arn arn:aws:iam::1234567890:role/billing_assumerole \
        bill-estimates --from-days-ago 1

  Example output:

      Today's estimated bill
      +------------+-----------+
      | Date       | Total     |
      |------------+-----------|
      | 2019-03-14 | USD 13.93 |
      +------------+-----------+

  You can specify any integer value to the `--days-ago` flag. It's optional. Default value set for today (current day).

  You can specify any region to the `--region` flag.



  Modules can be added easily by simply dropping them in and adding an entry into `akinaka` to include them, and some `click` code in their `__init__` (or elsewhere that's loaded, but this is the cleanest way).

  For example, given a module called `akinaka_moo`, and a single command and file called `moo`, add these two lines in the appropriate places of `akinaka`:

      from akinaka_update.commands import moo as moo_commands
      cli.add_command(moo_commands)

  and the following in the module's `commands.py`:

      @click.group()
      @click.option("--make-awesome", help="The way in which to make moo awesome")
      def moo(make_awesome):
          import .moo
          

  Adding commands that need subcommands isn't too different, but you might want to take a look at the already present examples of `update` and `cleanup`.


pkgId: bfe4dc794f0773a086f25a28a8052b4080e5e09d299ef8d8838e356937a2090c
name: python-akips
arch: src
version: 0.3.1
epoch: 0
release: 1
summary: Module to interact with the AKiPS Network Monitoring Software API interface
url: https://github.com/unc-network/akips
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akips-0.3.1-1.src.rpm
checksum_type: sha256
description:
  This akips module provides a simple way for python scripts to interact with
  the [AKiPS Network Monitoring Software](http://akips.com) API interface.

  To install akips, simply us pip:
  ```
  $ pip install akips
  ```

  AKiPS includes a way to extend the server through custom perl scripts.  They publish a list from
  their [Support - Site scripts](https://www.akips.com/customer-support/site-scripts/) page, along
  with install instructions.
  This module can use additional routines included in the *akips_setup* directory of
  this repository, [site_scripting.pl](akips_setup/site_scripting.pl).

  ```py
  from akips import AKIPS
  api = AKIPS('akips.example.com',username='api-ro',password='something')
  devices = api.get_devices()
  for name, fields in devices.items():
      print("Device: {} {}".format(name,fields))
  ```

  [API Documentation](https://unc-network.github.io/akips/docs/akips/index.html)

  Please use the [GitHub issue tracker](https://github.com/unc-network/akips/issues)
  to submit bugs or request features.


pkgId: 3bffaf5b6add9e0c0f29da18728b9ef6a898f1910ccbbc134271c5b1c2981177
name: python-akismet
arch: src
version: 24.5.1
epoch: 0
release: 1
summary: A Python interface to the Akismet spam-filtering service.
url: https://pypi.org/project/akismet/
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akismet-24.5.1-1.src.rpm
checksum_type: sha256
description:
  .. -*-restructuredtext-*-

  .. image:: https://github.com/ubernostrum/akismet/workflows/CI/badge.svg
     :alt: CI status image
     :target: https://github.com/ubernostrum/akismet/actions?query=workflow%3ACI

  A Python interface to `the Akismet spam-filtering service
  <https://akismet.com>`_.

  Two API clients are available from this library:

  * ``akismet.SyncClient`` is an Akismet API client which performs
    synchronous (blocking) HTTP requests to the Akismet web service.

  * ``akismet.AsyncClient`` is an Akismet API client which performs
    asynchronous (``async``/``await``/non-blocking) HTTP requests to the
    Akismet web service.

  Aside from one being sync and the other async, the two clients expose
  identical APIs, and implement all methods of `the Akismet web API
  <https://akismet.com/developers/>`_.

  To use this library, you will need to obtain an Akismet API key and
  register a site for use with the Akismet web service; you can do this
  at <https://akismet.com>. Once you have a key and corresponding
  registered site URL to use with it, place them in the environment
  variables ``PYTHON_AKISMET_API_KEY`` and ``PYTHON_AKISMET_BLOG_URL``,
  and they will be automatically detected and used.

  You can then construct a client instance and call its methods. For
  creating a long-lived API client instance, it's recommended that you
  use the ``validated_client()`` constructor method, which will
  automatically validate your API key with the Akismet web service. For
  example, to check a submitted forum post for spam:

  .. code-block:: python

     import akismet

     akismet_client = akismet.SyncClient.validated_client()

     if akismet_client.comment_check(
         user_ip=submitter_ip,
         comment_content=submitted_content,
         comment_type="forum-post",
         comment_author=submitter_name
     ):
         

  Or using the asynchronous client:

  .. code-block:: python

     import akismet

     akismet_client = await akismet.AsyncClient.validated_client()

     if await akismet_client.comment_check(
         user_ip=submitter_ip,
         comment_content=submitted_content,
         comment_type="forum-post",
         comment_author=submitter_name
     ):
         

  You can also use either client class as a context manager. This does
  *not* require the ``validated_client()`` constructor, because your API
  key is validated on entering the ``with`` block.

  .. code-block:: python

     import akismet

     with akismet.SyncClient() as akismet_client:
         if akismet_client.comment_check(
             user_ip=submitter_ip,
             comment_content=submitted_content,
             comment_type="forum-post",
             comment_author=submitter_name
         ):
             

  Or using the asynchronous client:

  .. code-block:: python

     import akismet

     async with akismet.AsyncClient() as akismet_client:
         if await akismet_client.comment_check(
             user_ip=submitter_ip,
             comment_content=submitted_content,
             comment_type="forum-post",
             comment_author=submitter_name
         ):
             



  See `the documentation <http://akismet.readthedocs.io/>`_ for full
  details.

  The original version of this library was written by Michael Foord.


pkgId: e3d20d28d1f14db27a579f0666008626b09e51b0e6f279048b53a7a38776d77a
name: python-akitools
arch: src
version: 0.2.7
epoch: 0
release: 1
summary: akitools
url: https://github.com/aki/akitools
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akitools-0.2.7-1.src.rpm
checksum_type: sha256
description:
  [![PyPi Version](https://img.shields.io/pypi/v/akitools)](https://pypi.org/project/akitools/) [![License](https://img.shields.io/pypi/l/akitools)](https://pypi.org/project/akitools/) ![PyPI - Downloads](https://img.shields.io/pypi/dm/akitools)

   

  ```
  pip install akitools
  ```



  ```python
  >>> from akitools import ftime
  >>> ftime()
  '20191109'

  >>> from akitools import ctime
  >>> ctime('2017-01-01')
  1483200000
  ```


pkgId: e8c13c37f2d4625b38d62a495b4f898a6212c930fd19d90df1c19f2a1b768330
name: python-aklogger
arch: src
version: 0.2.2
epoch: 0
release: 1
summary: A generic logging package for python projects
url: https://github.com/appknox/aklogger
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aklogger-0.2.2-1.src.rpm
checksum_type: sha256
description:
  Keep track of all the events happening in your project: A generic logging package for python projects.



  - Logging to console
  - Logging to file
  - Push logs to slack



  ```
  $ pip install aklogger
  ```



  Following script will log messages to slack, file and console:

  ```python
  from aklogger import logger

  logger.set_name('mycroft')
  logger.setLevel('DEBUG')


  logger.info('Some Dummy log', 'Some dummy details of the dummy log')


  logger.log_to_file('file.log')


  logger.info('Some Dummy log', 'Some dummy details of the dummy log')


  logger.enable_slack(SLACK_TOKEN)


  logger.set_slack_level('WARNING')


  logger.warning('Some Dummy log', 'Some dummy details of the dummy log')


  logger.info('Dummy log', 'Details of the dummy log', force_push_slack=True)
  ```

  See [python logging docs](https://docs.python.org/3/library/logging.html) for more uses.


pkgId: 34100023b746d682dab9b4df083490cf40b8359991cc44e428ae49ca484a9a70
name: python-akro
arch: src
version: 0.0.8
epoch: 0
release: 1
summary: Spaces types for reinforcement learning
url: https://github.com/rlworkgroup/akro
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akro-0.0.8-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://travis-ci.com/rlworkgroup/akro.svg?branch=master)](https://travis-ci.com/rlworkgroup/akro)
  [![codecov](https://codecov.io/gh/rlworkgroup/akro/branch/master/graph/badge.svg)](https://codecov.io/gh/rlworkgroup/akro)
  [![Docs](https://readthedocs.org/projects/akro/badge)](http://akro.readthedocs.org/en/latest/)
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/rlworkgroup/akro/blob/master/LICENSE)
  [![PyPI version](https://badge.fury.io/py/akro.svg)](https://badge.fury.io/py/akro)


  Spaces types for reinforcement learning


  ```shell
  pip install akro
  ```


pkgId: 4791790c5774979743b58df6c49309e3702a20c4d21922576b0529b92334aa9d
name: python-akrocansim
arch: src
version: 0.6.1
epoch: 0
release: 1
summary: akrocansim is a CAN bus J1939 controller simulator
url: https://pypi.org/project/akrocansim/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akrocansim-0.6.1-1.src.rpm
checksum_type: sha256
description:
  A CAN bus J1939 controller simulator.

  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/akrocansim)](https://github.com/cfsok/akrocansim)
  [![PyPI - Version](https://img.shields.io/pypi/v/akrocansim?color=blue)](https://pypi.org/project/akrocansim/)
  ![PyPI - License](https://img.shields.io/pypi/l/akrocansim)



  - [python-can](https://github.com/hardbyte/python-can)
  - [DearPyGUI](https://github.com/hoffstadt/DearPyGui)
  - [openpyxl](https://openpyxl.readthedocs.io/)


  - Integrates with all hardware CAN interfaces supported by python-can.
  - Transmits configured J1939 PGNs to the CAN bus with the following methods:
    - continuous tx of all PGNs
    - all PGNs transmitted once on button press
    - per PGN transmission, either continuous or on button press
  - GUI for setting SPN values:
    - sliders for changing continuous values
    - label selection for discrete values
    - direct entry of raw decimal values
    - direct entry of decoded decimal values

  ![Akrocansim demo screenshot](https://raw.githubusercontent.com/cfsok/akrocansim/main/docs/images/demo_2_Akrocansim.png)

  ![PCAN-View demo screenshot](https://raw.githubusercontent.com/cfsok/akrocansim/main/docs/images/demo_1_PCAN-View.png)


  Python 3.11 (64-bit) or higher is required.

  ```
  pip install akrocansim
  ```


  - A hardware CAN interface supported by python-can,
  see https://python-can.readthedocs.io/en/v4.3.1/interfaces.html.
  - A version of J1939 Digital Annex (J1939DA) from SAE International, see https://www.sae.org/standards/?search=j1939DA.
  - A way to convert `.xls` to `.xlsx` if your copy of the J1939DA is in `.xls` format.


  ```
  python -m akrocansim
  ```

  Upon initial run, a folder named `akrocansim` is created in your home folder hosting a starting configuration file.

  Follow the instructions on the application and in the configuration file for next steps.

  Upon successful parsing of the J1939DA, a series of json files are created in the `J1939` sub-folder inside the main configuration folder.
  These can be inspected to evaluate parsing correctness.

  The J1939DA PGN and SPN definition format is very irregular and parsing errors still exist.
  You can raise a GitHub issue or a pull request if you think that an SPN has not been parsed correctly.


  [GitHub issue tracker](https://github.com/cfsok/akrocansim/issues)


  [GitHub discussions](https://github.com/cfsok/akrocansim/discussions)


pkgId: 947f6d346c9b5c30588d9afd00393943308ee55797e7a3690079a59dc3debd66
name: python-akshara
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: A project to help spelling in Sanskrit (Devanaagari)
url: https://github.com/arindamsaha1507/akshara
rpm_license: GNU GENERAL PUBLIC LICENSE
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akshara-1.1.0-1.src.rpm
checksum_type: sha256
description:
  ![Linting Tests](https://github.com/arindamsaha1507/akshara/actions/workflows/pylint.yml/badge.svg)
  ![Code Tests](https://github.com/arindamsaha1507/akshara/actions/workflows/pytest.yml/badge.svg)
  ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/arindamsaha1507/akshara)
  ![GitHub last commit](https://img.shields.io/github/last-commit/arindamsaha1507/akshara)

  Akshara is a tool for all your spelling needs. The package offers functions to:

  1. Spell any given word (or any string) in Devanagari script.
  2. Construct a word from a given spelling.
  3. Count the number of svaras in a string.
  4. Count the number of sentences in a string.
  5. Obtain the syllables of a word.



  Latest version of akshara can be directly installed from PyPI using

  ```bash
  pip3 install akshara
  ```





  ```python
  import akshara.varnakaarya as vk
  ```



  ```python
  a = vk.get_vinyaasa("राम")       # a = ['र्', 'आ', 'म्', 'अ']
  b = vk.get_vinyaasa("गमॢँ")       # b = ['ग्', 'अ', 'म्', 'ऌँ']
  c = vk.get_vinyaasa("स पठति ।")  # c = ['स्', 'अ', ' ', 'प्', 'अ', 'ठ्', 'अ', 'त्', 'इ', ' ', '।']
  ```



  ```python
  a = vk.get_akshara("राम")       # a = ['रा', 'म']
  b = vk.get_akshara("गमॢँ")       # b = ['ग', 'मॢँ']
  c = vk.get_akshara("पठति")      # c = ['प', 'ठ', 'ति']
  ```



  ```python
  d = vk.get_shabda(['स्', 'अ', 'ं', 'स्', 'क्', 'ऋ', 'त्' ,'अ', 'म्'])    # d = 'संस्कृतम्'
  e = vk.get_shabda(['श्', 'इ', 'व्', 'अ', 'ः'])                        # e = 'शिवः'
  f = vk.get_shabda(['द्', 'ए', 'व्', 'अ', 'द्', 'अ', 'त्', 'त्', 'अ३'])  # f = देवदत्त३
  ```



  ```python
  g = "बुद्धं शरणं गच्छामि । धर्मं शरणं गच्छामि । सङ्घं शरणं गच्छामि ॥"

  num_svaras = vk.count_svaras(g)            # num_svaras = 24
  num_vyanjanas = vk.count_vyanjanas(g)      # num_vyanjanas = 30
  num_ayogavaahas = vk.count_ayogavaahas(g)  # num_ayogavaahas = 6
  num_varnas = vk.count_varnas(g)            # num_varnas = 60
  num_vaakyas = vk.count_vaakyas(g)          # num_vaakyas = 3
  ```


pkgId: e44f3d0fe6f1462e55042c378b1cc170d452c6be453018411a58040d0002c86e
name: python-akshare
arch: src
version: 1.14.93
epoch: 0
release: 1
url: https://github.com/akfamily/akshare
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akshare-1.14.93-1.src.rpm
checksum_type: sha256
summary:
  AKShare is an elegant and simple financial data interface library for Python, built for human beings!

description:
  **欢迎加入专注于财经数据和量化投资的知识社区，请点击[了解更多](https://akshare.akfamily.xyz/learn.html)**

  **相关视频教程已经发布：《AKShare-初阶-使用教学》、《AKShare-初阶-实战应用》、《AKShare-源码解析》、《开源项目巡礼》**，详情请访问[课程](https://app3rqjh1z21630.h5.xiaoeknow.com)查看更多课程信息！

  **AKQuant 量化教程请访问：[利用 PyBroker 进行量化投资](https://akquant.akfamily.xyz/)**

  **本次发布 [AKTools](https://github.com/akfamily/aktools) 作为 AKShare 的 HTTP API 版本，
  突破 Python 语言的限制，欢迎各位小伙伴试用并提出更好的意见或建议！
  点击 [AKTools](https://github.com/akfamily/aktools) 查看使用指南。另外提供 [awesome-data](https://github.com/akfamily/awesome-data) 方便各位小伙伴查询各种数据源。**

  ![AKShare Logo](https://github.com/akfamily/akshare/blob/main/assets/images/akshare_logo.jpg)

  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/akshare.svg)](https://pypi.org/project/akshare/)
  [![PyPI](https://img.shields.io/pypi/v/akshare.svg)](https://pypi.org/project/akshare/)
  [![Downloads](https://pepy.tech/badge/akshare)](https://pepy.tech/project/akshare)
  [![Documentation Status](https://readthedocs.org/projects/akshare/badge/?version=latest)](https://akshare.readthedocs.io/?badge=latest)
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  [![akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)
  [![Actions Status](https://github.com/akfamily/akshare/actions/workflows/release_and_deploy.yml/badge.svg)](https://github.com/akfamily/akshare/actions)
  [![MIT Licence](https://img.shields.io/badge/license-MIT-blue)](https://github.com/akfamily/akshare/blob/main/LICENSE)
  [![](https://img.shields.io/github/forks/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![](https://img.shields.io/github/stars/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![](https://img.shields.io/github/issues/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)



  [AKShare](https://github.com/akfamily/akshare) requires Python(64 bit) 3.8 or higher and
  aims to simplify the process of fetching financial data.

  **Write less, get more!**

  - Documentation: [中文文档](https://akshare.akfamily.xyz/)





  ```shell
  pip install akshare --upgrade
  ```



  ```shell
  pip install akshare -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com  --upgrade
  ```



  Please check out [Documentation](https://akshare.akfamily.xyz/contributing.html) if you
  want to contribute to AKShare





  ```shell
  docker pull registry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyter
  ```



  ```shell
  docker run -it registry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyter python
  ```



  ```python
  import akshare as ak

  print(ak.__version__)
  ```





  Code:

  ```python
  import akshare as ak

  stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date='20231022', adjust="")
  print(stock_zh_a_hist_df)
  ```

  Output:

  ```
        日期          开盘   收盘    最高  ...  振幅   涨跌幅  涨跌额  换手率
  0     2017-03-01   9.49   9.49   9.55  ...  0.84  0.11  0.01  0.21
  1     2017-03-02   9.51   9.43   9.54  ...  1.26 -0.63 -0.06  0.24
  2     2017-03-03   9.41   9.40   9.43  ...  0.74 -0.32 -0.03  0.20
  3     2017-03-06   9.40   9.45   9.46  ...  0.74  0.53  0.05  0.24
  4     2017-03-07   9.44   9.45   9.46  ...  0.63  0.00  0.00  0.17
            ...    ...    ...    ...  ...   ...   ...   ...   ...
  1610  2023-10-16  11.00  11.01  11.03  ...  0.73  0.09  0.01  0.26
  1611  2023-10-17  11.01  11.02  11.05  ...  0.82  0.09  0.01  0.25
  1612  2023-10-18  10.99  10.95  11.02  ...  1.00 -0.64 -0.07  0.34
  1613  2023-10-19  10.91  10.60  10.92  ...  3.01 -3.20 -0.35  0.61
  1614  2023-10-20  10.55  10.60  10.67  ...  1.51  0.00  0.00  0.27
  [1615 rows x 11 columns]
  ```



  Code:

  ```python
  import akshare as ak
  import mplfinance as mpf  # Please install mplfinance as follows: pip install mplfinance

  stock_us_daily_df = ak.stock_us_daily(symbol="AAPL", adjust="qfq")
  stock_us_daily_df = stock_us_daily_df.set_index(["date"])
  stock_us_daily_df = stock_us_daily_df["2020-04-01": "2020-04-29"]
  mpf.plot(stock_us_daily_df, type="candle", mav=(3, 6, 9), volume=True, show_nontrading=False)
  ```

  Output:

  ![KLine](https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/home/AAPL_candle.png)



  Welcome to join the **数据科学实战** knowledge planet to learn more about quantitative investment,
  please visit [数据科学实战](https://akshare.akfamily.xyz/learn.html) for more information:

  <div>
      <img alt="data science" src="https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/qrcode/data_scientist.png">
  </div>

  Pay attention to **数据科学实战** WeChat Official Accounts to get the [AKShare](https://github.com/akfamily/akshare) updated info:

  <div>
      <img alt="ds" src="https://github.com/akfamily/akshare/blob/main/assets/images/ds.png">
  </div>



  - **Easy of use**: Just one line code to fetch the data;
  - **Extensible**: Easy to customize your own code with other application;
  - **Powerful**: Python ecosystem.



  1. [Overview](https://akshare.akfamily.xyz/introduction.html)
  2. [Installation](https://akshare.akfamily.xyz/installation.html)
  3. [Tutorial](https://akshare.akfamily.xyz/tutorial.html)
  4. [Data Dict](https://akshare.akfamily.xyz/data/index.html)
  5. [Subjects](https://akshare.akfamily.xyz/topic/index.html)



  [AKShare](https://github.com/akfamily/akshare) is still under developing, feel free to open issues and pull requests:

  - Report or fix bugs
  - Require or publish interface
  - Write or fix documentation
  - Add test cases

  > Notice: We use [Ruff](https://github.com/astral-sh/ruff) to format the code



  1. All data provided by [AKShare](https://github.com/akfamily/akshare) is just for academic research purpose;
  2. The data provided by [AKShare](https://github.com/akfamily/akshare) is for reference only and does not constitute any investment proposal;
  3. Any investor based on [AKShare](https://github.com/akfamily/akshare) research should pay more attention to data risk;
  4. [AKShare](https://github.com/akfamily/akshare) will insist on providing open-source financial data;
  5. Based on some uncontrollable factors, some data interfaces in [AKShare](https://github.com/akfamily/akshare) may be removed;
  6. Please follow the relevant open-source protocol used by [AKShare](https://github.com/akfamily/akshare);
  7. Provide HTTP API for the person who uses other program language: [AKTools](https://aktools.readthedocs.io/).



  Use the badge in your project's README.md:

  ```markdown
  [![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)
  ```

  Using the badge in README.rst:

  ```
  .. image:: https://img.shields.io/badge/Data%20Science-AKShare-green
      :target: https://github.com/akfamily/akshare
  ```

  Looks like this:

  [![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)



  Please use this **bibtex** if you want to cite this repository in your publications:

  ```markdown
  @misc{akshare,
      author = {Albert King},
      title = {AKShare},
      year = {2019},
      publisher = {GitHub},
      journal = {GitHub repository},
      howpublished = {\url{https://github.com/akfamily/akshare}},
  }
  ```



  Special thanks [FuShare](https://github.com/LowinLi/fushare) for the opportunity of learning from the project;

  Special thanks [TuShare](https://github.com/waditu/tushare) for the opportunity of learning from the project;

  Thanks for the data provided by [生意社网站](http://www.100ppi.com/);

  Thanks for the data provided by [奇货可查网站](https://qhkch.com/);

  Thanks for the data provided by [中国银行间市场交易商协会网站](http://www.nafmii.org.cn/);

  Thanks for the data provided by [99期货网站](http://www.99qh.com/);

  Thanks for the data provided by [英为财情网站](https://cn.investing.com/);

  Thanks for the data provided by [中国外汇交易中心暨全国银行间同业拆借中心网站](http://www.chinamoney.com.cn/chinese/);

  Thanks for the data provided by [金十数据网站](https://www.jin10.com/);

  Thanks for the data provided by [和讯财经网站](http://www.hexun.com/);

  Thanks for the data provided by [新浪财经网站](https://finance.sina.com.cn/);

  Thanks for the data provided by [Oxford-Man Institute 网站](https://realized.oxford-man.ox.ac.uk/);

  Thanks for the data provided by [DACHENG-XIU 网站](https://dachxiu.chicagobooth.edu/);

  Thanks for the data provided by [上海证券交易所网站](http://www.sse.com.cn/assortment/options/price/);

  Thanks for the data provided by [深证证券交易所网站](http://www.szse.cn/);

  Thanks for the data provided by [北京证券交易所网站](http://www.bse.cn/);

  Thanks for the data provided by [中国金融期货交易所网站](http://www.cffex.com.cn/);

  Thanks for the data provided by [上海期货交易所网站](http://www.shfe.com.cn/);

  Thanks for the data provided by [大连商品交易所网站](http://www.dce.com.cn/);

  Thanks for the data provided by [郑州商品交易所网站](http://www.czce.com.cn/);

  Thanks for the data provided by [上海国际能源交易中心网站](http://www.ine.com.cn/);

  Thanks for the data provided by [Timeanddate 网站](https://www.timeanddate.com/);

  Thanks for the data provided by [河北省空气质量预报信息发布系统网站](http://110.249.223.67/publish/);

  Thanks for the data provided by [南华期货网站](http://www.nanhua.net/nhzc/varietytrend.html);

  Thanks for the data provided by [Economic Policy Uncertainty 网站](http://www.nanhua.net/nhzc/varietytrend.html);

  Thanks for the data provided by [微博指数网站](https://data.weibo.com/index/newindex);

  Thanks for the data provided by [百度指数网站](http://index.baidu.com/v2/main/index.html);

  Thanks for the data provided by [谷歌指数网站](https://trends.google.com/trends/?geo=US);

  Thanks for the data provided by [申万指数网站](http://www.swsindex.com/idx0120.aspx?columnid=8832);

  Thanks for the data provided by [真气网网站](https://www.zq12369.com/);

  Thanks for the data provided by [财富网站](http://www.fortunechina.com/);

  Thanks for the data provided by [中国证券投资基金业协会网站](http://gs.amac.org.cn/);

  Thanks for the data provided by [Expatistan 网站](https://www.expatistan.com/cost-of-living);

  Thanks for the data provided by [北京市碳排放权电子交易平台网站](https://www.bjets.com.cn/article/jyxx/);

  Thanks for the data provided by [国家金融与发展实验室网站](http://www.nifd.cn/);

  Thanks for the data provided by [IT桔子网站](https://www.itjuzi.com);

  Thanks for the data provided by [东方财富网站](http://data.eastmoney.com/jgdy/);

  Thanks for the data provided by [义乌小商品指数网站](http://www.ywindex.com/Home/Product/index/);

  Thanks for the data provided by [中国国家发展和改革委员会网站](http://jgjc.ndrc.gov.cn/dmzs.aspx?clmId=741);

  Thanks for the data provided by [百度迁徙网站](https://qianxi.baidu.com/?from=shoubai#city=0);

  Thanks for the data provided by [慈善中国网站](http://cishan.chinanpo.gov.cn/platform/login.html);

  Thanks for the data provided by [思知网站](https://www.ownthink.com/);

  Thanks for the data provided by [Currencyscoop 网站](https://currencyscoop.com/);

  Thanks for the data provided by [新加坡交易所网站](https://www.sgx.com/zh-hans/research-education/derivatives);

  Thanks for the tutorials provided by [微信公众号: Python大咖谈](https://upload-images.jianshu.io/upload_images/3240514-61004f2c71be4a0b.png).



  <a href="https://www.jetbrains.com/?from=jindaxiang/akshare" target="_blank">
  <img alt="jetbrains" src="https://github.com/akfamily/akshare/blob/main/assets/images/jetbrains.svg" width="100px" height="100px">
  </a>


pkgId: 6ada0b99d625b4d38f38752b5282bdf7e88da58074739d0ac92b255ee46b98e7
name: python-akshare
arch: src
version: 1.15.21
epoch: 0
release: 1
url: https://github.com/akfamily/akshare
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akshare-1.15.21-1.src.rpm
checksum_type: sha256
summary:
  AKShare is an elegant and simple financial data interface library for Python, built for human beings!

description:
  **欢迎加入专注于财经数据和量化投资的知识社区，请点击[了解更多](https://akshare.akfamily.xyz/learn.html)**

  **首门量化投资教程：《PyBroker-入门及实战》已经录制完成，目前已经上架！**

  **更多视频教程已经发布：《AKShare-初阶-使用教学》、《AKShare-初阶-实战应用》、《AKShare-源码解析》、《开源项目巡礼》**，
  详情请关注【数据科学实战】公众号，查看更多课程信息！

  **AKQuant 量化教程请访问：[利用 PyBroker 进行量化投资](https://akquant.akfamily.xyz/)**

  **本次发布 [AKTools](https://github.com/akfamily/aktools) 作为 AKShare 的 HTTP API 版本，
  突破 Python 语言的限制，欢迎各位小伙伴试用并提出更好的意见或建议！
  点击 [AKTools](https://github.com/akfamily/aktools) 查看使用指南。另外提供 [awesome-data](https://github.com/akfamily/awesome-data) 方便各位小伙伴查询各种数据源。**

  ![AKShare Logo](https://github.com/akfamily/akshare/blob/main/assets/images/akshare_logo.jpg)

  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/akshare.svg)](https://pypi.org/project/akshare/)
  [![PyPI](https://img.shields.io/pypi/v/akshare.svg)](https://pypi.org/project/akshare/)
  [![Downloads](https://pepy.tech/badge/akshare)](https://pepy.tech/project/akshare)
  [![Documentation Status](https://readthedocs.org/projects/akshare/badge/?version=latest)](https://akshare.readthedocs.io/?badge=latest)
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  [![akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)
  [![Actions Status](https://github.com/akfamily/akshare/actions/workflows/release_and_deploy.yml/badge.svg)](https://github.com/akfamily/akshare/actions)
  [![MIT Licence](https://img.shields.io/badge/license-MIT-blue)](https://github.com/akfamily/akshare/blob/main/LICENSE)
  [![](https://img.shields.io/github/forks/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![](https://img.shields.io/github/stars/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![](https://img.shields.io/github/issues/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)



  [AKShare](https://github.com/akfamily/akshare) requires Python(64 bit) 3.8 or higher and
  aims to simplify the process of fetching financial data.

  **Write less, get more!**

  - Documentation: [中文文档](https://akshare.akfamily.xyz/)





  ```shell
  pip install akshare --upgrade
  ```



  ```shell
  pip install akshare -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com  --upgrade
  ```



  Please check out [Documentation](https://akshare.akfamily.xyz/contributing.html) if you
  want to contribute to AKShare





  ```shell
  docker pull registry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyter
  ```



  ```shell
  docker run -it registry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyter python
  ```



  ```python
  import akshare as ak

  print(ak.__version__)
  ```





  Code:

  ```python
  import akshare as ak

  stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date='20231022', adjust="")
  print(stock_zh_a_hist_df)
  ```

  Output:

  ```
        日期          开盘   收盘    最高  ...  振幅   涨跌幅  涨跌额  换手率
  0     2017-03-01   9.49   9.49   9.55  ...  0.84  0.11  0.01  0.21
  1     2017-03-02   9.51   9.43   9.54  ...  1.26 -0.63 -0.06  0.24
  2     2017-03-03   9.41   9.40   9.43  ...  0.74 -0.32 -0.03  0.20
  3     2017-03-06   9.40   9.45   9.46  ...  0.74  0.53  0.05  0.24
  4     2017-03-07   9.44   9.45   9.46  ...  0.63  0.00  0.00  0.17
            ...    ...    ...    ...  ...   ...   ...   ...   ...
  1610  2023-10-16  11.00  11.01  11.03  ...  0.73  0.09  0.01  0.26
  1611  2023-10-17  11.01  11.02  11.05  ...  0.82  0.09  0.01  0.25
  1612  2023-10-18  10.99  10.95  11.02  ...  1.00 -0.64 -0.07  0.34
  1613  2023-10-19  10.91  10.60  10.92  ...  3.01 -3.20 -0.35  0.61
  1614  2023-10-20  10.55  10.60  10.67  ...  1.51  0.00  0.00  0.27
  [1615 rows x 11 columns]
  ```



  Code:

  ```python
  import akshare as ak
  import mplfinance as mpf  # Please install mplfinance as follows: pip install mplfinance

  stock_us_daily_df = ak.stock_us_daily(symbol="AAPL", adjust="qfq")
  stock_us_daily_df = stock_us_daily_df.set_index(["date"])
  stock_us_daily_df = stock_us_daily_df["2020-04-01": "2020-04-29"]
  mpf.plot(stock_us_daily_df, type="candle", mav=(3, 6, 9), volume=True, show_nontrading=False)
  ```

  Output:

  ![KLine](https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/home/AAPL_candle.png)



  Welcome to join the **数据科学实战** knowledge planet to learn more about quantitative investment,
  please visit [数据科学实战](https://akshare.akfamily.xyz/learn.html) for more information:

  <div>
      <img alt="data science" src="https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/qrcode/data_scientist.png">
  </div>

  Pay attention to **数据科学实战** WeChat Official Accounts to get the [AKShare](https://github.com/akfamily/akshare) updated info:

  <div>
      <img alt="ds" src="https://github.com/akfamily/akshare/blob/main/assets/images/ds.png">
  </div>



  - **Easy of use**: Just one line code to fetch the data;
  - **Extensible**: Easy to customize your own code with other application;
  - **Powerful**: Python ecosystem.



  1. [Overview](https://akshare.akfamily.xyz/introduction.html)
  2. [Installation](https://akshare.akfamily.xyz/installation.html)
  3. [Tutorial](https://akshare.akfamily.xyz/tutorial.html)
  4. [Data Dict](https://akshare.akfamily.xyz/data/index.html)
  5. [Subjects](https://akshare.akfamily.xyz/topic/index.html)



  [AKShare](https://github.com/akfamily/akshare) is still under developing, feel free to open issues and pull requests:

  - Report or fix bugs
  - Require or publish interface
  - Write or fix documentation
  - Add test cases

  > Notice: We use [Ruff](https://github.com/astral-sh/ruff) to format the code



  1. All data provided by [AKShare](https://github.com/akfamily/akshare) is just for academic research purpose;
  2. The data provided by [AKShare](https://github.com/akfamily/akshare) is for reference only and does not constitute any investment proposal;
  3. Any investor based on [AKShare](https://github.com/akfamily/akshare) research should pay more attention to data risk;
  4. [AKShare](https://github.com/akfamily/akshare) will insist on providing open-source financial data;
  5. Based on some uncontrollable factors, some data interfaces in [AKShare](https://github.com/akfamily/akshare) may be removed;
  6. Please follow the relevant open-source protocol used by [AKShare](https://github.com/akfamily/akshare);
  7. Provide HTTP API for the person who uses other program language: [AKTools](https://aktools.readthedocs.io/).



  Use the badge in your project's README.md:

  ```markdown
  [![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)
  ```

  Using the badge in README.rst:

  ```
  .. image:: https://img.shields.io/badge/Data%20Science-AKShare-green
      :target: https://github.com/akfamily/akshare
  ```

  Looks like this:

  [![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)



  Please use this **bibtex** if you want to cite this repository in your publications:

  ```markdown
  @misc{akshare,
      author = {Albert King},
      title = {AKShare},
      year = {2019},
      publisher = {GitHub},
      journal = {GitHub repository},
      howpublished = {\url{https://github.com/akfamily/akshare}},
  }
  ```



  Special thanks [FuShare](https://github.com/LowinLi/fushare) for the opportunity of learning from the project;

  Special thanks [TuShare](https://github.com/waditu/tushare) for the opportunity of learning from the project;

  Thanks for the data provided by [生意社网站](http://www.100ppi.com/);

  Thanks for the data provided by [奇货可查网站](https://qhkch.com/);

  Thanks for the data provided by [中国银行间市场交易商协会网站](http://www.nafmii.org.cn/);

  Thanks for the data provided by [99期货网站](http://www.99qh.com/);

  Thanks for the data provided by [英为财情网站](https://cn.investing.com/);

  Thanks for the data provided by [中国外汇交易中心暨全国银行间同业拆借中心网站](http://www.chinamoney.com.cn/chinese/);

  Thanks for the data provided by [金十数据网站](https://www.jin10.com/);

  Thanks for the data provided by [和讯财经网站](http://www.hexun.com/);

  Thanks for the data provided by [新浪财经网站](https://finance.sina.com.cn/);

  Thanks for the data provided by [Oxford-Man Institute 网站](https://realized.oxford-man.ox.ac.uk/);

  Thanks for the data provided by [DACHENG-XIU 网站](https://dachxiu.chicagobooth.edu/);

  Thanks for the data provided by [上海证券交易所网站](http://www.sse.com.cn/assortment/options/price/);

  Thanks for the data provided by [深证证券交易所网站](http://www.szse.cn/);

  Thanks for the data provided by [北京证券交易所网站](http://www.bse.cn/);

  Thanks for the data provided by [中国金融期货交易所网站](http://www.cffex.com.cn/);

  Thanks for the data provided by [上海期货交易所网站](http://www.shfe.com.cn/);

  Thanks for the data provided by [大连商品交易所网站](http://www.dce.com.cn/);

  Thanks for the data provided by [郑州商品交易所网站](http://www.czce.com.cn/);

  Thanks for the data provided by [上海国际能源交易中心网站](http://www.ine.com.cn/);

  Thanks for the data provided by [Timeanddate 网站](https://www.timeanddate.com/);

  Thanks for the data provided by [河北省空气质量预报信息发布系统网站](http://110.249.223.67/publish/);

  Thanks for the data provided by [南华期货网站](http://www.nanhua.net/nhzc/varietytrend.html);

  Thanks for the data provided by [Economic Policy Uncertainty 网站](http://www.nanhua.net/nhzc/varietytrend.html);

  Thanks for the data provided by [微博指数网站](https://data.weibo.com/index/newindex);

  Thanks for the data provided by [百度指数网站](http://index.baidu.com/v2/main/index.html);

  Thanks for the data provided by [谷歌指数网站](https://trends.google.com/trends/?geo=US);

  Thanks for the data provided by [申万指数网站](http://www.swsindex.com/idx0120.aspx?columnid=8832);

  Thanks for the data provided by [真气网网站](https://www.zq12369.com/);

  Thanks for the data provided by [财富网站](http://www.fortunechina.com/);

  Thanks for the data provided by [中国证券投资基金业协会网站](http://gs.amac.org.cn/);

  Thanks for the data provided by [Expatistan 网站](https://www.expatistan.com/cost-of-living);

  Thanks for the data provided by [北京市碳排放权电子交易平台网站](https://www.bjets.com.cn/article/jyxx/);

  Thanks for the data provided by [国家金融与发展实验室网站](http://www.nifd.cn/);

  Thanks for the data provided by [IT桔子网站](https://www.itjuzi.com);

  Thanks for the data provided by [东方财富网站](http://data.eastmoney.com/jgdy/);

  Thanks for the data provided by [义乌小商品指数网站](http://www.ywindex.com/Home/Product/index/);

  Thanks for the data provided by [中国国家发展和改革委员会网站](http://jgjc.ndrc.gov.cn/dmzs.aspx?clmId=741);

  Thanks for the data provided by [百度迁徙网站](https://qianxi.baidu.com/?from=shoubai#city=0);

  Thanks for the data provided by [慈善中国网站](http://cishan.chinanpo.gov.cn/platform/login.html);

  Thanks for the data provided by [思知网站](https://www.ownthink.com/);

  Thanks for the data provided by [Currencyscoop 网站](https://currencyscoop.com/);

  Thanks for the data provided by [新加坡交易所网站](https://www.sgx.com/zh-hans/research-education/derivatives);

  Thanks for the tutorials provided by [微信公众号: Python大咖谈](https://upload-images.jianshu.io/upload_images/3240514-61004f2c71be4a0b.png).



  <a href="https://www.jetbrains.com/?from=albertandking/akshare" target="_blank">
  <img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.png" alt="JetBrains logo.">
  </a>


pkgId: 0cecccf2231bf692fa3fa7b6b88177d2b7e407bbf61551439d8d739b4035a990
name: python-akshare
arch: src
version: 1.15.33
epoch: 0
release: 1
url: https://github.com/akfamily/akshare
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akshare-1.15.33-1.src.rpm
checksum_type: sha256
summary:
[cell repeats an earlier one in this file: 101 characters]

description:
  **欢迎加入专注于财经数据和量化投资的知识社区，请点击[了解更多](https://akshare.akfamily.xyz/learn.html)**

  **量化投研视频课程：《PyBroker-入门及实战》已经上架！《PyBroker-进阶及实战》正在更新！**

  **更多视频教程已经发布：《AKShare-初阶-使用教学》、《AKShare-初阶-实战应用》、《AKShare-源码解析》、《开源项目巡礼》**，
  详情请关注【数据科学实战】公众号，查看更多课程信息！

  **AKQuant 量化教程请访问：[利用 PyBroker 进行量化投资](https://akquant.akfamily.xyz/)**

  **本次发布 [AKTools](https://github.com/akfamily/aktools) 作为 AKShare 的 HTTP API 版本，
  突破 Python 语言的限制，欢迎各位小伙伴试用并提出更好的意见或建议！
  点击 [AKTools](https://github.com/akfamily/aktools) 查看使用指南。另外提供 [awesome-data](https://github.com/akfamily/awesome-data) 方便各位小伙伴查询各种数据源。**

  ![AKShare Logo](https://github.com/akfamily/akshare/blob/main/assets/images/akshare_logo.jpg)

  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/akshare.svg)](https://pypi.org/project/akshare/)
  [![PyPI](https://img.shields.io/pypi/v/akshare.svg)](https://pypi.org/project/akshare/)
  [![Downloads](https://pepy.tech/badge/akshare)](https://pepy.tech/project/akshare)
  [![Documentation Status](https://readthedocs.org/projects/akshare/badge/?version=latest)](https://akshare.readthedocs.io/?badge=latest)
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  [![akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)
  [![Actions Status](https://github.com/akfamily/akshare/actions/workflows/release_and_deploy.yml/badge.svg)](https://github.com/akfamily/akshare/actions)
  [![MIT Licence](https://img.shields.io/badge/license-MIT-blue)](https://github.com/akfamily/akshare/blob/main/LICENSE)
  [![](https://img.shields.io/github/forks/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![](https://img.shields.io/github/stars/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![](https://img.shields.io/github/issues/jindaxiang/akshare)](https://github.com/akfamily/akshare)
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)



  [AKShare](https://github.com/akfamily/akshare) requires Python(64 bit) 3.8 or higher and
  aims to simplify the process of fetching financial data.

  **Write less, get more!**

  - Documentation: [中文文档](https://akshare.akfamily.xyz/)





  ```shell
  pip install akshare --upgrade
  ```



  ```shell
  pip install akshare -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com  --upgrade
  ```



  Please check out [Documentation](https://akshare.akfamily.xyz/contributing.html) if you
  want to contribute to AKShare





  ```shell
  docker pull registry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyter
  ```



  ```shell
  docker run -it registry.cn-shanghai.aliyuncs.com/akfamily/aktools:jupyter python
  ```



  ```python
  import akshare as ak

  print(ak.__version__)
  ```





  Code:

  ```python
  import akshare as ak

  stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date='20231022', adjust="")
  print(stock_zh_a_hist_df)
  ```

  Output:

  ```
        日期          开盘   收盘    最高  ...  振幅   涨跌幅  涨跌额  换手率
  0     2017-03-01   9.49   9.49   9.55  ...  0.84  0.11  0.01  0.21
  1     2017-03-02   9.51   9.43   9.54  ...  1.26 -0.63 -0.06  0.24
  2     2017-03-03   9.41   9.40   9.43  ...  0.74 -0.32 -0.03  0.20
  3     2017-03-06   9.40   9.45   9.46  ...  0.74  0.53  0.05  0.24
  4     2017-03-07   9.44   9.45   9.46  ...  0.63  0.00  0.00  0.17
            ...    ...    ...    ...  ...   ...   ...   ...   ...
  1610  2023-10-16  11.00  11.01  11.03  ...  0.73  0.09  0.01  0.26
  1611  2023-10-17  11.01  11.02  11.05  ...  0.82  0.09  0.01  0.25
  1612  2023-10-18  10.99  10.95  11.02  ...  1.00 -0.64 -0.07  0.34
  1613  2023-10-19  10.91  10.60  10.92  ...  3.01 -3.20 -0.35  0.61
  1614  2023-10-20  10.55  10.60  10.67  ...  1.51  0.00  0.00  0.27
  [1615 rows x 11 columns]
  ```



  Code:

  ```python
  import akshare as ak
  import mplfinance as mpf  # Please install mplfinance as follows: pip install mplfinance

  stock_us_daily_df = ak.stock_us_daily(symbol="AAPL", adjust="qfq")
  stock_us_daily_df = stock_us_daily_df.set_index(["date"])
  stock_us_daily_df = stock_us_daily_df["2020-04-01": "2020-04-29"]
  mpf.plot(stock_us_daily_df, type="candle", mav=(3, 6, 9), volume=True, show_nontrading=False)
  ```

  Output:

  ![KLine](https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/home/AAPL_candle.png)



  Welcome to join the **数据科学实战** knowledge planet to learn more about quantitative investment,
  please visit [数据科学实战](https://akshare.akfamily.xyz/learn.html) for more information:

  <div>
      <img alt="data science" src="https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/qrcode/data_scientist.png">
  </div>

  Pay attention to **数据科学实战** WeChat Official Accounts to get the [AKShare](https://github.com/akfamily/akshare) updated info:

  <div>
      <img alt="ds" src="https://github.com/akfamily/akshare/blob/main/assets/images/ds.png">
  </div>



  - **Easy of use**: Just one line code to fetch the data;
  - **Extensible**: Easy to customize your own code with other application;
  - **Powerful**: Python ecosystem.



  1. [Overview](https://akshare.akfamily.xyz/introduction.html)
  2. [Installation](https://akshare.akfamily.xyz/installation.html)
  3. [Tutorial](https://akshare.akfamily.xyz/tutorial.html)
  4. [Data Dict](https://akshare.akfamily.xyz/data/index.html)
  5. [Subjects](https://akshare.akfamily.xyz/topic/index.html)



  [AKShare](https://github.com/akfamily/akshare) is still under developing, feel free to open issues and pull requests:

  - Report or fix bugs
  - Require or publish interface
  - Write or fix documentation
  - Add test cases

  > Notice: We use [Ruff](https://github.com/astral-sh/ruff) to format the code



  1. All data provided by [AKShare](https://github.com/akfamily/akshare) is just for academic research purpose;
  2. The data provided by [AKShare](https://github.com/akfamily/akshare) is for reference only and does not constitute any investment proposal;
  3. Any investor based on [AKShare](https://github.com/akfamily/akshare) research should pay more attention to data risk;
  4. [AKShare](https://github.com/akfamily/akshare) will insist on providing open-source financial data;
  5. Based on some uncontrollable factors, some data interfaces in [AKShare](https://github.com/akfamily/akshare) may be removed;
  6. Please follow the relevant open-source protocol used by [AKShare](https://github.com/akfamily/akshare);
  7. Provide HTTP API for the person who uses other program language: [AKTools](https://aktools.readthedocs.io/).



  Use the badge in your project's README.md:

  ```markdown
  [![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)
  ```

  Using the badge in README.rst:

  ```
  .. image:: https://img.shields.io/badge/Data%20Science-AKShare-green
      :target: https://github.com/akfamily/akshare
  ```

  Looks like this:

  [![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)



  Please use this **bibtex** if you want to cite this repository in your publications:

  ```markdown
  @misc{akshare,
      author = {Albert King},
      title = {AKShare},
      year = {2019},
      publisher = {GitHub},
      journal = {GitHub repository},
      howpublished = {\url{https://github.com/akfamily/akshare}},
  }
  ```



  Special thanks [FuShare](https://github.com/LowinLi/fushare) for the opportunity of learning from the project;

  Special thanks [TuShare](https://github.com/waditu/tushare) for the opportunity of learning from the project;

  Thanks for the data provided by [生意社网站](http://www.100ppi.com/);

  Thanks for the data provided by [中国银行间市场交易商协会网站](http://www.nafmii.org.cn/);

  Thanks for the data provided by [99期货网站](http://www.99qh.com/);

  Thanks for the data provided by [中国外汇交易中心暨全国银行间同业拆借中心网站](http://www.chinamoney.com.cn/chinese/);

  Thanks for the data provided by [金十数据网站](https://www.jin10.com/);

  Thanks for the data provided by [和讯财经网站](http://www.hexun.com/);

  Thanks for the data provided by [新浪财经网站](https://finance.sina.com.cn/);

  Thanks for the data provided by [DACHENG-XIU 网站](https://dachxiu.chicagobooth.edu/);

  Thanks for the data provided by [上海证券交易所网站](http://www.sse.com.cn/assortment/options/price/);

  Thanks for the data provided by [深证证券交易所网站](http://www.szse.cn/);

  Thanks for the data provided by [北京证券交易所网站](http://www.bse.cn/);

  Thanks for the data provided by [中国金融期货交易所网站](http://www.cffex.com.cn/);

  Thanks for the data provided by [上海期货交易所网站](http://www.shfe.com.cn/);

  Thanks for the data provided by [大连商品交易所网站](http://www.dce.com.cn/);

  Thanks for the data provided by [郑州商品交易所网站](http://www.czce.com.cn/);

  Thanks for the data provided by [上海国际能源交易中心网站](http://www.ine.com.cn/);

  Thanks for the data provided by [Timeanddate 网站](https://www.timeanddate.com/);

  Thanks for the data provided by [河北省空气质量预报信息发布系统网站](http://110.249.223.67/publish/);

  Thanks for the data provided by [南华期货网站](http://www.nanhua.net/nhzc/varietytrend.html);

  Thanks for the data provided by [Economic Policy Uncertainty 网站](http://www.nanhua.net/nhzc/varietytrend.html);

  Thanks for the data provided by [申万指数网站](http://www.swsindex.com/idx0120.aspx?columnid=8832);

  Thanks for the data provided by [真气网网站](https://www.zq12369.com/);

  Thanks for the data provided by [财富网站](http://www.fortunechina.com/);

  Thanks for the data provided by [中国证券投资基金业协会网站](http://gs.amac.org.cn/);

  Thanks for the data provided by [Expatistan 网站](https://www.expatistan.com/cost-of-living);

  Thanks for the data provided by [北京市碳排放权电子交易平台网站](https://www.bjets.com.cn/article/jyxx/);

  Thanks for the data provided by [国家金融与发展实验室网站](http://www.nifd.cn/);

  Thanks for the data provided by [东方财富网站](http://data.eastmoney.com/jgdy/);

  Thanks for the data provided by [义乌小商品指数网站](http://www.ywindex.com/Home/Product/index/);

  Thanks for the data provided by [百度迁徙网站](https://qianxi.baidu.com/?from=shoubai#city=0);

  Thanks for the data provided by [思知网站](https://www.ownthink.com/);

  Thanks for the data provided by [Currencyscoop 网站](https://currencyscoop.com/);

  Thanks for the data provided by [新加坡交易所网站](https://www.sgx.com/zh-hans/research-education/derivatives);

  Thanks for the tutorials provided by [微信公众号: Python大咖谈](https://upload-images.jianshu.io/upload_images/3240514-61004f2c71be4a0b.png).



  <a href="https://www.jetbrains.com/?from=albertandking/akshare" target="_blank">
  <img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.png" alt="JetBrains logo.">
  </a>


pkgId: 8e451b0d3a16de87de4d346188f897fa8596c073147c9ba62941b7aa59dba9ab
name: python-aksharify
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Ascii Art + Emoji Art python Package
url: https://primepatel.github.io/aksharify/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aksharify-0.2.0-1.src.rpm
checksum_type: sha256
description:
  <a name="readme-top"></a>



  [![Contributors][contributors-shield]][contributors-url]
  [![Forks][forks-shield]][forks-url]
  [![Stargazers][stars-shield]][stars-url]
  [![Issues][issues-shield]][issues-url]
  [![MIT License][license-shield]][license-url]
  [![LinkedIn][linkedin-shield]][linkedin-url]
  [![PyPI - Downloads][Downloads-shield]](https://pypistats.org/packages/aksharify)

  <br />



  Aksharify is an open-source python package hosted on GitHub that allows you to effortlessly transform images into captivating ASCII art representations. With Aksharify, you can convert your favorite images into an artistic arrangement of ASCII characters, adding a unique and nostalgic touch to your projects.

  Start transforming your photos into captivating ASCII art with Aksharify and unleash your creativity in the world of visual representation!


  - Convert photos and images into ASCII art with a single function call.

  - Fine-tune the output by adjusting parameters such as character set, resolution etc.

  - Support for various character sets, allowing you to customize the style of the generated ASCII art.

  - Export the ASCII art as plain text or save it as an image file for easy sharing and integration.



  ASCII art is a style of art in which people make graphics and designs by using letters, numbers, and symbols from a unique set of characters known as ASCII. ASCII painters create intriguing images by arranging these characters in patterns and forms rather than using colours and brushes as in traditional art. They meticulously select the appropriate characters and combine them to produce images of animals, people, or even landscapes. It's almost as if you're sketching with letters and symbols! ASCII art is a fun way for artists to express themselves using only the basic characters present on a computer keyboard.

  <!-- ABOUT THE PROJECT -->


  The inspiration for this module came from a Numberphile video called "The Trinity Hall Prime," which I first saw in high school days. It motivated me to explore the possibilities of such a prime number. I created a Python module that uses a predetermined character set to turn photos into ASCII art. It manipulates images using the PIL package, transforming them to grayscale before mapping pixel values to ASCII letters. Users can change the character set to get different effects.

  <!-- GETTING STARTED -->


  Before we begin, make sure you have one of recent versions of Python installed on your computer.



  ```sh
  python -m pip install aksharify
  ```



  ```python
  from aksharify import AksharArt
  from aksharify.image import Image
  from aksharify.distributions import Linear
  from aksharify.outputs import SVG
  ```

  ```python
  image = Image("images\julia1.png")
  image.set_dim(200)
  image.show()
  ```

  ```python
  lin = Linear("01")
  lin.show()
  ```

  ```python
  art = AksharArt(image, lin)
  art.aksharify(show=True)
  ```

  ```python
  config = SVG()
  config.file_name = "art"
  config.bold = True
  ```

  ```python
  art.export(config)
  ```

  _For examples from user community, please refer to the [primepatel.github.io/aksharify](https://primepatel.github.io/aksharify)_


  <!-- ROADMAP -->


  - [x] NumberiFy
  - [ ] Predifined order of characters
  - [ ] Getting images from URL
  - [ ] EmojiFy

  See the [open issues](https://github.com/github_username/repo_name/issues) for a full list of proposed features (and known issues).

  <!-- CONTRIBUTING -->


  Contributions are what make the open source community such a wonderful place to learn, be inspired, and create. Any contributions you make are `appreciated greatly`.

  If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
  Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  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

  <!-- LICENSE -->


  Distributed under the MIT License. See `LICENSE.txt` for more information.

  <!-- CONTACT -->


  Prime Patel - [@primepatel](https://twitter.com/primespatel) - primespatel@gmail.com

  Project Link: [https://github.com/primepatel/aksharify](https://github.com/primepatel/aksharify)


  <!-- ACKNOWLEDGMENTS -->
  <!-- ## Acknowledgments

  * []()
  * []()
  * []() -->

  <p align="right">(<a href="#readme-top">back to top</a>)</p>



  <!-- MARKDOWN LINKS & IMAGES -->
  <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
  [contributors-shield]: https://img.shields.io/github/contributors/primepatel/Aksharify.svg?style=for-the-badge
  [contributors-url]: https://github.com/primepatel/Aksharify/graphs/contributors
  [forks-shield]: https://img.shields.io/github/forks/primepatel/Aksharify.svg?style=for-the-badge
  [forks-url]: https://github.com/primepatel/Aksharify/network/members
  [stars-shield]: https://img.shields.io/github/stars/primepatel/Aksharify.svg?style=for-the-badge
  [stars-url]: https://github.com/primepatel/Aksharify/stargazers
  [issues-shield]: https://img.shields.io/github/issues/primepatel/Aksharify.svg?style=for-the-badge
  [issues-url]: https://github.com/primepatel/Aksharify/issues
  [license-shield]: https://img.shields.io/github/license/primepatel/Aksharify.svg?style=for-the-badge
  [license-url]: https://github.com/primepatel/Aksharify/blob/master/LICENSE.txt
  [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
  [linkedin-url]: https://linkedin.com/in/primepatel
  [Downloads-shield]: https://img.shields.io/pypi/dm/aksharify?style=for-the-badge


pkgId: 6b38698f35cb45519834b2c39bc011b822694139f7653b90d896501861428dea
name: python-akskubeconfig
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: A utility to genearate kubeconfig for AKS clusters in bulk across one or multiple subscriptions
url: https://github.com/niq-ccoe-platform-engineering/akskubeconfig
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-akskubeconfig-1.0.1-1.src.rpm
checksum_type: sha256
description:
  <!-- Space: CLDCOE -->
  <!-- Parent: NIQ Managed Actions -->
  <!-- Type: page -->
  <!-- Layout: article -->

  <!-- Include: disclaimer.tmpl -->
  <!-- Include: ac:toc -->

  A utility to generate a kubeconfig file for all AKS clusters in one or more Azure subscriptions.



  Managing and updating a Kubernetes configuration file for AKS clusters can be a
  nightmare when you manage multiple clusters across multiple subscriptions. This
  tool aims to simplify the process by generating a kubeconfig file for all AKS
  clusters that you have access to in all subscriptions that you have access to.

  While checking all subscriptions is default behavior, you can also specify a
  list of subscriptions to check. This can be useful if you have access to a large
  number of subscriptions and only want to check a subset of them.

  It also supports generating that kubeconfig file using a number of different
  authentication flows, including:

  - Default (using the default authentication flow)
  - Device Flow (using the device flow authentication flow)
  - Interactive (using the interactive web browser authentication flow)
  - Service Principal Secret (using a service principal secret to authenticate)
  - Service Principal PFX (using a service principal pfx certificate to authenticate)
  - Managed Identity (using a managed identity to authenticate)
  - Managed Identity ID (using a managed identity to authenticate)
  - Azure CLI (using the Azure CLI to authenticate)
  - Workload Identity (using a workload identity to authenticate)

  This can be useful for a number of reasons, such as generating a bulk kubeconfig
  file on-the-fly for CI/CD pipelines, or for generating a kubeconfig file for a
  specific cluster in a specific subscription.



  `akskubeconfig` is implemented in Python. Assuming you have a
  Python interpreter and pip installed you should be able to install with:

  ```shell
  pip install akskubeconfig
  ```

  > This has not yet been widely tested and is currently in a _works on my
  machine_ state.



  The simplest usage is to just run the tool and specify an output file for it to write to:

  ```shell
  akskubeconfig -o ~/.kube/config
  ```

  This will generate a set of schemas in a `schemas` directory. The tool
  provides a number of options to modify the output:

  ```shell
  akskubeconfig --help
  usage: akskubeconfig [-h] [-v] [-s SUBSCRIPTIONS] [--client-id CLIENT_ID] [--tenant-id TENANT_ID] [--client-secret CLIENT_SECRET] [--certificate-path CERTIFICATE_PATH]
                       [--server-id SERVER_ID] [--environment ENVIRONMENT]
                       [--default | --device-flow | --interactive | --sp-secret | --sp-pfx | --managed-identity | --managed-identity-id | --az-cli | --workload-identity  --json | --yaml]
                       [-m MAX_THREADS] [-o OUTFILE]

  options:
    -h, --help            show this help message and exit
    -v, --verbose         Increase output verbosity
    -s SUBSCRIPTIONS, --subscriptions SUBSCRIPTIONS
                          A comma separated list of subscription to use. If omitted, all subscriptions will be checked.
    --client-id CLIENT_ID
                          Override the client id to write into the kubeconfig. Only applicable if required by the selected authentication flow.
    --tenant-id TENANT_ID
                          Override the tenant id to write into the kubeconfig. Only applicable if required by the selected authentication flow.
    --client-secret CLIENT_SECRET
                          Override the client secret to write into the kubeconfig. Only applicable if required by the selected authentication flow.
    --certificate-path CERTIFICATE_PATH
                          Override the certificate path to write into the kubeconfig. Only applicable if required by the selected authentication flow.
    --server-id SERVER_ID
                          Override the server id to write into the kubeconfig.
    --environment ENVIRONMENT
                          Override the environment to write into the kubeconfig.
    --default             Use the default flow authenticate within the generated kubeconfig (default)
    --device-flow         Use device flow to authenticate within the generated kubeconfig
    --interactive         Use the interactive web browser flow to authenticate within the generated kubeconfig
    --sp-secret           Use a service principal secret to authenticate within the generated kubeconfig
    --sp-pfx              Use a service principal pfx certificate to authenticate within the generated kubeconfig
    --managed-identity    Use a managed identity to authenticate within the generated kubeconfig
    --managed-identity-id
                          Use a managed identity to authenticate within the generated kubeconfig
    --az-cli              Use the Azure CLI to authenticate within the generated kubeconfig
    --workload-identity   Use a workload identity to authenticate within the generated kubeconfig
    --json                Output as JSON
    --yaml                Output as YAML (default)
    -m MAX_THREADS, --max-threads MAX_THREADS
                          Maximum number of threads to use
    -o OUTFILE, --outfile OUTFILE
                          Output file
  ```

  <!-- Include: footer.tmpl -->


pkgId: c124e1c25252c03d76e97c6d253282068a414090341a8f90033182e42bebfa25
name: python-aktools
arch: src
version: 0.0.87
epoch: 0
release: 1
summary: AKTools is a tool for AKShare HTTP API!
url: https://github.com/akfamily/aktools
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aktools-0.0.87-1.src.rpm
checksum_type: sha256
description:
  **《AKShare-初阶-使用教学》视频课程已经上线，本课程手把手讲解 AKShare 和 AKTools 的环境配置和安装使用，还包含了众多衍生知识，[详情点击链接](https://zmj.xet.tech/s/wck86)! Tips：加入 AKShare VIP 答疑群可以免费获取该视频课程。**

  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/akshare.svg)](https://pypi.org/project/akshare/)
  [![PyPI](https://img.shields.io/pypi/v/aktools.svg)](https://pypi.org/project/aktools/)
  [![Downloads](https://pepy.tech/badge/aktools)](https://pepy.tech/project/aktools)
  [![Documentation Status](https://readthedocs.org/projects/aktools/badge/)](https://aktools.akfamily.xyz/)
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  [![aktools](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/aktools)
  [![Actions Status](https://github.com/akfamily/aktools/workflows/build/badge.svg)](https://github.com/akfamily/aktools/actions)
  [![MIT Licence](https://img.shields.io/badge/license-MIT-blue)](https://github.com/akfamily/aktools/blob/master/LICENSE)
  [![](https://img.shields.io/github/forks/akfamily/aktools)](https://github.com/akfamily/aktools)
  [![](https://img.shields.io/github/stars/akfamily/aktools)](https://github.com/akfamily/aktools)
  [![](https://img.shields.io/github/issues/akfamily/aktools)](https://github.com/akfamily/aktools)
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)



  AKTools is a package of HTTP API for AKShare! It depends on AKShare, FastAPI and Typer.

  [AKTools](https://github.com/akfamily/aktools) 是一款用于快速搭建 [AKShare](https://github.com/akfamily/akshare) HTTP API 的工具，通过 [AKTools](https://github.com/akfamily/aktools)
  可以利用一行命令来启动 HTTP 服务，从而让原本专属服务于 Python 用户的开源财经数据接口库 [AKShare](https://github.com/akfamily/akshare) 的使用
  突破编程语言的限制。无论您使用的是 C/C++、Java、Go、Rust、Ruby、PHP、JavaScript、R、Matlab、Stata 等编程语言或软件都可以快速、轻松获取财经数据，助力您更好地展开研究和开发工作。

  **[AKTools 中文文档](https://aktools.readthedocs.io/)**



  ```shell
  pip install aktools
  ```



  ```shell
  pip install aktools --upgrade -i https://pypi.org/simple  # AKTools's version should great than 0.0.70
  ```



  [Please visit AKShare's Documentation](https://akshare.akfamily.xyz/)



  [Please visit FastAPI's Documentation](https://fastapi.tiangolo.com/)



  [Please visit Typer's Documentation](https://typer.tiangolo.com/)



  1. just type the cmd/bash command: `python -m aktools`
  2. then type `http://127.0.0.1:8080/` in your Chrome and you can fetch your homepage and more information
  3. if you just want to test data api, you can type `http://127.0.0.1:8080/api/public/stock_zh_a_hist` in your Chrome
  4. if you want to set parameter for API, then you just type like `http://127.0.0.1:8080/api/public/stock_zh_a_hist?symbol=600000`



  AKTools set a simple homepage for user to provide simple reference information. When you set up your
  environment and deploy your local application, then you can type `http:127.0.0.1:8080` in your browser.
  We are developing more functions now, please pay more attention!





  ![](https://dss-1252952517.cos.ap-chengdu.myqcloud.com/image-20211209235248006.png)



  R-Program

  ```
  library(RCurl)  # 需要先安装该包
  library(jsonlite)  # 需要先安装该包
  options (warn = -1)  # 该行有助于在无参数请求时去掉 warning 信息

  temp_df <-
    getForm(
      uri = 'http://127.0.0.1:8080/api/public/stock_zh_a_hist',  # 此处的 http://127.0.0.1:8080 需要替换为您定义的地址和端口
      symbol = '000001',
      period = 'daily',
      start_date = '20211109',
      end_date = '20211209',
      adjust = 'hfq',
      .encoding = "utf-8"
    )
  inner_df <- fromJSON(temp_df)
  inner_df
  ```

  R-Result

  ```shell
           日期    开盘    收盘    最高    最低      成交量     成交额    振幅  涨跌幅  涨跌额 换手率
  1  2021-11-09 3009.83 3017.96 3037.46 2974.07 1240573 2163193120 2.11   0.60  17.88   0.64
  2  2021-11-10 3006.58 2996.83 3008.20 2957.82 1220851 2109735152 1.67  -0.70 -21.13   0.63
  3  2021-11-11 2988.70 3151.23 3164.23 2983.82 2084729 3752413856 6.02   5.15 154.40   1.07
  4  2021-11-12 3144.73 3138.23 3196.74 3112.22  957546 1753072720 2.68  -0.41 -13.00   0.49
  5  2021-11-15 3151.23 3164.23 3196.74 3126.85  655090 1203764096 2.23   0.83  26.00   0.34
  6  2021-11-16 3152.85 3130.10 3182.11 3121.97  601110 1099113408 1.90  -1.08 -34.13   0.31
  7  2021-11-17 3118.72 3112.22 3143.10 3091.09  664640 1203859184 1.66  -0.57 -17.88   0.34
  8  2021-11-18 3108.97 3061.84 3113.85 3050.46  799844 1430058304 2.04  -1.62 -50.38   0.41
  9  2021-11-19 3061.84 3118.72 3133.35 3045.58  786372 1414506384 2.87   1.86  56.88   0.41
  10 2021-11-22 3099.22 3113.85 3134.97 3078.09  738618 1337768176 1.82  -0.16  -4.87   0.38
  11 2021-11-23 3112.22 3074.84 3151.23 3042.33 1235978 2213817584 3.50  -1.25 -39.01   0.64
  12 2021-11-24 3056.96 3073.21 3086.22 3039.08  741311 1316774400 1.53  -0.05  -1.63   0.38
  13 2021-11-25 3052.09 3042.33 3060.21 3034.21  603533 1068221312 0.85  -1.00 -30.88   0.31
  14 2021-11-26 3032.58 3026.08 3040.71 3016.33  694500 1219937312 0.80  -0.53 -16.25   0.36
  15 2021-11-29 2998.45 3014.70 3024.46 2990.33  512595  895105984 1.13  -0.38 -11.38   0.26
  16 2021-11-30 3019.58 3003.33 3042.33 2988.70  733616 1280384560 1.78  -0.38 -11.37   0.38
  17 2021-12-01 3001.70 3035.83 3056.96 2991.95  706925 1243666848 2.16   1.08  32.50   0.36
  18 2021-12-02 3032.58 3027.71 3063.46 2991.95  994798 1749164560 2.36  -0.27  -8.12   0.51
  19 2021-12-03 3035.83 3037.46 3045.58 2998.45  707600 1242375056 1.56   0.32   9.75   0.36
  20 2021-12-06 3069.96 3110.60 3185.36 3061.84 2145625 3896385168 4.07   2.41  73.14   1.11
  21 2021-12-07 3143.10 3169.11 3203.24 3118.72 1616444 2979968976 2.72   1.88  58.51   0.83
  22 2021-12-08 3167.48 3170.73 3183.73 3120.35  980281 1798691056 2.00   0.05   1.62   0.51
  23 2021-12-09 3173.98 3208.11 3266.62 3154.48 1455887 2726663440 3.54   1.18  37.38   0.75
  ```



  MATLAB-Program

  ```
  api = 'http://127.0.0.1:8080/api/public/';
  url = [api 'stock_zh_a_hist'];
  options = weboptions('ContentType','json', 'CharacterEncoding', 'utf-8');
  data = webread(url, options, symbol = '000001', period = 'daily', start_date = '20211109', end_date = '20211209', adjust = 'hfq');
  data % 由于 MATLAB 无法显示中文字段名，请自行修改为英文字段，参考链接：https://iso2mesh.sourceforge.net/cgi-bin/index.cgi?jsonlab/Doc/Examples
  ```

  MATLAB-Result

  ```shell
  '2021-11-09'	3009.83000000000	3017.96000000000	3037.46000000000	2974.07000000000	1240573	2163193120.00000	2.11000000000000	0.600000000000000	17.8800000000000	0.640000000000000
  '2021-11-10'	3006.58000000000	2996.83000000000	3008.20000000000	2957.82000000000	1220851	2109735152.00000	1.67000000000000	-0.700000000000000	-21.1300000000000	0.630000000000000
  '2021-11-11'	2988.70000000000	3151.23000000000	3164.23000000000	2983.82000000000	2084729	3752413856.00000	6.02000000000000	5.15000000000000	154.400000000000	1.07000000000000
  '2021-11-12'	3144.73000000000	3138.23000000000	3196.74000000000	3112.22000000000	957546	1753072720.00000	2.68000000000000	-0.410000000000000	-13	0.490000000000000
  '2021-11-15'	3151.23000000000	3164.23000000000	3196.74000000000	3126.85000000000	655090	1203764096.00000	2.23000000000000	0.830000000000000	26	0.340000000000000
  '2021-11-16'	3152.85000000000	3130.10000000000	3182.11000000000	3121.97000000000	601110	1099113408.00000	1.90000000000000	-1.08000000000000	-34.1300000000000	0.310000000000000
  '2021-11-17'	3118.72000000000	3112.22000000000	3143.10000000000	3091.09000000000	664640	1203859184.00000	1.66000000000000	-0.570000000000000	-17.8800000000000	0.340000000000000
  '2021-11-18'	3108.97000000000	3061.84000000000	3113.85000000000	3050.46000000000	799844	1430058304.00000	2.04000000000000	-1.62000000000000	-50.3800000000000	0.410000000000000
  '2021-11-19'	3061.84000000000	3118.72000000000	3133.35000000000	3045.58000000000	786372	1414506384.00000	2.87000000000000	1.86000000000000	56.8800000000000	0.410000000000000
  '2021-11-22'	3099.22000000000	3113.85000000000	3134.97000000000	3078.09000000000	738618	1337768176.00000	1.82000000000000	-0.160000000000000	-4.87000000000000	0.380000000000000
  '2021-11-23'	3112.22000000000	3074.84000000000	3151.23000000000	3042.33000000000	1235978	2213817584.00000	3.50000000000000	-1.25000000000000	-39.0100000000000	0.640000000000000
  '2021-11-24'	3056.96000000000	3073.21000000000	3086.22000000000	3039.08000000000	741311	1316774400.00000	1.53000000000000	-0.0500000000000000	-1.63000000000000	0.380000000000000
  '2021-11-25'	3052.09000000000	3042.33000000000	3060.21000000000	3034.21000000000	603533	1068221312.00000	0.850000000000000	-1	-30.8800000000000	0.310000000000000
  '2021-11-26'	3032.58000000000	3026.08000000000	3040.71000000000	3016.33000000000	694500	1219937312.00000	0.800000000000000	-0.530000000000000	-16.2500000000000	0.360000000000000
  '2021-11-29'	2998.45000000000	3014.70000000000	3024.46000000000	2990.33000000000	512595	895105984	1.13000000000000	-0.380000000000000	-11.3800000000000	0.260000000000000
  '2021-11-30'	3019.58000000000	3003.33000000000	3042.33000000000	2988.70000000000	733616	1280384560.00000	1.78000000000000	-0.380000000000000	-11.3700000000000	0.380000000000000
  '2021-12-01'	3001.70000000000	3035.83000000000	3056.96000000000	2991.95000000000	706925	1243666848.00000	2.16000000000000	1.08000000000000	32.5000000000000	0.360000000000000
  '2021-12-02'	3032.58000000000	3027.71000000000	3063.46000000000	2991.95000000000	994798	1749164560.00000	2.36000000000000	-0.270000000000000	-8.12000000000000	0.510000000000000
  '2021-12-03'	3035.83000000000	3037.46000000000	3045.58000000000	2998.45000000000	707600	1242375056.00000	1.56000000000000	0.320000000000000	9.75000000000000	0.360000000000000
  '2021-12-06'	3069.96000000000	3110.60000000000	3185.36000000000	3061.84000000000	2145625	3896385168.00000	4.07000000000000	2.41000000000000	73.1400000000000	1.11000000000000
  '2021-12-07'	3143.10000000000	3169.11000000000	3203.24000000000	3118.72000000000	1616444	2979968976.00000	2.72000000000000	1.88000000000000	58.5100000000000	0.830000000000000
  '2021-12-08'	3167.48000000000	3170.73000000000	3183.73000000000	3120.35000000000	980281	1798691056.00000	2	0.0500000000000000	1.62000000000000	0.510000000000000
  '2021-12-09'	3173.98000000000	3208.11000000000	3266.62000000000	3154.48000000000	1455887	2726663440.00000	3.54000000000000	1.18000000000000	37.3800000000000	0.750000000000000
  ```



  Rust-Program

  ```rust
  use reqwest::blocking;
  use serde_json::Value;
  use std::collections::HashMap;

  // 定义常量，用于存储API的URL。
  const URL: &str = "http://127.0.0.1:8080/api/public";

  /// 获取股票数据的函数。
  ///
  /// # 参数
  /// * `symbol` - 股票代码。
  /// * `period` - 时间周期。
  /// * `start_date` - 开始日期。
  /// * `end_date` - 结束日期。
  /// * `adjust` - 复权类型。
  ///
  /// # 返回值
  /// 返回一个Result，如果成功返回空的Ok，如果失败返回错误。
  fn get_data(
      endpoint: &str,
      symbol: &str,
      period: &str,
      start_date: &str,
      end_date: &str,
      adjust: &str,
  ) -> Result<(), Box<dyn std::error::Error>> {
      // 初始化查询参数，使用提供的函数参数。
      let params = HashMap::from([
          ("symbol", symbol),
          ("period", period),
          ("start_date", start_date),
          ("end_date", end_date),
          ("adjust", adjust),
      ]);

      // 创建一个阻塞的HTTP客户端。
      let client = blocking::Client::new();
      // 构建HTTP GET请求，并将查询参数附加到请求上。
      let full_url = format!("{}/{}", URL, endpoint);
      let resp = client.get(full_url).query(&params).send()?;

      // 检查响应状态码是否表示成功。
      if resp.status().is_success() {
          // 解析响应体为JSON并打印。
          let stock_data_list: Value = resp.json()?;
          println!("{:#?}", stock_data_list);
      } else {
          // 如果响应不是成功的，则打印错误信息。
          eprintln!("请求失败，状态码为: {}", resp.status());
      }

      Ok(())
  }

  fn main() {
      // 调用`get_data`函数，并传递股票参数。
      // 如果出现错误，则打印错误信息。
      if let Err(e) = get_data("stock_zh_a_hist", "000001", "daily", "20240125", "20240127", "") {
          eprintln!("发生错误: {}", e);
      }
  }
  ```

  Rust-Result

  ```shell
  Array [
      Object {
          "开盘": Number(9.33),
          "成交量": Number(2162514),
          "成交额": Number(2037648413.07),
          "振幅": Number(2.89),
          "换手率": Number(1.11),
          "收盘": Number(9.5),
          "日期": String("2024-01-25T00:00:00.000"),
          "最低": Number(9.27),
          "最高": Number(9.54),
          "涨跌幅": Number(1.82),
          "涨跌额": Number(0.17),
      },
      Object {
          "开盘": Number(9.47),
          "成交量": Number(2272287),
          "成交额": Number(2172799799.01),
          "振幅": Number(2.42),
          "换手率": Number(1.17),
          "收盘": Number(9.62),
          "日期": String("2024-01-26T00:00:00.000"),
          "最低": Number(9.44),
          "最高": Number(9.67),
          "涨跌幅": Number(1.26),
          "涨跌额": Number(0.12),
      },
  ]
  ```


pkgId: ec4594c253147dbbfbfe4e4f3980fa89945ea2b602f8d9a8f41c92e3e18ff8dc
name: python-aktools
arch: src
version: 0.0.88
epoch: 0
release: 1
summary: AKTools is a tool for AKShare HTTP API!
url: https://github.com/akfamily/aktools
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aktools-0.0.88-1.src.rpm
checksum_type: sha256
description:
  **《AKShare-初阶-使用教学》视频课程已经上线，本课程手把手讲解 AKShare 和 AKTools 的环境配置和安装使用，还包含了众多衍生知识，[详情点击链接](https://zmj.xet.tech/s/wck86)!
  Tips：加入 AKShare VIP 答疑群可以免费获取该视频课程。**

  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/akshare.svg)](https://pypi.org/project/akshare/)
  [![PyPI](https://img.shields.io/pypi/v/aktools.svg)](https://pypi.org/project/aktools/)
  [![Downloads](https://pepy.tech/badge/aktools)](https://pepy.tech/project/aktools)
  [![Documentation Status](https://readthedocs.org/projects/aktools/badge/)](https://aktools.akfamily.xyz/)
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  [![aktools](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/aktools)
  [![Actions Status](https://github.com/akfamily/aktools/workflows/build/badge.svg)](https://github.com/akfamily/aktools/actions)
  [![MIT Licence](https://img.shields.io/badge/license-MIT-blue)](https://github.com/akfamily/aktools/blob/master/LICENSE)
  [![](https://img.shields.io/github/forks/akfamily/aktools)](https://github.com/akfamily/aktools)
  [![](https://img.shields.io/github/stars/akfamily/aktools)](https://github.com/akfamily/aktools)
  [![](https://img.shields.io/github/issues/akfamily/aktools)](https://github.com/akfamily/aktools)
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)



  AKTools is a package of HTTP API for AKShare! It depends on AKShare, FastAPI and Typer.

  [AKTools](https://github.com/akfamily/aktools) 是一款用于快速搭建 [AKShare](https://github.com/akfamily/akshare) HTTP API 的工具，通过 [AKTools](https://github.com/akfamily/aktools)
  可以利用一行命令来启动 HTTP 服务，从而让原本专属服务于 Python 用户的开源财经数据接口库 [AKShare](https://github.com/akfamily/akshare) 的使用
  突破编程语言的限制。无论您使用的是 C/C++、Java、Go、Rust、Ruby、PHP、JavaScript、R、Matlab、Stata 等编程语言或软件都可以快速、轻松获取财经数据，助力您更好地展开研究和开发工作。

  **[AKTools 中文文档](https://aktools.readthedocs.io/)**



  ```shell
  pip install aktools
  ```



  ```shell
  pip install aktools --upgrade -i https://pypi.org/simple  # AKTools's version should great than 0.0.70
  ```



  [Please visit AKShare's Documentation](https://akshare.akfamily.xyz/)



  [Please visit FastAPI's Documentation](https://fastapi.tiangolo.com/)



  [Please visit Typer's Documentation](https://typer.tiangolo.com/)



  1. just type the cmd/bash command: `python -m aktools`
  2. then type `http://127.0.0.1:8080/` in your Chrome and you can fetch your homepage and more information
  3. if you just want to test data api, you can type `http://127.0.0.1:8080/api/public/stock_zh_a_hist` in your Chrome
  4. if you want to set parameter for API, then you just type like `http://127.0.0.1:8080/api/public/stock_zh_a_hist?symbol=600000`



  AKTools set a simple homepage for user to provide simple reference information. When you set up your
  environment and deploy your local application, then you can type `http:127.0.0.1:8080` in your browser.
  We are developing more functions now, please pay more attention!





  ![](https://dss-1252952517.cos.ap-chengdu.myqcloud.com/image-20211209235248006.png)



  R-Program

  ```
  library(RCurl)  # 需要先安装该包
  library(jsonlite)  # 需要先安装该包
  options (warn = -1)  # 该行有助于在无参数请求时去掉 warning 信息

  temp_df <-
    getForm(
      uri = 'http://127.0.0.1:8080/api/public/stock_zh_a_hist',  # 此处的 http://127.0.0.1:8080 需要替换为您定义的地址和端口
      symbol = '000001',
      period = 'daily',
      start_date = '20211109',
      end_date = '20211209',
      adjust = 'hfq',
      .encoding = "utf-8"
    )
  inner_df <- fromJSON(temp_df)
  inner_df
  ```

  R-Result

  ```shell
           日期    开盘    收盘    最高    最低      成交量     成交额    振幅  涨跌幅  涨跌额 换手率
  1  2021-11-09 3009.83 3017.96 3037.46 2974.07 1240573 2163193120 2.11   0.60  17.88   0.64
  2  2021-11-10 3006.58 2996.83 3008.20 2957.82 1220851 2109735152 1.67  -0.70 -21.13   0.63
  3  2021-11-11 2988.70 3151.23 3164.23 2983.82 2084729 3752413856 6.02   5.15 154.40   1.07
  4  2021-11-12 3144.73 3138.23 3196.74 3112.22  957546 1753072720 2.68  -0.41 -13.00   0.49
  5  2021-11-15 3151.23 3164.23 3196.74 3126.85  655090 1203764096 2.23   0.83  26.00   0.34
  6  2021-11-16 3152.85 3130.10 3182.11 3121.97  601110 1099113408 1.90  -1.08 -34.13   0.31
  7  2021-11-17 3118.72 3112.22 3143.10 3091.09  664640 1203859184 1.66  -0.57 -17.88   0.34
  8  2021-11-18 3108.97 3061.84 3113.85 3050.46  799844 1430058304 2.04  -1.62 -50.38   0.41
  9  2021-11-19 3061.84 3118.72 3133.35 3045.58  786372 1414506384 2.87   1.86  56.88   0.41
  10 2021-11-22 3099.22 3113.85 3134.97 3078.09  738618 1337768176 1.82  -0.16  -4.87   0.38
  11 2021-11-23 3112.22 3074.84 3151.23 3042.33 1235978 2213817584 3.50  -1.25 -39.01   0.64
  12 2021-11-24 3056.96 3073.21 3086.22 3039.08  741311 1316774400 1.53  -0.05  -1.63   0.38
  13 2021-11-25 3052.09 3042.33 3060.21 3034.21  603533 1068221312 0.85  -1.00 -30.88   0.31
  14 2021-11-26 3032.58 3026.08 3040.71 3016.33  694500 1219937312 0.80  -0.53 -16.25   0.36
  15 2021-11-29 2998.45 3014.70 3024.46 2990.33  512595  895105984 1.13  -0.38 -11.38   0.26
  16 2021-11-30 3019.58 3003.33 3042.33 2988.70  733616 1280384560 1.78  -0.38 -11.37   0.38
  17 2021-12-01 3001.70 3035.83 3056.96 2991.95  706925 1243666848 2.16   1.08  32.50   0.36
  18 2021-12-02 3032.58 3027.71 3063.46 2991.95  994798 1749164560 2.36  -0.27  -8.12   0.51
  19 2021-12-03 3035.83 3037.46 3045.58 2998.45  707600 1242375056 1.56   0.32   9.75   0.36
  20 2021-12-06 3069.96 3110.60 3185.36 3061.84 2145625 3896385168 4.07   2.41  73.14   1.11
  21 2021-12-07 3143.10 3169.11 3203.24 3118.72 1616444 2979968976 2.72   1.88  58.51   0.83
  22 2021-12-08 3167.48 3170.73 3183.73 3120.35  980281 1798691056 2.00   0.05   1.62   0.51
  23 2021-12-09 3173.98 3208.11 3266.62 3154.48 1455887 2726663440 3.54   1.18  37.38   0.75
  ```



  MATLAB-Program

  ```
  api = 'http://127.0.0.1:8080/api/public/';
  url = [api 'stock_zh_a_hist'];
  options = weboptions('ContentType','json', 'CharacterEncoding', 'utf-8');
  data = webread(url, options, symbol = '000001', period = 'daily', start_date = '20211109', end_date = '20211209', adjust = 'hfq');
  data % 由于 MATLAB 无法显示中文字段名，请自行修改为英文字段，参考链接：https://iso2mesh.sourceforge.net/cgi-bin/index.cgi?jsonlab/Doc/Examples
  ```

  MATLAB-Result

  ```shell
  '2021-11-09'	3009.83000000000	3017.96000000000	3037.46000000000	2974.07000000000	1240573	2163193120.00000	2.11000000000000	0.600000000000000	17.8800000000000	0.640000000000000
  '2021-11-10'	3006.58000000000	2996.83000000000	3008.20000000000	2957.82000000000	1220851	2109735152.00000	1.67000000000000	-0.700000000000000	-21.1300000000000	0.630000000000000
  '2021-11-11'	2988.70000000000	3151.23000000000	3164.23000000000	2983.82000000000	2084729	3752413856.00000	6.02000000000000	5.15000000000000	154.400000000000	1.07000000000000
  '2021-11-12'	3144.73000000000	3138.23000000000	3196.74000000000	3112.22000000000	957546	1753072720.00000	2.68000000000000	-0.410000000000000	-13	0.490000000000000
  '2021-11-15'	3151.23000000000	3164.23000000000	3196.74000000000	3126.85000000000	655090	1203764096.00000	2.23000000000000	0.830000000000000	26	0.340000000000000
  '2021-11-16'	3152.85000000000	3130.10000000000	3182.11000000000	3121.97000000000	601110	1099113408.00000	1.90000000000000	-1.08000000000000	-34.1300000000000	0.310000000000000
  '2021-11-17'	3118.72000000000	3112.22000000000	3143.10000000000	3091.09000000000	664640	1203859184.00000	1.66000000000000	-0.570000000000000	-17.8800000000000	0.340000000000000
  '2021-11-18'	3108.97000000000	3061.84000000000	3113.85000000000	3050.46000000000	799844	1430058304.00000	2.04000000000000	-1.62000000000000	-50.3800000000000	0.410000000000000
  '2021-11-19'	3061.84000000000	3118.72000000000	3133.35000000000	3045.58000000000	786372	1414506384.00000	2.87000000000000	1.86000000000000	56.8800000000000	0.410000000000000
  '2021-11-22'	3099.22000000000	3113.85000000000	3134.97000000000	3078.09000000000	738618	1337768176.00000	1.82000000000000	-0.160000000000000	-4.87000000000000	0.380000000000000
  '2021-11-23'	3112.22000000000	3074.84000000000	3151.23000000000	3042.33000000000	1235978	2213817584.00000	3.50000000000000	-1.25000000000000	-39.0100000000000	0.640000000000000
  '2021-11-24'	3056.96000000000	3073.21000000000	3086.22000000000	3039.08000000000	741311	1316774400.00000	1.53000000000000	-0.0500000000000000	-1.63000000000000	0.380000000000000
  '2021-11-25'	3052.09000000000	3042.33000000000	3060.21000000000	3034.21000000000	603533	1068221312.00000	0.850000000000000	-1	-30.8800000000000	0.310000000000000
  '2021-11-26'	3032.58000000000	3026.08000000000	3040.71000000000	3016.33000000000	694500	1219937312.00000	0.800000000000000	-0.530000000000000	-16.2500000000000	0.360000000000000
  '2021-11-29'	2998.45000000000	3014.70000000000	3024.46000000000	2990.33000000000	512595	895105984	1.13000000000000	-0.380000000000000	-11.3800000000000	0.260000000000000
  '2021-11-30'	3019.58000000000	3003.33000000000	3042.33000000000	2988.70000000000	733616	1280384560.00000	1.78000000000000	-0.380000000000000	-11.3700000000000	0.380000000000000
  '2021-12-01'	3001.70000000000	3035.83000000000	3056.96000000000	2991.95000000000	706925	1243666848.00000	2.16000000000000	1.08000000000000	32.5000000000000	0.360000000000000
  '2021-12-02'	3032.58000000000	3027.71000000000	3063.46000000000	2991.95000000000	994798	1749164560.00000	2.36000000000000	-0.270000000000000	-8.12000000000000	0.510000000000000
  '2021-12-03'	3035.83000000000	3037.46000000000	3045.58000000000	2998.45000000000	707600	1242375056.00000	1.56000000000000	0.320000000000000	9.75000000000000	0.360000000000000
  '2021-12-06'	3069.96000000000	3110.60000000000	3185.36000000000	3061.84000000000	2145625	3896385168.00000	4.07000000000000	2.41000000000000	73.1400000000000	1.11000000000000
  '2021-12-07'	3143.10000000000	3169.11000000000	3203.24000000000	3118.72000000000	1616444	2979968976.00000	2.72000000000000	1.88000000000000	58.5100000000000	0.830000000000000
  '2021-12-08'	3167.48000000000	3170.73000000000	3183.73000000000	3120.35000000000	980281	1798691056.00000	2	0.0500000000000000	1.62000000000000	0.510000000000000
  '2021-12-09'	3173.98000000000	3208.11000000000	3266.62000000000	3154.48000000000	1455887	2726663440.00000	3.54000000000000	1.18000000000000	37.3800000000000	0.750000000000000
  ```



  Rust-Program

  ```rust
  use reqwest::blocking;
  use serde_json::Value;
  use std::collections::HashMap;

  // 定义常量，用于存储API的URL。
  const URL: &str = "http://127.0.0.1:8080/api/public";

  /// 获取股票数据的函数。
  ///
  /// # 参数
  /// * `symbol` - 股票代码。
  /// * `period` - 时间周期。
  /// * `start_date` - 开始日期。
  /// * `end_date` - 结束日期。
  /// * `adjust` - 复权类型。
  ///
  /// # 返回值
  /// 返回一个Result，如果成功返回空的Ok，如果失败返回错误。
  fn get_data(
      endpoint: &str,
      symbol: &str,
      period: &str,
      start_date: &str,
      end_date: &str,
      adjust: &str,
  ) -> Result<(), Box<dyn std::error::Error>> {
      // 初始化查询参数，使用提供的函数参数。
      let params = HashMap::from([
          ("symbol", symbol),
          ("period", period),
          ("start_date", start_date),
          ("end_date", end_date),
          ("adjust", adjust),
      ]);

      // 创建一个阻塞的HTTP客户端。
      let client = blocking::Client::new();
      // 构建HTTP GET请求，并将查询参数附加到请求上。
      let full_url = format!("{}/{}", URL, endpoint);
      let resp = client.get(full_url).query(&params).send()?;

      // 检查响应状态码是否表示成功。
      if resp.status().is_success() {
          // 解析响应体为JSON并打印。
          let stock_data_list: Value = resp.json()?;
          println!("{:#?}", stock_data_list);
      } else {
          // 如果响应不是成功的，则打印错误信息。
          eprintln!("请求失败，状态码为: {}", resp.status());
      }

      Ok(())
  }

  fn main() {
      // 调用`get_data`函数，并传递股票参数。
      // 如果出现错误，则打印错误信息。
      if let Err(e) = get_data("stock_zh_a_hist", "000001", "daily", "20240125", "20240127", "") {
          eprintln!("发生错误: {}", e);
      }
  }
  ```

  Rust-Result

  ```shell
  Array [
      Object {
          "开盘": Number(9.33),
          "成交量": Number(2162514),
          "成交额": Number(2037648413.07),
          "振幅": Number(2.89),
          "换手率": Number(1.11),
          "收盘": Number(9.5),
          "日期": String("2024-01-25T00:00:00.000"),
          "最低": Number(9.27),
          "最高": Number(9.54),
          "涨跌幅": Number(1.82),
          "涨跌额": Number(0.17),
      },
      Object {
          "开盘": Number(9.47),
          "成交量": Number(2272287),
          "成交额": Number(2172799799.01),
          "振幅": Number(2.42),
          "换手率": Number(1.17),
          "收盘": Number(9.62),
          "日期": String("2024-01-26T00:00:00.000"),
          "最低": Number(9.44),
          "最高": Number(9.67),
          "涨跌幅": Number(1.26),
          "涨跌额": Number(0.12),
      },
  ]
  ```


pkgId: 91c8e3566248fff4a3a6d29876736a59053dd73f71baff6f1803d356bcba29ef
name: python-al2var
arch: src
version: 1.0.0
epoch: 0
release: 1
url: https://github.com/jrhendrix/al2var
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-al2var-1.0.0-1.src.rpm
checksum_type: sha256
summary:
  Identify and calculate find variant rate between a bacterial genome sequence and either paired-end reads or another genome sequence

description:
  al2var identifies variants and caclulates the variant rate between a bacterial genome sequence and either paired-end reads or another genome sequence. al2var can also estimate the number of errors in the assembly.


  The primary purpose of al2var is to align either paired-end reads or a genome assembly to a given sequence. Al2var aligns the input using either Bowtie2 (paired-end reads) or minimap2 (genome sequence) then interprets the mappings to determine the number of variants and the variant rate.

  Al2var can also be used to estimate the number of errors in an assembly. It is recommended that high quality genome assemblies have fewer than 1 error per 100,000 bases (Chain, 2009).


  In reference-based error analysis, a sample is compared to a trusted representative of the same species to identify variants. Either genome could be used as the reference or the query for al2var, but the error rate will be normalized to the length of the reference. This application is not recommended for species that are diverse or that lack a sufficiently close and trusted representative sequence because true variants may be misinterpreted as errors.


  Errors could also be estimated without a species representative using the al2var bowtie2 mode, where paired-end reads are aligned to a given genome assembly and the variants are interpreted as errors. The paired-end approach to estimating errors requires that the genome and paired-end reads originated from the same sample. In addition, this method assumes that the consensus of multiple Illumina reads at a given location are correct. Though highly accurate, Illumina reads are not impervious to errors so this method is meant to provide an error estimate. To reduce the number of false positives, trim low quality ends off of Illumina reads and use higher read coverage.




  * Python 3.7+
  * bcftools v1.9+
  * samtools v1.6+
  * bowtie2 v2.2.5+
  * minimap2 v2.21+


  al2var was specifically tested with
  1. python v3.7.16, bcftools v1.9, samtools v1.6, bowtie2 v2.2.5, and minimap2 v2.21
  2. python v3.10.2, bcftools v1.14, samtools v1.14, bowtie2 v2.5.1, and minimap2 v2.24






  It is recomended by not required to install al2var in a conda environment.

  Creating a possible conda environment for al2var:
  ```
  conda create -n al2var python=3.10.2 bcftools=1.14 samtools=1.14 bowtie2=2.5.1 minimap2=2.24
  ```

  al2var is available on [PyPI](https://pypi.org/project/al2var/) and can be installed using pip.

  ```pip install al2var```

  OR clone from GitHub repository.


  al2var will create a directory to organize all of the generated output in various subdirectories.

  * Subdirectory `vcf/` harbors two files. The file ending in `000.vcf` is a sorted `vcf` that contains a record for each position in the reference sequence regardless of whether the query sequence had the same or a different genotype. If using the minimap2 mode, the genotype column will reflect the genotype of the query sequence at the mapped position. If using the bowtie2 mode, the genotype will reflect the consensus of the reads that mapped to that given position. The second file ending in `var.vcf` contains only the variants between the reference and the query sequence or input reads.
  * `report.txt` file reports on three stats: the alignment rate of the query to the reference, the number of variants between the input, and the variant rate. The variant rate is calculated from the reference length and normalized to 100kb.
  * Subdirectory `bam/` contains the alignment information in bam format. These files can be viewed in an interactive genome browser such as IGV. These files can be automatically deleted during runtime using the `--cleanup` flag.
  * The subdirectories `indexes/`, `mpileup/`, `sam/`, and `unconc/` contain various intermediary files that may be of interest to the user. Some of these files can be large (i.e. `.sam` files) and can be automatically deleted during runtime using the `--cleanup` flag.



  Regardless of mode, al2var requires a reference sequence in `fasta` format (any extension is acceptable).


  When using paired-end reads, al2var aligns the reads to the reference using bowtie2. The paired-end reads must be in `fastq` format and can be zipped or not.

  Basic usage:
  ```
  al2var bowtie2 -r reference.fasta -1 illumina_raeds_pair1.fastq.gz -2 illumina_reads_pair2.fastq.gz
  ```

  By default, the bowtie2 alignment step will use a seed sequence of 22bp and will not allow any mismatches in the seed sequence. The lenth of the seed sequence can be modified with the `-l` or `--length_seed` flag and the number of permitted mismatches can be increased to 1 using the `-n` or `--num_mismatch` flag. Increasing the number of possible mismatches in the seed sequence increases sensitivity but at the expense of runntime and it is not recommended to allow for more than 1 mismatch.

  To use a seed sequence of 30bp and allow 1 mismatch, use the following command:
  ```
  al2var bowtie2 -r reference.fasta -1 illumina_raeds_pair1.fastq.gz -2 illumina_reads_pair2.fastq.gz --length_seed 30 --num_mismatch 1
  ```


  When using a second genome, al2var aligns the entire sequence to the reference using minimap2. This second genome sequence must be in `fasta` format (with any extension) and can represent a genome assembly with any number of contigs or an excerpt of a genome.

  Basic usage:
  ```
  al2var minimap2 -r reference.fasta -q query.fasta
  ```


  By default al2var creates an output file named `out_al2var/` in the current working directory to organize the output files. The name of this file can be changed using the `-o` or `--output_directory` flag and the location can be changed using the `-p` or `--output_path` flag. The prefix of the report file can be specified using the `-s` or `--savename` flag.

  Since the intermediary files can be quite large and may not be of use to the user, al2var provides the user with two options for removing intermediary files during runtime. Use of the `-c` or `--cleanup` flag will remove all data within the directories `bam/`, `indexes/`, `mpileup/`, `sam/`, and `unconc/`. This action will leave the `al2var.log` and `report.txt` files along with the `vcf/` subdirectory. Additional use of the `-b` or `--keep_bam` flags will keep the `bam/` subdirectory rather than deleting it.


  Chain, P. S. G., et al. "Genome project standards in a new era of sequencing." Science 326.5950 (2009): 236-237.


pkgId: 711accdf0d9762c5fe1a0832167915012bac539f3f6040729b0c29964f9612eb
name: python-alabEBM
arch: src
version: 0.0.5
epoch: 0
release: 1
summary: Implementation of event-based models for degenerative diseases.
url: https://github.com/hongtaoh/alab-ebm
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alabEBM-0.0.5-1.src.rpm
checksum_type: sha256
description:
  This is the `python` package for implementing EBM.

  ```py
  pip install alabEBM
  ```



  To generate random data:

  ```py
  from alabEBM import generate
  import numpy as np
  S_ordering = np.array([
          'HIP-FCI', 'PCC-FCI', 'AB', 'P-Tau', 'MMSE', 'ADAS',
          'HIP-GMI', 'AVLT-Sum', 'FUS-GMI', 'FUS-FCI'
      ])

  real_theta_phi_file = '../alabEBM/data/real_theta_phi.json'

  js = [50, 100]
  rs = [0.1, 0.5]
  num_of_datasets_per_combination = 20

  generate(
      S_ordering,
      real_theta_phi_file,
      js,
      rs,
      num_of_datasets_per_combination,
      output_dir = 'data'
  )
  ```

  To get results:

  ```py
  from alabEBM import run_hard_kmeans
  from alabEBM import run_soft_kmeans
  from alabEBM import run_conjugate_priors

  data_file = '../alabEBM/data/25|50_10.csv'
  n_iter = 20
  n_shuffle = 2
  burn_in = 2
  thinning = 2
  heatmap_folder = 'heatmap'
  filename = '25_50_10_hk'
  temp_result_file = f'results/{filename}.json'

  run_hard_kmeans(
      data_file,
      n_iter,
      n_shuffle,
      burn_in,
      thinning,
      heatmap_folder,
      filename,
      temp_result_file,
  )

  filename = '25_50_10_sk'
  temp_result_file = f'results/{filename}.json'
  run_soft_kmeans(
      data_file,
      n_iter,
      n_shuffle,
      burn_in,
      thinning,
      heatmap_folder,
      filename,
      temp_result_file,
  )

  filename = '25_50_10_cp'
  temp_result_file = f'results/{filename}.json'
  run_conjugate_priors(
      data_file,
      n_iter,
      n_shuffle,
      burn_in,
      thinning,
      heatmap_folder,
      filename,
      temp_result_file,
  )
  ```


pkgId: 0bc5747e065feba3ac3e3eabc383611c7f80ecf6f3a68a2a823acacc0035b642
name: python-alabaster
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: A light, configurable Sphinx theme
url: https://alabaster.readthedocs.io/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alabaster-1.0.0-1.src.rpm
checksum_type: sha256
description:
  Alabaster is a visually (c)lean, responsive, configurable theme for the `Sphinx
  <https://www.sphinx-doc.org>`_ documentation system.
  It requires Python 3.10 or newer and Sphinx 6.2 or newer.
  It began as a third-party theme, and is still maintained separately, but as of
  Sphinx 1.3, Alabaster is an install-time dependency of Sphinx and is selected
  as the default theme.
  Live examples of this theme can be seen on `this project's own website
  <https://alabaster.readthedocs.io/>`_, `paramiko.org <https://www.paramiko.org>`_,
  `fabfile.org <https://www.fabfile.org>`_ and `pyinvoke.org <https://www.pyinvoke.org>`_.
  For more documentation, please see https://alabaster.readthedocs.io/.


pkgId: a546b4134732101da6943160f619c0e3d3a403444249322d93466602cc8fe96a
name: python-alamopy
arch: src
version: 0.2.2
epoch: 0
release: 1
summary: A package that is able to run ALAMO without the use of its GUI
url: https://pypi.org/project/alamopy/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alamopy-0.2.2-1.src.rpm
checksum_type: sha256
description:
  This is an interface for using ALAMO through a Python pip package.

  <h2> Preparation : </h2>

  <h4> for MacOS users: </h4>

  Download the ALAMO application from minlp.com, and unzip the package.

  <h4>  for Windows users: </h4>

  Download the ALAMO application from minlp.com, and install with the provided installer.

  <h2> Data to run ALAMO:</h2>

  Add the directory of the folder you have installed the pip package with your Python file to your PATH variable.

  Get your ALAMO license from minlp.com and place it inside the same folder as the Python file.

  Before running ALAMO, you should decide if you will provide your own data. If so, make sure your data are all in numpy arrays.
  Otherwise, select the appropriate simulator to run ALAMO.

  pip install alamopy\
  python\
  import numpy as np




  Test 1 to see if we can generate model for z = x\*\*2
  Most notably tests if the given example 1 works from ALAMO UI.

  from alamopy import almain as alamo\
  import numpy as np

  xdata = np.random.rand(11, 1)\
  xdata[:, 0] = [-5,-4,-3,-2,-1,0,1,2,3,4,5]

  zdata = xdata[:, 0]\*\*2

  opts = alamo.doalamo(xdata, zdata, linfcns = 1, logfcns = 1, sinfcns = 1, cosfns = 1, constant = 1, expfcns = 1, monomialpower = [2,3], keep_alm_file=True, keep_lst_file=True)

  <h2> Outputs from ALAMO </h2>

  You would get the result dictionary with a best-fitted function and other variables when calling ALAMO using this python interface.


pkgId: 7dda5abcf00905c85920f71a09bdb963bcb5da6f7950b64c5d47ad52b03e8ae5
name: python-alana
arch: src
version: 0.0.10
epoch: 0
release: 1
summary: Utilities for Alana, and maybe you too. Mostly geared toward LLM-heavy workflows.
url: https://github.com/alat-rights/alana-utilities
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alana-0.0.10-1.src.rpm
checksum_type: sha256
description:
  🎵 Note: I have been making new releases frequently. Make sure your package is up-to-date!

  ⚠️ Warning: This library is in active early development! No guarantees are made for backward compatibility. The library is NOT production-ready.


  This library is mostly designed for me (hence the name), but they might be helpful for you too!

  Here are some questions to ask yourself when considering whether to use this library:
  - Do you interact with LLMs? (Currently, only Anthropic LLMs are supported).
  - Do you value conciseness?
  - Are you writing **non-production prototype code**, where 1, occassional bugs and behavioral changes are acceptable, and 2, developer ergonomics are more important than performance?
    - Note: This library *strongly* assumes this use-case! e.g. `alana.gen` actually writes to the console by default (you can disable this with `loud=False`).
  - Do the features appeal to you?


  - Programming is too slow! This is doubly true when you're interacting with LLMs. By building nice utilities with sane defaults, I hope to speed up my (and maybe your) workflow.
  - I make trade-offs to speed up the developer experience:
    - I do not try hard to anticipate future upstream API changes. I'm also ok with breaking backward compatibility to make my functions more concise and more usable.
    - Usability > Principles. While I don't relish in it, I'm ok with breaking conventions designed for large production libraries if it speeds up programmers who use `alana`. The priority is to make the library intuitive and fast.
    - I don't try to serve every use-case.
  - Simplicity is key. This library strives to be readable and straightforward.


  (I tested these, and tried to make sure my code was idiomatic in all cases. Sorry if I messed up! Please report any issues to `h i ( a t ) [pip package name for this library] dot computer`.)

  Continuing a list of messages using Anthropic API (adapted from [Anthropic API documentation](https://docs.anthropic.com/claude/reference/messages_post):
  ```
  import anthropic
  from anthropic.types import MessageParam
  messages = [
    MessageParam(
      role="user",
      content="Hello, Claude!"
    ),
  ]
  output_text = anthropic.Anthropic().messages.create(
      model="claude-3-opus-20240229",
      max_tokens=1024,
      messages=messages
  ).content[0].text
  messages.append(
    MessageParam(
      role="assistant",
      content=output_text
    )
  )
  print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]
  ```

  Equivalent `alana` code:
  ```
  import alana
  messages = []
  alana.gen(user="Hello, Claude!", messages=messages, model="opus", max_tokens=1024)
  print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]
  ```

  Also, equivalent `alana` code thanks to defaults:
  ```
  import alana
  messages = []
  alana.gen(user="Hello, Claude!", messages=messages)
  print(messages)  # [{'role': 'user', 'content': 'Hello, Claude!'}, {'role': 'assistant', 'content': "Hello! It's nice to meet you. How are you doing today?"}]
  ```


pkgId: 5620fa28bf48351c47720bdfb6677cf3dd221e6a28107ba855f1a06bef739a5d
name: python-alanapy
arch: src
version: 1.3.2
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://github.com/orkahub/alanapy
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alanapy-1.3.2-1.src.rpm
checksum_type: sha256
description:
  Alana is a cloud-based platform that provides oil and gas companies with a suite of tools for managing their operations. The platform includes modules for data management, production forecasting, economic analysis, and more.

  - **Website:** https://alana.tech/open/accounts/login



  Some of the key features of Alana include:

  - Data management: Alana provides a centralized repository for all of your oil and gas data, including well data, production data, and economic data.

  - Production forecasting: Alana includes tools for forecasting oil and gas production, including decline curve analysis (DCA) and material balance analysis (MBA).

  - Economic analysis: Alana includes tools for analyzing the economic viability of oil and gas projects, including net present value (NPV) analysis and sensitivity analysis.

  - Collaboration: Alana allows teams to collaborate on projects and share data and analysis results.



  Some of the benefits of using Alana include:

  - Improved decision-making: Alana provides oil and gas companies with the data and analysis tools they need to make informed decisions about their operations.

  - Increased efficiency: Alana streamlines data management and analysis, reducing the time and effort required to perform tasks such as production forecasting and economic analysis.

  - Better collaboration: Alana allows teams to work together more effectively, improving communication and reducing the risk of errors and miscommunications.



  Alana is a powerful platform that provides oil and gas companies with the tools they need to manage their operations more effectively. Whether you're looking to improve your production forecasting, analyze the economic viability of a project, or simply streamline your data management processes, Alana has the features and benefits you need to succeed.



  The AlanaAPI is a Python library that provides a set of classes and methods to interact with the Alana platform. The library allows users to fetch data from the platform, run analysis, and create forecasts and scenarios.


pkgId: 1c6cb9c1b6a4668bb610af8944ed3c397a9b649bd1f3ec405c328475029eded7
name: python-alarmdecoder
arch: src
version: 1.13.11
epoch: 0
release: 1
url: http://github.com/nutechsoftware/alarmdecoder
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alarmdecoder-1.13.11-1.src.rpm
checksum_type: sha256
summary:
  Python interface for the AlarmDecoder (AD2) family of alarm devices which includes the AD2USB, AD2SERIAL and AD2PI.


pkgId: 2bdc41d52ff74d48579696ad43f05f6446bacd6be7f2448a150fefc73c7a78c5
name: python-alarmpy
arch: src
version: 1.5.4
epoch: 0
release: 1
summary: Pikud Ha'oref Alarm Tracking
url: https://github.com/yuvadm/alarmpy
rpm_license: GPLv3
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alarmpy-1.5.4-1.src.rpm
checksum_type: sha256
description:
  [![Build](https://github.com/yuvadm/alarmpy/workflows/Build/badge.svg)](https://github.com/yuvadm/alarmpy/actions/workflows/build.yml)
  [![PyPI](https://img.shields.io/pypi/v/alarmpy)](https://pypi.org/project/alarmpy/)

  A simple CLI tool for tracking Pikud Ha'oref alarms.

  Polls the unofficial API endpoint every second for incoming alarms. Prints active alarms as they occur. Prints routine messages once every 5 minutes by default.

  ![example.png](example.png)



  This tool is based on an unofficial API, and cannot be guaranteed to show correct or timely data. **Do not** use it if human life is at stake. **Do not** assume it shows you correct data. **Do not** assume it works properly, or even works at all. Always follow official guidelines and procedures published by [Pikud Ha'oref](https://www.oref.org.il/).

  Further fine-print covering the terms of use of this tool can be found in the [GPLv3 license](LICENSE) file.





  The easiest way to install is from PyPI with `pip`:

  ```bash
  $ pip install alarmpy
  ```

  You can then run the `alarmpy` executable directly:

  ```bash
  $ alarmpy --help
  ```



  For development usage it's recommended to clone the git repo and use `pipenv`:

  ```bash
  $ git clone https://github.com/yuvadm/alarmpy
  $ cd alarmpy
  $ pipenv sync -d
  $ pipenv run alarmpy
  ```



  For the default usage after installation, just run:

  ```bash
  $ alarmpy
  ```



  - Set the output language using `--language [en|he|ar|ru]`, this uses the official city and area name translations for Hebrew, Arabic, English and Russian.
  - In case of RTL issues in the terminal use `--reverse` to output all names in reverse.
  - Use `--highlight abc` in order to highlight any alarm which contains the string `abc`.



  The unofficial API is limited for use for Israeli-originating IPs only. In order to use alarmpy from outside Israel, users must route traffic through an Israeli exit point. The `HTTPS_PROXY` environment variable is supported for this use case.



  Advanced flags can be set as described in the usage:

  ```bash
  $ pipenv run alarmpy --help
  Usage: alarmpy.py [OPTIONS]

  Options:
    --language [en|he|ar|ru]  Alert language
    --highlight TEXT          String to search for and highlight in case of
                              alarm
    --reverse                 Reverse Hebrew/Arabic output for terminals with
                              RTL bugs
    --polling-delay INTEGER   Polling delay in seconds
    --routine-delay INTEGER   Routine message delay in seconds
    --alarm-id                Print alarm IDs
    --repeat-alarms           Do not suppress ongoing alarms
    --quiet                   Print only active alarms
    --desktop-notifications   Create push notifications on your desktop
                              notification center (currently only in Mac OS)
    --mqtt-server TEXT        Hostname / IP of MQTT server (optional)
    --mqtt-client-id TEXT     MQTT client identifier
    --mqtt-port INTEGER       Port for MQTT server
    --mqtt-topic TEXT         Topic on which to send MQTT messages
    --mqtt-filter TEXT        Payload value to filter before sending as a
                              message (semicolon separated)
    --output-test             Print a debug output and exit
    --help                    Show this message and exit.
  ```



  Integration with an MQTT server provides the ability to send custom MQTT messages for all or some of the alerts that are received. MQTT requires [`paho-mqtt`](https://pypi.org/project/paho-mqtt/) to be installed separately as an optional dependency.

  To enable, specify at least the following parameters via the command line:

  - `mqtt-server` - The MQTT Server hostname or IP, e.g. `localhost`
  - `mqtt-topic` - The MQTT topic to which the MQTT message will be sent, e.g. `alarmpy/zone`

  Additional optional parameters for MQTT integration are:

  - `mqtt-client-id` - The ID of the MQTT client used by alarmpy. This will be used to connect to the MQTT server. Default: `alarmPyClient`. This only needs to be change in case you plan to have more than one instance of alarmpy running
  - `mqtt-port` - The port on which the MQTT server is listening to. Default: `1883`



  When MQTT is enabled, all alerts are sent as separate messages on the specified topic. In case there is a desire to include only specific alert, use the `mqtt-filter` parameter to provide a semicolon separated list of substrings enclosed in double quotes. Each alert city and area will be checked against all filters, and only when a match is found, will an MQTT message be sent. For example: `--mqtt-filter "gaza;negev"`.



  [GPLv3](LICENSE)


pkgId: bc47cdbc40a04c22273f53f7a21b701ba3fc226d9c4e5da1e07d0a287415aee8
name: python-alaspo
arch: src
version: 0.2.6
epoch: 0
release: 1
summary: ALASPO: ASP + Large-Neighborhood Search
url: https://gitlab.tuwien.ac.at/kbs/BAI/alaspo
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alaspo-0.2.6-1.src.rpm
checksum_type: sha256
description:
  An (adaptive) LNS framework for the for ASP systems. Currently, the system only supports solvers based on [clingo](https://potassco.org/).



  It should work out-of-the-box in a conda env after running the following commands:
  ```
  conda create -n alaspo python=3.9
  conda activate alaspo
  conda install -c potassco clingo clingo-dl clingcon
  python -m pip install alaspo
  ```

  The command-line options of the problem-independent LNS can be shown as follows:
  ```
  alaspo -h
  ```

  Examples for portfolio config files can be found in the [git repository](https://gitlab.tuwien.ac.at/kbs/BAI/alaspo).


pkgId: f437e5ee9c7cb46b0193725115538d02923d46d03b2ccd2b167e0b9570dba8a4
name: python-alastria-auth
arch: src
version: 0.0.17
epoch: 0
release: 1
summary: A small alastria_auth app for django
url: https://pypi.org/project/alastria-auth/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alastria-auth-0.0.17-1.src.rpm
checksum_type: sha256
description:
  **Alastria ID authentication**

  - Descripción: Librería para poder autenticarse con alastria ID
  - URL: [https://pypi.org/project/alastria-auth/](https://pypi.org/project/alastria-auth/)
  - Requisitos: Django
  - Instalar: alastria-auth==0.0.9
  - Cómo usar:

  Añadir en settings.py:

  ```python
  INSTALLED_APPS = [
  ....
  "alastria_auth.apps.AlastriaAuthConfig"
  ]

  BACKEND_DOMAIN = os.environ.get("BACKEND_DOMAIN", "http://localhost:8000")
  NETWORK_SERVICE_HOST = os.environ.get("NETWORK_SERVICE_HOST", "http://host.docker.internal:8001")
  ISSUER_PRIVATE_KEY = os.environ.get("ISSUER_PRIVATE_KEY", "")
  ISSUER_PUBLIC_KEY = os.environ.get(
      "ISSUER_PUBLIC_KEY",
      "",
  )
  ISSUER_ADDRESS = os.environ.get("ISSUER_ADDRESS", "")
  ALASTRIA_T_NETWORK_ID = os.environ.get("ALASTRIA_T_NETWORK_ID", "redT")
  ALASTRIA_AUTH_SECRET = os.environ.get("ALASTRIA_AUTH_SECRET", "")
  ALASTRIA_SERVICE_HOST = os.environ.get("ALASTRIA_SERVICE_HOST", "http://host.docker.internal:5000")

  ```

  Añadir en [url.py](http://url.py) las urls:

  ```python
  from alastria_auth.views import AlastriaAuthView

  ....
  urlpatterns = [
  	path("alastria/", include("alastria_auth.urls")),
  ....
  ]
  ```


pkgId: b4cbb2bfdbdccb6506dc960cc0c955c783a67311047c1afbb25ee03dcffd9f3a
name: python-alastria-service-client
arch: src
version: 0.0.13
epoch: 0
release: 1
summary: A small client for alastria service
url: https://pypi.org/project/alastria-service-client/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alastria-service-client-0.0.13-1.src.rpm
checksum_type: sha256
description:
  alastria-service-client is a Python http client for dealing with communication with the wealize alastria service.



  Use the package manager [pip](https://pip.pypa.io/en/stable/) to install alastria-service-client.

  ```bash
  pip install alastria-service-client
  ```



  ```python
  from alastria_service_client.client import AClient, Client
  from django.core.exceptions import PermissionDenied
  from alastria_service_client.validators import (
      NetworkValidator,
      OnlyNetworkValidator,
      Address,
  )


  alastria_service_client: AClient = Client(
              service_host=settings.ALASTRIA_SERVICE_HOST
  )
  return alastria_service_client.identity_keys(
              address=Address(address), body=OnlyNetworkValidator(network=network_body)
  ).response
  ```



  Pull requests are welcome. For major changes, please open an issue first
  to discuss what you would like to change.

  Please make sure to update tests as appropriate.



  [MIT](https://choosealicense.com/licenses/mit/)


pkgId: 83387f71a04665198c90f4ccb6bcef1665d43ae9cbe27be6d5f87c8bd107144f
name: python-albanian-tools
arch: src
version: 0.0.16
epoch: 0
release: 1
summary: A small package for working with Albanian language texts.
url: https://github.com/bleroni/albanian_tools
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albanian-tools-0.0.16-1.src.rpm
checksum_type: sha256
description:
  ```python
  pip install albanian_tools
  ```



  There are three main functions: `remove_leading_numbers`, `replace_numbers_with_albanian_text`, and `integer_to_albanian_text_converter`.

  ```python
  from albanian_tools import AlbanianTools

  albanian_tool = AlbanianTools()


  text_1 = "913. Paragraf interesant" # Returns "Paragraf interesant"
  text_1_text_numbers = albanian_tool.remove_leading_numbers(text_1)
  print(f"remove_leading_numbers: {text_1_text_numbers}")


  text_2 = "Neni 217 kalon tutje." # Returns "Neni dyqind e shtatëmbëdhjetë kalon tutje."
  text_2_text_numbers = albanian_tool.replace_numbers_with_albanian_text(text_2)
  print(f"replace_numbers_with_albanian_text: {text_2_text_numbers}")


  integer_example = 717 # Returns "shtatëqind e shtatëmbëdhjetë"
  integer_example_text_number = albanian_tool.integer_to_albanian_text_converter(integer_example)
  print(f"integer_to_albanian_text_converter: {integer_example_text_number}")


  print(f"random_albanian_number: {albanian_tool.random_albanian_number()}")


  print(f"random_albanian_name: {albanian_tool.random_albanian_name()}")
  ```


pkgId: fd0aaf0bef95eada6b67fb052ab29065298185a1d28224b371398f331c27f37f
name: python-albatros-uav
arch: src
version: 0.16.0
epoch: 0
release: 1
summary: The tool for managing unmanned aerial vehicles missions.
url: https://gitlab.com/albatros-uav/albatros
rpm_license: LGPL-3.0-only
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albatros-uav-0.16.0-1.src.rpm
checksum_type: sha256
description:
  A python library that provides high-level functions for UAVs based on MAVLink. It allows to easily handle communication with the flight controller to create friendly mission management systems.



  *Plane:*

  - arming vehicle,
  - setting flight mode,
  - setting servos positions,
  - flying in `GUIDED` mode,
  - uploading mission and flying in `AUTO` mode,
  - param protocol.

  *Copter:*

  - arming vehicle,
  - setting flight mode,
  - setting servos positions,
  - flying in `GUIDED` mode,
  - param protocol,
  - precision landing,
  - uploading mission and flying in `AUTO` mode.

  *Access to UAV telemetry via `UAV.data`*



  - `Attitude`
  - `GlobalPositionInt`
  - `GPSRawInt`
  - `GPSStatus`
  - `Heartbeat`
  - `CommandACK`
  - `MissionACK`
  - `MissionRequestInt`
  - `RadioStatus`
  - `RcChannelsRaw`
  - `ServoOutputRaw`
  - `SysStatus`
  - `MissionItemReached`
  - `ParamValue`
  - `PositionTargetLocalNED`
  - `HomePosition`
  - `LocalPositionNED`
  - `NavControllerOutput`




  ```python
  from albatros import Plane, ConnectionType
  from albatros.telem import ComponentAddress


  plane = Plane()


  plane = Plane(device="/dev/tty/USB0/", baud_rate=57600)



  plane_addr = ComponentAddress(system_id=1, component_id=1)
  gcs_addr = ComponentAddress(system_id=255, component_id=1)
  plane = Plane(uav_addr=plane_addr, my_addr=gcs_addr)
  ```



  ```bash
  $ python -m examples.arming_vehicle
  ```

  ```python
  from albatros import UAV

  vehicle = UAV()

  while not vehicle.arm():
      print("Waiting vehicle to arm")
  print("Vehicle armed")

  if not vehicle.disarm():
      print("Disarm vehicle failed")
  print("Vehicle disarmed")
  ```


pkgId: c6e56eef8d5bb260f4479275799f5519bc58d6a9c87712c67a971b5bcaa9e03f
name: python-albion-similog
arch: src
version: 0.3.7
epoch: 0
release: 1
summary: Compute a consensus dataseries with FAMSA algorithm.
url: https://pypi.org/project/albion-similog/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albion-similog-0.3.7-1.src.rpm
checksum_type: sha256
description:
  This project is dedicated to the generation of possible edges within the
  [Albion](https://gitlab.com/Oslandia/albion) framework, through the way of
  [FAMSA](https://github.com/refresh-bio/FAMSA) algorithm.

  `albion_similog` works with Python3.8.





  This package works with a few dependencies from the biology ecosystem, like `biopython` or
  `scikit-bio`. They are installable easily through `pip`.

  There is a notable exception with `FAMSA`, that should be patched for specific Albion purpose, and
  compiled. Everything is managed through the `Makefile`.



  ```
  $ virtualenv .venv
  $ source .venv/bin/activate
  (.venv) $ make install
  ```



  TODO


pkgId: 640ce5a3468af2587b43e340b5c6d7e8252236fdc212bd6724365969a7c75dde
name: python-albucore
arch: src
version: 0.0.15
epoch: 0
release: 1
url: https://github.com/albumentations-team/albucore
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albucore-0.0.15-1.src.rpm
checksum_type: sha256
summary:
  A high-performance image processing library designed to optimize and extend the Albumentations library with specialized functions for advanced image transformations. Perfect for developers working in computer vision who require efficient and scalable image augmentation.

description:
  Albucore is a high-performance image processing library designed to optimize operations on images using Python and OpenCV, building upon the foundations laid by the popular Albumentations library. It offers specialized optimizations for different image data types and aims to provide faster processing times through efficient algorithm implementations.



  - Optimized image multiplication operations for both `uint8` and `float32` data types.
  - Support for single-channel and multi-channel images.
  - Custom decorators to manage channel dimensions and output constraints.



  Install Albucore using pip:

  ```bash
  pip install -U albucore
  ```



  Here's how you can use Albucore to multiply an image by a constant or a vector:

  ```python
  import cv2
  import numpy as np
  from albucore import multiply


  img = cv2.imread('path_to_your_image.jpg')


  multiplied_image = multiply(img, 1.5)


  multiplier = [1.5, 1.2, 0.9]  # Different multiplier for each channel
  multiplied_image = multiply(img, multiplier)
  ```



  For detailed benchmark results, including other configurations and data types, refer to the [Benchmark](benchmark/results/) in the repository.



  Distributed under the MIT License. See LICENSE for more information.


pkgId: fc27ad31ff8b83acd0c76c400c3bfbb22a805f6d8881087cb3de4623327ec3f7
name: python-album-sender
arch: src
version: 0.0.73
epoch: 0
release: 1
summary: Telegram album sender.
url: https://github.com/gaoyunzhi/telegram_album_sender
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-album-sender-0.0.73-1.src.rpm
checksum_type: sha256
description:
  Telegram album sender



  ```
  import album_sender, web_2_album
  result = web_2_album.get(url)
  album_sender.send_v2(chat, result, rotate=False)
  ```



  `pip3 install album_sender`


pkgId: e940a3f14cff2b2920510d4b091f5d25bc43de0ee0a4e3b6be99cad45052a057
name: python-albumentations
arch: src
version: 1.4.14
epoch: 0
release: 1
url: https://albumentations.ai
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albumentations-1.4.14-1.src.rpm
checksum_type: sha256
summary:
  An efficient library for image augmentation, providing extensive transformations to support machine learning and computer vision tasks.

description:
  [![PyPI version](https://badge.fury.io/py/albumentations.svg)](https://badge.fury.io/py/albumentations)
  ![CI](https://github.com/albumentations-team/albumentations/workflows/CI/badge.svg)
  [![PyPI Downloads](https://img.shields.io/pypi/dm/albumentations.svg?label=PyPI%20downloads)](
  https://pypi.org/project/albumentations/)
  [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/albumentations.svg?label=Conda%20downloads)](
  https://anaconda.org/conda-forge/albumentations)
  [![Stack Overflow](https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg)](
  https://stackoverflow.com/questions/tagged/albumentations)
  [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)

  [Docs](https://albumentations.ai/docs/) | [Discord](https://discord.gg/AKPrrDYNAt) | [Twitter](https://twitter.com/albumentations) | [LinkedIn](https://www.linkedin.com/company/100504475/)

  Albumentations is a Python library for image augmentation. Image augmentation is used in deep learning and computer vision tasks to increase the quality of trained models. The purpose of image augmentation is to create new training samples from the existing data.

  Here is an example of how you can apply some [pixel-level](#pixel-level-transforms) augmentations from Albumentations to create new images from the original one:
  ![parrot](https://habrastorage.org/webt/bd/ne/rv/bdnerv5ctkudmsaznhw4crsdfiw.jpeg)



  - Albumentations **[supports all common computer vision tasks](#i-want-to-use-albumentations-for-the-specific-task-such-as-classification-or-segmentation)** such as classification, semantic segmentation, instance segmentation, object detection, and pose estimation.
  - The library provides **[a simple unified API](#a-simple-example)** to work with all data types: images (RBG-images, grayscale images, multispectral images), segmentation masks, bounding boxes, and keypoints.
  - The library contains **[more than 70 different augmentations](#list-of-augmentations)** to generate new training samples from the existing data.
  - Albumentations is [**fast**](#benchmarking-results). We benchmark each new release to ensure that augmentations provide maximum speed.
  - It **[works with popular deep learning frameworks](#i-want-to-know-how-to-use-albumentations-with-deep-learning-frameworks)** such as PyTorch and TensorFlow. By the way, Albumentations is a part of the [PyTorch ecosystem](https://pytorch.org/ecosystem/).
  - [**Written by experts**](#authors). The authors have experience both working on production computer vision systems and participating in competitive machine learning. Many core team members are Kaggle Masters and Grandmasters.
  - The library is [**widely used**](#who-is-using-albumentations) in industry, deep learning research, machine learning competitions, and open source projects.



  <a href="https://roboflow.com/" target="_blank"><img src="https://avatars.githubusercontent.com/u/53104118?s=200&v=4" width="100"/></a>



  - [Albumentations](#albumentations)
    - [Why Albumentations](#why-albumentations)
    - [Sponsors](#sponsors)
    - [Table of contents](#table-of-contents)
    - [Authors](#authors)
    - [Installation](#installation)
    - [Documentation](#documentation)
    - [A simple example](#a-simple-example)
    - [Getting started](#getting-started)
      - [I am new to image augmentation](#i-am-new-to-image-augmentation)
      - [I want to use Albumentations for the specific task such as classification or segmentation](#i-want-to-use-albumentations-for-the-specific-task-such-as-classification-or-segmentation)
      - [I want to know how to use Albumentations with deep learning frameworks](#i-want-to-know-how-to-use-albumentations-with-deep-learning-frameworks)
      - [I want to explore augmentations and see Albumentations in action](#i-want-to-explore-augmentations-and-see-albumentations-in-action)
    - [Who is using Albumentations](#who-is-using-albumentations)
      - [See also](#see-also)
    - [List of augmentations](#list-of-augmentations)
      - [Pixel-level transforms](#pixel-level-transforms)
      - [Spatial-level transforms](#spatial-level-transforms)
      - [Mixing-level transforms](#mixing-level-transforms)
    - [A few more examples of **augmentations**](#a-few-more-examples-of-augmentations)
      - [Semantic segmentation on the Inria dataset](#semantic-segmentation-on-the-inria-dataset)
      - [Medical imaging](#medical-imaging)
      - [Object detection and semantic segmentation on the Mapillary Vistas dataset](#object-detection-and-semantic-segmentation-on-the-mapillary-vistas-dataset)
      - [Keypoints augmentation](#keypoints-augmentation)
    - [Benchmarking results](#benchmarking-results)
    - [Contributing](#contributing)
    - [Community and Support](#community-and-support)
    - [Comments](#comments)
    - [Citing](#citing)



  [**Vladimir I. Iglovikov**](https://www.linkedin.com/in/iglovikov/) | [Kaggle Grandmaster](https://www.kaggle.com/iglovikov)

  [**Mikhail Druzhinin**](https://www.linkedin.com/in/mikhail-druzhinin-548229100/) | [Kaggle Expert](https://www.kaggle.com/dipetm)

  [**Alex Parinov**](https://www.linkedin.com/in/alex-parinov/) | [Kaggle Master](https://www.kaggle.com/creafz)

  [**Alexander Buslaev** — Computer Vision Engineer at Mapbox](https://www.linkedin.com/in/al-buslaev/) | [Kaggle Master](https://www.kaggle.com/albuslaev)

  [**Evegene Khvedchenya** — Computer Vision Research Engineer at Piñata Farms](https://www.linkedin.com/in/cvtalks/) | [Kaggle Grandmaster](https://www.kaggle.com/bloodaxe)



  Albumentations requires Python 3.8 or higher. To install the latest version from PyPI:

  ```bash
  pip install -U albumentations
  ```

  Other installation options are described in the [documentation](https://albumentations.ai/docs/getting_started/installation/).



  The full documentation is available at **[https://albumentations.ai/docs/](https://albumentations.ai/docs/)**.



  ```python
  import albumentations as A
  import cv2


  transform = A.Compose([
      A.RandomCrop(width=256, height=256),
      A.HorizontalFlip(p=0.5),
      A.RandomBrightnessContrast(p=0.2),
  ])


  image = cv2.imread("image.jpg")
  image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)


  transformed = transform(image=image)
  transformed_image = transformed["image"]
  ```





  Please start with the [introduction articles](https://albumentations.ai/docs/#introduction-to-image-augmentation) about why image augmentation is important and how it helps to build better models.



  If you want to use Albumentations for a specific task such as classification, segmentation, or object detection, refer to the [set of articles](https://albumentations.ai/docs/#getting-started-with-albumentations) that has an in-depth description of this task. We also have a [list of examples](https://albumentations.ai/docs/examples/) on applying Albumentations for different use cases.



  We have [examples of using Albumentations](https://albumentations.ai/docs/#examples-of-how-to-use-albumentations-with-different-deep-learning-frameworks) along with PyTorch and TensorFlow.



  Check the [online demo of the library](https://albumentations-demo.herokuapp.com/). With it, you can apply augmentations to different images and see the result. Also, we have a [list of all available augmentations and their targets](#list-of-augmentations).



  <a href="https://www.apple.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/apple.jpeg" width="100"/></a>
  <a href="https://research.google/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/google.png" width="100"/></a>
  <a href="https://opensource.fb.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/meta_research.png" width="100"/></a>
  <a href="https: //www.nvidia.com/en-us/research/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/nvidia_research.jpeg" width="100"/></a>
  <a href="https://www.amazon.science/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/amazon_science.png" width="100"/></a>
  <a href="https://opensource.microsoft.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/microsoft.png" width="100"/></a>
  <a href="https://engineering.salesforce.com/open-source/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/salesforce_open_source.png" width="100"/></a>
  <a href="https://stability.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/stability.png" width="100"/></a>
  <a href="https://www.ibm.com/opensource/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/ibm.jpeg" width="100"/></a>
  <a href="https://huggingface.co/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/hugging_face.png" width="100"/></a>
  <a href="https://www.sony.com/en/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/sony.png" width="100"/></a>
  <a href="https://opensource.alibaba.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/alibaba.png" width="100"/></a>
  <a href="https://opensource.tencent.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/tencent.png" width="100"/></a>
  <a href="https://h2o.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/h2o_ai.png" width="100"/></a>



  - [A list of papers that cite Albumentations](https://scholar.google.com/citations?view_op=view_citation&citation_for_view=vkjh9X0AAAAJ:r0BpntZqJG4C).
  - [A list of teams that were using Albumentations and took high places in machine learning competitions](https://albumentations.ai/whos_using#competitions).
  - [Open source projects that use Albumentations](https://github.com/albumentations-team/albumentations/network/dependents?dependent_type=PACKAGE).





  Pixel-level transforms will change just an input image and will leave any additional targets such as masks, bounding boxes, and keypoints unchanged. The list of pixel-level transforms:

  - [AdvancedBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.AdvancedBlur)
  - [Blur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.Blur)
  - [CLAHE](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.CLAHE)
  - [ChannelDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/channel_dropout/#albumentations.augmentations.dropout.channel_dropout.ChannelDropout)
  - [ChannelShuffle](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ChannelShuffle)
  - [ChromaticAberration](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ChromaticAberration)
  - [ColorJitter](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ColorJitter)
  - [Defocus](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.Defocus)
  - [Downscale](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Downscale)
  - [Emboss](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Emboss)
  - [Equalize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Equalize)
  - [FDA](https://albumentations.ai/docs/api_reference/augmentations/domain_adaptation/#albumentations.augmentations.domain_adaptation.FDA)
  - [FancyPCA](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.FancyPCA)
  - [FromFloat](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.FromFloat)
  - [GaussNoise](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.GaussNoise)
  - [GaussianBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.GaussianBlur)
  - [GlassBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.GlassBlur)
  - [HistogramMatching](https://albumentations.ai/docs/api_reference/augmentations/domain_adaptation/#albumentations.augmentations.domain_adaptation.HistogramMatching)
  - [HueSaturationValue](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.HueSaturationValue)
  - [ISONoise](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ISONoise)
  - [ImageCompression](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ImageCompression)
  - [InvertImg](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.InvertImg)
  - [MedianBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.MedianBlur)
  - [MotionBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.MotionBlur)
  - [MultiplicativeNoise](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.MultiplicativeNoise)
  - [Normalize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Normalize)
  - [PixelDistributionAdaptation](https://albumentations.ai/docs/api_reference/augmentations/domain_adaptation/#albumentations.augmentations.domain_adaptation.PixelDistributionAdaptation)
  - [PlanckianJitter](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.PlanckianJitter)
  - [Posterize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Posterize)
  - [RGBShift](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RGBShift)
  - [RandomBrightnessContrast](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomBrightnessContrast)
  - [RandomFog](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomFog)
  - [RandomGamma](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGamma)
  - [RandomGravel](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGravel)
  - [RandomRain](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomRain)
  - [RandomShadow](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomShadow)
  - [RandomSnow](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomSnow)
  - [RandomSunFlare](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomSunFlare)
  - [RandomToneCurve](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomToneCurve)
  - [RingingOvershoot](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RingingOvershoot)
  - [Sharpen](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Sharpen)
  - [Solarize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Solarize)
  - [Spatter](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Spatter)
  - [Superpixels](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Superpixels)
  - [TemplateTransform](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.TemplateTransform)
  - [TextImage](https://albumentations.ai/docs/api_reference/augmentations/text/transforms/#albumentations.augmentations.text.transforms.TextImage)
  - [ToFloat](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToFloat)
  - [ToGray](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToGray)
  - [ToRGB](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToRGB)
  - [ToSepia](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToSepia)
  - [UnsharpMask](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.UnsharpMask)
  - [ZoomBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.ZoomBlur)



  Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. The following table shows which additional targets are supported by each transform.

  | Transform                                                                                                                                                                       | Image | Mask | BBoxes | Keypoints |
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---: | :--: | :----: | :-------: |
  | [Affine](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Affine)                             | ✓     | ✓    | ✓      | ✓         |
  | [BBoxSafeRandomCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.BBoxSafeRandomCrop)             | ✓     | ✓    | ✓      | ✓         |
  | [CenterCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.CenterCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [CoarseDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/coarse_dropout/#albumentations.augmentations.dropout.coarse_dropout.CoarseDropout)           | ✓     | ✓    |        | ✓         |
  | [Crop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.Crop)                                         | ✓     | ✓    | ✓      | ✓         |
  | [CropAndPad](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.CropAndPad)                             | ✓     | ✓    | ✓      | ✓         |
  | [CropNonEmptyMaskIfExists](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.CropNonEmptyMaskIfExists) | ✓     | ✓    | ✓      | ✓         |
  | [D4](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.D4)                                     | ✓     | ✓    | ✓      | ✓         |
  | [ElasticTransform](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.ElasticTransform)         | ✓     | ✓    | ✓      |           |
  | [Flip](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Flip)                                 | ✓     | ✓    | ✓      | ✓         |
  | [GridDistortion](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.GridDistortion)             | ✓     | ✓    | ✓      |           |
  | [GridDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/grid_dropout/#albumentations.augmentations.dropout.grid_dropout.GridDropout)                   | ✓     | ✓    |        |           |
  | [GridElasticDeform](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.GridElasticDeform)       | ✓     | ✓    |        |           |
  | [HorizontalFlip](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.HorizontalFlip)             | ✓     | ✓    | ✓      | ✓         |
  | [Lambda](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Lambda)                                                 | ✓     | ✓    | ✓      | ✓         |
  | [LongestMaxSize](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.LongestMaxSize)                     | ✓     | ✓    | ✓      | ✓         |
  | [MaskDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/mask_dropout/#albumentations.augmentations.dropout.mask_dropout.MaskDropout)                   | ✓     | ✓    |        |           |
  | [Morphological](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Morphological)                                   | ✓     | ✓    |        |           |
  | [NoOp](https://albumentations.ai/docs/api_reference/core/transforms_interface/#albumentations.core.transforms_interface.NoOp)                                                   | ✓     | ✓    | ✓      | ✓         |
  | [OpticalDistortion](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.OpticalDistortion)       | ✓     | ✓    | ✓      |           |
  | [PadIfNeeded](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.PadIfNeeded)                   | ✓     | ✓    | ✓      | ✓         |
  | [Perspective](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Perspective)                   | ✓     | ✓    | ✓      | ✓         |
  | [PiecewiseAffine](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.PiecewiseAffine)           | ✓     | ✓    | ✓      | ✓         |
  | [PixelDropout](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.PixelDropout)                                     | ✓     | ✓    |        |           |
  | [RandomCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [RandomCropFromBorders](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomCropFromBorders)       | ✓     | ✓    | ✓      | ✓         |
  | [RandomGridShuffle](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGridShuffle)                           | ✓     | ✓    |        | ✓         |
  | [RandomResizedCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomResizedCrop)               | ✓     | ✓    | ✓      | ✓         |
  | [RandomRotate90](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.RandomRotate90)                     | ✓     | ✓    | ✓      | ✓         |
  | [RandomScale](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.RandomScale)                           | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedBBoxSafeCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomSizedBBoxSafeCrop)   | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomSizedCrop)                   | ✓     | ✓    | ✓      | ✓         |
  | [Resize](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.Resize)                                     | ✓     | ✓    | ✓      | ✓         |
  | [Rotate](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.Rotate)                                     | ✓     | ✓    | ✓      | ✓         |
  | [SafeRotate](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.SafeRotate)                             | ✓     | ✓    | ✓      | ✓         |
  | [ShiftScaleRotate](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.ShiftScaleRotate)         | ✓     | ✓    | ✓      | ✓         |
  | [SmallestMaxSize](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.SmallestMaxSize)                   | ✓     | ✓    | ✓      | ✓         |
  | [Transpose](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Transpose)                       | ✓     | ✓    | ✓      | ✓         |
  | [VerticalFlip](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.VerticalFlip)                 | ✓     | ✓    | ✓      | ✓         |
  | [XYMasking](https://albumentations.ai/docs/api_reference/augmentations/dropout/xy_masking/#albumentations.augmentations.dropout.xy_masking.XYMasking)                           | ✓     | ✓    |        | ✓         |



  Transforms that mix several images into one

  | Transform                                                                                                                                                       | Image | Mask | BBoxes | Keypoints | Global Label |
  | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---: | :--: | :----: | :-------: | :----------: |
  | [MixUp](https://albumentations.ai/docs/api_reference/augmentations/mixing/transforms/#albumentations.augmentations.mixing.transforms.MixUp)                     | ✓     | ✓    |        |           | ✓            |
  | [OverlayElements](https://albumentations.ai/docs/api_reference/augmentations/mixing/transforms/#albumentations.augmentations.mixing.transforms.OverlayElements) | ✓     | ✓    |        |           |              |





  ![inria](https://habrastorage.org/webt/su/wa/np/suwanpeo6ww7wpwtobtrzd_cg20.jpeg)



  ![medical](https://habrastorage.org/webt/1i/fi/wz/1ifiwzy0lxetc4nwjvss-71nkw0.jpeg)



  ![vistas](https://habrastorage.org/webt/rz/-h/3j/rz-h3jalbxic8o_fhucxysts4tc.jpeg)



  <img src="https://habrastorage.org/webt/e-/6k/z-/e-6kz-fugp2heak3jzns3bc-r8o.jpeg" width=100%>



  To run the benchmark yourself, follow the instructions in [benchmark/README.md](https://github.com/albumentations-team/albumentations/blob/master/benchmark/README.md)

  Results for running the benchmark on the first 2000 images from the ImageNet validation set using an AMD Ryzen Threadripper 3970X CPU.
  The table shows how many images per second can be processed on a single core; higher is better.

  | Library | Version |
  |---------|---------|
  | Python | 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] |
  | albumentations | 1.4.11 |
  | imgaug | 0.4.0 |
  | torchvision | 0.18.1+rocm6.0 |
  | numpy | 1.26.4 |
  | opencv-python-headless | 4.10.0.84 |
  | scikit-image | 0.24.0 |
  | scipy | 1.14.0 |
  | pillow | 10.4.0 |
  | kornia | 0.7.3 |
  | augly | 1.0.0 |

  |                 |albumentations<br><small>1.4.11</small>|torchvision<br><small>0.18.1+rocm6.0</small>|kornia<br><small>0.7.3</small>|augly<br><small>1.0.0</small>|imgaug<br><small>0.4.0</small>|
  |-----------------|--------------------------------------|--------------------------------------------|------------------------------|-----------------------------|------------------------------|
  |HorizontalFlip   |**8017 ± 12**                         |2436 ± 2                                    |935 ± 3                       |3575 ± 4                     |4806 ± 7                      |
  |VerticalFlip     |7366 ± 7                              |2563 ± 8                                    |943 ± 1                       |4949 ± 5                     |**8159 ± 21**                 |
  |Rotate           |570 ± 12                              |152 ± 2                                     |207 ± 1                       |**633 ± 2**                  |496 ± 2                       |
  |Affine           |**1382 ± 31**                         |162 ± 1                                     |201 ± 1                       |-                            |682 ± 2                       |
  |Equalize         |1027 ± 2                              |336 ± 2                                     |77 ± 1                        |-                            |**1183 ± 1**                  |
  |RandomCrop64     |**19986 ± 57**                        |15336 ± 16                                  |811 ± 1                       |19882 ± 356                  |5410 ± 5                      |
  |RandomResizedCrop|**2308 ± 7**                          |1046 ± 3                                    |187 ± 1                       |-                            |-                             |
  |ShiftRGB         |1240 ± 3                              |-                                           |425 ± 2                       |-                            |**1554 ± 6**                  |
  |Resize           |**2314 ± 9**                          |1272 ± 3                                    |201 ± 3                       |431 ± 1                      |1715 ± 2                      |
  |RandomGamma      |**2552 ± 2**                          |232 ± 1                                     |211 ± 1                       |-                            |1794 ± 1                      |
  |Grayscale        |**7313 ± 4**                          |1652 ± 2                                    |443 ± 2                       |2639 ± 2                     |1171 ± 23                     |
  |ColorJitter      |**396 ± 1**                           |51 ± 1                                      |50 ± 1                        |224 ± 1                      |-                             |
  |PlankianJitter   |449 ± 1                               |-                                           |**598 ± 1**                   |-                            |-                             |
  |RandomPerspective|471 ± 1                               |123 ± 1                                     |114 ± 1                       |-                            |**478 ± 2**                   |
  |GaussianBlur     |**2099 ± 2**                          |113 ± 2                                     |79 ± 2                        |165 ± 1                      |1244 ± 2                      |
  |MedianBlur       |538 ± 1                               |-                                           |3 ± 1                         |-                            |**565 ± 1**                   |
  |MotionBlur       |**2197 ± 9**                          |-                                           |102 ± 1                       |-                            |508 ± 1                       |
  |Posterize        |2449 ± 1                              |**2587 ± 3**                                |339 ± 6                       |-                            |1547 ± 1                      |
  |JpegCompression  |**827 ± 1**                           |-                                           |50 ± 2                        |684 ± 1                      |428 ± 4                       |
  |GaussianNoise    |78 ± 1                                |-                                           |-                             |67 ± 1                       |**128 ± 1**                   |
  |Elastic          |127 ± 1                               |3 ± 1                                       |1 ± 1                         |-                            |**130 ± 1**                   |
  |Normalize        |**971 ± 2**                           |449 ± 1                                     |415 ± 1                       |-                            |-                             |



  To create a pull request to the repository, follow the documentation at [CONTRIBUTING.md](CONTRIBUTING.md)

  ![https://github.com/albuemntations-team/albumentation/graphs/contributors](https://contrib.rocks/image?repo=albumentations-team/albumentations)



  - [Twitter](https://twitter.com/albumentations)
  - [Discord](https://discord.gg/AKPrrDYNAt)



  In some systems, in the multiple GPU regime, PyTorch may deadlock the DataLoader if OpenCV was compiled with OpenCL optimizations. Adding the following two lines before the library import may help. For more details [https://github.com/pytorch/pytorch/issues/1355](https://github.com/pytorch/pytorch/issues/1355)

  ```python
  cv2.setNumThreads(0)
  cv2.ocl.setUseOpenCL(False)
  ```



  If you find this library useful for your research, please consider citing [Albumentations: Fast and Flexible Image Augmentations](https://www.mdpi.com/2078-2489/11/2/125):

  ```bibtex
  @Article{info11020125,
      AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
      TITLE = {Albumentations: Fast and Flexible Image Augmentations},
      JOURNAL = {Information},
      VOLUME = {11},
      YEAR = {2020},
      NUMBER = {2},
      ARTICLE-NUMBER = {125},
      URL = {https://www.mdpi.com/2078-2489/11/2/125},
      ISSN = {2078-2489},
      DOI = {10.3390/info11020125}
  }
  ```


pkgId: 06468e68e3f7f9e0b01de05980b802a18dc03b592cd674da120c5df721319444
name: python-albumentations
arch: src
version: 1.4.15
epoch: 0
release: 1
url: https://albumentations.ai
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albumentations-1.4.15-1.src.rpm
checksum_type: sha256
summary:
  An efficient library for image augmentation, providing extensive transformations to support machine learning and computer vision tasks.

description:
  [![PyPI version](https://badge.fury.io/py/albumentations.svg)](https://badge.fury.io/py/albumentations)
  ![CI](https://github.com/albumentations-team/albumentations/workflows/CI/badge.svg)
  [![PyPI Downloads](https://img.shields.io/pypi/dm/albumentations.svg?label=PyPI%20downloads)](
  https://pypi.org/project/albumentations/)
  [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/albumentations.svg?label=Conda%20downloads)](
  https://anaconda.org/conda-forge/albumentations)
  [![Stack Overflow](https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg)](
  https://stackoverflow.com/questions/tagged/albumentations)
  [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)

  [Docs](https://albumentations.ai/docs/) | [Discord](https://discord.gg/AKPrrDYNAt) | [Twitter](https://twitter.com/albumentations) | [LinkedIn](https://www.linkedin.com/company/100504475/)

  Albumentations is a Python library for image augmentation. Image augmentation is used in deep learning and computer vision tasks to increase the quality of trained models. The purpose of image augmentation is to create new training samples from the existing data.

  Here is an example of how you can apply some [pixel-level](#pixel-level-transforms) augmentations from Albumentations to create new images from the original one:
  ![parrot](https://habrastorage.org/webt/bd/ne/rv/bdnerv5ctkudmsaznhw4crsdfiw.jpeg)



  - Albumentations **[supports all common computer vision tasks](#i-want-to-use-albumentations-for-the-specific-task-such-as-classification-or-segmentation)** such as classification, semantic segmentation, instance segmentation, object detection, and pose estimation.
  - The library provides **[a simple unified API](#a-simple-example)** to work with all data types: images (RBG-images, grayscale images, multispectral images), segmentation masks, bounding boxes, and keypoints.
  - The library contains **[more than 70 different augmentations](#list-of-augmentations)** to generate new training samples from the existing data.
  - Albumentations is [**fast**](#benchmarking-results). We benchmark each new release to ensure that augmentations provide maximum speed.
  - It **[works with popular deep learning frameworks](#i-want-to-know-how-to-use-albumentations-with-deep-learning-frameworks)** such as PyTorch and TensorFlow. By the way, Albumentations is a part of the [PyTorch ecosystem](https://pytorch.org/ecosystem/).
  - [**Written by experts**](#authors). The authors have experience both working on production computer vision systems and participating in competitive machine learning. Many core team members are Kaggle Masters and Grandmasters.
  - The library is [**widely used**](#who-is-using-albumentations) in industry, deep learning research, machine learning competitions, and open source projects.



  <a href="https://roboflow.com/" target="_blank"><img src="https://avatars.githubusercontent.com/u/53104118?s=200&v=4" width="100"/></a>



  - [Albumentations](#albumentations)
    - [Why Albumentations](#why-albumentations)
    - [Sponsors](#sponsors)
    - [Table of contents](#table-of-contents)
    - [Authors](#authors)
    - [Installation](#installation)
    - [Documentation](#documentation)
    - [A simple example](#a-simple-example)
    - [Getting started](#getting-started)
      - [I am new to image augmentation](#i-am-new-to-image-augmentation)
      - [I want to use Albumentations for the specific task such as classification or segmentation](#i-want-to-use-albumentations-for-the-specific-task-such-as-classification-or-segmentation)
      - [I want to know how to use Albumentations with deep learning frameworks](#i-want-to-know-how-to-use-albumentations-with-deep-learning-frameworks)
      - [I want to explore augmentations and see Albumentations in action](#i-want-to-explore-augmentations-and-see-albumentations-in-action)
    - [Who is using Albumentations](#who-is-using-albumentations)
      - [See also](#see-also)
    - [List of augmentations](#list-of-augmentations)
      - [Pixel-level transforms](#pixel-level-transforms)
      - [Spatial-level transforms](#spatial-level-transforms)
      - [Mixing-level transforms](#mixing-level-transforms)
    - [A few more examples of **augmentations**](#a-few-more-examples-of-augmentations)
      - [Semantic segmentation on the Inria dataset](#semantic-segmentation-on-the-inria-dataset)
      - [Medical imaging](#medical-imaging)
      - [Object detection and semantic segmentation on the Mapillary Vistas dataset](#object-detection-and-semantic-segmentation-on-the-mapillary-vistas-dataset)
      - [Keypoints augmentation](#keypoints-augmentation)
    - [Benchmarking results](#benchmarking-results)
    - [Contributing](#contributing)
    - [Community and Support](#community-and-support)
    - [Comments](#comments)
    - [Citing](#citing)



  [**Vladimir I. Iglovikov**](https://www.linkedin.com/in/iglovikov/) | [Kaggle Grandmaster](https://www.kaggle.com/iglovikov)

  [**Mikhail Druzhinin**](https://www.linkedin.com/in/mikhail-druzhinin-548229100/) | [Kaggle Expert](https://www.kaggle.com/dipetm)

  [**Alex Parinov**](https://www.linkedin.com/in/alex-parinov/) | [Kaggle Master](https://www.kaggle.com/creafz)

  [**Alexander Buslaev** — Computer Vision Engineer at Mapbox](https://www.linkedin.com/in/al-buslaev/) | [Kaggle Master](https://www.kaggle.com/albuslaev)

  [**Evegene Khvedchenya** — Computer Vision Research Engineer at Piñata Farms](https://www.linkedin.com/in/cvtalks/) | [Kaggle Grandmaster](https://www.kaggle.com/bloodaxe)



  Albumentations requires Python 3.8 or higher. To install the latest version from PyPI:

  ```bash
  pip install -U albumentations
  ```

  Other installation options are described in the [documentation](https://albumentations.ai/docs/getting_started/installation/).



  The full documentation is available at **[https://albumentations.ai/docs/](https://albumentations.ai/docs/)**.



  ```python
  import albumentations as A
  import cv2


  transform = A.Compose([
      A.RandomCrop(width=256, height=256),
      A.HorizontalFlip(p=0.5),
      A.RandomBrightnessContrast(p=0.2),
  ])


  image = cv2.imread("image.jpg")
  image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)


  transformed = transform(image=image)
  transformed_image = transformed["image"]
  ```





  Please start with the [introduction articles](https://albumentations.ai/docs/#introduction-to-image-augmentation) about why image augmentation is important and how it helps to build better models.



  If you want to use Albumentations for a specific task such as classification, segmentation, or object detection, refer to the [set of articles](https://albumentations.ai/docs/#getting-started-with-albumentations) that has an in-depth description of this task. We also have a [list of examples](https://albumentations.ai/docs/examples/) on applying Albumentations for different use cases.



  We have [examples of using Albumentations](https://albumentations.ai/docs/#examples-of-how-to-use-albumentations-with-different-deep-learning-frameworks) along with PyTorch and TensorFlow.



  Check the [online demo of the library](https://albumentations-demo.herokuapp.com/). With it, you can apply augmentations to different images and see the result. Also, we have a [list of all available augmentations and their targets](#list-of-augmentations).



  <a href="https://www.apple.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/apple.jpeg" width="100"/></a>
  <a href="https://research.google/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/google.png" width="100"/></a>
  <a href="https://opensource.fb.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/meta_research.png" width="100"/></a>
  <a href="https: //www.nvidia.com/en-us/research/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/nvidia_research.jpeg" width="100"/></a>
  <a href="https://www.amazon.science/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/amazon_science.png" width="100"/></a>
  <a href="https://opensource.microsoft.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/microsoft.png" width="100"/></a>
  <a href="https://engineering.salesforce.com/open-source/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/salesforce_open_source.png" width="100"/></a>
  <a href="https://stability.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/stability.png" width="100"/></a>
  <a href="https://www.ibm.com/opensource/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/ibm.jpeg" width="100"/></a>
  <a href="https://huggingface.co/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/hugging_face.png" width="100"/></a>
  <a href="https://www.sony.com/en/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/sony.png" width="100"/></a>
  <a href="https://opensource.alibaba.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/alibaba.png" width="100"/></a>
  <a href="https://opensource.tencent.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/tencent.png" width="100"/></a>
  <a href="https://h2o.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/h2o_ai.png" width="100"/></a>



  - [A list of papers that cite Albumentations](https://scholar.google.com/citations?view_op=view_citation&citation_for_view=vkjh9X0AAAAJ:r0BpntZqJG4C).
  - [A list of teams that were using Albumentations and took high places in machine learning competitions](https://albumentations.ai/whos_using#competitions).
  - [Open source projects that use Albumentations](https://github.com/albumentations-team/albumentations/network/dependents?dependent_type=PACKAGE).





  Pixel-level transforms will change just an input image and will leave any additional targets such as masks, bounding boxes, and keypoints unchanged. The list of pixel-level transforms:

  - [AdvancedBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.AdvancedBlur)
  - [Blur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.Blur)
  - [CLAHE](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.CLAHE)
  - [ChannelDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/channel_dropout/#albumentations.augmentations.dropout.channel_dropout.ChannelDropout)
  - [ChannelShuffle](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ChannelShuffle)
  - [ChromaticAberration](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ChromaticAberration)
  - [ColorJitter](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ColorJitter)
  - [Defocus](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.Defocus)
  - [Downscale](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Downscale)
  - [Emboss](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Emboss)
  - [Equalize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Equalize)
  - [FDA](https://albumentations.ai/docs/api_reference/augmentations/domain_adaptation/#albumentations.augmentations.domain_adaptation.FDA)
  - [FancyPCA](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.FancyPCA)
  - [FromFloat](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.FromFloat)
  - [GaussNoise](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.GaussNoise)
  - [GaussianBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.GaussianBlur)
  - [GlassBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.GlassBlur)
  - [HistogramMatching](https://albumentations.ai/docs/api_reference/augmentations/domain_adaptation/#albumentations.augmentations.domain_adaptation.HistogramMatching)
  - [HueSaturationValue](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.HueSaturationValue)
  - [ISONoise](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ISONoise)
  - [ImageCompression](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ImageCompression)
  - [InvertImg](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.InvertImg)
  - [MedianBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.MedianBlur)
  - [MotionBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.MotionBlur)
  - [MultiplicativeNoise](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.MultiplicativeNoise)
  - [Normalize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Normalize)
  - [PixelDistributionAdaptation](https://albumentations.ai/docs/api_reference/augmentations/domain_adaptation/#albumentations.augmentations.domain_adaptation.PixelDistributionAdaptation)
  - [PlanckianJitter](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.PlanckianJitter)
  - [Posterize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Posterize)
  - [RGBShift](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RGBShift)
  - [RandomBrightnessContrast](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomBrightnessContrast)
  - [RandomFog](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomFog)
  - [RandomGamma](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGamma)
  - [RandomGravel](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGravel)
  - [RandomRain](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomRain)
  - [RandomShadow](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomShadow)
  - [RandomSnow](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomSnow)
  - [RandomSunFlare](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomSunFlare)
  - [RandomToneCurve](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomToneCurve)
  - [RingingOvershoot](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RingingOvershoot)
  - [Sharpen](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Sharpen)
  - [Solarize](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Solarize)
  - [Spatter](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Spatter)
  - [Superpixels](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Superpixels)
  - [TemplateTransform](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.TemplateTransform)
  - [TextImage](https://albumentations.ai/docs/api_reference/augmentations/text/transforms/#albumentations.augmentations.text.transforms.TextImage)
  - [ToFloat](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToFloat)
  - [ToGray](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToGray)
  - [ToRGB](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToRGB)
  - [ToSepia](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.ToSepia)
  - [UnsharpMask](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.UnsharpMask)
  - [ZoomBlur](https://albumentations.ai/docs/api_reference/augmentations/blur/transforms/#albumentations.augmentations.blur.transforms.ZoomBlur)



  Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. The following table shows which additional targets are supported by each transform.

  | Transform                                                                                                                                                                       | Image | Mask | BBoxes | Keypoints |
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---: | :--: | :----: | :-------: |
  | [Affine](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Affine)                             | ✓     | ✓    | ✓      | ✓         |
  | [BBoxSafeRandomCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.BBoxSafeRandomCrop)             | ✓     | ✓    | ✓      | ✓         |
  | [CenterCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.CenterCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [CoarseDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/coarse_dropout/#albumentations.augmentations.dropout.coarse_dropout.CoarseDropout)           | ✓     | ✓    |        | ✓         |
  | [Crop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.Crop)                                         | ✓     | ✓    | ✓      | ✓         |
  | [CropAndPad](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.CropAndPad)                             | ✓     | ✓    | ✓      | ✓         |
  | [CropNonEmptyMaskIfExists](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.CropNonEmptyMaskIfExists) | ✓     | ✓    | ✓      | ✓         |
  | [D4](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.D4)                                     | ✓     | ✓    | ✓      | ✓         |
  | [ElasticTransform](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.ElasticTransform)         | ✓     | ✓    | ✓      |           |
  | [GridDistortion](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.GridDistortion)             | ✓     | ✓    | ✓      |           |
  | [GridDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/grid_dropout/#albumentations.augmentations.dropout.grid_dropout.GridDropout)                   | ✓     | ✓    |        |           |
  | [GridElasticDeform](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.GridElasticDeform)       | ✓     | ✓    |        |           |
  | [HorizontalFlip](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.HorizontalFlip)             | ✓     | ✓    | ✓      | ✓         |
  | [Lambda](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Lambda)                                                 | ✓     | ✓    | ✓      | ✓         |
  | [LongestMaxSize](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.LongestMaxSize)                     | ✓     | ✓    | ✓      | ✓         |
  | [MaskDropout](https://albumentations.ai/docs/api_reference/augmentations/dropout/mask_dropout/#albumentations.augmentations.dropout.mask_dropout.MaskDropout)                   | ✓     | ✓    |        |           |
  | [Morphological](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.Morphological)                                   | ✓     | ✓    |        |           |
  | [NoOp](https://albumentations.ai/docs/api_reference/core/transforms_interface/#albumentations.core.transforms_interface.NoOp)                                                   | ✓     | ✓    | ✓      | ✓         |
  | [OpticalDistortion](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.OpticalDistortion)       | ✓     | ✓    | ✓      |           |
  | [PadIfNeeded](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.PadIfNeeded)                   | ✓     | ✓    | ✓      | ✓         |
  | [Perspective](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Perspective)                   | ✓     | ✓    | ✓      | ✓         |
  | [PiecewiseAffine](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.PiecewiseAffine)           | ✓     | ✓    | ✓      | ✓         |
  | [PixelDropout](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.PixelDropout)                                     | ✓     | ✓    |        |           |
  | [RandomCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [RandomCropFromBorders](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomCropFromBorders)       | ✓     | ✓    | ✓      | ✓         |
  | [RandomGridShuffle](https://albumentations.ai/docs/api_reference/augmentations/transforms/#albumentations.augmentations.transforms.RandomGridShuffle)                           | ✓     | ✓    |        | ✓         |
  | [RandomResizedCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomResizedCrop)               | ✓     | ✓    | ✓      | ✓         |
  | [RandomRotate90](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.RandomRotate90)                     | ✓     | ✓    | ✓      | ✓         |
  | [RandomScale](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.RandomScale)                           | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedBBoxSafeCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomSizedBBoxSafeCrop)   | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedCrop](https://albumentations.ai/docs/api_reference/augmentations/crops/transforms/#albumentations.augmentations.crops.transforms.RandomSizedCrop)                   | ✓     | ✓    | ✓      | ✓         |
  | [Resize](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.Resize)                                     | ✓     | ✓    | ✓      | ✓         |
  | [Rotate](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.Rotate)                                     | ✓     | ✓    | ✓      | ✓         |
  | [SafeRotate](https://albumentations.ai/docs/api_reference/augmentations/geometric/rotate/#albumentations.augmentations.geometric.rotate.SafeRotate)                             | ✓     | ✓    | ✓      | ✓         |
  | [ShiftScaleRotate](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.ShiftScaleRotate)         | ✓     | ✓    | ✓      | ✓         |
  | [SmallestMaxSize](https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/#albumentations.augmentations.geometric.resize.SmallestMaxSize)                   | ✓     | ✓    | ✓      | ✓         |
  | [Transpose](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.Transpose)                       | ✓     | ✓    | ✓      | ✓         |
  | [VerticalFlip](https://albumentations.ai/docs/api_reference/augmentations/geometric/transforms/#albumentations.augmentations.geometric.transforms.VerticalFlip)                 | ✓     | ✓    | ✓      | ✓         |
  | [XYMasking](https://albumentations.ai/docs/api_reference/augmentations/dropout/xy_masking/#albumentations.augmentations.dropout.xy_masking.XYMasking)                           | ✓     | ✓    |        | ✓         |



  Transforms that mix several images into one

  | Transform                                                                                                                                                       | Image | Mask | BBoxes | Keypoints | Global Label |
  | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---: | :--: | :----: | :-------: | :----------: |
  | [MixUp](https://albumentations.ai/docs/api_reference/augmentations/mixing/transforms/#albumentations.augmentations.mixing.transforms.MixUp)                     | ✓     | ✓    |        |           | ✓            |
  | [OverlayElements](https://albumentations.ai/docs/api_reference/augmentations/mixing/transforms/#albumentations.augmentations.mixing.transforms.OverlayElements) | ✓     | ✓    |        |           |              |





  ![inria](https://habrastorage.org/webt/su/wa/np/suwanpeo6ww7wpwtobtrzd_cg20.jpeg)



  ![medical](https://habrastorage.org/webt/1i/fi/wz/1ifiwzy0lxetc4nwjvss-71nkw0.jpeg)



  ![vistas](https://habrastorage.org/webt/rz/-h/3j/rz-h3jalbxic8o_fhucxysts4tc.jpeg)



  <img src="https://habrastorage.org/webt/e-/6k/z-/e-6kz-fugp2heak3jzns3bc-r8o.jpeg" width=100%>



  To run the benchmark yourself, follow the instructions in [benchmark/README.md](https://github.com/albumentations-team/albumentations/blob/master/benchmark/README.md)

  Results for running the benchmark on the first 2000 images from the ImageNet validation set using an AMD Ryzen Threadripper 3970X CPU.
  The table shows how many images per second can be processed on a single core; higher is better.

  | Library | Version |
  |---------|---------|
  | Python | 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] |
  | albumentations | 1.4.11 |
  | imgaug | 0.4.0 |
  | torchvision | 0.18.1+rocm6.0 |
  | numpy | 1.26.4 |
  | opencv-python-headless | 4.10.0.84 |
  | scikit-image | 0.24.0 |
  | scipy | 1.14.0 |
  | pillow | 10.4.0 |
  | kornia | 0.7.3 |
  | augly | 1.0.0 |

  |                 |albumentations<br><small>1.4.11</small>|torchvision<br><small>0.18.1+rocm6.0</small>|kornia<br><small>0.7.3</small>|augly<br><small>1.0.0</small>|imgaug<br><small>0.4.0</small>|
  |-----------------|--------------------------------------|--------------------------------------------|------------------------------|-----------------------------|------------------------------|
  |HorizontalFlip   |**8017 ± 12**                         |2436 ± 2                                    |935 ± 3                       |3575 ± 4                     |4806 ± 7                      |
  |VerticalFlip     |7366 ± 7                              |2563 ± 8                                    |943 ± 1                       |4949 ± 5                     |**8159 ± 21**                 |
  |Rotate           |570 ± 12                              |152 ± 2                                     |207 ± 1                       |**633 ± 2**                  |496 ± 2                       |
  |Affine           |**1382 ± 31**                         |162 ± 1                                     |201 ± 1                       |-                            |682 ± 2                       |
  |Equalize         |1027 ± 2                              |336 ± 2                                     |77 ± 1                        |-                            |**1183 ± 1**                  |
  |RandomCrop64     |**19986 ± 57**                        |15336 ± 16                                  |811 ± 1                       |19882 ± 356                  |5410 ± 5                      |
  |RandomResizedCrop|**2308 ± 7**                          |1046 ± 3                                    |187 ± 1                       |-                            |-                             |
  |ShiftRGB         |1240 ± 3                              |-                                           |425 ± 2                       |-                            |**1554 ± 6**                  |
  |Resize           |**2314 ± 9**                          |1272 ± 3                                    |201 ± 3                       |431 ± 1                      |1715 ± 2                      |
  |RandomGamma      |**2552 ± 2**                          |232 ± 1                                     |211 ± 1                       |-                            |1794 ± 1                      |
  |Grayscale        |**7313 ± 4**                          |1652 ± 2                                    |443 ± 2                       |2639 ± 2                     |1171 ± 23                     |
  |ColorJitter      |**396 ± 1**                           |51 ± 1                                      |50 ± 1                        |224 ± 1                      |-                             |
  |PlankianJitter   |449 ± 1                               |-                                           |**598 ± 1**                   |-                            |-                             |
  |RandomPerspective|471 ± 1                               |123 ± 1                                     |114 ± 1                       |-                            |**478 ± 2**                   |
  |GaussianBlur     |**2099 ± 2**                          |113 ± 2                                     |79 ± 2                        |165 ± 1                      |1244 ± 2                      |
  |MedianBlur       |538 ± 1                               |-                                           |3 ± 1                         |-                            |**565 ± 1**                   |
  |MotionBlur       |**2197 ± 9**                          |-                                           |102 ± 1                       |-                            |508 ± 1                       |
  |Posterize        |2449 ± 1                              |**2587 ± 3**                                |339 ± 6                       |-                            |1547 ± 1                      |
  |JpegCompression  |**827 ± 1**                           |-                                           |50 ± 2                        |684 ± 1                      |428 ± 4                       |
  |GaussianNoise    |78 ± 1                                |-                                           |-                             |67 ± 1                       |**128 ± 1**                   |
  |Elastic          |127 ± 1                               |3 ± 1                                       |1 ± 1                         |-                            |**130 ± 1**                   |
  |Normalize        |**971 ± 2**                           |449 ± 1                                     |415 ± 1                       |-                            |-                             |



  To create a pull request to the repository, follow the documentation at [CONTRIBUTING.md](CONTRIBUTING.md)

  ![https://github.com/albuemntations-team/albumentation/graphs/contributors](https://contrib.rocks/image?repo=albumentations-team/albumentations)



  - [Twitter](https://twitter.com/albumentations)
  - [Discord](https://discord.gg/AKPrrDYNAt)



  In some systems, in the multiple GPU regime, PyTorch may deadlock the DataLoader if OpenCV was compiled with OpenCL optimizations. Adding the following two lines before the library import may help. For more details [https://github.com/pytorch/pytorch/issues/1355](https://github.com/pytorch/pytorch/issues/1355)

  ```python
  cv2.setNumThreads(0)
  cv2.ocl.setUseOpenCL(False)
  ```



  If you find this library useful for your research, please consider citing [Albumentations: Fast and Flexible Image Augmentations](https://www.mdpi.com/2078-2489/11/2/125):

  ```bibtex
  @Article{info11020125,
      AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
      TITLE = {Albumentations: Fast and Flexible Image Augmentations},
      JOURNAL = {Information},
      VOLUME = {11},
      YEAR = {2020},
      NUMBER = {2},
      ARTICLE-NUMBER = {125},
      URL = {https://www.mdpi.com/2078-2489/11/2/125},
      ISSN = {2078-2489},
      DOI = {10.3390/info11020125}
  }
  ```


pkgId: 7fe288ab55838eb20592336b003a4436a30276d600ac1b5bc7896b8a76b4f55a
name: python-albumentations
arch: src
version: 1.4.18
epoch: 0
release: 1
url: https://albumentations.ai
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albumentations-1.4.18-1.src.rpm
checksum_type: sha256
summary:
  Fast, flexible, and advanced image augmentation library for deep learning and computer vision. Albumentations offers a wide range of transformations for images, masks, bounding boxes, and keypoints, with optimized performance and seamless integration into ML workflows.

description:
  [![PyPI version](https://badge.fury.io/py/albumentations.svg)](https://badge.fury.io/py/albumentations)
  ![CI](https://github.com/albumentations-team/albumentations/workflows/CI/badge.svg)
  [![PyPI Downloads](https://img.shields.io/pypi/dm/albumentations.svg?label=PyPI%20downloads)](
  https://pypi.org/project/albumentations/)
  [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/albumentations.svg?label=Conda%20downloads)](
  https://anaconda.org/conda-forge/albumentations)
  [![Stack Overflow](https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg)](
  https://stackoverflow.com/questions/tagged/albumentations)
  [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)

  [Docs](https://albumentations.ai/docs/) | [Discord](https://discord.gg/AKPrrDYNAt) | [Twitter](https://twitter.com/albumentations) | [LinkedIn](https://www.linkedin.com/company/100504475/)

  Albumentations is a Python library for image augmentation. Image augmentation is used in deep learning and computer vision tasks to increase the quality of trained models. The purpose of image augmentation is to create new training samples from the existing data.

  Here is an example of how you can apply some [pixel-level](#pixel-level-transforms) augmentations from Albumentations to create new images from the original one:
  ![parrot](https://habrastorage.org/webt/bd/ne/rv/bdnerv5ctkudmsaznhw4crsdfiw.jpeg)



  - Albumentations **[supports all common computer vision tasks](#i-want-to-use-albumentations-for-the-specific-task-such-as-classification-or-segmentation)** such as classification, semantic segmentation, instance segmentation, object detection, and pose estimation.
  - The library provides **[a simple unified API](#a-simple-example)** to work with all data types: images (RBG-images, grayscale images, multispectral images), segmentation masks, bounding boxes, and keypoints.
  - The library contains **[more than 70 different augmentations](#list-of-augmentations)** to generate new training samples from the existing data.
  - Albumentations is [**fast**](#benchmarking-results). We benchmark each new release to ensure that augmentations provide maximum speed.
  - It **[works with popular deep learning frameworks](#i-want-to-know-how-to-use-albumentations-with-deep-learning-frameworks)** such as PyTorch and TensorFlow. By the way, Albumentations is a part of the [PyTorch ecosystem](https://pytorch.org/ecosystem/).
  - [**Written by experts**](#authors). The authors have experience both working on production computer vision systems and participating in competitive machine learning. Many core team members are Kaggle Masters and Grandmasters.
  - The library is [**widely used**](#who-is-using-albumentations) in industry, deep learning research, machine learning competitions, and open source projects.



  <a href="https://roboflow.com/" target="_blank"><img src="https://avatars.githubusercontent.com/u/53104118?s=200&v=4" width="100"/></a>



  - [Albumentations](#albumentations)
    - [Why Albumentations](#why-albumentations)
    - [Sponsors](#sponsors)
    - [Table of contents](#table-of-contents)
    - [Authors](#authors)
    - [Installation](#installation)
    - [Documentation](#documentation)
    - [A simple example](#a-simple-example)
    - [Getting started](#getting-started)
      - [I am new to image augmentation](#i-am-new-to-image-augmentation)
      - [I want to use Albumentations for the specific task such as classification or segmentation](#i-want-to-use-albumentations-for-the-specific-task-such-as-classification-or-segmentation)
      - [I want to know how to use Albumentations with deep learning frameworks](#i-want-to-know-how-to-use-albumentations-with-deep-learning-frameworks)
      - [I want to explore augmentations and see Albumentations in action](#i-want-to-explore-augmentations-and-see-albumentations-in-action)
    - [Who is using Albumentations](#who-is-using-albumentations)
      - [See also](#see-also)
    - [List of augmentations](#list-of-augmentations)
      - [Pixel-level transforms](#pixel-level-transforms)
      - [Spatial-level transforms](#spatial-level-transforms)
    - [A few more examples of **augmentations**](#a-few-more-examples-of-augmentations)
      - [Semantic segmentation on the Inria dataset](#semantic-segmentation-on-the-inria-dataset)
      - [Medical imaging](#medical-imaging)
      - [Object detection and semantic segmentation on the Mapillary Vistas dataset](#object-detection-and-semantic-segmentation-on-the-mapillary-vistas-dataset)
      - [Keypoints augmentation](#keypoints-augmentation)
    - [Benchmarking results](#benchmarking-results)
    - [Contributing](#contributing)
    - [Community and Support](#community-and-support)
    - [Comments](#comments)
    - [Citing](#citing)



  [**Vladimir I. Iglovikov**](https://www.linkedin.com/in/iglovikov/) | [Kaggle Grandmaster](https://www.kaggle.com/iglovikov)

  [**Mikhail Druzhinin**](https://www.linkedin.com/in/mikhail-druzhinin-548229100/) | [Kaggle Expert](https://www.kaggle.com/dipetm)

  [**Alex Parinov**](https://www.linkedin.com/in/alex-parinov/) | [Kaggle Master](https://www.kaggle.com/creafz)

  [**Alexander Buslaev** — Computer Vision Engineer at Mapbox](https://www.linkedin.com/in/al-buslaev/) | [Kaggle Master](https://www.kaggle.com/albuslaev)

  [**Evegene Khvedchenya** — Computer Vision Research Engineer at Piñata Farms](https://www.linkedin.com/in/cvtalks/) | [Kaggle Grandmaster](https://www.kaggle.com/bloodaxe)



  Albumentations requires Python 3.8 or higher. To install the latest version from PyPI:

  ```bash
  pip install -U albumentations
  ```

  Other installation options are described in the [documentation](https://albumentations.ai/docs/getting_started/installation/).



  The full documentation is available at **[https://albumentations.ai/docs/](https://albumentations.ai/docs/)**.



  ```python
  import albumentations as A
  import cv2


  transform = A.Compose([
      A.RandomCrop(width=256, height=256),
      A.HorizontalFlip(p=0.5),
      A.RandomBrightnessContrast(p=0.2),
  ])


  image = cv2.imread("image.jpg")
  image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)


  transformed = transform(image=image)
  transformed_image = transformed["image"]
  ```





  Please start with the [introduction articles](https://albumentations.ai/docs/#introduction-to-image-augmentation) about why image augmentation is important and how it helps to build better models.



  If you want to use Albumentations for a specific task such as classification, segmentation, or object detection, refer to the [set of articles](https://albumentations.ai/docs/#getting-started-with-albumentations) that has an in-depth description of this task. We also have a [list of examples](https://albumentations.ai/docs/examples/) on applying Albumentations for different use cases.



  We have [examples of using Albumentations](https://albumentations.ai/docs/#examples-of-how-to-use-albumentations-with-different-deep-learning-frameworks) along with PyTorch and TensorFlow.



  Check the [online demo of the library](https://albumentations-demo.herokuapp.com/). With it, you can apply augmentations to different images and see the result. Also, we have a [list of all available augmentations and their targets](#list-of-augmentations).



  <a href="https://www.apple.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/apple.jpeg" width="100"/></a>
  <a href="https://research.google/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/google.png" width="100"/></a>
  <a href="https://opensource.fb.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/meta_research.png" width="100"/></a>
  <a href="https: //www.nvidia.com/en-us/research/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/nvidia_research.jpeg" width="100"/></a>
  <a href="https://www.amazon.science/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/amazon_science.png" width="100"/></a>
  <a href="https://opensource.microsoft.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/microsoft.png" width="100"/></a>
  <a href="https://engineering.salesforce.com/open-source/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/salesforce_open_source.png" width="100"/></a>
  <a href="https://stability.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/stability.png" width="100"/></a>
  <a href="https://www.ibm.com/opensource/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/ibm.jpeg" width="100"/></a>
  <a href="https://huggingface.co/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/hugging_face.png" width="100"/></a>
  <a href="https://www.sony.com/en/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/sony.png" width="100"/></a>
  <a href="https://opensource.alibaba.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/alibaba.png" width="100"/></a>
  <a href="https://opensource.tencent.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/tencent.png" width="100"/></a>
  <a href="https://h2o.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/html/assets/img/industry/h2o_ai.png" width="100"/></a>



  - [A list of papers that cite Albumentations](https://scholar.google.com/citations?view_op=view_citation&citation_for_view=vkjh9X0AAAAJ:r0BpntZqJG4C).
  - [A list of teams that were using Albumentations and took high places in machine learning competitions](https://albumentations.ai/whos_using#competitions).
  - [Open source projects that use Albumentations](https://github.com/albumentations-team/albumentations/network/dependents?dependent_type=PACKAGE).





  Pixel-level transforms will change just an input image and will leave any additional targets such as masks, bounding boxes, and keypoints unchanged. The list of pixel-level transforms:

  - [AdvancedBlur](https://explore.albumentations.ai/transform/AdvancedBlur)
  - [Blur](https://explore.albumentations.ai/transform/Blur)
  - [CLAHE](https://explore.albumentations.ai/transform/CLAHE)
  - [ChannelDropout](https://explore.albumentations.ai/transform/ChannelDropout)
  - [ChannelShuffle](https://explore.albumentations.ai/transform/ChannelShuffle)
  - [ChromaticAberration](https://explore.albumentations.ai/transform/ChromaticAberration)
  - [ColorJitter](https://explore.albumentations.ai/transform/ColorJitter)
  - [Defocus](https://explore.albumentations.ai/transform/Defocus)
  - [Downscale](https://explore.albumentations.ai/transform/Downscale)
  - [Emboss](https://explore.albumentations.ai/transform/Emboss)
  - [Equalize](https://explore.albumentations.ai/transform/Equalize)
  - [FDA](https://explore.albumentations.ai/transform/FDA)
  - [FancyPCA](https://explore.albumentations.ai/transform/FancyPCA)
  - [FromFloat](https://explore.albumentations.ai/transform/FromFloat)
  - [GaussNoise](https://explore.albumentations.ai/transform/GaussNoise)
  - [GaussianBlur](https://explore.albumentations.ai/transform/GaussianBlur)
  - [GlassBlur](https://explore.albumentations.ai/transform/GlassBlur)
  - [HistogramMatching](https://explore.albumentations.ai/transform/HistogramMatching)
  - [HueSaturationValue](https://explore.albumentations.ai/transform/HueSaturationValue)
  - [ISONoise](https://explore.albumentations.ai/transform/ISONoise)
  - [ImageCompression](https://explore.albumentations.ai/transform/ImageCompression)
  - [InvertImg](https://explore.albumentations.ai/transform/InvertImg)
  - [MedianBlur](https://explore.albumentations.ai/transform/MedianBlur)
  - [MotionBlur](https://explore.albumentations.ai/transform/MotionBlur)
  - [MultiplicativeNoise](https://explore.albumentations.ai/transform/MultiplicativeNoise)
  - [Normalize](https://explore.albumentations.ai/transform/Normalize)
  - [PixelDistributionAdaptation](https://explore.albumentations.ai/transform/PixelDistributionAdaptation)
  - [PlanckianJitter](https://explore.albumentations.ai/transform/PlanckianJitter)
  - [Posterize](https://explore.albumentations.ai/transform/Posterize)
  - [RGBShift](https://explore.albumentations.ai/transform/RGBShift)
  - [RandomBrightnessContrast](https://explore.albumentations.ai/transform/RandomBrightnessContrast)
  - [RandomFog](https://explore.albumentations.ai/transform/RandomFog)
  - [RandomGamma](https://explore.albumentations.ai/transform/RandomGamma)
  - [RandomGravel](https://explore.albumentations.ai/transform/RandomGravel)
  - [RandomRain](https://explore.albumentations.ai/transform/RandomRain)
  - [RandomShadow](https://explore.albumentations.ai/transform/RandomShadow)
  - [RandomSnow](https://explore.albumentations.ai/transform/RandomSnow)
  - [RandomSunFlare](https://explore.albumentations.ai/transform/RandomSunFlare)
  - [RandomToneCurve](https://explore.albumentations.ai/transform/RandomToneCurve)
  - [RingingOvershoot](https://explore.albumentations.ai/transform/RingingOvershoot)
  - [Sharpen](https://explore.albumentations.ai/transform/Sharpen)
  - [Solarize](https://explore.albumentations.ai/transform/Solarize)
  - [Spatter](https://explore.albumentations.ai/transform/Spatter)
  - [Superpixels](https://explore.albumentations.ai/transform/Superpixels)
  - [TemplateTransform](https://explore.albumentations.ai/transform/TemplateTransform)
  - [TextImage](https://explore.albumentations.ai/transform/TextImage)
  - [ToFloat](https://explore.albumentations.ai/transform/ToFloat)
  - [ToGray](https://explore.albumentations.ai/transform/ToGray)
  - [ToRGB](https://explore.albumentations.ai/transform/ToRGB)
  - [ToSepia](https://explore.albumentations.ai/transform/ToSepia)
  - [UnsharpMask](https://explore.albumentations.ai/transform/UnsharpMask)
  - [ZoomBlur](https://explore.albumentations.ai/transform/ZoomBlur)



  Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. The following table shows which additional targets are supported by each transform.

  | Transform                                                                                        | Image | Mask | BBoxes | Keypoints |
  | ------------------------------------------------------------------------------------------------ | :---: | :--: | :----: | :-------: |
  | [Affine](https://explore.albumentations.ai/transform/Affine)                                     | ✓     | ✓    | ✓      | ✓         |
  | [BBoxSafeRandomCrop](https://explore.albumentations.ai/transform/BBoxSafeRandomCrop)             | ✓     | ✓    | ✓      | ✓         |
  | [CenterCrop](https://explore.albumentations.ai/transform/CenterCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [CoarseDropout](https://explore.albumentations.ai/transform/CoarseDropout)                       | ✓     | ✓    | ✓      | ✓         |
  | [Crop](https://explore.albumentations.ai/transform/Crop)                                         | ✓     | ✓    | ✓      | ✓         |
  | [CropAndPad](https://explore.albumentations.ai/transform/CropAndPad)                             | ✓     | ✓    | ✓      | ✓         |
  | [CropNonEmptyMaskIfExists](https://explore.albumentations.ai/transform/CropNonEmptyMaskIfExists) | ✓     | ✓    | ✓      | ✓         |
  | [D4](https://explore.albumentations.ai/transform/D4)                                             | ✓     | ✓    | ✓      | ✓         |
  | [ElasticTransform](https://explore.albumentations.ai/transform/ElasticTransform)                 | ✓     | ✓    | ✓      | ✓         |
  | [GridDistortion](https://explore.albumentations.ai/transform/GridDistortion)                     | ✓     | ✓    | ✓      | ✓         |
  | [GridDropout](https://explore.albumentations.ai/transform/GridDropout)                           | ✓     | ✓    | ✓      | ✓         |
  | [GridElasticDeform](https://explore.albumentations.ai/transform/GridElasticDeform)               | ✓     | ✓    | ✓      | ✓         |
  | [HorizontalFlip](https://explore.albumentations.ai/transform/HorizontalFlip)                     | ✓     | ✓    | ✓      | ✓         |
  | [Lambda](https://explore.albumentations.ai/transform/Lambda)                                     | ✓     | ✓    | ✓      | ✓         |
  | [LongestMaxSize](https://explore.albumentations.ai/transform/LongestMaxSize)                     | ✓     | ✓    | ✓      | ✓         |
  | [MaskDropout](https://explore.albumentations.ai/transform/MaskDropout)                           | ✓     | ✓    | ✓      | ✓         |
  | [Morphological](https://explore.albumentations.ai/transform/Morphological)                       | ✓     | ✓    | ✓      | ✓         |
  | [NoOp](https://explore.albumentations.ai/transform/NoOp)                                         | ✓     | ✓    | ✓      | ✓         |
  | [OpticalDistortion](https://explore.albumentations.ai/transform/OpticalDistortion)               | ✓     | ✓    | ✓      | ✓         |
  | [OverlayElements](https://explore.albumentations.ai/transform/OverlayElements)                   | ✓     | ✓    |        |           |
  | [PadIfNeeded](https://explore.albumentations.ai/transform/PadIfNeeded)                           | ✓     | ✓    | ✓      | ✓         |
  | [Perspective](https://explore.albumentations.ai/transform/Perspective)                           | ✓     | ✓    | ✓      | ✓         |
  | [PiecewiseAffine](https://explore.albumentations.ai/transform/PiecewiseAffine)                   | ✓     | ✓    | ✓      | ✓         |
  | [PixelDropout](https://explore.albumentations.ai/transform/PixelDropout)                         | ✓     | ✓    | ✓      | ✓         |
  | [RandomCrop](https://explore.albumentations.ai/transform/RandomCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [RandomCropFromBorders](https://explore.albumentations.ai/transform/RandomCropFromBorders)       | ✓     | ✓    | ✓      | ✓         |
  | [RandomGridShuffle](https://explore.albumentations.ai/transform/RandomGridShuffle)               | ✓     | ✓    |        | ✓         |
  | [RandomResizedCrop](https://explore.albumentations.ai/transform/RandomResizedCrop)               | ✓     | ✓    | ✓      | ✓         |
  | [RandomRotate90](https://explore.albumentations.ai/transform/RandomRotate90)                     | ✓     | ✓    | ✓      | ✓         |
  | [RandomScale](https://explore.albumentations.ai/transform/RandomScale)                           | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedBBoxSafeCrop](https://explore.albumentations.ai/transform/RandomSizedBBoxSafeCrop)   | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedCrop](https://explore.albumentations.ai/transform/RandomSizedCrop)                   | ✓     | ✓    | ✓      | ✓         |
  | [Resize](https://explore.albumentations.ai/transform/Resize)                                     | ✓     | ✓    | ✓      | ✓         |
  | [Rotate](https://explore.albumentations.ai/transform/Rotate)                                     | ✓     | ✓    | ✓      | ✓         |
  | [SafeRotate](https://explore.albumentations.ai/transform/SafeRotate)                             | ✓     | ✓    | ✓      | ✓         |
  | [ShiftScaleRotate](https://explore.albumentations.ai/transform/ShiftScaleRotate)                 | ✓     | ✓    | ✓      | ✓         |
  | [SmallestMaxSize](https://explore.albumentations.ai/transform/SmallestMaxSize)                   | ✓     | ✓    | ✓      | ✓         |
  | [Transpose](https://explore.albumentations.ai/transform/Transpose)                               | ✓     | ✓    | ✓      | ✓         |
  | [VerticalFlip](https://explore.albumentations.ai/transform/VerticalFlip)                         | ✓     | ✓    | ✓      | ✓         |
  | [XYMasking](https://explore.albumentations.ai/transform/XYMasking)                               | ✓     | ✓    | ✓      | ✓         |





  ![inria](https://habrastorage.org/webt/su/wa/np/suwanpeo6ww7wpwtobtrzd_cg20.jpeg)



  ![medical](https://habrastorage.org/webt/1i/fi/wz/1ifiwzy0lxetc4nwjvss-71nkw0.jpeg)



  ![vistas](https://habrastorage.org/webt/rz/-h/3j/rz-h3jalbxic8o_fhucxysts4tc.jpeg)



  <img src="https://habrastorage.org/webt/e-/6k/z-/e-6kz-fugp2heak3jzns3bc-r8o.jpeg" width=100%>



  To run the benchmark yourself, follow the instructions in [benchmark/README.md](https://github.com/albumentations-team/albumentations/blob/master/benchmark/README.md)

  Results for running the benchmark on the first 2000 images from the ImageNet validation set using an AMD Ryzen Threadripper 3970X CPU.
  The table shows how many images per second can be processed on a single core; higher is better.

  | Library | Version |
  |---------|---------|
  | Python | 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] |
  | albumentations | 1.4.11 |
  | imgaug | 0.4.0 |
  | torchvision | 0.18.1+rocm6.0 |
  | numpy | 1.26.4 |
  | opencv-python-headless | 4.10.0.84 |
  | scikit-image | 0.24.0 |
  | scipy | 1.14.0 |
  | pillow | 10.4.0 |
  | kornia | 0.7.3 |
  | augly | 1.0.0 |

  |                 |albumentations<br><small>1.4.11</small>|torchvision<br><small>0.18.1+rocm6.0</small>|kornia<br><small>0.7.3</small>|augly<br><small>1.0.0</small>|imgaug<br><small>0.4.0</small>|
  |-----------------|--------------------------------------|--------------------------------------------|------------------------------|-----------------------------|------------------------------|
  |HorizontalFlip   |**8017 ± 12**                         |2436 ± 2                                    |935 ± 3                       |3575 ± 4                     |4806 ± 7                      |
  |VerticalFlip     |7366 ± 7                              |2563 ± 8                                    |943 ± 1                       |4949 ± 5                     |**8159 ± 21**                 |
  |Rotate           |570 ± 12                              |152 ± 2                                     |207 ± 1                       |**633 ± 2**                  |496 ± 2                       |
  |Affine           |**1382 ± 31**                         |162 ± 1                                     |201 ± 1                       |-                            |682 ± 2                       |
  |Equalize         |1027 ± 2                              |336 ± 2                                     |77 ± 1                        |-                            |**1183 ± 1**                  |
  |RandomCrop64     |**19986 ± 57**                        |15336 ± 16                                  |811 ± 1                       |19882 ± 356                  |5410 ± 5                      |
  |RandomResizedCrop|**2308 ± 7**                          |1046 ± 3                                    |187 ± 1                       |-                            |-                             |
  |ShiftRGB         |1240 ± 3                              |-                                           |425 ± 2                       |-                            |**1554 ± 6**                  |
  |Resize           |**2314 ± 9**                          |1272 ± 3                                    |201 ± 3                       |431 ± 1                      |1715 ± 2                      |
  |RandomGamma      |**2552 ± 2**                          |232 ± 1                                     |211 ± 1                       |-                            |1794 ± 1                      |
  |Grayscale        |**7313 ± 4**                          |1652 ± 2                                    |443 ± 2                       |2639 ± 2                     |1171 ± 23                     |
  |ColorJitter      |**396 ± 1**                           |51 ± 1                                      |50 ± 1                        |224 ± 1                      |-                             |
  |PlankianJitter   |449 ± 1                               |-                                           |**598 ± 1**                   |-                            |-                             |
  |RandomPerspective|471 ± 1                               |123 ± 1                                     |114 ± 1                       |-                            |**478 ± 2**                   |
  |GaussianBlur     |**2099 ± 2**                          |113 ± 2                                     |79 ± 2                        |165 ± 1                      |1244 ± 2                      |
  |MedianBlur       |538 ± 1                               |-                                           |3 ± 1                         |-                            |**565 ± 1**                   |
  |MotionBlur       |**2197 ± 9**                          |-                                           |102 ± 1                       |-                            |508 ± 1                       |
  |Posterize        |2449 ± 1                              |**2587 ± 3**                                |339 ± 6                       |-                            |1547 ± 1                      |
  |JpegCompression  |**827 ± 1**                           |-                                           |50 ± 2                        |684 ± 1                      |428 ± 4                       |
  |GaussianNoise    |78 ± 1                                |-                                           |-                             |67 ± 1                       |**128 ± 1**                   |
  |Elastic          |127 ± 1                               |3 ± 1                                       |1 ± 1                         |-                            |**130 ± 1**                   |
  |Normalize        |**971 ± 2**                           |449 ± 1                                     |415 ± 1                       |-                            |-                             |



  To create a pull request to the repository, follow the documentation at [CONTRIBUTING.md](CONTRIBUTING.md)

  ![https://github.com/albuemntations-team/albumentation/graphs/contributors](https://contrib.rocks/image?repo=albumentations-team/albumentations)



  - [Twitter](https://twitter.com/albumentations)
  - [Discord](https://discord.gg/AKPrrDYNAt)



  In some systems, in the multiple GPU regime, PyTorch may deadlock the DataLoader if OpenCV was compiled with OpenCL optimizations. Adding the following two lines before the library import may help. For more details [https://github.com/pytorch/pytorch/issues/1355](https://github.com/pytorch/pytorch/issues/1355)

  ```python
  cv2.setNumThreads(0)
  cv2.ocl.setUseOpenCL(False)
  ```



  If you find this library useful for your research, please consider citing [Albumentations: Fast and Flexible Image Augmentations](https://www.mdpi.com/2078-2489/11/2/125):

  ```bibtex
  @Article{info11020125,
      AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
      TITLE = {Albumentations: Fast and Flexible Image Augmentations},
      JOURNAL = {Information},
      VOLUME = {11},
      YEAR = {2020},
      NUMBER = {2},
      ARTICLE-NUMBER = {125},
      URL = {https://www.mdpi.com/2078-2489/11/2/125},
      ISSN = {2078-2489},
      DOI = {10.3390/info11020125}
  }
  ```

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


pkgId: 218acbb924cb02c8c9dc298bdfb9a06c8e4475d89fdb94883e587c00e8d58fc2
name: python-albumentations
arch: src
version: 1.4.22
epoch: 0
release: 1
url: https://albumentations.ai
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-albumentations-1.4.22-1.src.rpm
checksum_type: sha256
summary:
  Fast, flexible, and advanced image augmentation library for deep learning and computer vision. Albumentations offers a wide range of transformations for images, masks, bounding boxes, and keypoints, with optimized performance and seamless integration into ML workflows.

description:
  Your sponsorship is a way to say "thank you" to the maintainers and contributors who spend their free time building and maintaining Albumentations. Sponsors are featured on our website and README. View sponsorship tiers on [GitHub Sponsors](https://github.com/sponsors/albumentations-team)

  - [Albumentations](#albumentations)
    - [Why Albumentations](#why-albumentations)
    - [Community-Driven Project, Supported By](#community-driven-project-supported-by)
      - [💝 Become a Sponsor](#-become-a-sponsor)
    - [Table of contents](#table-of-contents)
    - [Authors](#authors)
      - [Current Maintainer](#current-maintainer)
      - [Emeritus Core Team Members](#emeritus-core-team-members)
    - [Installation](#installation)
    - [Documentation](#documentation)
    - [A simple example](#a-simple-example)
    - [Getting started](#getting-started)
      - [I am new to image augmentation](#i-am-new-to-image-augmentation)
      - [I want to use Albumentations for the specific task such as classification or segmentation](#i-want-to-use-albumentations-for-the-specific-task-such-as-classification-or-segmentation)
      - [I want to know how to use Albumentations with deep learning frameworks](#i-want-to-know-how-to-use-albumentations-with-deep-learning-frameworks)
      - [I want to explore augmentations and see Albumentations in action](#i-want-to-explore-augmentations-and-see-albumentations-in-action)
    - [Who is using Albumentations](#who-is-using-albumentations)
      - [See also](#see-also)
    - [List of augmentations](#list-of-augmentations)
      - [Pixel-level transforms](#pixel-level-transforms)
      - [Spatial-level transforms](#spatial-level-transforms)
    - [A few more examples of **augmentations**](#a-few-more-examples-of-augmentations)
      - [Semantic segmentation on the Inria dataset](#semantic-segmentation-on-the-inria-dataset)
      - [Medical imaging](#medical-imaging)
      - [Object detection and semantic segmentation on the Mapillary Vistas dataset](#object-detection-and-semantic-segmentation-on-the-mapillary-vistas-dataset)
      - [Keypoints augmentation](#keypoints-augmentation)
    - [Benchmarking results](#benchmarking-results)
      - [System Information](#system-information)
      - [Benchmark Parameters](#benchmark-parameters)
      - [Library Versions](#library-versions)
    - [Performance Comparison](#performance-comparison)
    - [Contributing](#contributing)
    - [Community](#community)
    - [Citing](#citing)


  [**Vladimir I. Iglovikov**](https://www.linkedin.com/in/iglovikov/) | [Kaggle Grandmaster](https://www.kaggle.com/iglovikov)

  [**Mikhail Druzhinin**](https://www.linkedin.com/in/mikhail-druzhinin-548229100/) | [Kaggle Expert](https://www.kaggle.com/dipetm)
  [**Alex Parinov**](https://www.linkedin.com/in/alex-parinov/) | [Kaggle Master](https://www.kaggle.com/creafz)
  [**Alexander Buslaev**](https://www.linkedin.com/in/al-buslaev/) | [Kaggle Master](https://www.kaggle.com/albuslaev)
  [**Eugene Khvedchenya**](https://www.linkedin.com/in/cvtalks/) | [Kaggle Grandmaster](https://www.kaggle.com/bloodaxe)

  Albumentations requires Python 3.9 or higher. To install the latest version from PyPI:
  ```bash
  pip install -U albumentations
  ```
  Other installation options are described in the [documentation](https://albumentations.ai/docs/getting_started/installation/).

  The full documentation is available at **[https://albumentations.ai/docs/](https://albumentations.ai/docs/)**.

  ```python
  import albumentations as A
  import cv2

  transform = A.Compose([
      A.RandomCrop(width=256, height=256),
      A.HorizontalFlip(p=0.5),
      A.RandomBrightnessContrast(p=0.2),
  ])

  image = cv2.imread("image.jpg")
  image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

  transformed = transform(image=image)
  transformed_image = transformed["image"]
  ```


  Please start with the [introduction articles](https://albumentations.ai/docs/#introduction-to-image-augmentation) about why image augmentation is important and how it helps to build better models.

  If you want to use Albumentations for a specific task such as classification, segmentation, or object detection, refer to the [set of articles](https://albumentations.ai/docs/#getting-started-with-albumentations) that has an in-depth description of this task. We also have a [list of examples](https://albumentations.ai/docs/examples/) on applying Albumentations for different use cases.

  We have [examples of using Albumentations](https://albumentations.ai/docs/#examples-of-how-to-use-albumentations-with-different-deep-learning-frameworks) along with PyTorch and TensorFlow.

  Check the [online demo of the library](https://albumentations-demo.herokuapp.com/). With it, you can apply augmentations to different images and see the result. Also, we have a [list of all available augmentations and their targets](#list-of-augmentations).

  <a href="https://www.apple.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/apple.jpeg" width="100"/></a>
  <a href="https://research.google/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/google.png" width="100"/></a>
  <a href="https://opensource.fb.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/meta_research.png" width="100"/></a>
  <a href="https://www.nvidia.com/en-us/research/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/nvidia_research.jpeg" width="100"/></a>
  <a href="https://www.amazon.science/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/amazon_science.png" width="100"/></a>
  <a href="https://opensource.microsoft.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/microsoft.png" width="100"/></a>
  <a href="https://engineering.salesforce.com/open-source/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/salesforce_open_source.png" width="100"/></a>
  <a href="https://stability.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/stability.png" width="100"/></a>
  <a href="https://www.ibm.com/opensource/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/ibm.jpeg" width="100"/></a>
  <a href="https://huggingface.co/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/hugging_face.png" width="100"/></a>
  <a href="https://www.sony.com/en/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/sony.png" width="100"/></a>
  <a href="https://opensource.alibaba.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/alibaba.png" width="100"/></a>
  <a href="https://opensource.tencent.com/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/tencent.png" width="100"/></a>
  <a href="https://h2o.ai/" target="_blank"><img src="https://raw.githubusercontent.com/albumentations-team/albumentations.ai/main/website/public/assets/industry/h2o_ai.png" width="100"/></a>

  - [A list of papers that cite Albumentations](https://scholar.google.com/citations?view_op=view_citation&citation_for_view=vkjh9X0AAAAJ:r0BpntZqJG4C).
  - [Open source projects that use Albumentations](https://github.com/albumentations-team/albumentations/network/dependents?dependent_type=PACKAGE).


  Pixel-level transforms will change just an input image and will leave any additional targets such as masks, bounding boxes, and keypoints unchanged. The list of pixel-level transforms:
  - [AdditiveNoise](https://explore.albumentations.ai/transform/AdditiveNoise)
  - [AdvancedBlur](https://explore.albumentations.ai/transform/AdvancedBlur)
  - [AutoContrast](https://explore.albumentations.ai/transform/AutoContrast)
  - [Blur](https://explore.albumentations.ai/transform/Blur)
  - [CLAHE](https://explore.albumentations.ai/transform/CLAHE)
  - [ChannelDropout](https://explore.albumentations.ai/transform/ChannelDropout)
  - [ChannelShuffle](https://explore.albumentations.ai/transform/ChannelShuffle)
  - [ChromaticAberration](https://explore.albumentations.ai/transform/ChromaticAberration)
  - [ColorJitter](https://explore.albumentations.ai/transform/ColorJitter)
  - [Defocus](https://explore.albumentations.ai/transform/Defocus)
  - [Downscale](https://explore.albumentations.ai/transform/Downscale)
  - [Emboss](https://explore.albumentations.ai/transform/Emboss)
  - [Equalize](https://explore.albumentations.ai/transform/Equalize)
  - [FDA](https://explore.albumentations.ai/transform/FDA)
  - [FancyPCA](https://explore.albumentations.ai/transform/FancyPCA)
  - [FromFloat](https://explore.albumentations.ai/transform/FromFloat)
  - [GaussianBlur](https://explore.albumentations.ai/transform/GaussianBlur)
  - [GlassBlur](https://explore.albumentations.ai/transform/GlassBlur)
  - [HistogramMatching](https://explore.albumentations.ai/transform/HistogramMatching)
  - [HueSaturationValue](https://explore.albumentations.ai/transform/HueSaturationValue)
  - [ISONoise](https://explore.albumentations.ai/transform/ISONoise)
  - [Illumination](https://explore.albumentations.ai/transform/Illumination)
  - [ImageCompression](https://explore.albumentations.ai/transform/ImageCompression)
  - [InvertImg](https://explore.albumentations.ai/transform/InvertImg)
  - [MedianBlur](https://explore.albumentations.ai/transform/MedianBlur)
  - [MotionBlur](https://explore.albumentations.ai/transform/MotionBlur)
  - [MultiplicativeNoise](https://explore.albumentations.ai/transform/MultiplicativeNoise)
  - [Normalize](https://explore.albumentations.ai/transform/Normalize)
  - [PixelDistributionAdaptation](https://explore.albumentations.ai/transform/PixelDistributionAdaptation)
  - [PlanckianJitter](https://explore.albumentations.ai/transform/PlanckianJitter)
  - [PlasmaBrightnessContrast](https://explore.albumentations.ai/transform/PlasmaBrightnessContrast)
  - [PlasmaShadow](https://explore.albumentations.ai/transform/PlasmaShadow)
  - [Posterize](https://explore.albumentations.ai/transform/Posterize)
  - [RGBShift](https://explore.albumentations.ai/transform/RGBShift)
  - [RandomBrightnessContrast](https://explore.albumentations.ai/transform/RandomBrightnessContrast)
  - [RandomFog](https://explore.albumentations.ai/transform/RandomFog)
  - [RandomGamma](https://explore.albumentations.ai/transform/RandomGamma)
  - [RandomGravel](https://explore.albumentations.ai/transform/RandomGravel)
  - [RandomRain](https://explore.albumentations.ai/transform/RandomRain)
  - [RandomShadow](https://explore.albumentations.ai/transform/RandomShadow)
  - [RandomSnow](https://explore.albumentations.ai/transform/RandomSnow)
  - [RandomSunFlare](https://explore.albumentations.ai/transform/RandomSunFlare)
  - [RandomToneCurve](https://explore.albumentations.ai/transform/RandomToneCurve)
  - [RingingOvershoot](https://explore.albumentations.ai/transform/RingingOvershoot)
  - [SaltAndPepper](https://explore.albumentations.ai/transform/SaltAndPepper)
  - [Sharpen](https://explore.albumentations.ai/transform/Sharpen)
  - [ShotNoise](https://explore.albumentations.ai/transform/ShotNoise)
  - [Solarize](https://explore.albumentations.ai/transform/Solarize)
  - [Spatter](https://explore.albumentations.ai/transform/Spatter)
  - [Superpixels](https://explore.albumentations.ai/transform/Superpixels)
  - [TemplateTransform](https://explore.albumentations.ai/transform/TemplateTransform)
  - [TextImage](https://explore.albumentations.ai/transform/TextImage)
  - [ToFloat](https://explore.albumentations.ai/transform/ToFloat)
  - [ToGray](https://explore.albumentations.ai/transform/ToGray)
  - [ToRGB](https://explore.albumentations.ai/transform/ToRGB)
  - [ToSepia](https://explore.albumentations.ai/transform/ToSepia)
  - [UnsharpMask](https://explore.albumentations.ai/transform/UnsharpMask)
  - [ZoomBlur](https://explore.albumentations.ai/transform/ZoomBlur)

  Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. The following table shows which additional targets are supported by each transform.
  | Transform                                                                                        | Image | Mask | BBoxes | Keypoints |
  | ------------------------------------------------------------------------------------------------ | :---: | :--: | :----: | :-------: |
  | [Affine](https://explore.albumentations.ai/transform/Affine)                                     | ✓     | ✓    | ✓      | ✓         |
  | [BBoxSafeRandomCrop](https://explore.albumentations.ai/transform/BBoxSafeRandomCrop)             | ✓     | ✓    | ✓      | ✓         |
  | [CenterCrop](https://explore.albumentations.ai/transform/CenterCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [CoarseDropout](https://explore.albumentations.ai/transform/CoarseDropout)                       | ✓     | ✓    | ✓      | ✓         |
  | [Crop](https://explore.albumentations.ai/transform/Crop)                                         | ✓     | ✓    | ✓      | ✓         |
  | [CropAndPad](https://explore.albumentations.ai/transform/CropAndPad)                             | ✓     | ✓    | ✓      | ✓         |
  | [CropNonEmptyMaskIfExists](https://explore.albumentations.ai/transform/CropNonEmptyMaskIfExists) | ✓     | ✓    | ✓      | ✓         |
  | [D4](https://explore.albumentations.ai/transform/D4)                                             | ✓     | ✓    | ✓      | ✓         |
  | [ElasticTransform](https://explore.albumentations.ai/transform/ElasticTransform)                 | ✓     | ✓    | ✓      | ✓         |
  | [Erasing](https://explore.albumentations.ai/transform/Erasing)                                   | ✓     | ✓    | ✓      | ✓         |
  | [FrequencyMasking](https://explore.albumentations.ai/transform/FrequencyMasking)                 | ✓     | ✓    | ✓      | ✓         |
  | [GridDistortion](https://explore.albumentations.ai/transform/GridDistortion)                     | ✓     | ✓    | ✓      | ✓         |
  | [GridDropout](https://explore.albumentations.ai/transform/GridDropout)                           | ✓     | ✓    | ✓      | ✓         |
  | [GridElasticDeform](https://explore.albumentations.ai/transform/GridElasticDeform)               | ✓     | ✓    | ✓      | ✓         |
  | [HorizontalFlip](https://explore.albumentations.ai/transform/HorizontalFlip)                     | ✓     | ✓    | ✓      | ✓         |
  | [Lambda](https://explore.albumentations.ai/transform/Lambda)                                     | ✓     | ✓    | ✓      | ✓         |
  | [LongestMaxSize](https://explore.albumentations.ai/transform/LongestMaxSize)                     | ✓     | ✓    | ✓      | ✓         |
  | [MaskDropout](https://explore.albumentations.ai/transform/MaskDropout)                           | ✓     | ✓    | ✓      | ✓         |
  | [Morphological](https://explore.albumentations.ai/transform/Morphological)                       | ✓     | ✓    | ✓      | ✓         |
  | [NoOp](https://explore.albumentations.ai/transform/NoOp)                                         | ✓     | ✓    | ✓      | ✓         |
  | [OpticalDistortion](https://explore.albumentations.ai/transform/OpticalDistortion)               | ✓     | ✓    | ✓      | ✓         |
  | [OverlayElements](https://explore.albumentations.ai/transform/OverlayElements)                   | ✓     | ✓    |        |           |
  | [Pad](https://explore.albumentations.ai/transform/Pad)                                           | ✓     | ✓    | ✓      | ✓         |
  | [PadIfNeeded](https://explore.albumentations.ai/transform/PadIfNeeded)                           | ✓     | ✓    | ✓      | ✓         |
  | [Perspective](https://explore.albumentations.ai/transform/Perspective)                           | ✓     | ✓    | ✓      | ✓         |
  | [PiecewiseAffine](https://explore.albumentations.ai/transform/PiecewiseAffine)                   | ✓     | ✓    | ✓      | ✓         |
  | [PixelDropout](https://explore.albumentations.ai/transform/PixelDropout)                         | ✓     | ✓    | ✓      | ✓         |
  | [RandomCrop](https://explore.albumentations.ai/transform/RandomCrop)                             | ✓     | ✓    | ✓      | ✓         |
  | [RandomCropFromBorders](https://explore.albumentations.ai/transform/RandomCropFromBorders)       | ✓     | ✓    | ✓      | ✓         |
  | [RandomGridShuffle](https://explore.albumentations.ai/transform/RandomGridShuffle)               | ✓     | ✓    | ✓      | ✓         |
  | [RandomResizedCrop](https://explore.albumentations.ai/transform/RandomResizedCrop)               | ✓     | ✓    | ✓      | ✓         |
  | [RandomRotate90](https://explore.albumentations.ai/transform/RandomRotate90)                     | ✓     | ✓    | ✓      | ✓         |
  | [RandomScale](https://explore.albumentations.ai/transform/RandomScale)                           | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedBBoxSafeCrop](https://explore.albumentations.ai/transform/RandomSizedBBoxSafeCrop)   | ✓     | ✓    | ✓      | ✓         |
  | [RandomSizedCrop](https://explore.albumentations.ai/transform/RandomSizedCrop)                   | ✓     | ✓    | ✓      | ✓         |
  | [Resize](https://explore.albumentations.ai/transform/Resize)                                     | ✓     | ✓    | ✓      | ✓         |
  | [Rotate](https://explore.albumentations.ai/transform/Rotate)                                     | ✓     | ✓    | ✓      | ✓         |
  | [SafeRotate](https://explore.albumentations.ai/transform/SafeRotate)                             | ✓     | ✓    | ✓      | ✓         |
  | [ShiftScaleRotate](https://explore.albumentations.ai/transform/ShiftScaleRotate)                 | ✓     | ✓    | ✓      | ✓         |
  | [SmallestMaxSize](https://explore.albumentations.ai/transform/SmallestMaxSize)                   | ✓     | ✓    | ✓      | ✓         |
  | [ThinPlateSpline](https://explore.albumentations.ai/transform/ThinPlateSpline)                   | ✓     | ✓    | ✓      | ✓         |
  | [TimeMasking](https://explore.albumentations.ai/transform/TimeMasking)                           | ✓     | ✓    | ✓      | ✓         |
  | [TimeReverse](https://explore.albumentations.ai/transform/TimeReverse)                           | ✓     | ✓    | ✓      | ✓         |
  | [Transpose](https://explore.albumentations.ai/transform/Transpose)                               | ✓     | ✓    | ✓      | ✓         |
  | [VerticalFlip](https://explore.albumentations.ai/transform/VerticalFlip)                         | ✓     | ✓    | ✓      | ✓         |
  | [XYMasking](https://explore.albumentations.ai/transform/XYMasking)                               | ✓     | ✓    | ✓      | ✓         |


  ![inria](https://habrastorage.org/webt/su/wa/np/suwanpeo6ww7wpwtobtrzd_cg20.jpeg)

  ![medical](https://habrastorage.org/webt/1i/fi/wz/1ifiwzy0lxetc4nwjvss-71nkw0.jpeg)

  ![vistas](https://habrastorage.org/webt/rz/-h/3j/rz-h3jalbxic8o_fhucxysts4tc.jpeg)

  <img src="https://habrastorage.org/webt/e-/6k/z-/e-6kz-fugp2heak3jzns3bc-r8o.jpeg" width=100%>


  - Platform: macOS-15.0.1-arm64-arm-64bit
  - Processor: arm
  - CPU Count: 10
  - Python Version: 3.12.7

  - Number of images: 1000
  - Runs per transform: 10
  - Max warmup iterations: 1000

  - albumentations: 1.4.20
  - augly: 1.0.0
  - imgaug: 0.4.0
  - kornia: 0.7.3
  - torchvision: 0.20.0

  Number - is the number of uint8 RGB images processed per second on a single CPU core. Higher is better.
  | Transform         | albumentations<br>1.4.20   | augly<br>1.0.0   | imgaug<br>0.4.0   | kornia<br>0.7.3   | torchvision<br>0.20.0   |
  |:------------------|:---------------------------|:-----------------|:------------------|:------------------|:------------------------|
  | HorizontalFlip    | **8618 ± 1233**            | 4807 ± 818       | 6042 ± 788        | 390 ± 106         | 914 ± 67                |
  | VerticalFlip      | **22847 ± 2031**           | 9153 ± 1291      | 10931 ± 1844      | 1212 ± 402        | 3198 ± 200              |
  | Rotate            | **1146 ± 79**              | 1119 ± 41        | 1136 ± 218        | 143 ± 11          | 181 ± 11                |
  | Affine            | 682 ± 192                  | -                | **774 ± 97**      | 147 ± 9           | 130 ± 12                |
  | Equalize          | **892 ± 61**               | -                | 581 ± 54          | 152 ± 19          | 479 ± 12                |
  | RandomCrop80      | **47341 ± 20523**          | 25272 ± 1822     | 11503 ± 441       | 1510 ± 230        | 32109 ± 1241            |
  | ShiftRGB          | **2349 ± 76**              | -                | 1582 ± 65         | -                 | -                       |
  | Resize            | **2316 ± 166**             | 611 ± 78         | 1806 ± 63         | 232 ± 24          | 195 ± 4                 |
  | RandomGamma       | **8675 ± 274**             | -                | 2318 ± 269        | 108 ± 13          | -                       |
  | Grayscale         | **3056 ± 47**              | 2720 ± 932       | 1681 ± 156        | 289 ± 75          | 1838 ± 130              |
  | RandomPerspective | 412 ± 38                   | -                | **554 ± 22**      | 86 ± 11           | 96 ± 5                  |
  | GaussianBlur      | **1728 ± 89**              | 242 ± 4          | 1090 ± 65         | 176 ± 18          | 79 ± 3                  |
  | MedianBlur        | **868 ± 60**               | -                | 813 ± 30          | 5 ± 0             | -                       |
  | MotionBlur        | **4047 ± 67**              | -                | 612 ± 18          | 73 ± 2            | -                       |
  | Posterize         | **9094 ± 301**             | -                | 2097 ± 68         | 430 ± 49          | 3196 ± 185              |
  | JpegCompression   | **918 ± 23**               | 778 ± 5          | 459 ± 35          | 71 ± 3            | 625 ± 17                |
  | GaussianNoise     | 166 ± 12                   | 67 ± 2           | **206 ± 11**      | 75 ± 1            | -                       |
  | Elastic           | 201 ± 5                    | -                | **235 ± 20**      | 1 ± 0             | 2 ± 0                   |
  | Clahe             | **454 ± 22**               | -                | 335 ± 43          | 94 ± 9            | -                       |
  | CoarseDropout     | **13368 ± 744**            | -                | 671 ± 38          | 536 ± 87          | -                       |
  | Blur              | **5267 ± 543**             | 246 ± 3          | 3807 ± 325        | -                 | -                       |
  | ColorJitter       | **628 ± 55**               | 255 ± 13         | -                 | 55 ± 18           | 46 ± 2                  |
  | Brightness        | **8956 ± 300**             | 1163 ± 86        | -                 | 472 ± 101         | 429 ± 20                |
  | Contrast          | **8879 ± 1426**            | 736 ± 79         | -                 | 425 ± 52          | 335 ± 35                |
  | RandomResizedCrop | **2828 ± 186**             | -                | -                 | 287 ± 58          | 511 ± 10                |
  | Normalize         | **1196 ± 56**              | -                | -                 | 626 ± 40          | 519 ± 12                |
  | PlankianJitter    | **2204 ± 385**             | -                | -                 | 813 ± 211         | -                       |

  To create a pull request to the repository, follow the documentation at [CONTRIBUTING.md](CONTRIBUTING.md)
  ![https://github.com/albuemntations-team/albumentation/graphs/contributors](https://contrib.rocks/image?repo=albumentations-team/albumentations)

  - [LinkedIn](https://www.linkedin.com/company/albumentations/)
  - [Twitter](https://twitter.com/albumentations)
  - [Discord](https://discord.gg/AKPrrDYNAt)

  If you find this library useful for your research, please consider citing [Albumentations: Fast and Flexible Image Augmentations](https://www.mdpi.com/2078-2489/11/2/125):
  ```bibtex
  @Article{info11020125,
      AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
      TITLE = {Albumentations: Fast and Flexible Image Augmentations},
      JOURNAL = {Information},
      VOLUME = {11},
      YEAR = {2020},
      NUMBER = {2},
      ARTICLE-NUMBER = {125},
      URL = {https://www.mdpi.com/2078-2489/11/2/125},
      ISSN = {2078-2489},
      DOI = {10.3390/info11020125}
  }
  ```

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


pkgId: bc9c32159015a6dc9799f4f3b7341ba5d60e3e242958a78dbda1f6fa53cbfc90
name: python-alchemical
arch: src
version: 1.0.2
epoch: 0
release: 1
summary: Modern SQLAlchemy simplified
url: https://github.com/miguelgrinberg/alchemical
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alchemical-1.0.2-1.src.rpm
checksum_type: sha256
description:
  Modern SQLAlchemy simplified.

  [![Build status](https://github.com/miguelgrinberg/alchemical/workflows/build/badge.svg)](https://github.com/miguelgrinberg/alchemical/actions) [![codecov](https://codecov.io/gh/miguelgrinberg/alchemical/branch/main/graph/badge.svg)](https://codecov.io/gh/miguelgrinberg/alchemical)



  - [Documentation](http://alchemical.readthedocs.io/en/stable/)
  - [PyPI](https://pypi.python.org/pypi/alchemical)
  - [Change Log](https://github.com/miguelgrinberg/alchemical/blob/main/CHANGES.md)


pkgId: 5de734ca8ca686d0d0fd267d1e14964fa06bed2af6d0efe4cf612d873888c527
name: python-alchemiscale
arch: src
version: 0.5.2
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://github.com/OpenFreeEnergy/alchemiscale
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alchemiscale-0.5.2-1.src.rpm
checksum_type: sha256
description:
  [![build](https://github.com/OpenFreeEnergy/alchemiscale/actions/workflows/ci-integration.yml/badge.svg)](https://github.com/OpenFreeEnergy/alchemiscale/actions/workflows/ci-integration.yml)
  [![coverage](https://codecov.io/gh/OpenFreeEnergy/alchemiscale/branch/main/graph/badge.svg)](https://codecov.io/gh/OpenFreeEnergy/alchemiscale)
  [![Documentation Status](https://readthedocs.org/projects/alchemiscale/badge/?version=latest)](https://alchemiscale.readthedocs.io/en/latest/?badge=latest)
  **alchemiscale**: a high-throughput alchemical free energy execution system for use with HPC, cloud, bare metal, and Folding@Home


pkgId: 51ee63883b83e1d827aeffecd2528b50468aaa1c60e355139c6327c35272b2de
name: python-alchemiscale
arch: src
version: 0.5.3
epoch: 0
release: 1
url: https://github.com/OpenFreeEnergy/alchemiscale
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alchemiscale-0.5.3-1.src.rpm
checksum_type: sha256
summary:
  a high-throughput alchemical free energy execution system for use with HPC, cloud, bare metal, and Folding@Home

description:
  [![build](https://github.com/OpenFreeEnergy/alchemiscale/actions/workflows/ci-integration.yml/badge.svg)](https://github.com/OpenFreeEnergy/alchemiscale/actions/workflows/ci-integration.yml)
  [![coverage](https://codecov.io/gh/OpenFreeEnergy/alchemiscale/branch/main/graph/badge.svg)](https://codecov.io/gh/OpenFreeEnergy/alchemiscale)
  [![Documentation Status](https://readthedocs.org/projects/alchemiscale/badge/?version=latest)](https://alchemiscale.readthedocs.io/en/latest/?badge=latest)
  **alchemiscale**: a high-throughput alchemical free energy execution system for use with HPC, cloud, bare metal, and Folding@Home


pkgId: 1ac0e9ae756345ec82be6279cf02cb86bff27f58eaaab3242e8081aa1fdb7655
name: python-alchemist
arch: src
version: 0.3.12
epoch: 0
release: 1
description: UNKNOWN
url: http://github.com/concordusapps/alchemist
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alchemist-0.3.12-1.src.rpm
checksum_type: sha256
summary:
  A server architecture built on top of a solid foundation provided by flask, sqlalchemy, and various extensions.


pkgId: 5b69e556cbbd9e9a8046c4eaa7bf0e7825ce72f356744c21205cbdbd97ab3d4a
name: python-alchemite-apiclient
arch: src
version: 0.84.0
epoch: 0
release: 1
summary: A python API client for using Alchemite Analytics
url: https://intellegens.com
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alchemite-apiclient-0.84.0-1.src.rpm
checksum_type: sha256
description:
  {'alchemite_version': '20200414',
   'api_application_version': '0.15.3',
   'api_definition_version': '0.14.3'}
  ```
  If instead you encounter an error at this stage please contact Intellegens for further guidance.
  Next, look through and try running example/example_basic.py.  This will upload a small dataset, train a basic model with the default hyperparameters and predict the missing values from a dataset.
  Examples of other functionality possible through the Alchemite API are given by:
  - example/example_hyperopt.py train an optimal model using hyperparameter optimization and impute the training dataset
  - example/example_chunk.py upload a larger dataset in chunks
  - example/example_delete.py delete models and datasets
  - example/example_optimize.py search the model's parameter space for parameters predicted to meet certain targets
  - example/example_outliers.py find outliers in the model's training dataset
  - example/example_preload.py preload a model into memory to make predictions for larger models faster

  The credentials.json file requires the following elements:
  - `host`: The base uri of the Alchemite api you are attempting to use. (Ordinarily `https://alchemiteapi.intellegens.ai/v0`)
  - `client_id`: The client id to use for authentication. (Ordinarily `PythonClient`)
  - `grant_type`: One of `password`, `client_credentials`, `authorization_code`.
  Grant types each have additional elements:

  This will open a browser to prompt for user credentials for using the API. This is the recommended way of authenticating.
  - `offline` (optional): If true, the client will attempt to acquire an offline token to persist user authentication between sessions. This token is stored in a `.alchemite_token` file in the working directory.

  This will use credentials collected from the commandline to authenticate with the API.
  - `username` (optional): The username to log in with. If omitted the user will be prompted to enter it
  - `password` (optional): The password to log in with. If omitted the user will be prompted to enter it
  - `offline` (optional): If true, the client will attempt to acquire an offline token to persist user authentication between sessions. This token is stored in a `.alchemite_token` file in the working directory.

  Attempts to authenticate using a client secret.
  - `client_secret`: The client secret to use for authentication.

  Offline tokens persist indefinitely, but will expire if unused for more than 30 days.
  In the event that the token is lost or stolen, it can be revoked from your profile page in the Applications tab.
  Reference documentation corresponding to each API endpoint can be found in the docs directory of the source distribution.
  This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.


pkgId: 365376b173d5585adf195959a57ef6ca97c07ea5a7ddeae7c829210cf7608841
name: python-alchemlyb
arch: src
version: 2.4.0
epoch: 0
release: 1
summary: the simple alchemistry library
url: https://github.com/alchemistry/alchemlyb
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alchemlyb-2.4.0-1.src.rpm
checksum_type: sha256
description:
  [![Zenodo DOI](https://zenodo.org/badge/68669096.svg)](https://zenodo.org/badge/latestdoi/68669096) [![Documentation](https://readthedocs.org/projects/alchemlyb/badge/?version=latest)](http://alchemlyb.readthedocs.io/en/latest/) [![Build Status](https://github.com/alchemistry/alchemlyb/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/alchemistry/alchemlyb/actions/workflows/ci.yaml) [![Code coverage](https://codecov.io/gh/alchemistry/alchemlyb/branch/master/graph/badge.svg)](https://codecov.io/gh/alchemistry/alchemlyb) [![anaconda package](https://anaconda.org/conda-forge/alchemlyb/badges/version.svg)](https://anaconda.org/conda-forge/alchemlyb)

  **alchemlyb** makes alchemical free energy calculations easier to do by leveraging the full power and flexibility of the PyData stack. It includes:

  1. Parsers for extracting raw data from output files of common molecular dynamics engines such as [GROMACS](http://www.gromacs.org/), [AMBER](http://ambermd.org/), [NAMD](http://www.ks.uiuc.edu/Research/namd/) and [other simulation codes](https://alchemlyb.readthedocs.io/en/latest/parsing.html).

  2. Subsamplers for obtaining uncorrelated samples from timeseries data (including extracting independent, equilibrated samples [Chodera2016](#chodera2016) as implemented in the [pymbar](http://pymbar.readthedocs.io/) package).

  3. Estimators for obtaining free energies directly from this data, using best-practices approaches for multistate Bennett acceptance ratio (MBAR) [Shirts2008](#shirts2008) and BAR (from [pymbar](http://pymbar.readthedocs.io/)) and thermodynamic integration (TI).



  The documentation is hosted on [Read the Docs](https://alchemlyb.readthedocs.io/en/latest/).



  **Install** via `pip` from [PyPi (alchemlyb)](https://pypi.org/project/alchemlyb):

  ```bash
  pip install alchemlyb
  ```

  or as a `conda` package from the [conda-forge (alchemlyb)](https://anaconda.org/conda-forge/alchemlyb) channel:

  ```bash
  conda install -c conda-forge alchemlyb
  ```

  **Update** with `pip`:

  ```bash
  pip install --update alchemlyb
  ```

  or with `conda` run:

  ```bash
  conda update -c conda-forge alchemlyb
  ```

  to get the latest released version.



  Contributions of all kinds are very welcome.

  If you have questions or want to discuss alchemlyb please post in the [alchemlyb Discussions](https://github.com/alchemistry/alchemlyb/discussions).

  If you have bug reports or feature requests then please get in touch with us through the [Issue Tracker](https://github.com/alchemistry/alchemlyb/issues).

  We also welcome code contributions: have a look at our [Developer Guide](https://github.com/alchemistry/alchemlyb/wiki/Developer-Guide). Open an issue with the proposed fix or change in the [Issue Tracker](https://github.com/alchemistry/alchemlyb/issues) and submit a pull request against the [alchemistry/alchemlyb](https://github.com/alchemistry/alchemlyb) GitHub repository.



  - <a name="shirts2008"></a> Shirts, M.R., and Chodera, J.D. (2008). Statistically optimal analysis of samples from multiple equilibrium states. The Journal of Chemical Physics 129, 124105.
  - <a name="chodera2016"></a> Chodera, J.D. (2016). A Simple Method for Automated Equilibration Detection in Molecular Simulations. Journal of Chemical Theory and Computation 12, 1799–1805.


pkgId: 872c94805190cbb9b25099975ec4e4ac140775516e73447b0d3e43b0b8f8a9d4
name: python-alchemy-cat
arch: src
version: 0.0.9
epoch: 0
release: 1
summary: Alchemy Cat —— 🔥Config System for SOTA
url: https://github.com/HAL-42/AlchemyCat
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alchemy-cat-0.0.9-1.src.rpm
checksum_type: sha256
description:
  <div align="center">

  ![GitHub commit activity](https://img.shields.io/github/commit-activity/y/HAL-42/AlchemyCat)
  <img src="https://img.shields.io/github/stars/HAL-42/AlchemyCat?color=yellow" alt="Stars">
  <img src="https://img.shields.io/github/issues/HAL-42/AlchemyCat?color=red" alt="Issues">
  ![GitHub License](https://img.shields.io/github/license/HAL-42/AlchemyCat?color=cyan)
  <br>
  [![PyPI version](https://badge.fury.io/py/alchemy-cat.svg)](https://badge.fury.io/py/alchemy-cat)
  ![PyPI - Downloads](https://img.shields.io/pypi/dm/alchemy-cat?color=yellow)
  <img src="https://img.shields.io/badge/python-3.9-purple.svg" alt="Python"> <br>

  </div>

  <div align="center">
  <a href="README.md">English</a> | <a href="README_CN.md">中文</a>
  </div>
  <br>

  ![banner](https://raw.githubusercontent.com/HAL-42/AlchemyCat/master/docs/figs/dl_config_logo.png)

  <div align="center">

  [🚀Introduction](https://github.com/HAL-42/AlchemyCat/blob/master/README.md#-introduction) | [📦Installation](https://github.com/HAL-42/AlchemyCat/blob/master/README.md#-installation) | [🚚Migration](https://github.com/HAL-42/AlchemyCat/blob/master/README.md#-migration) | [📖Documentation](https://github.com/HAL-42/AlchemyCat/blob/master/README.md#-documentation-)

  </div>



  When developing machine learning algorithms, we often bother with:
  * Config files (YAML / YACS / MMCV) are lengthy and complex. If entries are interdependent, extra caution is needed to avoid errors when modifying them.
  * Parameter tuning requires rewriting the config for each parameter set, leading to code duplication and difficulty in tracking changes.
  * Manually traversing the parameter space and summarizing results during parameter tuning is time-consuming and inefficient.
  * Insufficient parameter tuning can obscure effective designs.
  * Effective methods may not achieve SOTA due to insufficient parameter tuning, reducing persuasiveness.

  AlchemyCat is a config system designed for machine learning research to address such issues. It helps researchers to fully explore the parameter tuning potential by simplifying repetitive tasks like reproduction, modifying configs, and hyperparameter tuning

  The table below compares AlchemyCat with existing config systems (😡 not support, 🤔 limited support, 🥳 supported):

  | Feature                    | argparse | yaml | YACS | mmcv | AlchemyCat |
  |----------------------------|----------|------|------|------|------------|
  | Reproducible               | 😡       | 🥳   | 🥳   | 🥳   | 🥳         |
  | IDE Jump                   | 😡       | 😡   | 🥳   | 🥳   | 🥳         |
  | Inheritance                | 😡       | 😡   | 🤔   | 🤔   | 🥳         |
  | Composition                | 😡       | 😡   | 🤔   | 🤔   | 🥳         |
  | dependency                 | 😡       | 😡   | 😡   | 😡   | 🥳         |
  | Automatic Parameter Tuning | 😡       | 😡   | 😡   | 😡   | 🥳         |

  AlchemyCat implements all features of current popular config systems, while fully considering various special cases, ensuring stability. AlchemyCat distinguishes itself by:
  * Readable: The syntax is simple, elegant, and Pythonic.
  * Reusable: Supports **inheritance** and **composition** of configs, reducing redundancy and enhancing reusability.
  * Maintainable: Allows for establishing **dependency** between config items, enabling global synchronization with a single change.
  * Supports auto parameter tuning and result summarization without needing to modify original configs or training codes.

  [Migrate](https://github.com/HAL-42/AlchemyCat/blob/master/README.md#-migration) from config systems listed above to AlchemyCat is effortless. Just spend 15 minutes reading the [documentation](https://github.com/HAL-42/AlchemyCat/blob/master/README.md#-documentation-) and apply AlchemyCat to your project, and your GPU will never be idle again!


  Deep learning relies on numerous empirical hyperparameters, such as learning rate, loss weights, max iterations, sliding window size, drop probability, thresholds, and even random seeds.

  The relationship between hyperparameters and performance is hard to predict theoretically. The only certainty is that arbitrarily chosen hyperparameters are unlikely to be optimal. Practice has shown that grid search through the hyperparameter space can significantly enhance model performance; sometimes its effect even surpasses so-called "contributions." Achieving SOTA often depends on this!

  AlchemyCat offers an auto parameter-tuner that seamlessly integrates with existing config systems to explore the hyperparameter space and summarize experiment results automatically. Using this tool requires no modifications to the original config or training code.

  For example, with [MMSeg](https://github.com/open-mmlab/mmsegmentation) users only need to write a tunable config inherited from MMSeg's base config and define the parameter search space:
  ```python

  from alchemy_cat import Cfg2Tune, Param2Tune


  cfg = Cfg2Tune(caps='configs/deeplabv3plus/deeplabv3plus_r50-d8_4xb4-40k_voc12aug-512x512.py')


  cfg.model.auxiliary_head.loss_decode.loss_weight = 0.2


  cfg.train_dataloader.batch_size = Param2Tune([4, 8])
  cfg.train_cfg.max_iters = Param2Tune([20_000, 40_000])

  ```
  Next, write a script specifying how to run a single config and read its results:
  ```python

  import argparse, subprocess
  from alchemy_cat.dl_config import Cfg2TuneRunner, Config
  from alchemy_cat.dl_config.examples.read_mmcv_metric import get_metric

  parser = argparse.ArgumentParser()
  parser.add_argument('--cfg2tune', type=str)            # Path to the tunable config
  parser.add_argument('--num_gpu', type=int, default=2)  # Number of GPUs for each task
  args = parser.parse_args()

  runner = Cfg2TuneRunner(args.cfg2tune, experiment_root='work_dirs', work_gpu_num=args.num_gpu)

  @runner.register_work_fn  # Run experiment for each param combination with mmcv official train script
  def work(pkl_idx: int, cfg: Config, cfg_pkl: str, cfg_rslt_dir: str, cuda_env: dict[str, str]):
      mmcv_cfg = cfg.save_mmcv(cfg_rslt_dir + '/mmcv_config.py')
      subprocess.run(f'./tools/dist_train.sh {mmcv_cfg} {args.num_gpu}', env=cuda_env, shell=True)

  @runner.register_gather_metric_fn    # Optional, gather metric of each config
  def gather_metric(cfg: Config, cfg_rslt_dir: str, run_rslt, param_comb) -> dict[str, float]:
      return get_metric(cfg_rslt_dir)  # {'aAcc': xxx, 'mIoU': xxx, 'mAcc': xxx}

  runner.tuning()
  ```
  Run `CUDA_VISIBLE_DEVICES=0,1,2,3 python tools/tune_dist_train.py --cfg2tune configs/deeplabv3plus/tune_bs,iter/cfg.py`, which will automatically search the parameter space in parallel and summarize the experiment results as follows:

  <div align = "center">
  <img  src="https://raw.githubusercontent.com/HAL-42/AlchemyCat/master/docs/figs/readme-teaser-excel.png" width="500" />
  </div>

  In fact, the above config is still incomplete for some hyperparameters are interdependent and need to be adjusted together. For instance, the learning rate should scale with the batch size. AlchemyCat uses **dependency** to manage these relationships; when a dependency source changes, related dependencies automatically update for consistency. The complete config with dependencies is:
  ```python

  from alchemy_cat import Cfg2Tune, Param2Tune, P_DEP


  cfg = Cfg2Tune(caps='configs/deeplabv3plus/deeplabv3plus_r50-d8_4xb4-40k_voc12aug-512x512.py')


  cfg.model.auxiliary_head.loss_decode.loss_weight = 0.2


  cfg.train_dataloader.batch_size = Param2Tune([4, 8])
  cfg.train_cfg.max_iters = Param2Tune([20_000, 40_000])



  cfg.optim_wrapper.optimizer.lr = P_DEP(lambda c: (c.train_dataloader.batch_size / 8) * 0.01)


  @cfg.set_DEP()
  def param_scheduler(c):
      return dict(
          type='PolyLR',
          eta_min=1e-4,
          power=0.9,
          begin=0,
          end=c.train_cfg.max_iters,
          by_epoch=False)
  ```
  > [!NOTE]
  > In the example above, defining dependencies might seem needless since they can be computed directly. However, when combined with **inheritance**, setting dependencies in the base config allows tunable configs to focus on key hyperparameters without worrying about trivial dependency details. Refer to the [documentation](#dependency) for details.


  ```bash
  pip install alchemy-cat
  ```


  <details>
  <summary> How to migrate from YAML / YACS / MMCV </summary>

  σ`∀´)σ Just kidding! No migration is needed. AlchemyCat can direct read and write YAML / YACS / MMCV config files:

  ```python
  from alchemy_cat.dl_config import load_config, Config


  cfg = load_config('path/to/yaml_config.yaml or yacs_config.py or mmcv_config.py')

  cfg = Config('path/to/yaml_config.yaml or yacs_config.py or mmcv_config.py')

  cfg = Config(caps='path/to/yaml_config.yaml or yacs_config.py or mmcv_config.py')

  print(cfg.model.backbone)  # Access config item

  cfg.save_yaml('path/to/save.yaml')  # Save to YAML config
  cfg.save_mmcv('path/to/save.py')    # Save to MMCV config
  cfg.save_py('path/to/save.py')      # Save to AlchemyCat config
  ```
  We also provide a script to convert between different config formats:
  ```bash
  python -m alchemy_cat.dl_config.from_x_to_y --x X --y Y --y_type=yaml/mmcv/alchemy-cat
  ```
  where:
  * `--x`: Source config file path, can be YAML / YACS / MMCV / AlchemyCat config.
  * `--y`: Target config file path.
  * `--y_type`: Target config format, can be `yaml`, `mmcv`, or `alchemy-cat`.

  </details>




  AlchemyCat ensures a one-to-one correspondence between each configuration and its unique experimental record, with the bijective relationship ensuring the experiment's reproducibility.
  ```text
  config C + algorithm code A ——> reproducible experiment E(C, A)
  ```
  The experimental directory is automatically generated, mirroring the relative path of the configuration file. This path can include multi-level directories and special characters such as spaces, commas, and equal signs. Such flexibility aids in categorizing experiments for clear management. For instance:
  ```text
  .
  ├── configs
  │   ├── MNIST
  │   │   ├── resnet18,wd=1e-5@run2
  │   │   │   └── cfg.py
  │   │   └── vgg,lr=1e-2
  │   │       └── cfg.py
  │   └── VOC2012
  │       └── swin-T,γ=10
  │           └── 10 epoch
  │               └── cfg.py
  └── experiment
      ├── MNIST
      │   ├── resnet18,wd=1e-5@run2
      │   │   └── xxx.log
      │   └── vgg,lr=1e-2
      │       └── xxx.log
      └── VOC2012
          └── swin-T,γ=10
              └── 10 epoch
                  └── xxx.log
  ```
  > [!TIP]
  > **Best Practice: Avoid having '.' in the path. By following this best practice, relative imports can be used in `cfg.py`, and functions and classes defined within it can be pickled.**


  Let's begin with an incomplete example to demonstrate writing and loading a config. First, create the [config file](alchemy_cat/dl_config/examples/configs/mnist/plain_usage/cfg.py):
  ```python


  from torchvision.datasets import MNIST
  from alchemy_cat.dl_config import Config

  cfg = Config()

  cfg.rand_seed = 0

  cfg.dt.cls = MNIST
  cfg.dt.ini.root = '/tmp/data'
  cfg.dt.ini.train = True


  ```
  Here, we first instantiate a `Config` object `cfg`, and then add config items through attribute operator `.`. Config items can be any Python objects, including functions, methods, and classes.

  > [!TIP]
  > **Best Practice: We prefer specifying functions or classes directly in config over using strings/semaphores to control the program behavior. This enables IDE navigation, simplifying reading and debugging.**

  `Config` is a subclass of Python's `dict`. The above code defines a nested dictionary with a **tree structure**:
  ```text
  >>> print(cfg.to_dict())
  {'rand_seed': 0,
   'dt': {'cls': <class 'torchvision.datasets.mnist.MNIST'>,
          'ini': {'root': '/tmp/data', 'train': True}}}
  ```
  `Config` implements all API of Python `dict`:
  ```test
  >>> cfg.keys()
  dict_keys(['rand_seed', 'dt'])

  >>> cfg['dt']['ini']['root']
  '/tmp/data'

  >>> {**cfg['dt']['ini'], 'download': True}
  {'root': '/tmp/data', 'train': True, 'download': True}
  ```

  You can initialize a `Config` object using `dict` (yaml, json) or its subclasses (YACS, mmcv.Config).
  ```text
  >>> Config({'rand_seed': 0, 'dt': {'cls': MNIST, 'ini': {'root': '/tmp/data', 'train': True}}})
  {'rand_seed': 0, 'dt': {'cls': <class 'torchvision.datasets.mnist.MNIST'>, 'ini': {'root': '/tmp/data', 'train': True}}}
  ```

  Using operator `.` to read and write `cfg` will be clearer. For instance, the following code creates and initializes the `MNIST` dataset based on the config:
  ```text
  >>> dataset = cfg.dt.cls(**cfg.dt.ini)
  >>> dataset
  Dataset MNIST
      Number of datapoints: 60000
      Root location: /tmp/data
      Split: Train
  ```
  Accessing a non-existent key returns an empty dictionary, which should be treated as `False`:
  ```text
  >>> cfg.not_exit
  {}
  ```

  In the [main code](alchemy_cat/dl_config/examples/train.py), use the following code to load the config:
  ```python


  from alchemy_cat.dl_config import load_config
  cfg = load_config('configs/mnist/base/cfg.py', experiments_root='/tmp/experiment', config_root='configs')

  torch.save(model.state_dict(), f"{cfg.rslt_dir}/model_{epoch}.pth")  # Save all experiment results to cfg.rslt_dir.
  ```

  The `load_config` imports `cfg` from `configs/mnist/base/cfg.py`, handling inheritance and dependencies. Given the experiment root directory `experiments_root` and config root directory `config_root`, it auto creates an experiment directory at `experiment/mnist/base` and assign it to `cfg.rslt_dir`. All experimental results should be saved to `cfg.rslt_dir`.

  The loaded `cfg` is read-only by default (`cfg.is_frozen == True`). To modify, unfreeze `cfg` with `cfg.unfreeze()`.


  * The config file offers a `Config` object `cfg`, a nested dictionary with a tree structure, allowing read and write via the `.` operator.
  * Accessing non-existent keys in `cfg` returns a one-time empty dictionary considered as `False`.
  * Use `load_config` to load the config file. The experiment path will be auto created and assigned to `cfg.rslt_dir`.


  The new config can inherit the existing base config, written as `cfg = Config(caps='base_cfg.py')`. The new config only needs to override or add items, with rest items reusing the base config. For example, with [base config](alchemy_cat/dl_config/examples/configs/mnist/plain_usage/cfg.py):
  ```python




  cfg.loader.ini.batch_size = 128
  cfg.loader.ini.num_workers = 2

  cfg.opt.cls = optim.AdamW
  cfg.opt.ini.lr = 0.01


  ```
  To double the batch size, [new config](alchemy_cat/dl_config/examples/configs/mnist/plain_usage,2xbs/cfg.py) can be written as:
  ```python


  from alchemy_cat.dl_config import Config

  cfg = Config(caps='configs/mnist/plain_usage/cfg.py')  # Inherit from base config.

  cfg.loader.ini.batch_size = 128 * 2  # Double batch size.

  cfg.opt.ini.lr = 0.01 * 2  # Linear scaling rule, see https://arxiv.org/abs/1706.02677
  ```
  Inheritance behaves like `dict.update`. The key difference is that if both config have keys with the same name and their values are `Config` instance (naming config subtree), we recursively update within these subtrees. Thus, the new config can modify `cfg.loader.ini.batch_size` while inheriting `cfg.loader.ini.num_workers`.
  ```text
  >>> base_cfg = load_config('configs/mnist/plain_usage/cfg.py', create_rslt_dir=False)
  >>> new_cfg = load_config('configs/mnist/plain_usage,2xbs/cfg.py', create_rslt_dir=False)
  >>> base_cfg.loader.ini
  {'batch_size': 128, 'num_workers': 2}
  >>> new_cfg.loader.ini
  {'batch_size': 256, 'num_workers': 2}
  ```
  To overwrite the entire config subtree in the new config, set this subtree to "override", [e.g.](alchemy_cat/dl_config/examples/configs/mnist/plain_usage,override_loader/cfg.py) :
  ```python


  from alchemy_cat.dl_config import Config

  cfg = Config(caps='configs/mnist/plain_usage/cfg.py')  # Inherit from base config.

  cfg.loader.ini.override()  # Set subtree as whole.
  cfg.loader.ini.shuffle = False
  cfg.loader.ini.drop_last = False
  ```
  `cfg.loader.ini` will now be solely defined by the new config:
  ```text
  >>> base_cfg = load_config('configs/mnist/plain_usage/cfg.py', create_rslt_dir=False)
  >>> new_cfg = load_config('configs/mnist/plain_usage,2xbs/cfg.py', create_rslt_dir=False)
  >>> base_cfg.loader.ini
  {'batch_size': 128, 'num_workers': 2}
  >>> new_cfg.loader.ini
  {'shuffle': False, 'drop_last': False}
  ```
  Naturally, a base config can inherit from another base config, known as chain inheritance.

  Multiple inheritance is also supported, written as `cfg = Config(caps=('base.py', 'patch1.py', 'patch2.py', ...))`, creating an inheritance chain of `base -> patch1 -> patch2 -> current cfg`. The base configs on the right are often used patches to batch add config items. For example, this [patch](alchemy_cat/dl_config/examples/configs/patches/cifar10.py) includes CIFAR10 dataset configurations:
  ```python


  import torchvision.transforms as T
  from torchvision.datasets import CIFAR10

  from alchemy_cat.dl_config import Config

  cfg = Config()

  cfg.dt.override()
  cfg.dt.cls = CIFAR10
  cfg.dt.ini.root = '/tmp/data'
  cfg.dt.ini.transform = T.Compose([T.ToTensor(), T.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
  ```
  To switch to CIFAR10, [new config](alchemy_cat/dl_config/examples/configs/mnist/plain_usage,cifar10/cfg.py) only need to inherit the patch:
  ```python


  from alchemy_cat.dl_config import Config

  cfg = Config(caps=('configs/mnist/plain_usage/cfg.py', 'alchemy_cat/dl_config/examples/configs/patches/cifar10.py'))
  ```
  ```text
  >>> cfg = load_config('configs/mnist/plain_usage,cifar10/cfg.py', create_rslt_dir=False)
  >>> cfg.dt
  {'cls': torchvision.datasets.cifar.CIFAR10,
   'ini': {'root': '/tmp/data',
    'transform': Compose(
        ToTensor()
        Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))
    )}}
  ```
  > _Inheritance Implementation Details_
  >
  > We copy the base config tree and update it with the new config, ensuring isolation between them. This means changes to the new config do not affect the base. Complex inheritance like diamond inheritance is supported but not recommended due to readability issues. \
  > Note that leaf node values are passed by reference; modifying them inplace will affect the entire inheritance chain.


  * The new config can leverage inheritance to reuse the base config and modifies or adds some items.
  * The new config updates the base config recursively. Use `Config.override` to revert to the `dict.update` method for updates.
  * `Config` supports chain and multiple inheritance, allowing for more fine-grained reuse.


  In the [previous](#inheritance) example, changing the batch size in the new configuration also alters the learning rate. This interdependence is called "dependency."

  When modifying a config item, it's common to forget its dependencies. AlchemyCat lets you define dependencies, changing the dependency source updates all dependent items automatically. [For example](alchemy_cat/dl_config/examples/configs/mnist/base/cfg.py):

  ```python


  from alchemy_cat.dl_config import Config, DEP


  cfg.loader.ini.batch_size = 128

  cfg.opt.ini.lr = DEP(lambda c: c.loader.ini.batch_size // 128 * 0.01)  # Linear scaling rule.


  ```
  The learning rate `cfg.opt.ini.lr` is calculated as a dependency `DEP` using the batch size `cfg.loader.ini.batch_size`. `DEP` takes a function with `cfg` as an argument and returns the dependency value.

  In the [new config](alchemy_cat/dl_config/examples/configs/mnist/base,2xbs/cfg.py), we only need to modify the batch size, and the learning rate will update automatically:
  ```python


  from alchemy_cat.dl_config import Config

  cfg = Config(caps='configs/mnist/base/cfg.py')

  cfg.loader.ini.batch_size = 128 * 2  # Double batch size, learning rate will be doubled automatically.
  ```
  ```text
  >>> cfg = load_config('configs/mnist/base,2xbs/cfg.py', create_rslt_dir=False)
  >>> cfg.loader.ini.batch_size
  256
  >>> cfg.opt.ini.lr
  0.02
  ```
  Below is a more complex [example](alchemy_cat/dl_config/examples/configs/mnist/base/cfg.py):
  ```python




  cfg.sched.epochs = 30
  @cfg.sched.set_DEP(name='warm_epochs', priority=0)  # kwarg `name` is not necessary
  def warm_epochs(c: Config) -> int:  # warm_epochs = 10% of total epochs
      return round(0.1 * c.sched.epochs)

  cfg.sched.warm.cls = sched.LinearLR
  cfg.sched.warm.ini.total_iters = DEP(lambda c: c.sched.warm_epochs, priority=1)
  cfg.sched.warm.ini.start_factor = 1e-5
  cfg.sched.warm.ini.end_factor = 1.

  cfg.sched.main.cls = sched.CosineAnnealingLR
  cfg.sched.main.ini.T_max = DEP(lambda c: c.sched.epochs - c.sched.warm.ini.total_iters,
                                 priority=2)  # main_epochs = total_epochs - warm_epochs


  ```
  ```text
  >>> print(cfg.sched.to_txt(prefix='cfg.sched.'))  # A pretty print of the config tree.
  cfg.sched = Config()

  cfg.sched.epochs = 30
  cfg.sched.warm_epochs = 3
  cfg.sched.warm.cls = <class 'torch.optim.lr_scheduler.LinearLR'>
  cfg.sched.warm.ini.total_iters = 3
  cfg.sched.warm.ini.start_factor = 1e-05
  cfg.sched.warm.ini.end_factor = 1.0
  cfg.sched.main.cls = <class 'torch.optim.lr_scheduler.CosineAnnealingLR'>
  cfg.sched.main.ini.T_max = 27
  ```
  In the code, `cfg.sched.epochs` determines total training epochs, which is also the dependency source. Warm-up epochs `cfg.sched.warm_epochs` are 10% of this total, and main epochs `cfg.sched.main.ini.T_max` is the remainder. Adjusting total training epochs updates both warm-up and main epochs automatically.

  The dependency `cfg.sched.warm_epochs` is defined using the `Config.set_DEP` decorator. The decorated function, passed as the first parameter of `DEP`, computes the dependency. The key name of dependency can be specified via the keyword argument `name`; if omitted, it defaults to the function's name. For complex computations, using a decorator for definition is recommended.

  When a dependency relies on another dependency, they must be computed in the correct order. By default, this is the defined order. The `priority` parameter can specify computation order: smaller `priority` compute earlier. For instance, `cfg.sched.warm_epochs` depended by `cfg.sched.warm.ini.total_iters`, which is depended by `cfg.sched.main.ini.T_max`, so their `priority` increase sequentially.


  * A dependency is defined when one config item relies on another. Changing the dependency source will automatically recalculate the dependency based on the calculation function.
  * Dependencies can be defined by `DEP(...)` or the `Config.set_DEP` decorator.
  * If dependencies are interdependent, use the `priority` parameter to specify the computation order; otherwise, they resolve in the order of definition.


  Composition allows reusing configs by compose predefined config subtrees to form a complete config. For instance, the following [config subtree](alchemy_cat/dl_config/examples/configs/addons/linear_warm_cos_sched.py) defines a learning rate strategy:

  ```python

  import torch.optim.lr_scheduler as sched

  from alchemy_cat.dl_config import Config, DEP

  cfg = Config()

  cfg.epochs = 30

  @cfg.set_DEP(priority=0)  # warm_epochs = 10% of total epochs
  def warm_epochs(c: Config) -> int:
      return round(0.1 * c.epochs)

  cfg.warm.cls = sched.LinearLR
  cfg.warm.ini.total_iters = DEP(lambda c: c.warm_epochs, priority=1)
  cfg.warm.ini.start_factor = 1e-5
  cfg.warm.ini.end_factor = 1.

  cfg.main.cls = sched.CosineAnnealingLR
  cfg.main.ini.T_max = DEP(lambda c: c.epochs - c.warm.ini.total_iters,
                           priority=2)  # main_epochs = total_epochs - warm_epochs

  ```
  In the [final config](alchemy_cat/dl_config/examples/configs/mnist/base,sched_from_addon/cfg.py), we compose this set of learning rate strategy:
  ```python



  cfg.sched = Config('configs/addons/linear_warm_cos_sched.py')


  ```
  ```text
  >>> print(cfg.sched.to_txt(prefix='cfg.sched.'))  # A pretty print of the config tree.
  cfg.sched = Config()

  cfg.sched.epochs = 30
  cfg.sched.warm_epochs = 3
  cfg.sched.warm.cls = <class 'torch.optim.lr_scheduler.LinearLR'>
  cfg.sched.warm.ini.total_iters = 3
  cfg.sched.warm.ini.start_factor = 1e-05
  cfg.sched.warm.ini.end_factor = 1.0
  cfg.sched.main.cls = <class 'torch.optim.lr_scheduler.CosineAnnealingLR'>
  cfg.sched.main.ini.T_max = 27
  ```

  It looks very simple! Just assign/mount the predefined config sub-subtree to the final config. `Config('path/to/cfg.py')` returns a copy of the `cfg` object in the config file, ensuring modifications before and after copying are isolated.

  > _Implementation Details of Composition and Dependency_
  >
  > Attentive readers might wonder how `DEP` determines the parameter `c` for the dependency computation function, specifically which Config object is passed. In this chapter's example, `c` is the config subtree of learning rate; thus, the calculation function for `cfg.warm.ini.total_iters` is `lambda c: c.warm_epochs`. However, in the [previous chapter's](#dependency) example, `c` is the final config; hence, the calculation function for `cfg.sched.warm.ini.total_iters` is `lambda c: c.sched.warm_epochs`.
  >
  > In fact, `c` is the root node of the configuration tree where `DEP` was first mounted. The `Config` is a bidirectional tree. When `DEP` is first mounted, it records its relative distance to the root. During computation, it traces back this distance to find and pass the corresponding config tree into the computation function.
  >
  > To prevent this default behavior, set `DEP(lambda c: ..., rel=False)`, ensuring `c` is always the complete configuration.

  **Best Practice: Both composition and inheritance aim to reuse config. Composition is more flexible and loosely coupled, so it should be prioritized over inheritance.**


  * Define config subtree and compose them to create a complete config.



  <details>
  <summary> Expand full example </summary>

  [Config subtree](alchemy_cat/dl_config/examples/configs/addons/linear_warm_cos_sched.py) related to learning rate:
  ```python


  import torch.optim.lr_scheduler as sched

  from alchemy_cat.dl_config import Config, DEP

  cfg = Config()

  cfg.epochs = 30

  @cfg.set_DEP(priority=0)  # warm_epochs = 10% of total epochs
  def warm_epochs(c: Config) -> int:
      return round(0.1 * c.epochs)

  cfg.warm.cls = sched.LinearLR
  cfg.warm.ini.total_iters = DEP(lambda c: c.warm_epochs, priority=1)
  cfg.warm.ini.start_factor = 1e-5
  cfg.warm.ini.end_factor = 1.

  cfg.main.cls = sched.CosineAnnealingLR
  cfg.main.ini.T_max = DEP(lambda c: c.epochs - c.warm.ini.total_iters,
                           priority=2)  # main_epochs = total_epochs - warm_epochs
  ```
  The composed [base config](alchemy_cat/dl_config/examples/configs/mnist/base,sched_from_addon/cfg.py):
  ```python


  import torchvision.models as model
  import torchvision.transforms as T
  from torch import optim
  from torchvision.datasets import MNIST

  from alchemy_cat.dl_config import Config, DEP

  cfg = Config()

  cfg.rand_seed = 0


  cfg.dt.cls = MNIST
  cfg.dt.ini.root = '/tmp/data'
  cfg.dt.ini.transform = T.Compose([T.Grayscale(3), T.ToTensor(), T.Normalize((0.1307,), (0.3081,)),])


  cfg.loader.ini.batch_size = 128
  cfg.loader.ini.num_workers = 2


  cfg.model.cls = model.resnet18
  cfg.model.ini.num_classes = DEP(lambda c: len(c.dt.cls.classes))


  cfg.opt.cls = optim.AdamW
  cfg.opt.ini.lr = DEP(lambda c: c.loader.ini.batch_size // 128 * 0.01)  # Linear scaling rule.


  cfg.sched = Config('configs/addons/linear_warm_cos_sched.py')


  cfg.log.save_interval = DEP(lambda c: c.sched.epochs // 5, priority=1)  # Save model at every 20% of total epochs.
  ```
  Inherited from the base config, batch size doubled, number of epochs halved [new config](alchemy_cat/dl_config/examples/configs/mnist/base,sched_from_addon,2xbs,2÷epo/cfg.py):

  ```python


  from alchemy_cat.dl_config import Config

  cfg = Config(caps='configs/mnist/base,sched_from_addon/cfg.py')

  cfg.loader.ini.batch_size = 256

  cfg.sched.epochs = 15
  ```
  Note that dependencies such as learning rate, warm-up epochs, and main epochs will be automatically updated:
  ```text
  >>> cfg = load_config('configs/mnist/base,sched_from_addon,2xbs,2÷epo/cfg.py', create_rslt_dir=False)
  >>> print(cfg)
  cfg = Config()
  cfg.override(False).set_attribute('_cfgs_update_at_parser', ('configs/mnist/base,sched_from_addon/cfg.py',))

  cfg.rand_seed = 0
  cfg.dt.cls = <class 'torchvision.datasets.mnist.MNIST'>
  cfg.dt.ini.root = '/tmp/data'
  cfg.dt.ini.transform = Compose(
      Grayscale(num_output_channels=3)
      ToTensor()
      Normalize(mean=(0.1307,), std=(0.3081,))
  )
  cfg.loader.ini.batch_size = 256
  cfg.loader.ini.num_workers = 2
  cfg.model.cls = <function resnet18 at 0x7f5bcda68a40>
  cfg.model.ini.num_classes = 10
  cfg.opt.cls = <class 'torch.optim.adamw.AdamW'>
  cfg.opt.ini.lr = 0.02
  cfg.sched.epochs = 15
  cfg.sched.warm_epochs = 2
  cfg.sched.warm.cls = <class 'torch.optim.lr_scheduler.LinearLR'>
  cfg.sched.warm.ini.total_iters = 2
  cfg.sched.warm.ini.start_factor = 1e-05
  cfg.sched.warm.ini.end_factor = 1.0
  cfg.sched.main.cls = <class 'torch.optim.lr_scheduler.CosineAnnealingLR'>
  cfg.sched.main.ini.T_max = 13
  cfg.log.save_interval = 3
  cfg.rslt_dir = 'mnist/base,sched_from_addon,2xbs,2÷epo'
  ```
  [Training code](alchemy_cat/dl_config/examples/train.py):
  ```python

  import argparse
  import json

  import torch
  import torch.nn.functional as F
  from rich.progress import track
  from torch.optim.lr_scheduler import SequentialLR

  from alchemy_cat.dl_config import load_config
  from utils import eval_model

  parser = argparse.ArgumentParser(description='AlchemyCat MNIST Example')
  parser.add_argument('-c', '--config', type=str, default='configs/mnist/base,sched_from_addon,2xbs,2÷epo/cfg.py')
  args = parser.parse_args()


  cfg = load_config(args.config, experiments_root='/tmp/experiment', config_root='configs')
  print(cfg)

  torch.manual_seed(cfg.rand_seed)  # Use `cfg` to set random seed

  dataset = cfg.dt.cls(**cfg.dt.ini)  # Use `cfg` to set dataset type and its initial parameters



  loader = torch.utils.data.DataLoader(dataset, shuffle=True, **cfg.loader.ini)

  model = cfg.model.cls(**cfg.model.ini).train().to('cuda')  # Use `cfg` to set model


  opt = cfg.opt.cls(model.parameters(), **cfg.opt.ini, weight_decay=0.)


  warm_sched = cfg.sched.warm.cls(opt, **cfg.sched.warm.ini)
  main_sched = cfg.sched.main.cls(opt, **cfg.sched.main.ini)
  sched = SequentialLR(opt, [warm_sched, main_sched], [cfg.sched.warm_epochs])

  for epoch in range(1, cfg.sched.epochs + 1):  # train `cfg.sched.epochs` epochs
      for data, target in track(loader, description=f"Epoch {epoch}/{cfg.sched.epochs}"):
          F.cross_entropy(model(data.to('cuda')), target.to('cuda')).backward()
          opt.step()
          opt.zero_grad()

      sched.step()

      
      if cfg.log and epoch % cfg.log.save_interval == 0:
          torch.save(model.state_dict(), f"{cfg.rslt_dir}/model_{epoch}.pth")

      eval_model(model)

  if cfg.log:
      eval_ret = eval_model(model)
      with open(f"{cfg.rslt_dir}/eval.json", 'w') as json_f:
          json.dump(eval_ret, json_f)
  ```
  Run `python train.py --config 'configs/mnist/base,sched_from_addon,2xbs,2÷epo/cfg.py'`, and it will use the settings in the config file to train with `train.py` and save the results to the `/tmp/experiment/mnist/base,sched_from_addon,2xbs,2÷epo` directory.
  </details>


  In the [example above](#full-example), running `python train.py --config path/to/cfg.py` each time yields an experimental result for a set of parameters.

  However, we often need to perform grid search over the parameter space to find the optimal parameter combination. Writing a config for each combination is laborious and error-prone. Can we define the entire parameter space in a "tunable config"? Then let the program automatically traverse all combinations, generate configs, run them, and summarize results for comparison.

  The auto-tuner traverses through tunable config's parameter combinations, generates `N` sub-configs, runs them to obtain `N` experimental records, and summarizes all experimental results into an Excel sheet:

  ```text
  config to be tuned T ───> config C1 + algorithm code A ───> reproducible experiment E1(C1, A) ───> summary table S(T,A)
                       │                                                                          │ 
                       ├──> config C2 + algorithm code A ───> reproducible experiment E1(C2, A) ──│ 
                      ...                                                                         ...
  ```

  To use the auto-tuner, we first need to write a tunable config:
  ```python


  from alchemy_cat.dl_config import Cfg2Tune, Param2Tune

  cfg = Cfg2Tune(caps='configs/mnist/base,sched_from_addon/cfg.py')

  cfg.loader.ini.batch_size = Param2Tune([128, 256, 512])

  cfg.sched.epochs = Param2Tune([5, 15])
  ```
  Its writing style is similar to the [normal configuration](alchemy_cat/dl_config/examples/configs/mnist/base,sched_from_addon,2xbs,2÷epo/cfg.py) in the previous chapter. It supports attribute reading and writing, inheritance, dependency, and combination. The difference lies in:
  * The type of config is `Cfg2Tune`, a subclass of `Config`.
  * For grid search parameters, use `Param2Tune([v1, v2, ...])` with optional values `v1, v2, ...`.

  The tunable config above will search a parameter space of size 3×2=6 and generate these 6 sub-configs:
  ```text
  batch_size  epochs  child_configs
  128         5       configs/tune/tune_bs_epoch/batch_size=128,epochs=5/cfg.pkl
              15      configs/tune/tune_bs_epoch/batch_size=128,epochs=15/cfg.pkl
  256         5       configs/tune/tune_bs_epoch/batch_size=256,epochs=5/cfg.pkl
              15      configs/tune/tune_bs_epoch/batch_size=256,epochs=15/cfg.pkl
  512         5       configs/tune/tune_bs_epoch/batch_size=512,epochs=5/cfg.pkl
              15      configs/tune/tune_bs_epoch/batch_size=512,epochs=15/cfg.pkl
  ```
  Set the `priority` parameter of `Param2Tune` to specify the search order. The default is the defined order. Use `optional_value_names` to assign readable names to parameter values. [For example](alchemy_cat/dl_config/examples/configs/tune/tune_bs_epoch,pri,name/cfg.py):

  ```python


  from alchemy_cat.dl_config import Cfg2Tune, Param2Tune

  cfg = Cfg2Tune(caps='configs/mnist/base,sched_from_addon/cfg.py')

  cfg.loader.ini.batch_size = Param2Tune([128, 256, 512], optional_value_names=['1xbs', '2xbs', '4xbs'], priority=1)

  cfg.sched.epochs = Param2Tune([5, 15], priority=0)
  ```
  whose search space is:
  ```text
  epochs batch_size  child_configs
  5      1xbs        configs/tune/tune_bs_epoch,pri,name/epochs=5,batch_size=1xbs/cfg.pkl
         2xbs        configs/tune/tune_bs_epoch,pri,name/epochs=5,batch_size=2xbs/cfg.pkl
         4xbs        configs/tune/tune_bs_epoch,pri,name/epochs=5,batch_size=4xbs/cfg.pkl
  15     1xbs        configs/tune/tune_bs_epoch,pri,name/epochs=15,batch_size=1xbs/cfg.pkl
         2xbs        configs/tune/tune_bs_epoch,pri,name/epochs=15,batch_size=2xbs/cfg.pkl
         4xbs        configs/tune/tune_bs_epoch,pri,name/epochs=15,batch_size=4xbs/cfg.pk
  ```

  We can set constraints between parameters to eliminate unnecessary combinations. For example, the following [example](alchemy_cat/dl_config/examples/configs/tune/tune_bs_epoch,subject_to/cfg.py) limits total iterations to a maximum of 15×128:
  ```python


  from alchemy_cat.dl_config import Cfg2Tune, Param2Tune

  cfg = Cfg2Tune(caps='configs/mnist/base,sched_from_addon/cfg.py')

  cfg.loader.ini.batch_size = Param2Tune([128, 256, 512])

  cfg.sched.epochs = Param2Tune([5, 15],
                                subject_to=lambda cur_val: cur_val * cfg.loader.ini.batch_size.cur_val <= 15 * 128)
  ```
  whose search space is:
  ```text
  batch_size epochs  child_configs
  128        5       configs/tune/tune_bs_epoch,subject_to/batch_size=128,epochs=5/cfg.pkl
             15      configs/tune/tune_bs_epoch,subject_to/batch_size=128,epochs=15/cfg.pkl
  256        5       configs/tune/tune_bs_epoch,subject_to/batch_size=256,epochs=5/cfg.pkl
  ```


  We also need to write a small script to run the auto-tuner:
  ```python

  import argparse, json, os, subprocess, sys
  from alchemy_cat.dl_config import Config, Cfg2TuneRunner

  parser = argparse.ArgumentParser(description='Tuning AlchemyCat MNIST Example')
  parser.add_argument('-c', '--cfg2tune', type=str)
  args = parser.parse_args()


  runner = Cfg2TuneRunner(args.cfg2tune, experiment_root='/tmp/experiment', work_gpu_num=1)

  @runner.register_work_fn  # How to run config
  def work(pkl_idx: int, cfg: Config, cfg_pkl: str, cfg_rslt_dir: str, cuda_env: dict[str, str]) -> ...:
      subprocess.run([sys.executable, 'train.py', '-c', cfg_pkl], env=cuda_env)

  @runner.register_gather_metric_fn  # How to gather metric for summary
  def gather_metric(cfg: Config, cfg_rslt_dir: str, run_rslt: ..., param_comb: dict[str, tuple[..., str]]) -> dict[str, ...]:
      return json.load(open(os.path.join(cfg_rslt_dir, 'eval.json')))

  runner.tuning()
  ```
  The script performs these operations:
  * Instantiates the auto-tuner with `runner = Cfg2TuneRunner(...)`, passing in the tunable config path. By default, it runs sub-configs sequentially. Set the parameter `work_gpu_num` to run `len(os.environ['CUDA_VISIBLE_DEVICES']) // work_gpu_num` sub-configs in parallel.
  * Registers a worker that executes each sub-config. The function parameters are:
    - `pkl_idx`: index of the sub-config
    - `cfg`: the sub-config
    - `cfg_pkl`: pickle save path for this sub-config
    - `cfg_rslt_dir`: experiment directory.
    - `cuda_env`: If `work_gpu_num` is set, then `cuda_env` will allocate non-overlapping `CUDA_VISIBLE_DEVICES` environment variables for parallel sub-configs.

    Commonly, we only need to pass `cfg_pkl` as the config file into the training script, since `load_cfg` supports reading config in pickle format. For deep learning tasks, different `CUDA_VISIBLE_DEVICES` are needed for each sub-config.
  * Registers a summary function that returns an experimental result as a `{metric_name: metric_value}` dictionary. The auto-tunner will traverse all experimental results and summary into a table. The summary function accepts these parameters:
    - `cfg`: the sub-configuration
    - `cfg_rslt_dir`: experiment directory
    - `run_rslt`: returned from working functions
    - `param_comb`: parameter combinations for that particular sub-configuration.

    Generally, only need to read results from `cfg_rslt_dir` and return them.
  * Calls `runner.tuning()` to start automatic tuning.

  After tuning, the tuning results will be printed:
  ```text
  Metric Frame:
                    test_loss    acc
  batch_size epochs
  128        5       1.993285  32.63
             15      0.016772  99.48
  256        5       1.889874  37.11
             15      0.020811  99.49
  512        5       1.790593  41.74
             15      0.024695  99.33

  Saving Metric Frame at /tmp/experiment/tune/tune_bs_epoch/metric_frame.xlsx
  ```
  As the prompt says, the tuning results will also be saved to the `/tmp/experiment/tune/tune_bs_epoch/metric_frame.xlsx` table:
  <div align = "center">
  <img  src="https://github.com/HAL-42/AlchemyCat/raw/master/docs/figs/readme-cfg2tune-excel.png" width="400" />
  </div>

  > [!TIP]
  > **Best Practice: The auto-tuner is separate from the standard workflow. Write configs and code without considering it. When tuning, add extra code to define parameter space, specify invocation and result methods. After tuning, remove the auto-tuner, keeping only the best config and algorithm.**


  * Define a tunable config `Cfg2Tune` with `Param2Tune` to specify the parameter space.
  * Use the auto-tuner `Cfg2TuneRunner` to traverse the parameter space, generate sub-configs, run them, and summarize the results.



  <details>
  <summary> Expand advanced usage </summary>


  The `__str__` method of `Config` is overloaded to print the tree structure with keys separated by `.`:

  ```text
  >>> cfg = Config()
  >>> cfg.foo.bar.a = 1
  >>> cfg.bar.foo.b = ['str1', 'str2']
  >>> cfg.whole.override()
  >>> print(cfg)
  cfg = Config()
  cfg.whole.override(True)

  cfg.foo.bar.a = 1
  cfg.bar.foo.b = ['str1', 'str2']
  ```

  When all leaf nodes are built-in types, the pretty print output of `Config` can be executed as Python code to get the same configuration:
  ```text
  >>> exec(cfg.to_txt(prefix='new_cfg.'), globals(), (l_dict := {}))
  >>> l_dict['new_cfg'] == cfg
  True
  ```

  For invalid attribute names, `Config` will fall back to the print format of `dict`:
  ```text
  >>> cfg = Config()
  >>> cfg['Invalid Attribute Name'].foo = 10
  >>> cfg.bar['def'] = {'a': 1, 'b': 2}
  >>> print(cfg)
  cfg = Config()

  cfg['Invalid Attribute Name'].foo = 10
  cfg.bar['def'] = {'a': 1, 'b': 2}
  ```


  For deep learning tasks, we recommend using `init_env` instead of `load_config`. In addition to loading the config, `init_env` can also initialize the deep learning environment, such as setting the torch device, gradient, random seed, and distributed training:

  ```python
  from alchemy_cat.torch_tools import init_env

  if __name__ == '__main__':
      import argparse

      parser = argparse.ArgumentParser()
      parser.add_argument('-c', '--config', type=str)
      parser.add_argument('--local_rank', type=int, default=-1)
      args = parser.parse_args()

      device, cfg = init_env(config_path=args.config,             # config file path，read to `cfg`
                             is_cuda=True,                        # if True，`device` is cuda，else cpu
                             is_benchmark=bool(args.benchmark),   # torch.backends.cudnn.benchmark = is_benchmark
                             is_train=True,                       # torch.set_grad_enabled(is_train)
                             experiments_root="experiment",       # root of experiment dir
                             rand_seed=True,                      # set python, numpy, torch rand seed. If True, read cfg.rand_seed as seed, else use actual parameter as rand seed.
                             cv2_num_threads=0,                   # set cv2 num threads
                             verbosity=True,                      # print more env init info
                             log_stdout=True,                     # where fork stdout to log file
                             loguru_ini=True,                     # config a pretty loguru format
                             reproducibility=False,               # set pytorch to reproducible mode
                             local_rank=...,                      # dist.init_process_group(..., local_rank=local_rank)
                             silence_non_master_rank=True,        # if True, non-master rank will not print to stdout, but only log to file
                             is_debug=bool(args.is_debug))        # is debug mode
  ```
  If `log_stdout=True`, `init_env` will fork `sys.stdout` and `sys.stderr` to the log file `cfg.rslt_dir/{local-time}.log`. This will not interfere with normal `print`, but all screen output will be recorded in the log. Therefore, there is no need to manually write logs, what you see on the screen is what you get in the log.

  Details can be found in the docstring of `init_env`.


  If you are a user of [addict](https://github.com/mewwts/addict), our `ADict` can be used as a drop-in replacement for `addict.Dict`: `from alchemy_cat.dl_config import ADict as Dict`.

  `ADict` has all the interfaces of `addict.Dict`. However, all methods are re-implemented to optimize execution efficiency and cover more corner cases (such as circular references). `Config` is actually a subclass of `ADict`.

  If you haven't used `addict` before, read this [documentation](https://github.com/mewwts/addict). Research code often involves complex dictionaries. `addict.Dict` or `ADict` supports attribute-style access for nested dictionaries.


  The initialization, inheritance, and composition of `ADict` and `Config` require a `branch_copy` operation, which is between shallow and deep copy, that is, copying the tree structure but not the leaf nodes. `ADict.copy`, `Config.copy`, and `copy.copy(cfg)` all call `branch_copy`, not the `copy` method of `dict`.

  In theory, `ADict.branch_copy` can handle circular references, such as:
  ```text
  >>> dic = {'num': 0,
             'lst': [1, 'str'],
             'sub_dic': {'sub_num': 3}}
  >>> dic['lst'].append(dic['sub_dic'])
  >>> dic['sub_dic']['parent'] = dic
  >>> dic
  {'num': 0,
   'lst': [1, 'str', {'sub_num': 3, 'parent': {...}}],
   'sub_dic': {'sub_num': 3, 'parent': {...}}}

  >>> adic = ADict(dic)
  >>> adic.sub_dic.parent is adic is not dic
  True
  >>> adic.lst[-1] is adic.sub_dic is not dic['sub_dic']
  True
  ```
  Different from `ADict`, the data model of `Config` is a bidirectional tree, and circular references will form a cycle. To avoid cycles, if a subtree is mounted to different parent configs multiple times, the subtree will be copied to an independent config tree before mounting. In normal use, circular references should not appear in the config tree.

  In summary, although circular references are supported, they are neither necessary nor recommended.


  `Config.named_branchs` and `Config.named_ckl` respectively traverse all branches and leaves of the config tree (the branch, key name, and value they are in):
  ```text
  >>> list(cfg.named_branches)
  [('', {'foo': {'bar': {'a': 1}},
         'bar': {'foo': {'b': ['str1', 'str2']}},
         'whole': {}}),
   ('foo', {'bar': {'a': 1}}),
   ('foo.bar', {'a': 1}),
   ('bar', {'foo': {'b': ['str1', 'str2']}}),
   ('bar.foo', {'b': ['str1', 'str2']}),
   ('whole', {})]

  >>> list(cfg.ckl)
  [({'a': 1}, 'a', 1), ({'b': ['str1', 'str2']}, 'b', ['str1', 'str2'])]
  ```


  ```text
  >>> from alchemy_cat.dl_config import Config
  >>> cfg = Config(caps='configs/mnist/base,sched_from_addon/cfg.py')
  >>> cfg.loader.ini.batch_size = 256
  >>> cfg.sched.epochs = 15
  >>> print(cfg)

  cfg = Config()
  cfg.override(False).set_attribute('_cfgs_update_at_parser', ('configs/mnist/base,sched_from_addon/cfg.py',))

  cfg.loader.ini.batch_size = 256
  cfg.sched.epochs = 15
  ```
  When inheriting, the parent configs `caps` is not immediately updated, but is loaded when `load_config` is called. Lazy inheritance allows the config system to have an eager-view of the entire inheritance chain, and a few features rely on this.



  For `config C + algorithm code A ——> reproducible experiment E(C, A)`, meaning that when the config `C` and the algorithm code `A` are determined, the experiment `E` can always be reproduced. Therefore, it is recommended to submit the configuration file and algorithm code to the Git repository together for reproducibility.

  We also provide a [script](alchemy_cat/torch_tools/scripts/tag_exps.py) that runs `pyhon -m alchemy_cat.torch_tools.scripts.tag_exps -s commit_ID -a commit_ID`, interactively lists the new configs added by the commit, and tags the commit according to the config path. This helps quickly trace back the config and algorithm of a historical experiment.


  The `work` function receives the idle GPU automatically allocated by `Cfg2TuneRunner` through the `cuda_env` parameter. We can further control the definition of 'idle GPU':
  ```python
  runner = Cfg2TuneRunner(args.cfg2tune, experiment_root='/tmp/experiment', work_gpu_num=1,
                          block=True,             # Try to allocate idle GPU
                          memory_need=10 * 1024,  # Need 10 GB memory
                          max_process=2)          # Max 2 process already ran on each GPU
  ```
  where:
  - `block`: Defaults is `True`. If set to `False`, GPUs are allocated sequentially, regardless of whether they are idle.
  - `memory_need`: The amount of GPU memory required for each sub-config, in MB. The free memory on an idle GPU must be ≥ `memory_need`. Default is `-1.`, indicating need all memory.
  - `max_process`: Maximum number of existing processes. The number of existing processes on an idle GPU must be ≤ `max_process`. Default value is `-1`, indicating no limit.


  Sub-configs generated by `Cfg2Tune` will be saved using pickle. However, if `Cfg2Tune` defines dependencies as `DEP(lambda c: ...)`, these lambda functions cannot be pickled. Workarounds include:
  * Using the decorator `@Config.set_DEP` to define the dependency's computation function.
  * Defining the dependency's calculation function in a separate module and passing it to `DEP`.
  * Defining dependencies in the parent configs since inheritance is handled lazily, so sub-configs temporarily exclude dependencies.
  * If the dependency source is a tunable parameter, use `P_DEP`, which resolves after generating sub-configs of `Cfg2Tune` but before saving them as pickle.




  The `Config.empty_leaf()` combines `Config.clear()` and `Config.override()` to get an empty and "override" subtree. This is commonly used to represent the "delete" semantics during inheritance, that is, using an empty config to override a subtree of the base config.


  Let `cfg` be a `Config` instance and `base_cfg` be a `dict` instance. The effects of `cfg.dict_update(base_cfg)`, `cfg.update(base_cfg)`, and `cfg |= base_cfg` are similar to inheriting `Config(base_cfg)` from `cfg`.

  Run `cfg.dict_update(base_cfg, incremental=True)` to ensure only incremental updates, that is, only add keys that do not exist in `cfg` without overwriting existing keys.

  </details>

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


