# packages

pkgId: 4b604852830cecce5556615cb2405d389f61ac72725eee4c321081a3d7e7eaf8
name: python-bamsnap
arch: src
version: 0.2.19
epoch: 0
release: 1
summary: A converter from .bam to .png for specific genomic region.
url: https://github.com/danielmsk/bamsnap
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bamsnap-0.2.19-1.src.rpm
checksum_type: sha256
description:
  <!--[![Build Status](https://travis-ci.org/bamsnap/bamsnap.svg?branch=develop)](https://travis-ci.org/bamsnap/bamsnap)
  [![Code Health](https://landscape.io/github/bamsnap/bamsnap/develop/landscape.svg?style=flat)](https://landscape.io/github/bamsnap/bamsnap/develop)
  [![Coverage Status](https://img.shields.io/codecov/c/github/bamsnap/bamsnap/develop.svg)](https://codecov.io/github/bamsnap/bamsnap?branch=develop)-->

  BamSnap: a lightweight command-based visualization tool for sequencing reads in BAM files

  <!--<img src="https://raw.githubusercontent.com/parklab/bamsnap/master/data/ex1/snapfiles/snap_test11.bam_1_715347-715348.png" height=128px width=405px>-->

  For more details, see BamSnap [**Documentation**](http://bamsnap.readthedocs.io/en/latest).

  [<img src="https://img.shields.io/pypi/v/bamsnap.svg">](https://pypi.org/project/bamsnap/)
  [<img src="https://img.shields.io/pypi/dm/bamsnap.svg">](https://pypi.org/project/bamsnap/)
  [<img src="https://readthedocs.org/projects/bamsnap/badge/?version=latest">](https://bamsnap.readthedocs.io/)
  [<img src="https://img.shields.io/docker/pulls/danielmsk/bamsnap.svg">](https://hub.docker.com/r/danielmsk/bamsnap)




  * python 3.4+
  * [Pillow (Python Imaging Library)](https://pypi.org/project/Pillow/)
  * [pysam](https://pypi.org/project/pysam/)
  * [pyfaidx](https://pypi.org/project/pyfaidx/)
  * [pytabix](https://pypi.org/project/pytabix/)



  ```bash
  pip install bamsnap
  ```
  * [pypi site for bamsnap](https://pypi.org/project/bamsnap/)



  ```
  git clone https://github.com/parklab/bamsnap
  cd bamsnap
  python setup.py install
  ```




  ```bash
  $ bamsnap -bam test.bam -pos 1:7364529 -out test.png
  ```

  For more details, see BamSnap [**Documentation**](http://bamsnap.readthedocs.io/en/latest).


  ```bash
  $ docker pull danielmsk/bamsnap
  $ docker run --rm -it -v /local_directory_path:/directory_path_in_image danielmsk/bamsnap bamsnap \
      -bam /directory_path_in_image/test.bam \
      -pos 1:7364529 \
      -out /directory_path_in_image/test.png
  ```





  * [**1000 Genome Data**](https://bamsnap-1kg.s3.amazonaws.com/index.html): 1000 genomic loci in 2504 individuals
  * [**BamSnap Plot Gallery**](https://bamsnap.readthedocs.io/en/latest/gallery.html)


pkgId: bae70b033a835cdde6f607c83a4b06498d0730d74906032f4f62b80038526bbf
name: python-banal
arch: src
version: 1.0.6
epoch: 0
release: 1
summary: Commons of banal micro-functions for Python.
url: http://github.com/pudo/banal
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banal-1.0.6-1.src.rpm
checksum_type: sha256
description:
  Commons of Python micro-functions. This basically an out-sourced, shared
  utils module with a focus on functions that buffer type uncertainties in
  Python (e.g. "is this a list?").

  Rules:

  * Functions are properly typed, library passes `mypy`.
  * Cannot depend on anything but six and the standard library



  * ``is_listish``: check if something is list-ish
  * ``is_mapping``: check if an object is dict-ish
  * ``ensure_list``: make sure an argument is a list, or make it into a single-element list
  * ``clean_dict``: remove null values from a dict, recursively
  * ``decode_path``: decode a path name to be unicode
  * ``hash_data``: generate a SHA1 from a dict of reasonable objects


pkgId: 7404fdc3a775454252607474bd832e7437e9028081de68937cae1e2cb4c17dbf
name: python-banana
arch: src
version: 0.5.1
epoch: 0
release: 1
url: https://github.com/MonashBI/banana
rpm_license: The Apache Software Licence 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banana-0.5.1-1.src.rpm
checksum_type: sha256
summary:
  Brain imAgiNg Analysis iN Arcana (Banana): brain imaging analysis workflows implemented in the Arcana framework (arcana.readthedocs.io)

description:
  Brain imAgiNg Analysis iN Arcana (Banana): a collection of brain imaging analysis
  workflows implemented in the Arcana_ framework, which can be used to analyse
  analysis datasets stored in XNAT, BIDS or plain-directory repositories.


pkgId: b4a76e850f549edf77bf844a9503c739575b7ed3606af60dbaea7467124891cc
name: python-banana-bot-client
arch: src
version: 0.1.17
epoch: 0
release: 1
summary: Automate Telegram game Banana Bot using Python
url: https://pypi.org/project/banana-bot-client/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banana-bot-client-0.1.17-1.src.rpm
checksum_type: sha256
description:
  Inspired by [banana-bot](https://github.com/dkzhen/banana-bot). This is a simple client SDK that connects to Telegram Banana Bot API.


pkgId: 214c0304211ce6db262b580b0b4b3f485afd71bdb73ce4a77914cb0edf46608f
name: python-banana-manager
arch: src
version: 0.5.0
epoch: 0
release: 1
summary: Ready-to-go web app for end-users to interact with tables in a database.
url: https://github.com/GusFurtado/BananaManager
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banana-manager-0.5.0-1.src.rpm
checksum_type: sha256
description:
  Welcome to **Banana Manager**! Banana Manager is a Python package designed to connect to a database and create a simple web app that displays and allows updates to selected tables. This tool is perfect for non-technical end-users who need to interact with database tables without using complex DBA tools.




  - **[Dash](https://dash.plotly.com/) and [AG Grid](https://www.ag-grid.com/)**: User-friendly, intuitive, and interactive web interface with powerful table displays and editing capabilities.
  - **[Pydantic](https://pydantic-docs.helpmanual.io/) and [YAML](https://yaml.org/)**: Fast and accurate data handling and configuration.
  - **[SQLAlchemy](https://www.sqlalchemy.org/)**: Secure, efficient, and flexible database operations for multiple database backends.




  To install Banana Manager, simply use pip:

  ```bash
  pip install banana-manager
  ```

  Also, remember to install the appropriate database connector for your project, like `pyodbc` or `psycopg2`. If you’re unsure, SQLAlchemy will inform you when you load your application.

  Additionally, consider installing a production server like `waitress`:

  ```bash
  pip install waitress
  ```



  At the end of this tutorial, you’ll have a folder structure similar to the following:

  ```
  my_manager
      └─ app.py
      └─ config.yaml
      └─ my_tables
              └─ my_group_of_tables.yaml
              └─ another_group_of_tables.yaml
  ```



  Create a `config.yaml` file in the root folder of your project with the following structure:

  ```yaml
  connection:
    drivername: <optional str>
    username: <optional str>
    password: <optional str>
    host: <optional str>
    port: <optional str>
    database: <optional str>
  dataPath: "data"
  tablePaths: ["tables"]
  title: "Banana Database Manager"
  theme: <optional str>
  defaultColDef: <optional dict>
  defaultGridOptions: <optional dict>
  ```

  - **connection** *(dict)* : This will create a [SQLAlchemy URL](https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.engine.URL) object. See the section [Dialets](https://docs.sqlalchemy.org/en/20/dialects/) for more information about the appropriate driver.
  - **dataPath** *(str, default="data")* : The folder where the app data files will be stored.
  - **tablePaths** *(list[str], default=["tables"])* : List of folder where the table models YAML files are stored.
  - **title** *(str, default="Banana Database Manager")* : HTML header title attribute.
  - **theme** *(str, default="cyan")* : One of the [default Mantine colors](https://mantine.dev/theming/colors/#default-colors).
  - **defaultColDef** *(dict[str, Any])* : [AG Grid column properties](https://www.ag-grid.com/angular-data-grid/column-properties/).
  - **defaultGridOptions** *(dict[str, Any])* : [AG Grid options](https://www.ag-grid.com/react-data-grid/grid-options/).



  The tables can be defined using YAML files located in the folders specified in the `config.yaml`. If no folder is specified, create a new folder named "tables" in the root folder.

  Each YAML file represents a group containing a list of tables. Here’s the structure:

  ```yaml
  group_name: <optional string>
  display_order: <optional integer>
  tables:
    - name: <string>
      schema_name: <optional string>
      display_name: <optional string>
      primary_key:
        name: <string>
        display_name: <optional string>
        columnDef: <optional dict>
      columns:
        - name: <string>
          display_name: <optional string>
          foreign_key: (optional)
            table_name: <string>
            schema_name: <optional string>
            column_name: <string>
            column_display: <string>
            order_by: (optional)
              - column: <string>
                desc: <optional bool>
          columnDef: <optional dict>
        - <other columns>
      order_by: (optional)
        - column: <string>
          desc: <optional bool>
        - <other columns>
      limit: <optional int>
      defaultColDef: <optional dict>
      gridOptions: <optional dict>

    - <other tables>
  ```



  - **group_name** *(str, optional)* : Name of the group that will be displayed in the side menu.
  - **display_order** *(int, optional)* : Order which the groups will be stacked in the side menu.
  - **tables** *(list)* : List of table configurations.



  - **name** *(str)* : Name of the table in the database.
  - **schema_name** *(str, optional)* : Schema where the table is located in the database.
  - **display_name** : *(str, optional)* : Name that will be displayed at the side menu.
  - **primary_key** *(dict)* : Primary key configuration.
  - **columns** *(list)* : List of column configurations.
  - **order_by** *(list[dict])* : Default ordering of the table rows.
  - **limit** *(int)* : Maximum of rows returned after order by.
  - **defaultColDef** *(dict[str, Any])* : [AG Grid column properties](https://www.ag-grid.com/angular-data-grid/column-properties/).
  - **gridOptions** *(dict[str, Any])* : [AG Grid options](https://www.ag-grid.com/react-data-grid/grid-options/).



  - **name** *(str)* : Name of the column in the database that will be used as primary key.
  - **display_name** *(str, optional)* : Name that will be displayed in the table.
  - **columnDef** *(dict[str, Any])* : [AG Grid column properties](https://www.ag-grid.com/angular-data-grid/column-properties/).



  - **column** *(str)* : Name of the column
  - **desc** *(bool, optional)* : If True, order table by column in descending order.



  - **name** *(str)* : Name of the column in the database.
  - **display_name** *(str, optional)* : Name that will be displayed in the table.
  - **foreign_key** *(dict, optional)* : Foreign key configuration.
  - **columnDef** *(dict[str, Any])* : [AG Grid column properties](https://www.ag-grid.com/angular-data-grid/column-properties/).



  - **table_name** *(str)* : Name of the foreign table in the database.
  - **schema_name** *(str, optional)* : Schema where the foreign table is located in the database.
  - **column_name** *(str)* : Name of the referenced column in the database.
  - **column_display** *(str)* : Values that will be displayed in the app.
  - **order_by** *(list[dict])* : Ordering of the dropdown options.



  You can set the `columnDef` property in the `Column` and `PrimaryKey` models and set the `defaultColDef` property in the `Config` and `Table` models.

  The column definitions set in the `Config` model are applied to every table and column in the application, but they will be overwritten by the definitions set in the `Table`, and lastly overwritten by the definitions set in `Column` and `PrimaryKey`.

  BananaManager does not offer support to every single definition of the original AG Grid, specially the Enterprise-only properties, but are some highlights that were fully tested:

  - **editable** *(bool)* : Set to `true` if this column is editable, otherwise `false`.
  - **hide** *(bool)* : Set to `true` for this column to be hidden.
  - **sortable** *(bool)* : Set to `false` to disable sorting which is enabled by default.
  - **filter** *(bool)* : Set to `true` to use the default filter component.



  Create an app.py file in the root folder:

  ```python
  from banana import Banana

  app = Banana()
  MY_PORT = 4000

  if __name__ == "__main__":
      app.run_server(port=MY_PORT)
  ```

  This will load a development server in the selected port. Consider running a production server with `waitress`:

  ```python
  from banana import Banana
  from waitress import serve

  app = Banana()
  MY_PORT = 4000

  if __name__ == "__main__":
      serve(app.server, port=MY_PORT)
  ```




  | Version  | Description                  | Release date               |
  |----------|------------------------------|----------------------------|
  | **v0.1** | Load table and update cells  | First half of July 2024    |
  | **v0.2** | Table groups                 | Second half of July 2024   |
  | **v0.3** | Logging and configurations   | First half of August 2024  |
  | **v0.4** | Insert rows and color themes | Second half of August 2024 |
  | **v0.5** | Change history               | September 2024             |
  | **v0.6** | Delete rows                  | November 2024              |
  | **v0.7** | Special data types           | December 2024              |
  | **v0.8** | User authentication          | First quarter of 2025      |
  | **v0.9** | Advanced user authorization  | Second quarter of 2025     |



  Banana Manager is released under the MIT License. See the [LICENSE](LICENSE) file for more details.


pkgId: 93ee537d7a56b7dd68c07f6e01baf926b10b0a00f64792d12a8fc19676a1955e
name: python-bananalyzer
arch: src
version: 0.12.0
epoch: 0
release: 1
summary: Open source AI Agent evaluation framework for web tasks 🐒🍌
url: https://pypi.org/project/bananalyzer/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bananalyzer-0.12.0-1.src.rpm
checksum_type: sha256
description:
  Banana-lyzer is an open source AI Agent evaluation framework and dataset for **web tasks** with Playwright (And has a
  banana theme because why not).
  We've created our own evals repo because:
  - Websites change overtime, are affected by latency, and may have anti bot protections.
  - We need a system that can reliably save and deploy historic/static snapshots of websites.
  - Standard web practices are loose and there is an abundance of different underlying ways to represent a single
    individual website. For an agent to best generalize, we require building a diverse dataset of websites across
    industries and use-cases.
  - We have specific evaluation criteria and agent use cases focusing on structured and direct information retrieval
    across websites.
  - There exists valuable web task datasets and evaluations that we'd like to unify in a single
    repo ([Mind2Web](https://osu-nlp-group.github.io/Mind2Web/), [WebArena](https://webarena.dev/), etc).
  https://github.com/reworkd/bananalyzer/assets/50181239/4587615c-a5b4-472d-bca9-334594130af1

  ⚠️ Note that this repo is a work in progress. ⚠️
  Banana-lyzer is a CLI tool that runs a set of evaluations against a set of example websites.
  The examples are defined
  in [examples.json](https://github.com/reworkd/bananalyzer/blob/main/static/examples.json) using a schema
  similar to [Mind2Web](https://osu-nlp-group.github.io/Mind2Web/) and [WebArena](https://webarena.dev/). The examples
  store metadata like the agent goal and the expected agent output in addition to snapshots of urls via mhtml to ensure
  the page is not changed over time. Note all examples today expect structured JSON output using data directly extracted
  from the page.
  The CLI tool will sequentially run examples against a user defined agent by dynamically constructing a pytest test suite
  and executing it.
  As a user, you simply create a file that implements the `AgentRunner` interface and defines an instance of your
  AgentRunner in a variable called "agent".
  AgentRunner exposes the example, and a playwright browser context to use.
  In the future we will support more complex evaluation methods and examples that require multiple steps to complete. The
  plan is to translate existing datasets like Mind2Web and WebArena into this format.

  We have defined a set of page types and test intents an agent can be evaluated on. These types are defined in the `ExampleType`
  enum in [schemas.py](https://github.com/reworkd/bananalyzer/blob/main/bananalyzer/data/schemas.py).
  - **listing**: The example starts on a listing page but must scrape all detail page links and the information from those detail pages.
  Note that currently, we only test that all of the detail page URLs were captured.
  - **detail**: The example starts on a detail page and the agent must retrieve specific JSON information from the page. This is the most common test type.
  - **listing_detail**: The agent is on a listing page and must scrape all information from the current page.
  All of the required information is available on the current page. The agent need not visit the detail page.
  Separately, there are specific `tags` that can be used further filter test intents
  - **pagination**: Must fetch data across pages. Either links or fetch for now.


  - `pip install --dev bananalyzer`
  - Implement the `agent_runner.py` interface and make a banalyzer.py test file (The name doesn't matter). Below is an
    example file
  ```python
  import asyncio
  from playwright.async_api import BrowserContext
  from bananalyzer import AgentResult, AgentRunner, Example
  class NullAgentRunner(AgentRunner):
      """
      A test agent class that just returns an empty string
      """
      async def run(
          self,
          context: BrowserContext,
          example: Example,
      ) -> AgentResult:
          page = await context.new_page()
          await page.goto(
              example.get_static_url())  # example.url has the real url, example.get_static_url() returns the local mhtml file url
          await asyncio.sleep(0.5)
          return example.evals[0].expected  # Just return expected output directly so that tests pass
  ```
  - Run `bananalyze ./tests/banalyzer.py` to run the test suite
  - You can also run `bananalyze .` to run all tests in the current directory
  - To run local examples (from the repo's `static` folder) on MacOS, please run `unix2dos static/*/*.mhtml` to convert CRLF formatting in MHTML files

  - `-h` or `--help`: Show help
  - `--headless`: Run with Playwright headless mode
  - `-id` or `--id`: Run a specific test by id
  - `-i` or `--intent`: Only run tests of a particular intent (fetch, links, etc)
  - `-c` or `--category`: Only run tests of a particular category (healthcare, manufacturing, software, etc)
  - `-n` or `--n`: Number of test workers to use. The default is 1
  - `-skip` or `--skip`: A list of ids to skip tests on, separated by commas
  - `-t` or `--type`: Only run tests of a particular type (links, fetch, etc)


  The project has a basic FastAPI server to expose example data. You can run it with the following command:
  ```
  cd server
  poetry run uvicorn server:app --reload
  ```
  Then travel to `http://127.0.0.1:8000/api/docs` in your browser to see the API docs.

  All current examples have been manually added through running the `fetch.ipynb` notebook at the root of this project.
  This notebook will load a site with Playwright and use the chrome developer API to save the page as an MHTML file.


  - [x] Functions to serve local MHTML sites
  - [x] Agent interface required for running the tool
  - [x] Pytest wrapper to enable CLI testing with additional arguments
  - [x] Document a majority of the repo
  - [x] Functions to serve complicated pages via HAR

  - [x] CLI param to filter tests by intent
  - [x] Additional CLI params to select for specific tests or test categories
  - [ ] Ability to add multiple site pages to examples
  - [ ] Ability to add in-page actions to examples
  - [ ] Translate WebArena evals
  - [ ] Translate Mind2Web evals
  - [ ] Lag and bot detection emulation
  - [ ] Updated test visualization with separation of categories and outputs

  - [x] 15 additional data retrieval examples
  - [x] 15 additional link examples
  - [ ] 15 click examples
  - [ ] 15 navigation examples
  - [ ] Tests requiring multi-step navigation
  - [ ] Tests requiring both navigation and data retrieval
  - [ ] Tests requiring pop-up closing
  - [ ] Tests requiring sign-in
  - [ ] Tests requiring captcha solving

  ```
  bibtex
  @misc{reworkd2023bananalyzer,
    title        = {Bananalyzer},
    author       = {Asim Shrestha and Adam Watkins and Rohan Pandey and Srijan Subedi and Sunshine},
    year         = {2023},
    howpublished = {GitHub},
    url          = {https://github.com/reworkd/bananalyzer}
  }
  ```


pkgId: d400d797e113dd2892a54944ac59a64c5d3c8c6e779d25ee44a951c24479d75f
name: python-bananaproto
arch: src
version: 1.3.0
epoch: 0
release: 1
summary: A BANANA Protobuf / gRPC generator & library
url: https://github.com/BananaLoaf/python-bananaproto
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bananaproto-1.3.0-1.src.rpm
checksum_type: sha256
description:
  - Fixed input types imports missing
  - Methods return non-string type hints
  - Server methods now receive metadata
  - Server-side exceptions get passed to client with original error message
  - Removed Pydantic
  - Support only `python3.10+`
  - Seamless await for coroutines (see below)



  Usually you write code like this:

  ```python
  from package import Stub

  stub = Stub(channel=channel)

  await stub.cool_method()

  async for res in stub.cool_stream():
      pass
  ```

  However, due to my personal needs, I added ability to seamlessly de-async coroutines and async generators.

  ```python
  from bananaproto.event_loop import EventLoop, SingletonEventLoop
  from package import Stub


  loop = EventLoop().get_loop()


  loop = SingletonEventLoop().get_loop()


  stub = Stub(channel=channel, synchronization_loop=loop)


  stub.cool_method()
  for res in stub.cool_stream():
      pass
  ```



  [![Python Version](https://img.shields.io/pypi/pyversions/bananaproto.svg?color=yellow&style=flat-square)](https://www.python.org/downloads/)
  [![GitHub Licence](https://img.shields.io/github/license/BananaLoaf/python-bananaproto.svg?color=blue&style=flat-square)](https://github.com/BananaLoaf/python-bananaproto/blob/master/LICENSE)
  [![Package Version](https://img.shields.io/pypi/v/bananaproto.svg?color=green&style=flat-square)](https://pypi.org/project/bananaproto/)
  [![Tests](https://github.com/BananaLoaf/python-bananaproto/actions/workflows/tests.yaml/badge.svg)](https://github.com/BananaLoaf/python-bananaproto/actions/workflows/tests.yaml)
  > :octocat: If you're reading this on github, please be aware that it might mention unreleased features! See the latest released README on [pypi](https://pypi.org/project/bananaproto/).

  This project aims to provide an improved experience when using Protobuf / gRPC in a modern Python environment by making use of modern language features and generating readable, understandable, idiomatic Python code. It will not support legacy features or environments (e.g. Protobuf 2). The following are supported:

  - Protobuf 3 & gRPC code generation
    - Both binary & JSON serialization is built-in
  - Python 3.7+ making use of:
    - Enums
    - Dataclasses
    - `async`/`await`
    - Timezone-aware `datetime` and `timedelta` objects
    - Relative imports
    - Mypy type checking

  This project is heavily inspired by, and borrows functionality from:

  - https://github.com/protocolbuffers/protobuf/tree/master/python
  - https://github.com/eigenein/protobuf/
  - https://github.com/vmagamedov/grpclib



  This project exists because I am unhappy with the state of the official Google protoc plugin for Python.

  - No `async` support (requires additional `grpclib` plugin)
  - No typing support or code completion/intelligence (requires additional `mypy` plugin)
  - No `__init__.py` module files get generated
  - Output is not importable
    - Import paths break in Python 3 unless you mess with `sys.path`
  - Bugs when names clash (e.g. `codecs` package)
  - Generated code is not idiomatic
    - Completely unreadable runtime code-generation
    - Much code looks like C++ or Java ported 1:1 to Python
    - Capitalized function names like `HasField()` and `SerializeToString()`
    - Uses `SerializeToString()` rather than the built-in `__bytes__()`
    - Special wrapped types don't use Python's `None`
    - Timestamp/duration types don't use Python's built-in `datetime` module


  This project is a reimplementation from the ground up focused on idiomatic modern Python to help fix some of the above. While it may not be a 1:1 drop-in replacement due to changed method names and call patterns, the wire format is identical.



  First, install the package. Note that the `[compiler]` feature flag tells it to install extra dependencies only needed by the `protoc` plugin:

  ```sh

  pip install "bananaproto[compiler]"


  pip install bananaproto
  ```

  *Bananaproto* is under active development. To install the latest beta version, use `pip install --pre bananaproto`.





  Given you installed the compiler and have a proto file, e.g `example.proto`:

  ```protobuf
  syntax = "proto3";

  package hello;

  // Greeting represents a message you can tell a user.
  message Greeting {
    string message = 1;
  }
  ```

  You can run the following to invoke protoc directly:

  ```sh
  mkdir lib
  protoc -I . --python_bananaproto_out=lib example.proto
  ```

  or run the following to invoke protoc via grpcio-tools:

  ```sh
  pip install grpcio-tools
  python -m grpc_tools.protoc -I . --python_bananaproto_out=lib example.proto
  ```

  This will generate `lib/hello/__init__.py` which looks like:

  ```python



  from dataclasses import dataclass

  import bananaproto


  @dataclass
  class Greeting(bananaproto.Message):
    """Greeting represents a message you can tell a user."""

    message: str = bananaproto.string_field(1)
  ```

  Now you can use it!

  ```python
  >>> from lib.hello import Greeting
  >>> test = Greeting()
  >>> test
  Greeting(message='')

  >>> test.message = "Hey!"
  >>> test
  Greeting(message="Hey!")

  >>> serialized = bytes(test)
  >>> serialized
  b'\n\x04Hey!'

  >>> another = Greeting().parse(serialized)
  >>> another
  Greeting(message="Hey!")

  >>> another.to_dict()
  {"message": "Hey!"}
  >>> another.to_json(indent=2)
  '{\n  "message": "Hey!"\n}'
  ```



  The generated Protobuf `Message` classes are compatible with [grpclib](https://github.com/vmagamedov/grpclib) so you are free to use it if you like. That said, this project also includes support for async gRPC stub generation with better static type checking and code completion support. It is enabled by default.

  Given an example service definition:

  ```protobuf
  syntax = "proto3";

  package echo;

  message EchoRequest {
    string value = 1;
    // Number of extra times to echo
    uint32 extra_times = 2;
  }

  message EchoResponse {
    repeated string values = 1;
  }

  message EchoStreamResponse  {
    string value = 1;
  }

  service Echo {
    rpc Echo(EchoRequest) returns (EchoResponse);
    rpc EchoStream(EchoRequest) returns (stream EchoStreamResponse);
  }
  ```

  Generate echo proto file:

  ```
  python -m grpc_tools.protoc -I . --python_bananaproto_out=. echo.proto
  ```

  A client can be implemented as follows:
  ```python
  import asyncio
  import echo

  from grpclib.client import Channel


  async def main():
      channel = Channel(host="127.0.0.1", port=50051)
      service = echo.EchoStub(channel)
      response = await service.echo(echo.EchoRequest(value="hello", extra_times=1))
      print(response)

      async for response in service.echo_stream(echo.EchoRequest(value="hello", extra_times=1)):
          print(response)

      
      channel.close()


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

  ```

  which would output
  ```python
  EchoResponse(values=['hello', 'hello'])
  EchoStreamResponse(value='hello')
  EchoStreamResponse(value='hello')
  ```

  This project also produces server-facing stubs that can be used to implement a Python
  gRPC server.
  To use them, simply subclass the base class in the generated files and override the
  service methods:

  ```python
  import asyncio
  from echo import EchoBase, EchoRequest, EchoResponse, EchoStreamResponse
  from grpclib.server import Server
  from typing import AsyncIterator


  class EchoService(EchoBase):
      async def echo(self, echo_request: "EchoRequest") -> "EchoResponse":
          return EchoResponse([echo_request.value for _ in range(echo_request.extra_times)])

      async def echo_stream(self, echo_request: "EchoRequest") -> AsyncIterator["EchoStreamResponse"]:
          for _ in range(echo_request.extra_times):
              yield EchoStreamResponse(echo_request.value)


  async def main():
      server = Server([EchoService()])
      await server.start("127.0.0.1", 50051)
      await server.wait_closed()

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



  Both serializing and parsing are supported to/from JSON and Python dictionaries using the following methods:

  - Dicts: `Message().to_dict()`, `Message().from_dict(...)`
  - JSON: `Message().to_json()`, `Message().from_json(...)`

  For compatibility the default is to convert field names to `camelCase`. You can control this behavior by passing a casing value, e.g:

  ```python
  MyMessage().to_dict(casing=bananaproto.Casing.SNAKE)
  ```



  Sometimes it is useful to be able to determine whether a message has been sent on the wire. This is how the Google wrapper types work to let you know whether a value is unset, set as the default (zero value), or set as something else, for example.

  Use `bananaproto.serialized_on_wire(message)` to determine if it was sent. This is a little bit different from the official Google generated Python code, and it lives outside the generated `Message` class to prevent name clashes. Note that it **only** supports Proto 3 and thus can **only** be used to check if `Message` fields are set. You cannot check if a scalar was sent on the wire.

  ```py

  >>> mymessage.HasField('myfield')


  >>> bananaproto.serialized_on_wire(mymessage.myfield)
  ```



  Protobuf supports grouping fields in a `oneof` clause. Only one of the fields in the group may be set at a given time. For example, given the proto:

  ```protobuf
  syntax = "proto3";

  message Test {
    oneof foo {
      bool on = 1;
      int32 count = 2;
      string name = 3;
    }
  }
  ```

  You can use `bananaproto.which_one_of(message, group_name)` to determine which of the fields was set. It returns a tuple of the field name and value, or a blank string and `None` if unset.

  ```py
  >>> test = Test()
  >>> bananaproto.which_one_of(test, "foo")
  ["", None]

  >>> test.on = True
  >>> bananaproto.which_one_of(test, "foo")
  ["on", True]


  >>> test.count = 57
  >>> bananaproto.which_one_of(test, "foo")
  ["count", 57]
  >>> test.on
  False


  >>> test.name = ""
  >>> bananaproto.which_one_of(test, "foo")
  ["name", ""]
  >>> test.count
  0
  >>> test.on
  False
  ```

  Again this is a little different than the official Google code generator:

  ```py

  >>> message.WhichOneof("group")
  "foo"


  >>> bananaproto.which_one_of(message, "group")
  ["foo", "foo's value"]
  ```



  Google provides several well-known message types like a timestamp, duration, and several wrappers used to provide optional zero value support. Each of these has a special JSON representation and is handled a little differently from normal messages. The Python mapping for these is as follows:

  | Google Message              | Python Type                              | Default                |
  | --------------------------- | ---------------------------------------- | ---------------------- |
  | `google.protobuf.duration`  | [`datetime.timedelta`][td]               | `0`                    |
  | `google.protobuf.timestamp` | Timezone-aware [`datetime.datetime`][dt] | `1970-01-01T00:00:00Z` |
  | `google.protobuf.*Value`    | `Optional[...]`                          | `None`                 |
  | `google.protobuf.*`         | `bananaproto.lib.google.protobuf.*`      | `None`                 |

  [td]: https://docs.python.org/3/library/datetime.html#timedelta-objects
  [dt]: https://docs.python.org/3/library/datetime.html#datetime.datetime

  For the wrapper types, the Python type corresponds to the wrapped type, e.g. `google.protobuf.BoolValue` becomes `Optional[bool]` while `google.protobuf.Int32Value` becomes `Optional[int]`. All of the optional values default to `None`, so don't forget to check for that possible state. Given:

  ```protobuf
  syntax = "proto3";

  import "google/protobuf/duration.proto";
  import "google/protobuf/timestamp.proto";
  import "google/protobuf/wrappers.proto";

  message Test {
    google.protobuf.BoolValue maybe = 1;
    google.protobuf.Timestamp ts = 2;
    google.protobuf.Duration duration = 3;
  }
  ```

  You can do stuff like:

  ```py
  >>> t = Test().from_dict({"maybe": True, "ts": "2019-01-01T12:00:00Z", "duration": "1.200s"})
  >>> t
  Test(maybe=True, ts=datetime.datetime(2019, 1, 1, 12, 0, tzinfo=datetime.timezone.utc), duration=datetime.timedelta(seconds=1, microseconds=200000))

  >>> t.ts - t.duration
  datetime.datetime(2019, 1, 1, 11, 59, 58, 800000, tzinfo=datetime.timezone.utc)

  >>> t.ts.isoformat()
  '2019-01-01T12:00:00+00:00'

  >>> t.maybe = None
  >>> t.to_dict()
  {'ts': '2019-01-01T12:00:00Z', 'duration': '1.200s'}
  ```




  - _See how you can help &rarr; [Contributing](.github/CONTRIBUTING.md)_



  - Python (3.7 or higher)

  - [poetry](https://python-poetry.org/docs/#installation)
    *Needed to install dependencies in a virtual environment*

  - [poethepoet](https://github.com/nat-n/poethepoet) for running development tasks as defined in pyproject.toml
    - Can be installed to your host environment via `pip install poethepoet` then executed as simple `poe`
    - or run from the poetry venv as `poetry run poe`



  ```sh

  poetry install -E compiler


  poetry shell
  ```



  This project enforces [black](https://github.com/psf/black) python code formatting.

  Before committing changes run:

  ```sh
  poe format
  ```

  To avoid merge conflicts later, non-black formatted python code will fail in CI.



  There are two types of tests:

  1. Standard tests
  2. Custom tests



  Adding a standard test case is easy.

  - Create a new directory `bananaproto/tests/inputs/<name>`
    - add `<name>.proto`  with a message called `Test`
    - add `<name>.json` with some test data (optional)

  It will be picked up automatically when you run the tests.

  - See also: [Standard Tests Development Guide](tests/README.md)



  Custom tests are found in `tests/test_*.py` and are run with pytest.



  Here's how to run the tests.

  ```sh

  poe generate

  poe test
  ```

  To run tests as they are run in CI (with tox) run:

  ```sh
  poe full-test
  ```



  Bananaproto includes compiled versions for Google's well-known types at [src/bananaproto/lib/google](src/bananaproto/lib/google).
  Be sure to regenerate these files when modifying the plugin output format, and validate by running the tests.

  Normally, the plugin does not compile any references to `google.protobuf`, since they are pre-compiled. To force compilation of `google.protobuf`, use the option `--custom_opt=INCLUDE_GOOGLE`.

  Assuming your `google.protobuf` source files (included with all releases of `protoc`) are located in `/usr/local/include`, you can regenerate them as follows:

  ```sh
  protoc \
      --plugin=protoc-gen-custom=src/bananaproto/plugin/main.py \
      --custom_opt=INCLUDE_GOOGLE \
      --custom_out=src/bananaproto/lib \
      -I /usr/local/include/ \
      /usr/local/include/google/protobuf/*.proto
  ```



  - [x] Fixed length fields
    - [x] Packed fixed-length
  - [x] Zig-zag signed fields (sint32, sint64)
  - [x] Don't encode zero values for nested types
  - [x] Enums
  - [x] Repeated message fields
  - [x] Maps
    - [x] Maps of message fields
  - [x] Support passthrough of unknown fields
  - [x] Refs to nested types
  - [x] Imports in proto files
  - [x] Well-known Google types
    - [ ] Support as request input
    - [ ] Support as response output
      - [ ] Automatically wrap/unwrap responses
  - [x] OneOf support
    - [x] Basic support on the wire
    - [x] Check which was set from the group
    - [x] Setting one unsets the others
  - [ ] JSON that isn't completely naive.
    - [x] 64-bit ints as strings
    - [x] Maps
    - [x] Lists
    - [x] Bytes as base64
    - [ ] Any support
    - [x] Enum strings
    - [x] Well known types support (timestamp, duration, wrappers)
    - [x] Support different casing (orig vs. camel vs. others?)
  - [x] Async service stubs
    - [x] Unary-unary
    - [x] Server streaming response
    - [x] Client streaming request
  - [x] Renaming messages and fields to conform to Python name standards
  - [x] Renaming clashes with language keywords
  - [x] Python package
  - [x] Automate running tests
  - [ ] Cleanup!



  - [ ] Add *Reflections* chapter to README
  - [ ] Return original folder structure
  - [ ] Automatically import *_pb2 for reflections
  - [ ] Fix comments in generated code
  - [ ] Omit Empty argument from Stub and Service



  Copyright © 2019 Daniel G. Taylor

  http://dgt.mit-license.org/


pkgId: 1c11b912c7dbd5db6d8393c082f16e54407548c178aa88babf5177e682db6306
name: python-bananopie
arch: src
version: 0.1.3.2
epoch: 0
release: 1
summary: A python library to simplify sending and receiving Banano. Also a RPC wrapper.
url: https://github.com/jetstream0/bananopie
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bananopie-0.1.3.2-1.src.rpm
checksum_type: sha256
description:
  Bananopie is a python library for the Banano cryptocurrency. It aims to be the python equivalent of Banano.js, and not just a RPC wrapper (Sending, receiving, changing rep functions are very high level).



  `pip install bananopie`

  Bananopie is on [pypi](https://pypi.org/project/bananopie/).


  - There is an outdated fork of Bananopie for Nano, also made by me, called [nanohakase](https://pypi.org/project/nanohakase/). It should suit most of your needs, but if you need new Bananopie features, fork Bananopie, change the work difficulty to `FFFFFFF800000000`, decimals to `31`, and you should be good to go.
  - When running on Replit (ew), installing Bananopie may fail if you do not have `gcc` installed (nix package: `libgccjit`).



  First, start with a `RPC` class, for read only
  ```py
  from bananopie import *
  rpc = RPC("https://kaliumapi.appditto.com/api")


  print(rpc.get_block_count()["count"])


  print(rpc.get_account_history("ban_1jung1eb3uomk1gsx7w6w7toqrikxm5pgn5wbsg5fpy96ckpdf6wmiuuzpca", count=10)["history"])


  print(raw_to_whole(int(rpc.get_account_balance("ban_1jung1eb3uomk1gsx7w6w7toqrikxm5pgn5wbsg5fpy96ckpdf6wmiuuzpca")["balance"])))
  ```

  For sending/receiving transactions, use a `Wallet`.
  ```py
  from bananopie import RPC, Wallet
  rpc = RPC("https://kaliumapi.appditto.com/api")

  my_account = Wallet(rpc, seed="seed here", index=0)


  my_new_account = Wallet(rpc, index=0)

  print(my_new_account.seed)


  print(my_account.get_address())


  print(my_account.get_balance())


  print(my_account.send("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94", "1")["hash"])


  my_account.receive_all()


  my_account.change_rep("ban_3catgir1p6b1edo5trp7fdb8gsxx4y5ffshbphj73zzy5hu678rsry7srh8b")


  my_account.index = 2
  ```

  Bananopie can also generate work, albeit slowly. This is useful when using node that don't support generating work. Also, the `legacy` parameter can be passed to the RPC class when the RPC supports the deprecated `pending` RPC call instead of the newer `receivable` call.
  ```py
  from bananopie import RPC, Wallet

  no_work_rpc = RPC("https://public.node.jungletv.live/rpc", legacy=True)

  my_work_account = Wallet(no_work_rpc, seed="seed here", index=0, try_work=True)


  my_work_account.send("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94", "0.0042")
  ```

  Utility functions are also provided.
  ```py
  import bananopie


  print(bananopie.whole_to_raw("492.2"))


  print(bananopie.raw_to_whole(1900000000000000000000000000))
  ```



  Also see the [Nano RPC docs](https://docs.nano.org/commands/rpc-protocol) for information on what rpc call wrapper functions return.


  **Parameters:**
  - `rpc_url` (*str*): IP or URL of node
  - `auth` (*str* or *bool*, Default: False): Optional HTTP Authorization header
  - `legacy` (*bool*, Default: False): If `True`, will use 'pending' instead of 'receivable'

  Sample:
  ```py
  rpc = RPC("https://kaliumapi.appditto.com/api")
  ```

  **Properties:**
  - `rpc_url` (*str*): IP or URL of node
  - `auth` (*str* or *bool*): Optional HTTP Authorization header

  **Methods:**


  RPC call. Intended for internal use, but useful for RPC calls that aren't directly implemented.

  **Parameters:**
  - `payload` (*dictionary*): Payload to send to node

  Sample:
  ```py
  rpc.call({"action": "block_count"})
  ```

  **Returns:**
  Response of RPC call (JSON dictionary)


  Get network block count.

  **Parameters**
  None

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#block_count)



  Get block info for hash.

  **Parameters**
  - `block` (*st*): Block hash

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#block_info)


  Get blocks.

  **Parameters**
  - `blocks` (*list[str]*): List of block hashes to get information on

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#blocks)


  Get blocks, with more detailed information.

  **Parameters**
  - `blocks` (*list[str]*): List of block hashes to get information on

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#blocks_info)


  Get list of network representatives and their weight

  **Parameters**
  None

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#representatives)


  Get list of network representatives that have recently voted

  **Parameters**
  None

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#representatives_online)


  Get account history (confirmed and received transaction list)

  **Parameters**
  - `account` (*str*): Address of account
  - `count` (*int*, Default: -1): Optional parameter to specify amount of transactions to return. `-1` means all, or at least as much as the node will allow
  - `head` (*str* or *None*, Default: None): Block hash to start from, defaults to latest block hash if omitted
  - `account_filter` (*list[str]* or *None*, Default: None): List of addresses to only show sends/receives from. Please note that some public nodes will ignore this parameter

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_history)


  Get account information, like height, frontier, balance, etc

  **Parameters**
  - `account` (*str*): Address of account

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_info)


  Get account balance

  **Parameters**
  - `account` (*str*): Address of account

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_balance)


  Get account representative

  **Parameters**
  - `account` (*str*): Address of account

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_representative)


  Get representatives of accounts

  **Parameters**
  - `account` (*list[str]*): List of addresses

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_representatives)


  Get delegated weight of representative

  **Parameters**
  - `account` (*str*): Address of representative

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_weight)


  Get receivable transactions for account

  **Parameters**
  - `account` (*str*): Address of representative
  - `count` (*int*, Default: 20): Optional parameter to specify max amount of receivable transactions to return
  - `threshold` (*int* or *None*, Default: None): Optional parameter to filter out any receivable transactions with value below the threshold (in raw)

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#receivable)



  **Parameters:**
  - `rpc` (*RPC*): A RPC class
  - `seed` (*str* or *None*, Default: None): 64 character hex seed, if `None`, will generate a seed by itself. Private keys are derived from the seed.
  - `index` (*int*, Default: 0): Optional parameter that is the index of the seed. Any number from 0 to 4294967295. Each index of the seed is a different private key, and so different address.
  - `try_work` (*bool*, Default: False): If `True`, will try to generate work locally instead of asking node for work (and no work provided). Good to use if node does not support generating own work.

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  ```

  **Properties:**
  - `rpc_url` (*str*): IP or URL of node
  - `seed` (*str*): Banano seed (64 character hex string)
  - `index` (*int*): Seed index. Change this property to change the wallet seed index.

  **Methods**


  Internal use function to send a `process` RPC call

  **Parameters**
  - `block` (*dictionary*): block content
  - `subtype` (*str*): Send, receive, or change

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  High level function to send Banano

  **Parameters**
  - `to` (*str*): Address to send to
  - `amount` (*str*): Amount of Banano to send (in whole, not raw)
  - `work` (*str* or *bool*, Default: False): Leave it as `False` to ask node to generate work (passes `do_work`). Put in a work string if work generated locally
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.send("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94", "1")
  ```

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  High level function to send all Banano

  **Parameters**
  - `to` (*str*): Address to send to
  - `work` (*str* or *bool*, Default: False): Leave it as `False` to ask node to generate work (passes `do_work`). Put in a work string if work generated locally
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.send_all("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94")
  ```

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  Receive a specific block

  **Parameters**
  - `hash` (*str*): Block hash to receive
  - `work` (*str* or *bool*, Default: False): Leave it as `False` to ask node to generate work (passes `do_work`). Put in a work string if work generated locally
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  Receive all (technically, 20) receivable transactions

  **Parameters**
  - `count` (*int*, Default: 20): Optional parameter to specify max amount of receivable transactions to receive
  - `threshold` (*int* or *None*, Default: None): Optional parameter to not receive any receivable transactions with value below the threshold (in whole, not raw)

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.receive_all()
  ```

  **Returns**
  - A list of block hashes that were received (See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process))


  Change account representative

  **Parameters**
  - `new_representative` (*str*): Representative Banano address to change to
  - `work` (*str* or *bool*, Default: False): Leave it as False to ask node to generate work (passes `do_work`). Put in a work string if work generated locally
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.change_rep("ban_3catgir1p6b1edo5trp7fdb8gsxx4y5ffshbphj73zzy5hu678rsry7srh8b")
  ```

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  Sign utf-8 message with private key at current index of current seed

  **Parameters**
  - `message` (*str*): utf-8 message to sign

  **Returns**
  *str*, Hex signature


  Sign utf-8 message as a dummy block (making sure ledger devices can also sign) with private key at current index of current seed

  **Parameters**
  - `message` (*str*): utf-8 message to sign

  **Returns**
  *str*, Hex signature


  Get public key at current index of current seed

  **Parameters**
  None

  **Returns**
  *str*, Hex public key


  Get address at current index of current seed

  **Parameters**
  None

  **Returns**
  *str*, Banano address


  Double wrapped function to get balance of self (see `RPC`'s `get_account_balance`)


  Double wrapped function to get receivable blocks (see `RPC`'s `get_receivable`)


  Double wrapped function to get receivable blocks (see `RPC`'s `get_receivable`), except `threshold` parameter is in whole Banano, not raw


  Double wrapped function to get representative of self (see `RPC`'s `get_account_representative`)


  Double wrapped function to get account info of self (see `RPC`'s `get_account_info`)


  Double wrapped function to get account info of self (see `RPC`'s `get_account_history`)


  Generate a random seed using `os.urandom`

  **Parameters**
  None

  Sample:
  ```py
  print(Wallet.generate_seed())
  ```

  **Returns**
  64 character hex seed



  **Properties**
  - `BANANO_DECIMALS` (*int*): Amount of decimals that Banano has (29)
  - `PREAMBLE` (*str*): Hex string to prepend when signing
  - `BANANO_WORK` (*str*): Hex string of Banano's work threshold/minimum

  **Methods**

  `encode_base32`, `decode_base32`, `bytes_to_hex`, `hex_to_bytes`, `utf8_to_bytes`, `random_bytes`, `get_private_key_from_seed`, `get_public_key_from_private_key`, `get_address_from_public_key`, `get_public_key_from_address`, `hash_block`, `sign`, `sign_message_dummy_block`, `gen_dummy_block_hash` are internal use Functions that are currently undocumented. Look at `/bananopie/util.py` to see what they do.


  Verifies whether signed message is real

  **Parameters**
  - `public_key` (*str*): Hex public key
  - `signature` (*str*): Hex signature
  - `claimed_message` (*str*): utf-8 message that was allegedly signed

  **Returns**
  *bool*, `True` if message verified, `False` if message not verified


  Verifies whether signed message (with dummy block) is real

  **Parameters**
  - `public_key` (*str*): Hex public key
  - `signature` (*str*): Hex signature
  - `claimed_message` (*str*): utf-8 message (with dummy block) that was allegedly signed

  **Returns**
  *bool*, `True` if message (with dummy block) verified, `False` if message (with dummy block) not verified


  Converts whole Banano to raw Banano

  **Parameters**
  - `whole` (*str*): Whole amount of Banano

  **Returns**
  *int*, that is raw amount of Banano


  Converts raw Banano to whole Banano (Cuts off at 2 decimal places by default)

  **Parameters**
  - `raw` (*int*): Raw amount of Banano
  - `precision` (*int*, Default: 2): Decimal places to cut off at

  **Returns**
  *int*, that is whole amount of Banano


  Converts raw Banano to whole Banano, without rounding

  **Parameters**
  - `raw` (*int*): Raw amount of Banano

  **Returns**
  *str*, that is unrounded whole amount of Banano


  Generate work given block's previous hash (or if opening block, account public key), and threshold. Generates work using psuedorandom generator.

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key
  - `threshold` (*str*): Hex minimum work threshold

  **Returns**
  *str*, that is hex of work


  Generate work given block's previous hash (or if opening block, account public key), and threshold. Generates work deterministically.

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key
  - `threshold` (*str*): Hex minimum work threshold

  **Returns**
  *str*, that is hex of work


  Generate work given block's previous hash (or if opening block, account public key). Basically a wrapper for `gen_work_deterministic` with threshold being the hardcoded Banano default.

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key

  **Returns**
  *str*, that is hex of work


  Verify whether work is valid or not, given previous hash of block (or if opening block, account public key).

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key
  - `work` (*str*): Hex of work

  **Returns**
  *bool*, whether the work is valid or not


pkgId: 5f966312f705e16bf4670bd1a1be85f2e9d1c1577d2be030acb0434f85ecd40c
name: python-bananopie
arch: src
version: 0.1.4
epoch: 0
release: 1
summary: A python library to simplify sending and receiving Banano. Also a RPC wrapper.
url: https://github.com/jetstream0/bananopie
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bananopie-0.1.4-1.src.rpm
checksum_type: sha256
description:
  Bananopie is a python library for the Banano cryptocurrency. It aims to be the python equivalent of Banano.js, and not just a RPC wrapper (Sending, receiving, changing rep functions are very high level).



  `pip install bananopie`

  Bananopie is on [pypi](https://pypi.org/project/bananopie/).


  - There is an outdated fork of Bananopie for Nano, also made by me, called [nanohakase](https://pypi.org/project/nanohakase/). It should suit most of your needs, but if you need new Bananopie features, fork Bananopie, change the work difficulty to `FFFFFFF800000000`, decimals to `31`, and you should be good to go.
  - When running on Replit (ew), installing Bananopie may fail if you do not have `gcc` installed (nix package: `libgccjit`).



  First, start with a `RPC` class, for read only
  ```py
  from bananopie import *
  rpc = RPC("https://kaliumapi.appditto.com/api")


  print(rpc.get_block_count()["count"])


  print(rpc.get_account_history("ban_1jung1eb3uomk1gsx7w6w7toqrikxm5pgn5wbsg5fpy96ckpdf6wmiuuzpca", count=10)["history"])


  print(raw_to_whole(int(rpc.get_account_balance("ban_1jung1eb3uomk1gsx7w6w7toqrikxm5pgn5wbsg5fpy96ckpdf6wmiuuzpca")["balance"])))
  ```

  For sending/receiving transactions, use a `Wallet`.
  ```py
  from bananopie import RPC, Wallet
  rpc = RPC("https://kaliumapi.appditto.com/api")

  my_account = Wallet(rpc, seed="seed here", index=0)


  my_new_account = Wallet(rpc, index=0)

  print(my_new_account.seed)


  print(my_account.get_address())


  print(my_account.get_balance())


  print(my_account.send("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94", "1")["hash"])


  my_account.receive_all()


  my_account.change_rep("ban_3catgir1p6b1edo5trp7fdb8gsxx4y5ffshbphj73zzy5hu678rsry7srh8b")


  my_account.index = 2
  ```

  Bananopie can also generate work, albeit slowly. This is useful when using node that don't support generating work. Also, the `legacy` parameter can be passed to the RPC class when the RPC supports the deprecated `pending` RPC call instead of the newer `receivable` call.
  ```py
  from bananopie import RPC, Wallet

  no_work_rpc = RPC("https://public.node.jungletv.live/rpc", legacy=True)

  my_work_account = Wallet(no_work_rpc, seed="seed here", index=0, try_work=True)


  my_work_account.send("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94", "0.0042")
  ```

  Utility functions are also provided.
  ```py
  import bananopie


  print(bananopie.whole_to_raw("492.2"))


  print(bananopie.raw_to_whole(1900000000000000000000000000))
  ```



  Also see the [Nano RPC docs](https://docs.nano.org/commands/rpc-protocol) for information on what rpc call wrapper functions return.


  **Parameters:**
  - `rpc_url` (*str*): IP or URL of node
  - `auth` (*str* or *bool*, Default: False): Optional HTTP Authorization header
  - `legacy` (*bool*, Default: False): If `True`, will use 'pending' instead of 'receivable'

  Sample:
  ```py
  rpc = RPC("https://kaliumapi.appditto.com/api")
  ```

  **Properties:**
  - `rpc_url` (*str*): IP or URL of node
  - `auth` (*str* or *bool*): Optional HTTP Authorization header

  **Methods:**


  RPC call. Intended for internal use, but useful for RPC calls that aren't directly implemented.

  **Parameters:**
  - `payload` (*dictionary*): Payload to send to node

  Sample:
  ```py
  rpc.call({"action": "block_count"})
  ```

  **Returns:**
  Response of RPC call (JSON dictionary)


  Get network block count.

  **Parameters**
  None

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#block_count)



  Get block info for hash.

  **Parameters**
  - `block` (*st*): Block hash

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#block_info)


  Get blocks.

  **Parameters**
  - `blocks` (*list[str]*): List of block hashes to get information on

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#blocks)


  Get blocks, with more detailed information.

  **Parameters**
  - `blocks` (*list[str]*): List of block hashes to get information on

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#blocks_info)


  Get list of network representatives and their weight

  **Parameters**
  None

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#representatives)


  Get list of network representatives that have recently voted

  **Parameters**
  None

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#representatives_online)


  Get account history (confirmed and received transaction list)

  **Parameters**
  - `account` (*str*): Address of account
  - `count` (*int*, Default: -1): Optional parameter to specify amount of transactions to return. `-1` means all, or at least as much as the node will allow
  - `head` (*str* or *None*, Default: None): Block hash to start from, defaults to latest block hash if omitted
  - `account_filter` (*list[str]* or *None*, Default: None): List of addresses to only show sends/receives from. Please note that some public nodes will ignore this parameter

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_history)


  Get account information, like height, frontier, balance, etc

  **Parameters**
  - `account` (*str*): Address of account

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_info)


  Get account balance

  **Parameters**
  - `account` (*str*): Address of account

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_balance)


  Get account representative

  **Parameters**
  - `account` (*str*): Address of account

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_representative)


  Get representatives of accounts

  **Parameters**
  - `account` (*list[str]*): List of addresses

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_representatives)


  Get delegated weight of representative

  **Parameters**
  - `account` (*str*): Address of representative

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#account_weight)


  Get receivable transactions for account

  **Parameters**
  - `account` (*str*): Address of representative
  - `count` (*int*, Default: 20): Optional parameter to specify max amount of receivable transactions to return
  - `threshold` (*int* or *None*, Default: None): Optional parameter to filter out any receivable transactions with value below the threshold (in raw)

  **Returns:**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#receivable)



  **Parameters:**
  - `rpc` (*RPC*): A RPC class
  - `seed` (*str* or *None*, Default: None): 64 character hex seed, if `None`, will generate a seed by itself. Private keys are derived from the seed.
  - `index` (*int*, Default: 0): Optional parameter that is the index of the seed. Any number from 0 to 4294967295. Each index of the seed is a different private key, and so different address.
  - `try_work` (*bool*, Default: False): If `True`, will try to generate work locally instead of asking node for work (and no work provided). Good to use if node does not support generating own work.

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  ```

  **Properties:**
  - `rpc_url` (*str*): IP or URL of node
  - `seed` (*str*): Banano seed (64 character hex string)
  - `index` (*int*): Seed index. Change this property to change the wallet seed index.

  **Methods**


  Internal use function to send a `process` RPC call

  **Parameters**
  - `block` (*dictionary*): block content
  - `subtype` (*str*): Send, receive, or change

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  High level function to send Banano

  **Parameters**
  - `to` (*str*): Address to send to
  - `amount` (*str*): Amount of Banano to send (in whole, not raw)
  - `work` (*str* or *bool* or *function*, Default: False): Leave it as `False` to ask node to generate work (passes `do_work`). Put in a work string if work generated locally, if it is a function, the work will be the function called with the block hash as a parameter (keep in mind you can set the class' `try_work` to `True` to use the built-in `gen_work` function)
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.send("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94", "1")
  ```

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  High level function to send all Banano

  **Parameters**
  - `to` (*str*): Address to send to
  - `work` (*str* or *bool* or *function*, Default: False): Leave it as `False` to ask node to generate work (passes `do_work`). Put in a work string if work generated locally, if it is a function, the work will be the function called with the block hash as a parameter (keep in mind you can set the class' `try_work` to `True` to use the built-in `gen_work` function)
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.send_all("ban_3pdripjhteyymwjnaspc5nd96gyxgcdxcskiwwwoqxttnrncrxi974riid94")
  ```

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  Receive a specific block

  **Parameters**
  - `hash` (*str*): Block hash to receive
  - `work` (*str* or *bool* or *function*, Default: False): Leave it as `False` to ask node to generate work (passes `do_work`). Put in a work string if work generated locally, if it is a function, the work will be the function called with the block hash as a parameter (keep in mind you can set the class' `try_work` to `True` to use the built-in `gen_work` function)
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  Receive all (technically, 20) receivable transactions

  **Parameters**
  - `count` (*int*, Default: 20): Optional parameter to specify max amount of receivable transactions to receive
  - `threshold` (*int* or *None*, Default: None): Optional parameter to not receive any receivable transactions with value below the threshold (in whole, not raw)

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.receive_all()
  ```

  **Returns**
  - A list of block hashes that were received (See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process))


  Change account representative

  **Parameters**
  - `new_representative` (*str*): Representative Banano address to change to
  - `work` (*str* or *bool* or *function*, Default: False): Leave it as `False` to ask node to generate work (passes `do_work`). Put in a work string if work generated locally, if it is a function, the work will be the function called with the block hash as a parameter (keep in mind you can set the class' `try_work` to `True` to use the built-in `gen_work` function)
  - `previous` (*str* or *None*, Default: None): Previous block hash. Otherwise, address' frontier block hash used

  Sample:
  ```py
  my_account = Wallet(RPC("https://kaliumapi.appditto.com/api"), "seed here", 0)
  my_account.change_rep("ban_3catgir1p6b1edo5trp7fdb8gsxx4y5ffshbphj73zzy5hu678rsry7srh8b")
  ```

  **Returns**
  See [Nano RPC Docs](https://docs.nano.org/commands/rpc-protocol/#process)


  Sign utf-8 message with private key at current index of current seed

  **Parameters**
  - `message` (*str*): utf-8 message to sign

  **Returns**
  *str*, Hex signature


  Sign utf-8 message as a dummy block (making sure ledger devices can also sign) with private key at current index of current seed

  **Parameters**
  - `message` (*str*): utf-8 message to sign

  **Returns**
  *str*, Hex signature


  Get public key at current index of current seed

  **Parameters**
  None

  **Returns**
  *str*, Hex public key


  Get address at current index of current seed

  **Parameters**
  None

  **Returns**
  *str*, Banano address


  Double wrapped function to get balance of self (see `RPC`'s `get_account_balance`)


  Double wrapped function to get receivable blocks (see `RPC`'s `get_receivable`)


  Double wrapped function to get receivable blocks (see `RPC`'s `get_receivable`), except `threshold` parameter is in whole Banano, not raw


  Double wrapped function to get representative of self (see `RPC`'s `get_account_representative`)


  Double wrapped function to get account info of self (see `RPC`'s `get_account_info`)


  Double wrapped function to get account info of self (see `RPC`'s `get_account_history`)


  Generate a random seed using `os.urandom`

  **Parameters**
  None

  Sample:
  ```py
  print(Wallet.generate_seed())
  ```

  **Returns**
  64 character hex seed



  **Properties**
  - `BANANO_DECIMALS` (*int*): Amount of decimals that Banano has (29)
  - `PREAMBLE` (*str*): Hex string to prepend when signing
  - `BANANO_WORK` (*str*): Hex string of Banano's work threshold/minimum

  **Methods**

  `encode_base32`, `decode_base32`, `bytes_to_hex`, `hex_to_bytes`, `utf8_to_bytes`, `random_bytes`, `get_private_key_from_seed`, `get_public_key_from_private_key`, `get_address_from_public_key`, `get_public_key_from_address`, `hash_block`, `sign`, `sign_message_dummy_block`, `gen_dummy_block_hash` are internal use Functions that are currently undocumented. Look at `/bananopie/util.py` to see what they do.


  Verifies whether signed message is real

  **Parameters**
  - `public_key` (*str*): Hex public key
  - `signature` (*str*): Hex signature
  - `claimed_message` (*str*): utf-8 message that was allegedly signed

  **Returns**
  *bool*, `True` if message verified, `False` if message not verified


  Verifies whether signed message (with dummy block) is real

  **Parameters**
  - `public_key` (*str*): Hex public key
  - `signature` (*str*): Hex signature
  - `claimed_message` (*str*): utf-8 message (with dummy block) that was allegedly signed

  **Returns**
  *bool*, `True` if message (with dummy block) verified, `False` if message (with dummy block) not verified


  Converts whole Banano to raw Banano

  **Parameters**
  - `whole` (*str*): Whole amount of Banano

  **Returns**
  *int*, that is raw amount of Banano


  Converts raw Banano to whole Banano (Cuts off at 2 decimal places by default)

  **Parameters**
  - `raw` (*int*): Raw amount of Banano
  - `precision` (*int*, Default: 2): Decimal places to cut off at

  **Returns**
  *int*, that is whole amount of Banano


  Converts raw Banano to whole Banano, without rounding

  **Parameters**
  - `raw` (*int*): Raw amount of Banano

  **Returns**
  *str*, that is unrounded whole amount of Banano


  Generate work given block's previous hash (or if opening block, account public key), and threshold. Generates work using psuedorandom generator.

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key
  - `threshold` (*str*): Hex minimum work threshold

  **Returns**
  *str*, that is hex of work


  Generate work given block's previous hash (or if opening block, account public key), and threshold. Generates work deterministically.

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key
  - `threshold` (*str*): Hex minimum work threshold

  **Returns**
  *str*, that is hex of work


  Generate work given block's previous hash (or if opening block, account public key). Basically a wrapper for `gen_work_deterministic` with threshold being the hardcoded Banano default.

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key

  **Returns**
  *str*, that is hex of work


  Verify whether work is valid or not, given previous hash of block (or if opening block, account public key).

  **Parameters**
  - `hash` (*str*): Hex previous hash of block / account public key
  - `work` (*str*): Hex of work

  **Returns**
  *bool*, whether the work is valid or not


pkgId: 8f33668c344bc902ba896127d172cb1faad107edc71537b949eb5782a564cdb7
name: python-bananopie-bns
arch: src
version: 0.0.1
epoch: 0
release: 1
summary: A python library to simplify sending and receiving Banano. Also a RPC wrapper.
url: https://github.com/jetstream0/bananopie_bns
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bananopie-bns-0.0.1-1.src.rpm
checksum_type: sha256
description:
  A direct translation of the resolver bits of the [BNS Typescript Library](https://github.com/stjet/bns) into Python. That Typescript library relies on the banani library, which was a translation of bananopie (a Python library for Banano). And this library relies on bananopie too... Seems like I've gone full circle.


pkgId: acea89b184590d21988cf6abdb4c65efd1813a7bdecf3f8a8fef1a31321b8030
name: python-bananopie-bns
arch: src
version: 0.0.3
epoch: 0
release: 1
summary: A python library to simplify sending and receiving Banano. Also a RPC wrapper.
url: https://github.com/jetstream0/bananopie_bns
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bananopie-bns-0.0.3-1.src.rpm
checksum_type: sha256
description:
  A direct translation of the resolver bits of the [BNS Typescript Library](https://github.com/stjet/bns) into Python. That Typescript library relies on the banani library, which was a translation of bananopie (a Python library for Banano). And this library relies on bananopie too... Seems like I've gone full circle.

  See the [BNS protocol spec](https://github.com/stjet/bns/blob/master/bns_protocol.md) for more details.

  Published on pypi as [bananopie-bns](https://pypi.org/project/bananopie-bns/):

  ```
  pip install bananopie-bns
  ```

  Example from tests.py:

  ```python
  from bananopie_bns import *
  from bananopie import RPC

  rpc = RPC("https://kaliumapi.appditto.com/api")


  test_tld_mapping = {
    "mictest": "ban_1dzpfrgi8t4byzmdeidh57p14h5jwbursf1t3ztbmeqnqqdcbpgp9x8j3cw6",
    "jtv": "ban_3gipeswotbnyemcc1dejyhy5a1zfgj35kw356dommbx4rdochiteajcsay56",
    "ban": "ban_1fdo6b4bqm6pp1w55duuqw5ebz455975o4qcp8of85fjcdw9qhuzxsd3tjb9",
  }

  resolver = Resolver(rpc, test_tld_mapping)

  nishina247 = resolver.resolve("nishina247", "mictest")

  print(nishina247["resolved_address"])
  print(len(nishina247["history"]), nishina247["metadata_hash"])

  print(resolver.resolve("doesnotexist19190836", "jtv") == None)
  print(resolver.resolve("skip", "jtv")["resolved_address"])

  print(resolver.resolve_backwards_ish("ban_1n4f89e93kkg5dchm1thgqcd6hchtidunbru3pwbq11iwn11qwbgyka8ruop", "mictest")["resolved_address"])
  ```


pkgId: 7d859302ed8b545154bce225189d779f0dde96d5b46a37a8bbf1d7c3deda4f18
name: python-bancointer-python
arch: src
version: 0.10
epoch: 0
release: 1
summary: Emita boletos bancários utilizando a API do Banco Inter PJ.
url: https://github.com/renatojdev/bancointer-python
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bancointer-python-0.10-1.src.rpm
checksum_type: sha256
description:
  Este projeto consome a API do Banco Inter PJ de boletos registrados. Para acesso a documentação precisa estar logado no internet banking do Banco Inter. Para criar seu aplicativo, siga estas etapas simples:

  * Faça login no Internet Banking (Banco Inter).
  * Navegue até a seção APIs:
  * Conta Digital > Aplicações > <em>**Nova Aplicação**</em>

  **Atualizado para a API versão 3**

  * Crie um arquivo `.env` com os seguitntes atributos na aplicação que irá usar este projeto.

  ```
      
      APP_ENV=SANDBOX
      CPFCNPJ_BENEF='Número CPF OU CNPJ da conta no banco inter'
      X_INTER_CONTA_CORRENTE='Numero da conta corrente'
      
      API_SBX_TOKEN_V2=https://cdpj-sandbox.partners.uatinter.co/oauth/v2/token
      API_SBX_COBRA_V3=https://cdpj-sandbox.partners.uatinter.co/cobranca/v3/
      
      API_URL_TOKEN_V2=https://cdpj.partners.bancointer.com.br/oauth/v2/token
      API_URL_COBRA_V3=https://cdpj.partners.bancointer.com.br/cobranca/v3/
      API_URL_COBRA_V2=https://cdpj.partners.bancointer.com.br/cobranca/v2/
      API_URL_COBRA_V1=https://apis.bancointer.com.br/openbanking/v1/certificado/
      SSL_DIR_BASE='Diretorio base dos arquivos SSL'
      PUBLIC_KEY_V1='Path do arquivo public key da versão 1'
      PRIVATE_KEY_V1='Path do Arquivo private key da versão 1'
      PUBLIC_KEY_V2='Path do arquivo public key da versão 2'
      PRIVATE_KEY_V2='Path do Arquivo private key da versão 2'
      DOWNLOAD_PATH='Path do diretorio que os arquivos PDF de download serão salvos'
      CLIENT_ID='Chave client id da sua app no banco inter'
      CLIENT_SECRET='Chave client secret da sua app no banco inter'
  ```

  **Referências:**

  * Portal do desenvolvedor: https://developers.inter.co/
  * Referência da API: https://developers.inter.co/references/token


      * API Cobrança (Boleto com Pix)
          - Emissão de boletos
          - Download de boletos
          - Baixa de boletos
          - Consulta detalhada de boletos


      * Recursos da Api Banking
          * Extrato
              - Consultar extrato
      * Recursos da Api Pix



  ```pip install bancointer-python```

  ou

  ```python setup.py install```


  Exemplos de utilização da API do Banco Inter (SANDBOX) para emissão, download e baixa de títulos bancários. Veja a pasta `examples/`.

  - Importe as dependências necessárias:

  ```
  from decouple import config

  dir_base_ssl = config("SSL_DIR_BASE")


  dir_base_ssl = config("SSL_DIR_BASE")
  cert = (dir_base_ssl + config("PUBLIC_KEY_V2"), dir_base_ssl + config("PRIVATE_KEY_V2"))
  client_id = config("CLIENT_ID")
  client_secret = config("CLIENT_SECRET")


  app_env_name = config("APP_ENV")
  env = Environment.get_environment_by_value(app_env_name.upper())
  ```


  ```
  payer = Pessoa(
      "9" * 11,  # valido
      PersonType.FISICA,
      "NOME DO PAGADOR",
      "ENDERECO DO PAGADOR",
      "CIDADE DO PAGADOR",
      "PR",
      "80030000",
  )  # OU FISICA


  discount = Desconto("PERCENTUALDATAINFORMADA", 0, 1.2, 2)
  multa = Multa("VALORFIXO", 0, 100)
  mora = Mora("TAXAMENSAL", 0, 4.5)
  message = Message("message 1", "message 2", "message 3", "", "message 5")


  beneficiario_final = Pessoa(
      "12345678901",
      PersonType.FISICA,
      "Nome do beneficiário",
      "Avenida Brasil, 1200",
      "Belo Horizonte",
      "MG",
      "30110000",
  )

  cobranca = Cobranca.criar_sobranca_simples("0001", 2.5, "2024-11-22", payer)
  cobranca.multa = multa
  cobranca.desconto = discount
  cobranca.beneficiarioFinal = beneficiario_final

  sol_new_cobranca = SolicitacaoEmitirCobranca(cobranca)

  emite_cobranca = EmiteCobranca(env, client_id, client_secret, cert)
  resposta = emite_cobranca.emitir(sol_new_cobranca)

  print(resposta)
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  recupera_cobranca = RecuperaCobranca(env, client_id, client_secret, cert)

  response = recupera_cobranca.recuperar(request_code)
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  recupera_cobranca = RecuperaCobrancaPDF(env, client_id, client_secret, cert)

  response = recupera_cobranca.recuperar_pdf(request_code, config("DOWNLOAD_PATH"))
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  cancela_cobranca = CancelaCobranca(env, client_id, client_secret, cert)

  response = cancela_cobranca.cancelar(request_code, Baixa.ACERTOS.value)
  ```


  Clone o repositório do projeto

  > $ git clone https://github.com/renatojdev/bancointer-python.git

  Se não tiver o pipenv instalado, para instalar:
  > $ pip install -U pipenv

  Instale as dependências
  > $ make install




  - [Python 3.7+](https://www.python.org/downloads/release/python-374/)
  - [Pipenv](https://github.com/kennethreitz/pipenv)



  [MIT](http://en.wikipedia.org/wiki/MIT_License)


pkgId: d5d4082e1f93364f37d978f6598063553409532da743c3cdb2cfee364d4a397a
name: python-bancointer-python
arch: src
version: 0.13
epoch: 0
release: 1
summary: Emita boletos bancários utilizando a API do Banco Inter PJ.
url: https://pypi.org/project/bancointer-python/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bancointer-python-0.13-1.src.rpm
checksum_type: sha256
description:
  Este projeto consome a API do Banco Inter PJ de boletos registrados. Para acesso a documentação precisa estar logado no internet banking do Banco Inter. Para criar seu aplicativo, siga estas etapas simples:

  * Faça login no Internet Banking (Banco Inter).
  * Navegue até a seção APIs:
  * Conta Digital > Aplicações > <em>**Nova Aplicação**</em>

  **Atualizado para a API versão 3**

  * Crie um arquivo `.env` com os seguitntes atributos na aplicação que irá usar este projeto.

  ```
      
      APP_ENV=SANDBOX
      CPFCNPJ_BENEF='Número CPF OU CNPJ da conta no banco inter'
      X_INTER_CONTA_CORRENTE='Numero da conta corrente'
      
      API_SBX_TOKEN_V2=https://cdpj-sandbox.partners.uatinter.co/oauth/v2/token
      API_SBX_COBRA_V3=https://cdpj-sandbox.partners.uatinter.co/cobranca/v3/
      
      API_URL_TOKEN_V2=https://cdpj.partners.bancointer.com.br/oauth/v2/token
      API_URL_COBRA_V3=https://cdpj.partners.bancointer.com.br/cobranca/v3/
      API_URL_COBRA_V2=https://cdpj.partners.bancointer.com.br/cobranca/v2/
      API_URL_COBRA_V1=https://apis.bancointer.com.br/openbanking/v1/certificado/
      SSL_DIR_BASE='Diretorio base dos arquivos SSL'
      PUBLIC_KEY_V1='Path do arquivo public key da versão 1'
      PRIVATE_KEY_V1='Path do Arquivo private key da versão 1'
      PUBLIC_KEY_V2='Path do arquivo public key da versão 2'
      PRIVATE_KEY_V2='Path do Arquivo private key da versão 2'
      DOWNLOAD_PATH='Path do diretorio que os arquivos PDF de download serão salvos'
      CLIENT_ID='Chave client id da sua app no banco inter'
      CLIENT_SECRET='Chave client secret da sua app no banco inter'
  ```

  **Referências:**

  * Portal do desenvolvedor: https://developers.inter.co/
  * Referência da API: https://developers.inter.co/references/token


      * API Cobrança (Boleto com Pix)
          - Emissão de boletos
          - Download de boletos
          - Baixa de boletos
          - Consulta detalhada de boletos

      * API Banking
          * Saldo
              - Consultar saldo
          * Extrato
              - Consultar extrato
              - Recuperar extrato em PDF
          * Pagamento
              - Incluir pagamento com código de barras
              - Incluir pagamento DARF
              - Cancelar agendamento do pagamento
              - Buscar pagamentos
              - Buscar pagamentos de DARF
          * Pix pagamento
              - Incluir Pagamento Pix


      * Recursos da Api Banking
          * Extrato
              - Consultar extrato enriquecido
      * Recursos da Api Pix
          * Cobrança imediata
              - Criar cobrança imediata
              - Consultar cobrança imediata
          * Cobrança com vencimento
              - Criar cobrança com vencimento
              - Consultar cobrança com vencimento



  ```pip install bancointer-python```

  ou

  ```pip install .```


  Exemplos de utilização da API do Banco Inter (SANDBOX) para emissão, download e baixa de títulos bancários. Veja a pasta `examples/`.

  - Importe as dependências necessárias:

  ```
  from decouple import config
  from bancointer.utils.environment import Environment


  dir_base_ssl = config("SSL_DIR_BASE")
  cert = (dir_base_ssl + config("PUBLIC_KEY_V2"), dir_base_ssl + config("PRIVATE_KEY_V2"))
  client_id = config("CLIENT_ID")
  client_secret = config("CLIENT_SECRET")
  conta_corrente = config("X_INTER_CONTA_CORRENTE")


  app_env_name = config("APP_ENV")
  env = Environment.get_environment_by_value(app_env_name.upper())
  ```


  ```
  payer = Pessoa(
      "9" * 11,  # valido
      PersonType.FISICA,
      "NOME DO PAGADOR",
      "ENDERECO DO PAGADOR",
      "CIDADE DO PAGADOR",
      "PR",
      "80030000",
  )  # OU FISICA


  discount = Desconto("PERCENTUALDATAINFORMADA", 0, 1.2, 2)
  multa = Multa("VALORFIXO", 0, 100)
  mora = Mora("TAXAMENSAL", 0, 4.5)
  message = Message("message 1", "message 2", "message 3", "", "message 5")


  beneficiario_final = Pessoa(
      "12345678901",
      PersonType.FISICA,
      "Nome do beneficiário",
      "Avenida Brasil, 1200",
      "Belo Horizonte",
      "MG",
      "30110000",
  )

  cobranca = Cobranca.criar_sobranca_simples("0001", 2.5, "2024-11-22", payer)
  cobranca.multa = multa
  cobranca.desconto = discount
  cobranca.beneficiarioFinal = beneficiario_final

  sol_new_cobranca = SolicitacaoEmitirCobranca(cobranca)

  emite_cobranca = EmiteCobranca(env, client_id, client_secret, cert, conta_corrente)
  resposta = emite_cobranca.emitir(sol_new_cobranca)

  print(resposta)
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  recupera_cobranca = RecuperaCobranca(env, client_id, client_secret, cert, conta_corrente)

  response = recupera_cobranca.recuperar(request_code)
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  recupera_cobranca = RecuperaCobrancaPDF(env, client_id, client_secret, cert, conta_corrente)

  response = recupera_cobranca.recuperar_pdf(request_code, config("DOWNLOAD_PATH"))
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  cancela_cobranca = CancelaCobranca(env, client_id, client_secret, cert, conta_corrente)

  response = cancela_cobranca.cancelar(request_code, Baixa.ACERTOS.value)
  ```


  Clone o repositório do projeto

  > $ git clone https://github.com/renatojdev/bancointer-python.git

  Se não tiver o pipenv instalado, para instalar:
  > ```$ pip install -U pipenv```

  Instale as dependências
  > ```$ make install```




  - [Python 3.7+](https://www.python.org/downloads/release/python-374/)
  - [Pipenv](https://github.com/kennethreitz/pipenv)



  [MIT](http://en.wikipedia.org/wiki/MIT_License)


pkgId: b5854c2cea4e854b1eb16ca40e676547d0fb80e3d425a06fc965e3e197f91d93
name: python-bancointer-python
arch: src
version: 0.14
epoch: 0
release: 1
summary: Emita boletos bancários utilizando a API do Banco Inter PJ.
url: https://pypi.org/project/bancointer-python/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bancointer-python-0.14-1.src.rpm
checksum_type: sha256
description:
  Este projeto consome a API do Banco Inter PJ de boletos registrados. Para acesso a documentação precisa estar logado no internet banking do Banco Inter. Para criar seu aplicativo, siga estas etapas simples:

  * Faça login no Internet Banking (Banco Inter).
  * Navegue até a seção APIs:
  * Conta Digital > Aplicações > <em>**Nova Aplicação**</em>

  **Atualizado para a API versão 3**

  * Crie um arquivo `.env` com os seguitntes atributos na aplicação que irá usar este projeto.

  ```
      
      APP_ENV=SANDBOX
      CPFCNPJ_BENEF='Número CPF OU CNPJ da conta no banco inter'
      X_INTER_CONTA_CORRENTE='Numero da conta corrente'
      
      API_SBX_TOKEN_V2=https://cdpj-sandbox.partners.uatinter.co/oauth/v2/token
      API_SBX_COBRA_V3=https://cdpj-sandbox.partners.uatinter.co/cobranca/v3/
      
      API_URL_TOKEN_V2=https://cdpj.partners.bancointer.com.br/oauth/v2/token
      API_URL_COBRA_V3=https://cdpj.partners.bancointer.com.br/cobranca/v3/
      API_URL_COBRA_V2=https://cdpj.partners.bancointer.com.br/cobranca/v2/
      API_URL_COBRA_V1=https://apis.bancointer.com.br/openbanking/v1/certificado/
      SSL_DIR_BASE='Diretorio base dos arquivos SSL'
      PUBLIC_KEY_V1='Path do arquivo public key da versão 1'
      PRIVATE_KEY_V1='Path do Arquivo private key da versão 1'
      PUBLIC_KEY_V2='Path do arquivo public key da versão 2'
      PRIVATE_KEY_V2='Path do Arquivo private key da versão 2'
      DOWNLOAD_PATH='Path do diretorio que os arquivos PDF de download serão salvos'
      CLIENT_ID='Chave client id da sua app no banco inter'
      CLIENT_SECRET='Chave client secret da sua app no banco inter'
  ```

  **Referências:**

  * Portal do desenvolvedor: https://developers.inter.co/
  * Referência da API: https://developers.inter.co/references/token


      * API Cobrança (Boleto com Pix)
          - Emissão de boletos
          - Download de boletos
          - Baixa de boletos
          - Consulta detalhada de boletos

      * API Banking
          * Saldo
              - Consultar saldo
          * Extrato
              - Consultar extrato
              - Recuperar extrato em PDF
          * Pagamento
              - Incluir pagamento com código de barras
              - Incluir pagamento DARF
              - Cancelar agendamento do pagamento
              - Buscar pagamentos
              - Buscar pagamentos de DARF
          * Pix pagamento
              - Incluir Pagamento Pix
              - Consultar Pagamento Pix

      * Recursos da Api Pix
          * Cobrança imediata
              - Criar cobrança imediata com txid
              - Revisar cobrança imediata
              - Criar cobrança imediata
              - Consultar cobrança imediata
          * Cobrança com vencimento
              - Criar cobrança com vencimento
              - Revisar cobrança com vencimento
              - Consultar cobrança com vencimento


      * Recursos da Api Banking
          * Extrato
              - Consultar extrato enriquecido




  ```pip install bancointer-python```

  ou

  ```pip install .```


  Exemplos de utilização da API do Banco Inter (SANDBOX) para emissão, download e baixa de títulos bancários. Veja a pasta `examples/`.

  - Importe as dependências necessárias:

  ```
  from decouple import config
  from bancointer.utils.environment import Environment


  dir_base_ssl = config("SSL_DIR_BASE")
  cert = (dir_base_ssl + config("PUBLIC_KEY_V2"), dir_base_ssl + config("PRIVATE_KEY_V2"))
  client_id = config("CLIENT_ID")
  client_secret = config("CLIENT_SECRET")
  conta_corrente = config("X_INTER_CONTA_CORRENTE")


  app_env_name = config("APP_ENV")
  env = Environment.get_environment_by_value(app_env_name.upper())
  ```


  ```
  payer = Pessoa(
      "9" * 11,  # valido
      PersonType.FISICA,
      "NOME DO PAGADOR",
      "ENDERECO DO PAGADOR",
      "CIDADE DO PAGADOR",
      "PR",
      "80030000",
  )  # OU FISICA


  discount = Desconto("PERCENTUALDATAINFORMADA", 0, 1.2, 2)
  multa = Multa("VALORFIXO", 0, 100)
  mora = Mora("TAXAMENSAL", 0, 4.5)
  message = Message("message 1", "message 2", "message 3", "", "message 5")


  beneficiario_final = Pessoa(
      "12345678901",
      PersonType.FISICA,
      "Nome do beneficiário",
      "Avenida Brasil, 1200",
      "Belo Horizonte",
      "MG",
      "30110000",
  )

  cobranca = Cobranca.criar_sobranca_simples("0001", 2.5, "2024-11-22", payer)
  cobranca.multa = multa
  cobranca.desconto = discount
  cobranca.beneficiarioFinal = beneficiario_final

  sol_new_cobranca = SolicitacaoEmitirCobranca(cobranca)

  emite_cobranca = EmiteCobranca(env, client_id, client_secret, cert, conta_corrente)
  resposta = emite_cobranca.emitir(sol_new_cobranca)

  print(resposta)
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  recupera_cobranca = RecuperaCobranca(env, client_id, client_secret, cert, conta_corrente)

  response = recupera_cobranca.recuperar(request_code)
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  recupera_cobranca = RecuperaCobrancaPDF(env, client_id, client_secret, cert, conta_corrente)

  response = recupera_cobranca.recuperar_pdf(request_code, config("DOWNLOAD_PATH"))
  ```

  ```
  request_code = "1783d19f-ab81-4a54-92a3-a0064f9b26ee"

  cancela_cobranca = CancelaCobranca(env, client_id, client_secret, cert, conta_corrente)

  response = cancela_cobranca.cancelar(request_code, Baixa.ACERTOS.value)
  ```


  Clone o repositório do projeto

  > $ git clone https://github.com/renatojdev/bancointer-python.git

  Se não tiver o pipenv instalado, para instalar:
  > ```$ pip install -U pipenv```

  Instale as dependências
  > ```$ make install```




  - [Python 3.7+](https://www.python.org/downloads/release/python-374/)
  - [Pipenv](https://github.com/kennethreitz/pipenv)



  [MIT](http://en.wikipedia.org/wiki/MIT_License)


pkgId: 63988b84ea5b3b2b24d35d4829d38e851aa109936a60251fd27518c7e13a97f5
name: python-bandcamp-auto-uploader
arch: src
version: 0.2.14
epoch: 0
release: 1
summary: Upload albums to Bandcamp automatically without a Pro account
url: https://pypi.org/project/bandcamp-auto-uploader/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bandcamp-auto-uploader-0.2.14-1.src.rpm
checksum_type: sha256
description:
  Upload albums in bulk without a Bandcamp Pro account. Automatically set track artist/title/comments/art based on track metadata.
  ![Example](/docs/screenshot.png)




  Download the latest release for your platform [here](https://github.com/7x11x13/bandcamp-auto-uploader/releases)


  ```
  $ pip install bandcamp-auto-uploader
  $ bc-upload
  ```



  - You must be signed in to the account you want to upload to in at least one browser (or you must supply a cookies.txt file)
  - Supported browsers are found [here](https://github.com/borisbabic/browser_cookie3#contribute)
  - RIFF tags are not currently supported by mutagen, so if you want your tracks to be named from the metadata make sure to use ID3 tags
  - The program ignores any non-audio files in the album folder except for the first image it encounters which it makes the album cover
  - Bandcamp only allows WAV, FLAC, and AIFF files to be uploaded



  - Thanks [SeyNoe](https://seynoe.bandcamp.com/) for testing


pkgId: d8b8a3a2d58420bdef7505704e4fb8bc5d7359c37b23128f26bd6e3f7c27d444
name: python-bandcrash
arch: src
version: 0.8.0
epoch: 0
release: 1
summary: Tools for publishing albums to the web and digital stores
url: https://github.com/fluffy-critter/bandcrash
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bandcrash-0.8.0-1.src.rpm
checksum_type: sha256
description:
  Bandcrash is a standalone program that automatically encodes an album of songs into a bunch of different formats for distribution on various platforms, such as [itch.io](https://itch.io/), or for hosting on your own website.

  [See it in action](https://fluffy.itch.io/novembeat-2021)!

  [![Documentation Status](https://readthedocs.org/projects/bandcrash/badge/?version=latest)](https://bandcrash.readthedocs.io/en/latest/?badge=latest)



  * Output as mp3, ogg, FLAC, and web preview (HTML5+mp3 at a lower bitrate)
  * Optionally upload everything to your page on itch using [butler](https://itch.io/docs/butler/)
  * High-quality encoding and metadata, with support for cover songs, per-track artwork, embedded lyrics, and more
  * Web player also supports per-track artwork



  Please see [the online documentation](https://bandcrash.readthedocs.io) for installation and usage instructions.





  If you are developing under Windows, you will probably need to use a POSIX environment under Windows (such as [msys](https://www.msys2.org) or [Git Bash](https://git-scm.com)) rather than WSL.

  If you are developing under macOS, please use a `universal2` build of Python (such as the ones installable from [python.org](https://python.org)) and you need to ensure that you've created your environment against that (e.g. `poetry env use /usr/local/bin/python3.11`).



  See the [github issues](https://github.com/fluffy-critter/bandcrash/issues) for details, but roughly:

  * Local GUI and/or web UI to make setting up the `album.json` easier (and easier installation, especially on Windows!)
  * Various player improvements
  * Easy embedding into websites (opengraph et al)





  [Blamscamp](https://suricrasia.online/blamscamp/) and [scritch](https://torcado.itch.io/scritch-editor) are both great programs for publishing previews of already-encoded on itch.io and other websites! However, their functionality is only to bundle prepared audio files into a web-based player, and they don't presently handle encoding or tagging, two things that are historically tedious and difficult to do well.

  Bandcrash is a full end-to-end system for preparing an album for both sale and preview online in a variety of formats.



  [Faircamp](https://simonrepp.com/faircamp/) does handle the end-to-end encoding and processing and builds a quite beautiful static website! If you just want to build a site to host your music and handle your own payments, it's totally usable for that.

  Bandcrash is for people who want to be able to host their downloads and web-based preview on existing marketplaces such as [itch.io](https://itch.io/), [gumroad](https://gumroad.com/), [ko-fi](https://ko-fi.com/), etc., or who want to be able to embed their preview on their website under their own terms, rather than being beholden to a specific static site template.



  At present, it defaults to using [Camptown](https://github.com/fluffy-critter/camptown), a player built specifically for Bandcrash. However, I do plan on eventually making it possible to choose from a variety of player engines, including Blamscamp and Scritch.



  Back when this project started, it was named pyBlamscamp as the intention was to be basically a Python version of the blamscamp GUI which would also handle encoding steps for you, but it very quickly drifted away from that and became something else.

  For a while, Bandcrash used a fork of the blamscamp player, but at this point that has been entirely removed.



  You already have your large .wav files on your local hard drive. Your local drive is also a good place to keep your previous encoding results. Your local computer also has a lot more space available than a typical cloud server, doesn't have to juggle cloud storage credentials, doesn't have to worry about the security of the server running the encoder app, the cost of running servers or paying for cloud storage, and so on.

  Basically, it's easier for everyone.

  Sometimes local apps are just Better™.

  That said, Bandcrash is also embeddable as a library, so someone could conceivably build a web-based system that uses it for encoding and tagging files.



  * Main code: [@fluffy-critter](https://github.com/fluffy-critter)
  * Original player code and this project's name: [@blackle](https://github.com/blackle)


pkgId: 6cd35f28275ac801ab5aa24de26571075a3ea1f24160e7c9a7a10094abe0f297
name: python-bandersnatch-safety-db
arch: src
version: 0.1.122139
epoch: 0
release: 1
summary: Bandersnatch filtering plugin to filter packages listed in safety_db
url: https://github.com/dwighthubbard/bandersnatch_safety_db
rpm_license: Academic Free License, version 3
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bandersnatch-safety-db-0.1.122139-1.src.rpm
checksum_type: sha256
description:
  This package provides a bandersnatch plugin that filters releases based on [safety-db]().

  ``` command
  pip install bandersnatch bandersnatch_safety_db
  ```

  To enable add `safety_db_release` to the [blacklist] plugins setting of the bandersnatch.conf.
  - If bandersnatch > 3.3.1
  ```
  [plugins]
  enabled =
      safety_db_release
  ```
  - If bandersnatch <= 3.3.1
  ```
  [blacklist]
  plugins =
      safety_db_release
  ```


pkgId: 6f1a81aa3966e43394997bb35197d1ddcb1586c687bb24059c2df8dd1387d9e8
name: python-bandit-sarif-formatter
arch: src
version: 1.1.1
epoch: 0
release: 1
url: https://github.com/microsoft/bandit-sarif-formatter
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bandit-sarif-formatter-1.1.1-1.src.rpm
checksum_type: sha256
summary:
  A Bandit formatter for the Static Analysis Results Interchange Format (SARIF) Version 2.1.0 file format.


pkgId: dd473f25dcb3f308f2e9388d4ab25e9342f3446aa6d20c07a0074b9ddfbe2cd7
name: python-banditcoot
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Python module for developing and testing multi-armed bandits
url: https://pypi.org/project/banditcoot/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banditcoot-0.2.0-1.src.rpm
checksum_type: sha256
description:
  <img align="left" width="75" src="https://github.com/dan-kwon/banditcoot/blob/master/resources/Banditcoot.png"/>
  **banditcoot** is a Python module is intended for my own personal use when developing and testing multi-armed bandit algorithms. Forked from the accompanying [code repository](https://github.com/johnmyleswhite/BanditsBook) for [Bandit Algorithms for Website Optimization](https://www.oreilly.com/library/view/bandit-algorithms-for/9781449341565/).
  *Any use of this code is at your own risk.*
  </br>


pkgId: 4ae37cb748a2d493ab028fe3dbd8bd34c40905924ed110eb0700470217acc889
name: python-banditml
arch: src
version: 1.0.2
epoch: 0
release: 1
summary: Lightweight library for training & serving contextual bandit models.
url: https://github.com/banditml/banditml
rpm_license: GNU General Public License (GPL)
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banditml-1.0.2-1.src.rpm
checksum_type: sha256
description:
  Bandit ML is a lightweight library for training & serving contextual bandit & reinforcement learning models.


pkgId: 39b485e75eab29be452f57004dfda09882e137d257a0841c443de74034a4ab33
name: python-banditsdk
arch: src
version: 0.2.1
epoch: 0
release: 1
summary: Common usage tools
url: https://github.com/4ngry-GitHub/banditsdk
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banditsdk-0.2.1-1.src.rpm
checksum_type: sha256
description:
  This library is written for economy time of developement.
  Common usage tools in one touch. GPL-3.0 license.
  The library contains the next packages:


  <a href=https://github.com/4ngry-GitHub/banditsdk>Click here</a>


  <ul>
  <li> <a href=https://github.com/4ngry-GitHub>AngryDanny+</a> </li>
  <li> <a href=https://github.com/NazikXY>N_XY</a> </li>
  </ul>

  <ul>
  <li><a href=https://docs.pydantic.dev/>Pydantic</a></li>
  <li><a href=https://www.sqlalchemy.org/>SqlAlchemy</a></li>
  </ul>


pkgId: 8782c24189187c159c99c7887a098ff4fd67ab911a79098e93d24d34b98af9e1
name: python-bandparams
arch: src
version: 0.1
epoch: 0
release: 1
summary: Calculate band parameters, such as max, barycenter, width
url: https://pypi.org/project/bandparams/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bandparams-0.1-1.src.rpm
checksum_type: sha256
description:
  Calculate parameters of a band: max, barycenter, width etc
  It works for single bands. Works best for unimodal bands (single maximum),
  but may also work for bands having side maxima in addition to the main max.
  In such cases, max_pos and max_val refer to the global maximum.
  FWHM determination may need to be carefully checked in such cases.


pkgId: 3538b530bba2e0f31723c2a84b96a58245481fd49b14aff8c05755ffd1186a27
name: python-bands-inspect
arch: src
version: 0.3.2
epoch: 0
release: 1
summary: Utilities for creating, comparing and plotting bandstructures of materials.
url: https://github.com/Z2PackDev/bands_inspect
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bands-inspect-0.3.2-1.src.rpm
checksum_type: sha256
description:
  <!--
  (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
  Author: Dominik Gresch <mail@greschd.ch>
  -->


  Utilities for creating, comparing and plotting bandstructures of materials.

  Documentation: https://bands-inspect.greschd.ch

  [![Build Status](https://travis-ci.org/Z2PackDev/bands_inspect.svg?branch=master)](https://travis-ci.org/Z2PackDev/bands_inspect)


pkgId: 431d75ab93f1811a7f71b9930c7c029eb94bc5dfa5ddfffa6ae4fc688c5ce613
name: python-bane
arch: src
version: 5.1.8
epoch: 0
release: 1
url: https://github.com/AlaBouali/bane
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bane-5.1.8-1.src.rpm
checksum_type: sha256
summary:
  This Python library offers a comprehensive set of tools for various cybersecurity and networking tasks. Its functionalities encompass diverse capabilities such as bruteforce attacks, cryptographic methods, DDoS attacks, information gathering, botnet creation and management, CMS vulnerability scanning, network discovery, vulnerability scanning, useful modules for common tasks, web page analyzers, and proxy utilities making it a powerful toolkit for cybersecurity professionals and network administrators.

description:
  "Oh, you think darkness is your ally. But you merely adopted the dark; I was born in it, molded by it. I didn't see the light until I was already a man, by then it was nothing to me but BLINDING! The shadows betray you, because they belong to me!" -Bane (Dark Knight)



                                  .///` `.--::::::---.`` `///.
                                  h-.-s+++/--<br>.---/+o++s:.-h
                                  ++..-.                `:../s
                               -+ydm-..:                :..-dmho:`
                            :odmNNNNs..-.              `:..+MNNNmmy/.                            `
                         .odmNNNNMMMN`..:              -..`mMMMMNNNNmy:
                        +mNNNNMMMMMMMo`.:`             :``/MMMMMMMMNNNmy.
                      .yNNNNMMMMMMMMMd` `-<br>```````..-` `yMMMMMMMMMMNNNd:
                     -dNNNMMMMMMMMMMMN`  ..-`      `-`-   mMMMMMMMMMMMMNNmo
                    :mNNNMMMMMMMMMMMMM:   .         `.`  -MMMMMMMMMMMMMMNNNs`
                   /mNNNMMMMMMMMMMMMMMy   ---      .--   oMMMMMMMMMMMMMMMNNNy`
                  :mNNNMMMMMMMMMMMMMMMN```:.````````.:```dMMMMMMMMMMMMMMMMNNNy`
                 -mNNNNMMMMMMMMMMMMMMMMo`.-`        `-.`+MMMMMMMMMMMMMMMMMNNNNo
                 hNNNNNMMMMMMMMMMMMMMMMm.``-        .``.dMMMMMMMMMMMMMMMMMMNNNm-
                -NNNNNMMMMMMMMMMMMMMMMMM-..:        -<br>NMMMMMMMMMMMMMMMMMMNNNNs
                oNNNNNMMMMMMMMMMMMMMMMMMo``.`       -` +MMMMMMMMMMMMMMMMMMMNNNNm
               :dNNNNNNMMMMMMMMMMMMMMMMMd<br>-``````<br>.hMMMMMMMMMMMMMMMMMMMNNNNNs.
             .ssmNNNNNNMMMMMMMMMMMMMMMMMM.``/:.  .-/```NMMMMMMMMMMMMMMMMMMNNNNNNyy+`             `
           `oy: mNNNNNNMMMMMMMMMMMMMMMMMM/``-`    `-``:MMMMMMMMMMMMMMMMMMMNNNNNN/`+y:            `
           +y`  dNNNNNNMMMMMMMMMMMMMMMMMMy..-:-  --:..oMMMMMMMMMMMMMMMMMMMNNNNNN:  -N`
           m-   hNNNNNNMMMNdhhyyhddmMMMMMd```:.``.:```hMMMMNdhso++++shmNMMMNNNNN:   yo           `
          /d    yNNNNNMMh/-````````.-/ydNM.``-    -```NNds:.`..-----..-sNMMNNNNN-   -m`
          h+    sNNNNNMMmsyhddmmmdhs:` `-o/../`  `/-.:+-` `:yhddmNNNNmmNMMMNNNNN.    d/
          m/    oNNNNNMMMMMMMNdyssoooo:` `:..``.+```.-.  :o++//+yydMMMMMMMMNNNNN`   .so
          d--   /NNNNNNMMMMMmyhm//   ymy.`-     o    `- odm:-  .ddssNMMMMMNNNNNm    /:s
         .h /   :NNNNNNNMMMmhshhy+++ohy/. .:   `o`  `/``-shysssyddddNMMMMNNNNNNd   --.h
         -y `:  .NNNNNNNMMMMMMMMNNmmmhys/:.`..``.``..`-:syhhdmNNMMMMMMMMMMNNNNNy   / `d
         :s  :`  dNNNNNMMMMMMMMMNNNmmNNh-    `.`  `.`  `+mMNNNNNMMMMMMMMMMNNNNN+  :`  m          `
         /o   /` oNNNNMMMMMMMMMMMMMMmd+.. `.:- -` - -:.. -sddmNMMMMMMMMMMMMNNNm. .:   m          `
         ++   `:``dNNNMMMMMMMMMMMNo+/.`./-. o`  --`  o `-/.``/+omMMMMMMMMMMNNNo .:    d`         `
         -h    `:`:mNNMMMMMMMMMMd-.+.+--:.`.+.-.::.-./-`.:--/:+..hMMMMMMMMMNNh`.:    -h          `
          s:    `:`+mNMMMMMMMMMm- `/:` o/://++:++++:+/+/:/o``:+` .mMMMMMMMMNd..:     y-
          .h     `:`/hNMMMMMMd+: -::<br>s-:+`.+:+-.+:+:`/:-+:-.-:- :NMMMMMMNy.--    :y
           o/   ` `:``:ymMNh:`-  /:-+`o::/`  +:/. +:+`  /::o./--+  /omMNdo- --  `   h.
           `d` `+.` :.` -s:  -` ./:::`/::/   +-/. +-+`  :::/`-:::- `-`++.``-. `-+  :s
            o+  /`-:``.-.   `-  /--/  /:-:   +-/. +-+   :-:+  /--/  .. `--. .:..:  h.
            `d` :` +h+.     -  `+-:: .+-:+..-+://-+:+-../:-+-`-:-/.  -`   -yd. /  /s
             o+ `:. -ydo.  -`  //::..o/-:o:.//:/++/:/+.:+/-/+: /::o   : :yd+``--  d.
             `d   .:. -sy ..  .o--+ -.+-.`.-/<br>:/<br>/--`.-+.: +--o-  `/d+``--`:s
              s/    .:` :.:```-o--o.-.:-` `:/   .:   /:` `-/ / s:-o-```+``.-`    h.
              .h      -:`/.///`/..`:-.:`<br> <br><br><br>. <br>`: /--../ //:o.:.-y
               s:       -o/::/:--.-.-.:                    : /`:.---/::+.       y-
               `h.       ``/. `/ `  -.:```   <br><br>..`  ```: /  ` :` ./.     +o
                .y.         -.--    -.:.``- -```::```: ..`./ :    .-.-`       /s
                 .y-                -.:```: :/::o+/::/ : ``: :              `+o
                  `s+`     -..-     -.o/:/: `+::+//:+. -/::o`:     ..`-`   .s/
                    :s-  ./-  `-    -.o//o.  /:::-::+  `o//o :    -`  ./.`+o.
                     `/o:+..+`.`    -.://+<br>+--//:-+<br>////`:    `../-.ss-
                        /h  /` ..-`  .-o/+:..+--//:-+..-o/+:.` `-.- `+  y-
                         o+``.-+-.::<br>o//o- /--::--+ .o//s<br>:/.-//:``:s
                          -o:```.//:   :+::+.o--oo:-o.+::+/   :/o.```:o:
                            -o++oy.:    .- /`o::oo:-+-/ --    /o++++o:
                                 `os      .. /..//../ ..`    `s:
                                  `o+.       `:`:-.-.     `.++-
                                    `/+/.`    `.  .`   `-++:`
                                       `:+++/:-<br>-:+++/-
                                            `.-::--`
                                                                                                 `



  <h1>Table of contents</h1>
  <ul>
  <li><a href="#introduction">Introduction</a></li>
  <li><a href="#documentation">Documentation</a></li>
  <li><a href="#why-you-should-use-bane">Why you should use "bane"</a></li>
  <li><a href="#installation">Installation</a></li>
  <li><a href="#special-speech">Special Speech</a></li>


  </ul>


  <h1 id="introduction">Introduction:</h1>

  The "bane" Python library stands out as a robust toolkit catering to a wide spectrum of cybersecurity and networking tasks. Its versatile range of functionalities covers various aspects, including bruteforce attacks, cryptographic methods, DDoS attacks, information gathering, botnet creation and management, and CMS vulnerability scanning, among others. The library's capabilities extend from performing bruteforce login attempts to analyzing web pages for vulnerabilities, managing botnets, and conducting thorough network discovery. Noteworthy is its rich selection of modules, which encompass encryption tools, security testing utilities, network scanning features, and other essential functions. This comprehensive library, written in pure Python, operates seamlessly on both Python 2 and 3, as well as Jython and IronPython. Maintained diligently since April 2018 by its sole developer <a href='https://alabouali.medium.com/'>Ala Bouali</a>, "bane" continues to evolve, offering cybersecurity professionals and network administrators a powerful and self-contained toolkit for their operations.

  This library is intended exclusively for educational purposes and ethical use with the explicit permission from the people who this tool is used against. The author of this code expressly disclaims any responsibility for any misuse or improper application of this library. It is imperative to emphasize that the user, and the user alone, bears full accountability for their actions when utilizing this library. Any legal ramifications stemming from the misuse of this library are solely the responsibility of the user, and the author shall not be held liable for any such consequences. By utilizing this library, users are acknowledging their understanding and acceptance of these terms and conditions.

  <h1 id="Documentation">Documentation:</h1>

  <ul>
  <li><a href="https://github.com/AlaBouali/bane#installation">Installation</a></li>
  <br>
  <!-- Root Directory -->
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane">Home</a> </li>
  <br>
  <!-- bruteforce Directory -->
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce"><b>Bruteforce:</b></a> </li>
    <br>
    <ul>
    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#Admin_Panel_Finder-class">Admin_Panel_Finder :</a> used to search for potential admin panel URLs on a website using a predefined list of extensions.</li>
    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#Decryptor-class">Decryptor :</a> used for performing various cryptographic hash decryption attempts.</li>
    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#Files_Manager_Finder-class">Files_Manager_Finder :</a> used to search for a filemanager on a website.</li>
    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#Force_Browsing-class">Force_Browsing :</a> used to perform force browsing on a website by attempting to access various URLs with different extensions.</li>
    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#HTTP_Auth_Bruteforce-class">HTTP_Auth_Bruteforce :</a> used to perform HTTP authentication bruteforce attacks on a website.</li>

  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#jwt_manager-class">JWT_Manager :</a> provides functionality for analyzing, encoding, decoding, and guessing secret keys for JSON Web Tokens (JWT). JWTs are widely used in web applications for secure data exchange and authentication.</li>


    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#Hydra-class">Hydra :</a> used for performing brute-force login attempts on various services, including SSH, Telnet, FTP, SMTP, MySQL, and WordPress. It takes a list of username-password combinations and tries to log in using different protocols. It reports success or failure for each combination.</li>
    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#Services_Login-class">Services_Login :</a> class provides a set of methods for performing various login/authentication attempts for different services, such as SMTP, Telnet, SSH, FTP, and MySQL. These methods check for successful login using the provided credentials and options.</li>
    <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/bruteforce#Web_Login_Bruteforce-class">Web_Login_Bruteforce :</a> used for performing brute-force login attempts on web-based login forms. It takes a list of username-password combinations and tries to log in by filling out the login form. It reports success or failure for each combination.</li>
    </ul>
  <br>
  <!-- common Directory -->
  <li><a href="https://github.com/AlaBouali/bane/blob/master/bane/common">Common_Variables :</a> used to store internal and necessary variables for bane to run including: more than 20k unique user-agents created on importation, valid lists legit values for many HTTP headers to choose from, various file types ( png , jpg , docx , pptx , html , php ... ) used to fill the forms and test of file upload vulnerabilities , ...</li>
  <br>
  <!-- cryptographers Directory -->
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers"><b>Cryptographers:</b></a> </li>
   <br> <ul>
   <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#BASE64-class">BASE64 :</a> provides methods for encoding and decoding data using Base64 encoding.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#CAESAR-class">CAESAR :</a> provides methods for encoding and decoding text using the Caesar cipher ( just for fun )</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#MD5-class">MD5 :</a> provides methods for generating and comparing MD-5 hash values for text and files.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#SHA1-class">SHA1 :</a> provides methods for generating and comparing SHA-1 hash values for text and files.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#SHA224-class">SHA224 :</a> provides methods for generating and comparing SHA-224 hash values for text and files.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#SHA256-class">SHA256 :</a> provides methods for generating and comparing SHA-256 hash values for text and files.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#SHA348-class">SHA384 :</a> provides methods for generating and comparing SHA-384 hash values for text and files.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#SHA512-class">SHA512 :</a> provides methods for generating and comparing SHA-512 hash values for text and files.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/cryptographers#XOR-class">XOR :</a> provides methods for generating and comparing XOR hash values for text and files.</li>
  </ul>
  <br>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos"><b>DDoS ( Distributed Denial-of-Service  ) :</b></a> </li>
    <br><ul>

  <!-- ddos Directory -->
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#HTTP_Puncher-class">HTTP_Puncher :</a> used for launching HTTP-based DDoS attacks on a target URL.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#HTTP_Spam-class">HTTP_Spam :</a> used for launching HTTP-based DDoS attacks on a target URL by spamming each connection with a stream of requests unlike the previous one.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#Proxies_Hammer-class">Proxies_Hammer :</a> used for launching low-rate HTTP POST requests through a list of proxy servers to a target URL.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#Proxies_HTTP_Spam-class">Proxies_HTTP_Spam :</a> used for launching HTTP-based DDoS attacks on a target URL by spamming each connection with a stream of requests through proxies.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#Proxies_Xerxes-class">Proxies_Xerxes :</a> used for performing a simple DDoS attack by sending NULL characters through a list of proxy servers.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#Slow_Read-class">Slow_Read :</a> used to perform a slow reading attack on a target server. This attack sends normal HTTP requests but reads them slowly to keep the connection open for an extended period of time.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#TCP_Flood-class">TCP_Flood :</a> used to perform a TCP flooding attack on a target server. This attack floods the target with a large number of TCP packets to overwhelm the server and disrupt its normal operations.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#Tor_Hammer-class">Tor_Hammer :</a> used for launching low-rate HTTP POST requests through TOR to a target URL.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#UDP_Flood-class">UDP_Flood :</a> used to perform a DDoS attack by flooding a target server with UDP (User Datagram Protocol) packets. UDP is a connectionless protocol, and this attack generates a large volume of UDP packets to overwhelm the target.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#VSE_Flood-class">VSE_Flood :</a> used to perform a DDoS attack known as the Valve Source Engine Query (VSE) flood attack. The attack sends spoofed queries to Source Engine servers in an attempt to overwhelm them with traffic. This attack is often used in the gaming community to disrupt online game servers.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/ddos#Xerxes-class">Xerxes :</a> used to perform a DDoS attack using the Xerxes tool. This attack sends NULL characters to a target server to flood it with traffic. The tool is named after the ancient Persian king Xerxes I, known for his invasion of Greece.</li>
  <br>
  <!-- gather_info Directory -->
  </ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/gather_info"><b>Information Gathering:</b></a> </li>
    <br><ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/gather_info#Domain_Info-class">Domain_Info :</a> provides methods for gathering information about a domain, including WHOIS data, domain information, and DNS resolution.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/gather_info#Dorking_Info-class">Dorking_Info :</a> provides a method for performing Google dork searches to find URLs related to a specific query.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/gather_info#IP_Info-class">IP_Info :</a> provides methods for gathering information related to IP addresses, including obtaining your own IP, geolocation information, reverse IP lookup, and Shodan reports.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/gather_info#Network_Info-class">Network_Info :</a> provides methods for network-related tasks, including retrieving local IP addresses, checking if a host is alive, performing TCP port scanning, and obtaining banners from network services.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/gather_info#Subdomain_Info-class">Subdomain_Info :</a> provides methods for extracting and analyzing subdomains associated with a given domain. It can fetch subdomains from sources like crt.sh and the Wayback Machine, allowing you to discover subdomains for a target domain.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/gather_info#URL_Info-class">URL_Info :</a> provides methods for performing security checks, deep inspection, and HTTP OPTIONS requests on a given URL. You can use these methods to analyze and gather information about a specific URL, such as its security status, response headers, and more.</li>
  <br>
  <!-- scanners Directory -->
  </ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/botnet"><b>Botnet: creation , control and management with a scalable infrastructure :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/botnet#botnet_master-class">Botnet_Master :</a> used for managing botnet operations.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/botnet#Botnet_Scanner-class">Botnet_Scanner :</a> used for scanning safe IPs all over the internet with a word list to bruteforce various login protocols, including FTP, SSH, Telnet, SMTP, and MySQL. The scan results are saved to text files in the same directory.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/botnet#botnet_c_c_server-class">Botnet_C_C_Server :</a> used for managing a Command and Control (C&C) server for a botnet.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/botnet#botnet_malware_download_server-class">Botnet_Malware_Download_Server :</a> used for creating a server to download malware files from a specified folder while preventing path traversal vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/botnet#botnet_reporting_server-class">Botnet_Reporting_Server :</a> used for creating a server to receive reports from the bots and store them in the database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/botnet#botnet_web_interface_server-class">Botnet_Web_Interface_Server :</a> used for creating a web interface server for managing the botnet.</li>
  </ul>
  <br>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/cms"><b>CMS's Vulnerability Scanner :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/cms#Drupal_Scanner-class">Drupal_Scanner :</a> used to scan a website for Drupal-related information and vulnerabilities. It checks the target URL for Drupal version, server information, subdomains, and possible vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/cms#Joomla_Scanner-class">Joomla_Scanner :</a> used to scan a website for Joomla-related information and vulnerabilities. It checks the target URL for Joomla version, server information, subdomains, and possible vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/cms#Magento_Scanner-class">Magento_Scanner :</a> used to scan a website for Magento-related information and vulnerabilities. It checks the target URL for Magento version, server information, subdomains, and possible vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/cms#WordPress_Scanner-class">WordPress_Scanner :</a> used to scan a website for WordPress-related information and vulnerabilities. It checks the target URL for WordPress version, server information, subdomains, themes, plugins, and possible vulnerabilities.</li>
  </ul>
  <br>

  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/data_visualization_stack"><b>Data Visualization Stack :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/data_visualization_stack#elasticsearch_scanner-class">ElasticSearch_Scanner :</a> designed to scan an Elasticsearch server for information and vulnerabilities. It checks the target server for Elasticsearch version, performs a basic HTTP request, and retrieves relevant vulnerability information using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/data_visualization_stack#grafana_scanner-class">Grafana_Scanner :</a> designed to scan a Grafana server for information and vulnerabilities. It checks the target server for Grafana version, server information, subdomains, and possible vulnerabilities.</li>
  <br>
  </ul>

  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases"><b>Databases :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases#mariadb_scanner-class">MariaDB_Scanner :</a> provides a static method for scanning MariaDB installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases#mongodb_scanner-class">MongoDB_Scanner :</a> provides a static method for scanning MongoDB installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases#microsoft_sql_server_scanner-class">Microsoft_SQL_Server_Scanner :</a> provides a static method for scanning Microsoft SQL Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases#mysql_mysql_scanner-class">MySQL_MySQL_Scanner :</a> provides a static method for scanning MySQL Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases#mysql_oracle_scanner-class">MySQL_Oracle_Scanner :</a> provides a static method for scanning MySQL Server installations (Oracle variant) using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases#postgresql_scanner-class">PostgreSQL_Scanner :</a> provides a static method for scanning PostgreSQL installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/databases#redis_scanner-class">Redis_Scanner :</a> provides a static method for scanning Redis installations using the Vulners database.</li>
  <br>
  </ul>



  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management"><b>DevOps ( project management ) :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#ansible_scanner-class">Ansible_Scanner :</a> provides a static method for scanning Ansible installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#docker_scanner-class">Docker_Scanner :</a> provides a static method for scanning Docker installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#git_scanner-class">Git_Scanner :</a> provides a static method for scanning Git installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#jenkins_scanner-class">Jenkins_Scanner :</a> designed to perform application security testing on Jenkins sites. It scans for known vulnerabilities using the Vulners database and provides detailed information about the Jenkins site's configuration, versions, and potential exploits.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#jira_scanner-class">Jira_Scanner :</a> designed for application security testing on Jira sites. It scans for vulnerabilities using the Vulners database and provides detailed information about the Jira site's configuration, versions, and potential exploits.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#kubernetes_scanner-class">Kubernetes_Scanner :</a> provides a static method for scanning Kubernetes installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#maven_scanner-class">Maven_Scanner :</a> provides a static method for scanning Maven installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/devops_project_management#puppet_scanner-class">Puppet_Scanner :</a> provides a static method for scanning Puppet installations using the Vulners database.</li>
  <br>
  </ul>


  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/erp_solutions"><b>ERP Solutions :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/erp_solutions#dolibarr_scanner-class">Dolibarr_Scanner :</a> designed to scan a Dolibarr server for information and vulnerabilities. It checks the target server for Dolibarr version, server information, subdomains, and possible vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/erp_solutions#odoo_scanner-class">Odoo_scanner :</a> designed to scan a Odoo server for information and vulnerabilities. It checks the target server for Odoo version, server information, subdomains, and possible vulnerabilities.</li>
  <br>
  </ul>


  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/js_dev_ecosystem"><b>Javasript Development Eco-System :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/js_dev_ecosystem#angular_scanner-class">Angular_Scanner :</a> provides a static method for scanning Angular installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/js_dev_ecosystem#angularjs_scanner-class">AngularJS_Scanner :</a> provides a static method for scanning AngularJS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/js_dev_ecosystem#nodejs_scanner-class">NodeJS_Scanner :</a> designed to scan Node.js installations for known vulnerabilities using the Vulners database. It provides a static method to perform the scanning process based on the specified Node.js version.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/js_dev_ecosystem#npmjs_scanner-class">NPMJS_Scanner :</a> provides a static method for scanning npm packages using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/js_dev_ecosystem#reactjs_scanner-class">ReactJS_Scanner :</a> designed to scan React.js installations for known vulnerabilities using the Vulners database. It provides a static method to perform the scanning process based on the specified React.js version.</li>
  <br>
  </ul>

  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/lms"><b>LMS's Vulnerability Scanner :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/lms#moodle_scanner-class">Moodle_Scanner :</a> used to scan a website for Moodle-related information and vulnerabilities. It checks the target URL for Moodle version, server information, subdomains, and possible vulnerabilities.</li>
  <br>
  </ul>


  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/mobile_dev"><b>Mobile Applications development Stack :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/mobile_dev#flutter_scanner-class">Flutter_Scanner :</a> provides a static method for scanning Flutter installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/mobile_dev#react_native_scanner-class">React_Native_Scanner :</a> provides a static method for scanning React Native installations using the Vulners database.</li>
  <br>
  </ul>




  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/network_protocols"><b>Network Discovery and Scanning:</b></a> </li>
    <br><ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/network_protocols#Chargen_Amplification_Scanner-class">Chargen_Amplification_Scanner :</a> used to calculate the amplification factor for a given Chargen server.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/network_protocols#DNS_Amplification_Scanner-class">DNS_Amplification_Scanner :</a> used to calculate the amplification factor for a given DNS server.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/network_protocols#Echo_Amplification_Scanner-class">Echo_Amplification_Scanner :</a> used to calculate the amplification factor for a given Echo server.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/network_protocols#Memcache_Amplification_Scanner-class">Memcache_Amplification_Scanner :</a> used to calculate the amplification factor for a given Memcache server.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/network_protocols#NTP_Amplification_Scanner-class">NTP_Amplification_Scanner :</a> used to calculate the amplification factor for a given NTP (Network Time Protocol) server.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/network_protocols#Ports_Scanner-class">Ports_Scanner :</a> used to scan a range of ports on a target IP address to check if they are open or closed.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners#SNMP_Amplification_Scanner-class">SNMP_Amplification_Scanner :</a> used to calculate the amplification factor for a given SNMP (Simple Network Management Protocol) server.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners#SSDP_Amplification_Scanner-class">SSDP_Amplification_Scanner :</a> used to calculate the amplification factor for a given SSDP (Simple Service Discovery Protocol) server.</li>
  <br>
  </ul>




  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems"><b>Operating Systems :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#android_os_scanner-class">Android_OS_Scanner :</a> provides a static method for scanning Android OS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#busybox_os_scanner-class">Busybox_OS_Scanner :</a> provides a static method for scanning Busybox OS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#centos_scanner-class">CentOS_Scanner :</a> provides a static method for scanning CentOS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#debian_os_scanner-class">Debian_OS_Scanner :</a> provides a static method for scanning Debian OS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#freebsd_os_scanner-class">FreeBSD_OS_Scanner :</a> provides a static method for scanning FreeBSD OS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#ios_scanner-class">IOS_Scanner :</a> provides a static method for scanning iOS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#mac_os_scanner-class">Mac_OS_Scanner :</a> provides a static method for scanning macOS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#ubuntu_os_scanner-class">Ubuntu_OS_Scanner :</a> provides a static method for scanning Ubuntu OS installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/operating_systems#windows_os_scanner-class">Windows_OS_Scanner :</a> provides a static method for scanning Windows OS installations using the Vulners database.</li>
  <br>
  </ul>





  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities"><b>Vulnerability Scanners:</b></a> </li>
    <br><ul>

  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#ADB_Exploit_Scanner-class">ADB_Exploit_Scanner :</a> used to scan for Android Debug Bridge (ADB) vulnerabilities on a target device.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Backend_Technologies_Scanner-class">Backend_Technologies_Scanner :</a> used to scan web applications for information about the backend technologies and potential vulnerabilities associated with them.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#ClickJacking_Scanner-class">ClickJacking_Scanner :</a> used to scan a web page for Clickjacking protection headers and determine if Clickjacking is possible.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#CORS_Misconfiguration_Scanner-class">CORS_Misconfiguration_Scanner :</a> used to detect Cross-Origin Resource Sharing (CORS) misconfigurations in web applications.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#CRLF_Injection_Scanner-class">CRLF_Injection_Scanner :</a> used to detect potential CRLF (Carriage Return Line Feed) injection vulnerabilities in web applications.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#CSRF_Scanner-class">CSRF_Scanner :</a> used for scanning and detecting Cross-Site Request Forgery (CSRF) vulnerabilities on web pages. It provides methods to identify vulnerable forms and perform tests to check for CSRF vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Exposed_ENV_Scanner-class">Exposed_ENV_Scanner :</a> used for scanning and detecting exposed environment (".env") files on web servers. It provides methods to check if a specific path or multiple common paths lead to an exposed environment file.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Exposed_Git_Scanner-class">Exposed_Git_Scanner :</a> used to scan for exposed Git repositories on web servers. It checks if a specific URL is an exposed Git repository and returns a boolean result.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Exposed_Telnet_Scanner-class">Exposed_Telnet_Scanner :</a> used to scan for exposed an unauthenticated Telnet services on a remote host. It attempts to establish a Telnet connection to a specified host and port and returns a boolean result indicating whether the connection was successful or not.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#File_Upload_Scanner-class">File_Upload_Scanner :</a> used to scan web forms for potential file upload vulnerabilities. It searches for forms that allow file uploads, tests the file upload functionality, and reports potential issues such as unacceptable file extensions.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Open_Redirect_Scanner-class">Open_Redirect_Scanner :</a> used to scan web forms for potential open redirect vulnerabilities. It detects and reports open redirect issues in web applications, helping security professionals identify and mitigate these risks.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Path_Traversal_Scanner-class">Path_Traversal_Scanner :</a> used to scan web applications for Path Traversal vulnerabilities. It provides methods to check for directory traversal and file inclusion vulnerabilities in web pages.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#PHP_Unit_Exploit_Scanner-class">PHP_Unit_Exploit_Scanner :</a> used to detect vulnerabilities related to the PHP Unit exploit on a specified website URL.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#RCE_Scanner-class">RCE_Scanner :</a> used for scanning web forms for Remote Code / Command Execution (RCE) vulnerabilities using various payload injections.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Shodan_Scanner-class">Shodan_Scanner :</a> designed to interact with the Shodan API and retrieve information about a specific IP address.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Mixed_Content_Scanner-class">Mixed_Content_Scanner :</a> used to scan web pages for mixed content vulnerabilities, where HTTP content is loaded on an HTTPS page.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#SpringBoot_Actuator_Exploit_Scanner-class">SpringBoot_Actuator_Exploit_Scanner :</a> used to scan a Spring Boot application for vulnerabilities in the Actuator endpoints.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#SSRF_Scanner-class">SSRF_Scanner :</a> used for scanning web pages for Server-Side Request Forgery (SSRF) vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#SSTI_Scanner-class">SSTI_Scanner :</a> used for scanning websites for Server-Side Template Injection (SSTI) vulnerabilities.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#Vulners_Search_Scanner-class">Vulners_Search_Scanner :</a> used to search for vulnerabilities in software using the Vulners API.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/vulnerabilities#XSS_Scanner-class">XSS_Scanner :</a> designed for systematically identifying and testing Cross-Site Scripting (XSS) vulnerabilities in web applications. This method allows users to spider through web pages, identify forms, and test them for XSS vulnerabilities. It provides flexibility to test multiple pages and payloads.</li>
  <br>
  <!-- Utils Directory -->
  </ul>



  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev"><b>Web Development :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev#aspnet_dast_scanner-class">ASPNET_DAST_Scanner :</a> designed to perform dynamic application security testing (DAST) on ASP.NET sites. It scans for known vulnerabilities using the Vulners database and provides detailed information about the ASP.NET site's configuration, version, and potential exploits.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev#php_dast_scanner-class">PHP_DAST_Scanner :</a> designed to perform dynamic application security testing (DAST) on PHP sites. It scans for known vulnerabilities using the Vulners database and provides detailed information about the PHP site's configuration, version, and potential exploits.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev#ruby_dast_scanner-class">Ruby_DAST_Scanner :</a> designed to perform dynamic application security testing (DAST) on Ruby on Rails sites. It scans for known vulnerabilities using the Vulners database and provides detailed information about the Ruby on Rails site's configuration, versions, and potential exploits.</li>
  <br>
  </ul>




  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers"><b>Web Development Frameworks :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev_frameworks#django_scanner-class">Django_Scanner :</a> provides a static method for scanning Django installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev_frameworks#fastapi_scanner-class">FastAPI_Scanner :</a> provides a static method for scanning FastAPI installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev_frameworks#flask_scanner-class">Flask_Scanner :</a> provides a static method for scanning Flask installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev_frameworks#laravel_scanner-class">Laravel_Scanner :</a> provides a static method for scanning Laravel installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev_frameworks#spring_boot_scanner-class">Spring_Boot_Scanner :</a> provides a static method for scanning Spring Boot installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev_frameworks#spring_security_scanner-class">Spring_Security_Scanner :</a> provides a static method for scanning Spring Security installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_dev_frameworks#symfony_scanner-class">Symfony_Scanner :</a> provides a static method for scanning Symfony installations using the Vulners database.</li>
  <br>
  </ul>






  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers"><b>Web Servers :</b></a> </li>
   <br> <ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#apache_coyote_server_scanner-class">Apache_Coyote_Server_Scanner :</a> provides a static method for scanning Apache Coyote Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#apache_http_server_scanner-class">Apache_HTTP_Server_Scanner :</a> provides a static method for scanning Apache HTTP Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#apache_tomcat_server_scanner-class">Apache_Tomcat_Server_Scanner :</a> provides a static method for scanning Apache Tomcat Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#glassfish_server_scanner-class">GlassFish_Server_Scanner :</a> provides a static method for scanning GlassFish Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#jetty_server_scanner-class">Jetty_Server_Scanner :</a> provides a static method for scanning Jetty Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#microsoft_iis_server_scanner-class">Microsoft_IIS_Server_Scanner :</a> provides a static method for scanning Microsoft IIS Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#nginx_server_scanner-class">Nginx_Server_Scanner :</a> provides a static method for scanning Nginx Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#payara_server_scanner-class">Payara_Server_Scanner :</a> provides a static method for scanning Payara Server installations using the Vulners database.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/scanners/web_servers#windows_server_scanner-class">Windows_Server_Scanner :</a> provides a static method for scanning Windows Server installations using the Vulners database.</li>
  <br>
  </ul>











  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager"><b>Web Pages Analyzers:</b></a> </li>
    <br><ul>

  <!-- Utils/pager Directory -->
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#Cookies_Manager-class">Cookies_Manager :</a> provides methods for managing HTTP cookies.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#FORMS_FILLER-class">FORMS_FILLER :</a> provides methods for filling HTML forms with data, including injecting payloads into form parameters.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#FORMS_FINDER-class">FORMS_FINDER :</a> provides methods for extracting and parsing HTML forms from web pages. It offers methods for sorting inputs in forms and parsing forms from web pages. </li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#FORM_FILE_UPLOAD-class">FORM_FILE_UPLOAD :</a> used for extracting and identifying file upload forms from HTML documents. It provides methods to retrieve these forms both from a list of dictionaries and from a URL with HTML content.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#Pager_Interface-class">Pager_Interface :</a> provides various methods for web scraping and JavaScript code analysis.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#RANDOM_GENERATOR-class">RANDOM_GENERATOR :</a> provides various static methods for generating random data, such as IP addresses, URLs, phone numbers, HTML input colors, and random dates.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#LOGIN_FORM_FILLER-class">LOGIN_FORM_FILLER :</a> provides methods for working with login forms in web pages. It includes methods for getting a login form and setting its values for username and password.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/pager#URLS_Parser-class">URLS_Parser :</a> provides methods for parsing and extracting information from URLs and web page sources. It includes methods for converting URLs to form data and extracting links from the page source.</li>
  </ul>
  <br>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/proxer"><b>Useful Proxing Utilities:</b></a> </li>
    <br><ul>

  <!-- Utils/proxer Directory -->
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/proxer#BurpSuite_Getter-class">BurpSuite_Getter :</a> provides a method for obtaining a Burp Suite proxy configuration. It includes a method for getting the Burp Suite proxy settings with optional host and port parameters.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/proxer#Proxies_Collector-class">Proxies_Collector :</a> used to collect and verify proxy information from various sources.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/proxer#Proxies_Interface-class">Proxies_Interface :</a> provides methods for loading, parsing, and converting proxy data for use in various applications.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/proxer#ProxyChecker-class">ProxyChecker :</a> responsible for checking the validity and functionality of proxy servers in a list. It can perform proxy checks using either socket-level connections or HTTP requests, depending on the configuration.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/proxer#Proxies_Getter-class">Proxies_Getter :</a> used to retrieve proxy sockets and proxy settings for various protocols.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils/proxer#Proxies_Parser-class">Proxies_Parser :</a> used to parse and handle proxy configurations and settings.</li>
  </ul>
  <br>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils"><b>Additional Useful Modules :</b></a></li>
    <br><ul>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils#Userful_Utilities-class">Userful_Utilities :</a> provides various utility methods for common tasks and operations.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils#Files_Interface-class">Files_Interface :</a> provides utility methods for working with files, including clearing, deleting, writing, and reading files. It also includes methods for creating and reading JSON files.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils#Bane_Instances_Interface-class">Bane_Instances_Interface :</a> provides utility methods for working with instances of other classes, especially those created for parallel processing.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils#Socket_Connection-class">Socket_Connection :</a> provides methods for creating and configuring socket connections.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils#Tor_Switch_Interface-class">Tor_Switch_Interface :</a> provides methods for switching IP addresses when using the Tor network. It allows for automatic IP switching with or without a password, depending on the Tor configuration and platform.</li>
  <li><a href="https://github.com/AlaBouali/bane/tree/master/bane/utils#Update_Module_Interface-class">Update_Module_Interface :</a> provides methods for updating the "bane" module to a specified version or the latest version available.</li>
  </ul>
  <h1 id="why-you-should-use-bane">Why you should use "bane"</h1>
  <ul>
      <li>
          <h2>Bruteforce Tools:</h2>
          <p>Tools for performing brute-force attacks on various services, such as admin panel finding, cryptographic hash decryption, and login attempts.</p>
      </li>
      <li>
          <h2>JWT Manager:</h2>
          <p>Functionality for analyzing, encoding, decoding, and guessing secret keys for JSON Web Tokens (JWT).</p>
      </li>
      <li>
          <h2>DDoS Tools:</h2>
          <p>Tools for launching different types of Distributed Denial-of-Service (DDoS) attacks for assessing server and network infrastructure resilience.</p>
      </li>
      <li>
          <h2>Information Gathering:</h2>
          <p>Tools for gathering domain, IP, network, and subdomain information, useful for reconnaissance and vulnerability assessment.</p>
      </li>
      <li>
          <h2>Botnet Creation and Management:</h2>
          <p>Features for creating, managing, and scaling a botnet infrastructure, valuable for studying botnets and their operations.</p>
      </li>
      <li>
          <h2>CMS Vulnerability Scanners:</h2>
          <p>Specific scanners for popular Content Management Systems (CMS) like Drupal, Joomla, Magento, and WordPress, for identifying vulnerabilities in websites using these platforms.</p>
      </li>
      <li>
          <h2>Network Discovery and Scanning:</h2>
          <p>Scanners for port scanning, amplification factor calculation, and network-related vulnerability assessment.</p>
      </li>
      <li>
          <h2>Vulnerability Scanners:</h2>
          <p>Various vulnerability scanners for detecting different types of web application vulnerabilities, including CSRF, XSS, RCE, and more.</p>
      </li>
      <li>
          <h2>Additional Useful Modules:</h2>
          <p>Utility modules for common tasks and operations, such as working with files, managing cookies, and updating the library.</p>
      </li>
      <li>
          <h2>Web Page Analyzers:</h2>
          <p>Tools for analyzing web pages, filling forms, generating random data, and parsing URLs, useful for web scraping and data analysis.</p>
      </li>
      <li>
          <h2>Proxying Utilities:</h2>
          <p>Utilities for handling proxy configurations and checking the validity of proxy servers, beneficial for tasks that require anonymity and security.</p>
      </li>
      <li>
              <h2>Proxies and TOR Support in Almost All Components ( including the Botnet's master and scanner ) :</h2>
              <p>The "bane" library offers comprehensive support for a wide range of proxies across the majority of its functionalities. Notably, it includes support for TOR in various components, enhancing anonymity and security. The only exceptions are SSH and database connections, which fall outside the project's control.</p>
          </li>
          <li>
              <h2>No DNS Leakage with TOR:</h2>
              <p>Thanks to its advanced capabilities, "bane" ensures that TOR users remain anonymous and free from any DNS leakage, reinforcing privacy and security for users seeking anonymity.</p>
          </li>
          <li>
              <h2>Request Routing via Random IPs in TOR:</h2>
              <p>"bane" has implemented a feature that enables each request to exit through a different TOR node without the need to obtain a new identity or restart TOR's service. This innovation adds an extra layer of sophistication to the project, further enhancing user experience.</p>
          </li>
          <li>
              <h2>Dynamic Manipulation of HTTP Headers in DDoS Attacks:</h2>
              <p>For added challenge and effectiveness in HTTP-based DDoS attacks, "bane" generates HTTP requests with headers featuring random but legitimate values, courtesy of its extensive list of 20,000 user-agents and header values. Subsequently, it rearranges these headers into a random order and selectively removes certain headers (with caution to retain critical ones) before sending the request, ensuring a multifaceted and impactful approach to DDoS attacks.</p>
          </li>
          <li>
              <h2>Enhanced Security Measures:</h2>
              <p><code>bane</code> offers an added layer of security by incorporating a hardcoded list of U.S. government and military IP ranges for several countries. This feature ensures that when generating random IP addresses for its botnet scanner, the tool will steer clear of these specified IP ranges. By doing so, <code>bane</code> mitigates the risk of unintentional interference with government or military infrastructure, thus safeguarding the user from any inadvertent involvement with such sensitive networks. This proactive approach not only protects users from legal complications but also underscores <code>bane</code>'s commitment to responsible and ethical usage in the realm of cybersecurity.</p>
          </li>
          <li>
              <h2>Efficiency:</h2>
              <p><code>Bane</code> offers a streamlined and efficient process for security testing. It autonomously parses all available URLs, media sources (videos, images, etc.), and HTML forms, eliminating the need for manual intervention. This automation allows <code>bane</code> to systematically test each element one at a time while respecting the form's input types. It intelligently fills each parameter with the appropriate values, optimizing the testing process for comprehensive security assessments.</p></li>

  </ul>

  <h1 id="installation">Installation:</h1>

  <p>If you are using Windows, please follow these steps:</p>
  <ol>
  <li>Download and install <a href="https://npcap.com/#download">Npcap</a>.</li>
  <li>Download and install <a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html">PuTTY</a>.</li>
  <li>Restart your computer after the installations are complete.</li>
  <li>Then, install <code>bane</code> using pip:</li>
  </ol>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%">pip install bane</pre>
  </div>

  <p>If you are on Linux, run the following command with <code>sudo</code> to ensure that required packages, <code>sshpass</code> and <code>tor</code> are installed ( it may take some time to finish their installation without any output so wait few minutes ):</p>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%">sudo pip install bane</pre>
  </div>
  <p>Otherwise if you wish to install the current version on github:</p>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%">git clone https://github.com/AlaBouali/bane
  cd bane
  pip install .</pre>
  </div>

  <!--
  <p>Alternatively, you can clone the project from the link and run setup.py:</p>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%">
              git clone https://github.com/AlaBouali/bane
              cd bane
              python setup.py install
  </pre>
  </div>
      -->

  <p>To use <code>bane</code> you need to open the Python interpreter from your terminal / cmd, as <code>bane</code> can be used only within the interpreter after importing it or as a part of a script:</p>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%">python</pre>
  </div>

  <p>or</p>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%">python3</pre>
  </div>

  <p>After that, import <code>bane</code> and start using it as explained in the documentation above:</p>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%">import bane</pre>
  </div>

  <p>If you are using <code>jython</code> , please navigate to the <code>site-packages</code> directory (e.g., <code>C:\jython\Lib\site-packages</code>). Open the <code>dns</code> folder, and within the <code>resolver.py</code> file, comment out line <code>1149</code> by placing a <code>#</code> in front of it:</p>

  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%"><b>socket.SOCK_DGRAM: [socket.SOL_UDP],</b></pre>
  </div>
  to:
  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%"><b>#socket.SOCK_DGRAM: [socket.SOL_UDP],</b></pre>
  </div>
  That should fix the error that you might encounter when importing "bane" the first time.

  <b>Note :</b> you might encounter such messages when importing this library:
  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%"><b>WARNING: can't import layer ipsec: cannot import name 'gcd' from 'fractions' (C:\...</b></pre>
  </div>
  or
  <div style="background: #f8f8f8; overflow:auto; width:auto; border:solid gray; border-width:.1em .1em .1em .8em; padding:.2em .6em;">
  <pre style="margin: 0; line-height: 125%"><b>WARNING: Failed to execute tcpdump. Check it is installed and in the PATH
  WARNING: can't import layer ipsec: cannot import name 'gcd' from 'fractions' (/usr/lib/python3.9/fractions.py)</b></pre>
  </div>
  Please, ignore them since they are not related to the performance or classified as "importing issue" for "bane" library.

  <h1 id="special-speech">Special Speech:</h1>

  Since embarking on this journey in late October 2016, my professional growth has been remarkable. I have had invaluable experiences and interactions that have not only rescued me but also nurtured my personal development. This transformative journey led me to transition from being a blackhat hacker to a highly skilled security researcher, penetration tester, and software engineer. Through the years, my project has evolved from a simple public proxies grabber and user agent scraper to its present state. This transformation has been a result of a gradual integration of new functionalities, rigorous testing, bug fixing, and continuous development efforts. While I have largely driven this project forward independently, I must acknowledge the mentors and supporters who guided me during my initial steps and believed in my potential. With immense gratitude, I dedicate this project to the community as a means of giving back and sharing the tools I've developed over the years. My goal is to simplify the complexities of code and empower others to create their own tools and solutions.

  Thank you all:
  <ul>
  <li><a href="https://twitter.com/YourAnonS0u1">S0u1 :</a> programmer and blackhat.</li>
  <li><a href="https://www.facebook.com/vincelinux">Vince :</a> Linux and hardware expert, social engeneering and programmer.</li>
  <li><a href="https://www.facebook.com/zachary.barker.5439">Zachary Barker (lulz zombie) :</a> teams leader, anarkist, ops organizer, progammer, cyber security expert and blackhat ( R.I.P ) .</li>
  <li><a href="https://www.twitter.com/lulztigre">Lulztigre :</a> Bug Bounty Hunter, Penetration Tester And Python Programmer.</li>
  <li>Jen Hill.</li>
  </ul>


pkgId: 27ade247d2d24a3b272b360fc80eccbc0099148299ec1467081b56293c14214a
name: python-banet
arch: src
version: 0.6.7
epoch: 0
release: 1
url: https://github.com/mnpinto/banet
rpm_license: Apache Software License 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banet-0.6.7-1.src.rpm
checksum_type: sha256
summary:
  A deep learning approach for mapping and dating burned areas using temporal sequences of satellite images

description:
  > Over the past decades, methods for burned areas mapping and dating from remote sensing imagery have been the object of extensive research. The limitations of current methods, together with the heavy pre-processing of input data they require, make them difficult to improve or apply to different satellite sensors. Here, we explore a deep learning approach based on daily sequences of multi-spectral images, as a promising and flexible technique that can be applicable to observations with various spatial and spectral resolutions. We test the proposed model for five regions around the globe using input data from VIIRS 750 m bands resampled to a 0.01º spatial resolution grid. The derived burned areas are validated against higher resolution reference maps and compared with the MCD64A1 Collection 6 and FireCCI51 global burned area datasets. We show that the proposed methodology achieves competitive results in the task of burned areas mapping, despite using lower spatial resolution observations than the two global datasets. Furthermore, we improve the task of burned areas dating for the considered regions of study when compared with state-of-the-art products. We also show that our model can be used to map burned areas for low burned fraction levels and that it can operate in near-real-time, converging to the final solution in only a few days. The obtained results are a strong indication of the advantage of deep learning approaches for the problem of mapping and dating of burned areas and provide several routes for future research.


  ![Graphical Abstract](nbs/images/graphical_abstract.jpg)



  libhdf4-dev is required for pyhdf to read .hdf4 files.

  `sudo apt install -y libhdf4-dev`

  `pip install banet`


  The dataset used to train the model and the pretrained weights are available at https://drive.google.com/drive/folders/1142CCdtyekXHc60gtIgmIYzHdv8lMHqN?usp=sharing. Notice that the size of the full dataset is about 160 GB. You can, however, donwload individual regions in case you want to test with a smaller dataset.


  The procedure to generate predictions for a new region or for a different period of the existing regions is straightforward.

  * **Step 1.** Define a `.json` file with region name, bounding boxes and spatial resolution. Region definition files are by default on `data/regions` and should be named as `R_{name}.json`, where name is the name you give to the region inside the file. For example for Iberian Peninsula region the file `data/regions/R_PI.json` contains the following: `{"name": "PI", "bbox": [-10, 36, 5, 44], "pixel_size": 0.01}`.

  * **Step 2.** To download the reflectance data the command line script `banet_viirs750_download` can be used. However, in order to use it, you need to first register at the website (https://ladsweb.modaps.eosdis.nasa.gov/) and generate an authentication token.

  * **Step 3.** Next you need to download the VIIRS active fire data for the region you seletected. This procedure is manual but you should be able to request data for the entire temporal window in one go. To do that go to https://firms.modaps.eosdis.nasa.gov/download/, select `Create New Request`, select the region based on your region bounding box, for fire data source select `VIIRS`, then select the date range and finally `.csv` for the file format. You should receive an email with the confirmation and later another with the link to download the data. If not go back to the download page enter the email you used for the request and choose `Check Request Status`. If it is completed the download link will appear. Once you have the file place it in `data/hotspots` and name it `hotspots{name}.csv` where name is the name of the region as in the `.json` file defined in Step 1.

  * **Step 4.** Now that you have all the data, you can use the command line script `banet_create_dataset`.

  * **Step 5.** Finally you can use the `banet_predict_monthly` command line script to generate the model outputs.

  **Note:** Some examples of usage for the command line tools are available in the documentation.



  To train the model you need a dataset of image tiles and the respective targets. The data for the 5 study regions is available for download at https://drive.google.com/drive/folders/1142CCdtyekXHc60gtIgmIYzHdv8lMHqN?usp=sharing. In case you want to train a model on different regions the procedure to collect VIIRS data is described on **Generate predictions for a new region in 5 steps** above.

  * **Step 1.** In case you opted for new regions you need to collect MCD64A1 collection 6 burned areas to use as targets. MCD64A1 collection 6 data can be downloaded from `ftp://ba1.geog.umd.edu/` server (description and credentials available on http://modis-fire.umd.edu/files/MODIS_C6_BA_User_Guide_1.2.pdf section 4). Once you log into the server go to `Collection 6/TIFF` folder and download data for the window or windows covering your region (Figure 2 on the user guide shows the delineation of the windows).

  * **Step 2.** Once you have the data you can generate a dataset with `banet_create_dataset` and `banet_dataset2tiles` command line tools. If you downloaded the dataset already in `.mat` files format provided in the url above then you just use the `banet_dataset2tiles`.

  * **Step 3.** To train the model the `banet_train_model` command line tool is provided. To use sequences of 64 days with 128x128 size tiles and batch size of 1, you need a 8 GB GPU. You can try reducing the sequence length if your GPU has less memory or increase the batch size otherwise.

  **Note:** Some examples of usage for the command line tools are available in the documentation.


  It is possible to fine-tune the trained model weights to a specific region or using a different source for the input data (e.g., data from VIIRS 375m bands or data from another satellite). The easiest way to include a new dataset is to write a `Dataset` class similar to `Viirs750Dataset` or the other dataset classes on `banet.data`. Once you have the new dataset you can follow the **Train the model from scratch** guideline and the only change you need to make is to make sure you load the pretrained weights before starting to train.


  If you find any bug or have any question regarding the code or applications of BA-Net you can navigate to `Issues` tab and create a new Issue describing your problem. I will try to answer as soon as possible.


  ```bibtex
  @article{pinto2020banet,
    title={A deep learning approach for mapping and dating burned areas using temporal sequences of satellite images},
    author={Pinto, Miguel M and Libonati, Renata and Trigo, Ricardo M and Trigo, Isabel F and DaCamara, Carlos C},
    journal={ISPRS Journal of Photogrammetry and Remote Sensing},
    volume={160},
    pages={260--274},
    year={2020},
    publisher={Elsevier}
  }
  ```


pkgId: f957a567a97fd7b8514a166fbb5103d27dcdf2042cc3d7e510c2442dae56c2c3
name: python-bangla
arch: src
version: 0.0.2
epoch: 0
release: 1
url: http://github.com/arsho/bangla
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bangla-0.0.2-1.src.rpm
checksum_type: sha256
summary:
  Bangla is a package for Bangla language users with various functionalities including Bangla date and Bangla numeric conversation.

description:
  |Build Status| |Version| |Python| |Size| |Codecov|
  Bangla is a package for Bangla language users with various functionalities including Bangla date and Bangla numeric conversation.
  It can be used to get Bangla date that includes year, month, date, weekday and season of Bangla year.
  Bangla has used the rules from Wikipedia https://en.wikipedia.org/wiki/Bengali_calendars to convert
  Gregorian date to Bangla date. It is based on the revised version of the Bengali calendar which was officially adopted in Bangladesh in 1987.
  Among the Bengali community in India, the provided date may differ.
  Moreover, this package has also a method to convert English numeric string to Bangla numeric string.
  This software can be used on Linux/Unix, Mac OS and Windows systems.
  Features
  ~~~~~~~~
  -  Get Bangla date that includes:
     - Bangla Date (১-৩১)
     - Bangla Month ("বৈশাখ", "জ্যৈষ্ঠ", "আষাঢ়", "শ্রাবণ", "ভাদ্র", "আশ্বিন", "কার্তিক", "অগ্রহায়ণ", "পৌষ", "মাঘ", "ফাল্গুন", "চৈত্র")
     - Bangla Year (১৯৮৭ - )
     - Bangla Season ("গ্রীষ্ম", "বর্ষা", "শরৎ", "হেমন্ত", "শীত", "বসন্ত")
     - Bangla Weekday ("শনিবার", "রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার")
  -  Convert English numeric string to Bangla numeric string (123456 -> ১২৩৪৫৬).
  Installation
  ~~~~~~~~~~~~
  We recommend install ``bangla`` through pip install using Python 3.
      $ pip install bangla
  Example
  ~~~~~~~
  To get today's date in Bangla calendar:
  	import bangla
  	bangla_date = bangla.get_date()
  	print(bangla_date)
  	
  To convert any Gregorian date to Bangla date :
      import bangla
      bangla_date = bangla.get_date(20,6,2017) # date, month, year
      print(bangla_date)
      
  To convert any English numeric string to Bangla numeric string :
      import bangla
      bangla_numeric_string = bangla.convert_english_digit_to_bangla_digit("123456")
      print(bangla_numeric_string)
      
  Contribute
  ~~~~~~~~~~
  Create Github Pull Request https://github.com/arsho/bangla/pulls
  If you have suggestion use GitHub issue system or send a message in Facebook https://www.facebook.com/ars.shovon.
  Thanks
  ~~~~~~
  Influenced by বঙ্গাব্দ - jQuery Plugin
  https://github.com/nuhil/bangla-calendar


pkgId: 2dffa6542e3860de547d29056d7887cadc81906663a0c294c51ef6181b065a32
name: python-bank-statement-reader-altara
arch: src
version: 1.4.8
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://pypi.org/project/bank-statement-reader-altara/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bank-statement-reader-altara-1.4.8-1.src.rpm
checksum_type: sha256
description:
  This bank statement reader can be used to read nigerian bank statement in pdf format.

  It helps to extract the following details

  Update Dependencies
  pip freeze > requirements.txt

  Run Test

  poetry run pytest -v

  build for publishing
  poetry build

  publish to pytest

  poetry publish

  Build and Publish

  poetry publish --build

  Run Test on Bank Statement
  python main.py


pkgId: 888c6ff0ed86b87b8c2e737a4ba20fe0962a141a2c9323ca25bb538c55b11575
name: python-banking633
arch: src
version: 0.0.5
epoch: 0
release: 1
summary: An example package
url: https://github.com/zhangz128/DATA533-project-step3-group20.git
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banking633-0.0.5-1.src.rpm
checksum_type: sha256
description:
  ﻿# Introduction:
  [![Build Status](https://app.travis-ci.com/zhangz128/DATA533-project-step3-group20.svg?token=ZE7d4eqsfoF5iC5KRgDj&branch=main)](https://app.travis-ci.com/zhangz128/DATA533-project-step3-group20)

  The `banking633` system is divided into 2 subpackage `Admin` with modules `view`, `action`, `card` and `User` with modules `account`, `transaction`.
  `main` is the main menu, `data.json` is for storing all action data though `store`.


  Execution: The application can be started by running main `import banking633` and `import banking633.main` directly, then select role depending on the desired mode (admin or user).
  We general "account: 1, password: 1" for admin, user should have account created at the first time.


  Purpose: Serves as the entry point for the application, allowing users to choose between admin and user modes.
  Methods:
  run_admin: Executes the admin view.
  run_user: Executes the user view.
  choice_user_type: Displays welcome message and lets users choose their role (admin or user).



  Purpose: Handles data storage and retrieval.
  Attributes: data_file_path (path to the data file), users (dictionary of users).
  Methods:
  save_all_data: Saves all user data to a file.
  read_users_from_file: Reads users from a file and converts them to User objects.


  Purpose: Handles user actions such as creating or removing users.
  Methods:
  createUser: Registers a new user after validating inputs.
  randomCardId: Generates a unique card ID.
  killUser: Deletes a user based on card number after validation.
  checkPasswd: Validates a password.


  Purpose: Represents a bank card.
  Attributes: cardId, cardPasswd, cardMoney, cardLock.
  Method: to_dict: Converts card attributes to a dictionary.


  -Purpose: Represents a user.
  Attributes: name, idCard, phone, card.
  Method: to_dict: Converts user attributes to a dictionary.



  Purpose: Provides the admin interface for managing users.
  Methods:
  quit: Saves data and exits.
  login: Handles admin login.
  admin_view: Displays admin options and handles user interactions.




  Purpose: Provides the user interface for banking transactions.
  Methods:
  menu: Displays the user menu.
  user_view: Handles user interactions based on menu choices.
  quit: Saves data and exits.


  Purpose: Handles banking transactions like balance check, withdrawal, deposit, and transfer.
  Methods:
  balance: Displays the user's current balance.
  withdraw: Processes a withdrawal after validation.
  deposit: Processes a deposit.
  transfer: Handles fund transfers between accounts.
  checkPasswd: Validates the password with a maximum of three attempts.



  ![report](/Coverage_Reports.png)

  NOTE: the lack of coverage for admin/view is UI code and for user/transaction is print statement

  pypi: https://pypi.org/project/banking633/0.0.2/


pkgId: 5b9c40cabefe06958041bdfd3aceacf0600fe487d0dfb4e8cbc79de86cf3c0bb
name: python-banks
arch: src
version: 1.6.0
epoch: 0
release: 1
summary: A prompt programming language
url: https://pypi.org/project/banks/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banks-1.6.0-1.src.rpm
checksum_type: sha256
description:
  **Table of Contents**
  - [banks](#banks)
    - [Installation](#installation)
    - [Features](#features)
    - [Cookbook](#cookbook)
    - [Examples](#examples)
      - [:point\_right: Render a prompt template as chat messages](#point_right-render-a-prompt-template-as-chat-messages)
      - [:point\_right: Add images to the prompt for vision models](#point_right-add-images-to-the-prompt-for-vision-models)
      - [:point\_right: Use a LLM to generate a text while rendering a prompt](#point_right-use-a-llm-to-generate-a-text-while-rendering-a-prompt)
      - [:point\_right: Function calling directly from the prompt](#point_right-function-calling-directly-from-the-prompt)
      - [:point\_right: Use prompt caching from Anthropic](#point_right-use-prompt-caching-from-anthropic)
    - [Reuse templates from registries](#reuse-templates-from-registries)
    - [Async support](#async-support)
    - [Contributing](#contributing)
    - [License](#license)

  ```console
  pip install banks
  ```

  Prompts are instrumental for the success of any LLM application, and Banks focuses around specific areas of their
  lifecycle:
  - :orange_book: **Templating**: Banks provides tools and functions to build prompts text and chat messages from generic blueprints.
  - :tickets: **Versioning and metadata**: Banks supports attaching metadata to prompts to ease their management, and versioning is
  first-class citizen.
  - :file_cabinet: **Management**: Banks provides ways to store prompts on disk along with their metadata.

  - :blue_book: [In-prompt chat completion](./cookbook/in_prompt_completion.ipynb)
  - :blue_book: [Prompt caching with Anthropic](./cookbook/Prompt_Caching_with_Anthropic.ipynb)
  - :blue_book: [Prompt versioning](./cookbook/Prompt_Versioning.ipynb)

  For a more extensive set of code examples, [see the documentation page](https://masci.github.io/banks/examples/).

  You'll find yourself feeding an LLM a list of chat messages instead of plain text
  more often than not. Banks will help you remove the boilerplate by defining the
  messages already at the prompt level.
  ```py
  from banks import Prompt
  prompt_template = """
  {% chat role="system" %}
  You are a {{ persona }}.
  {% endchat %}
  {% chat role="user" %}
  Hello, how are you?
  {% endchat %}
  """
  p = Prompt(prompt_template)
  print(p.chat_messages({"persona": "helpful assistant"}))





  ```

  If you're working with a multimodal model, you can include images directly in the prompt,
  and Banks will do the job needed to upload them when rendering the chat messages:
  ```py
  import litellm
  from banks import Prompt
  prompt_template = """
  {% chat role="user" %}
  Guess where is this place.
  {{ picture | image }}
  { endchat %}
  """
  pic_url = (
      "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/CorcianoMar302024_01.jpg/1079px-CorcianoMar302024_01.jpg"
  )


  p = Prompt(prompt_template)
  as_dict = [msg.model_dump(exclude_none=True) for msg in p.chat_messages({"picture": pic_url})]
  r = litellm.completion(model="gpt-4-vision-preview", messages=as_dict)
  print(r.choices[0].message.content)
  ```

  Sometimes it might be useful to ask another LLM to generate examples for you in a
  few-shots prompt. Provided you have a valid OpenAI API key stored in an env var
  called `OPENAI_API_KEY` you can ask Banks to do something like this (note we can
  annotate the prompt using comments - anything within `{# ... #}` will be removed
  from the final prompt):
  ```py
  from banks import Prompt
  prompt_template = """
  {% set examples %}
  {% completion model="gpt-3.5-turbo-0125" %}
    {% chat role="system" %}You are a helpful assistant{% endchat %}
    {% chat role="user" %}Generate a bullet list of 3 tweets with a positive sentiment.{% endchat %}
  {% endcompletion %}
  {% endset %}
  {# output the response content #}
  Generate a tweet about the topic {{ topic }} with a positive sentiment.
  Examples:
  {{ examples }}
  """
  p = Prompt(prompt_template)
  print(p.text({"topic": "climate change"}))
  ```
  The output would be something similar to the following:
  ```txt
  Generate a tweet about the topic climate change with a positive sentiment.
  Examples:
  - "Feeling grateful for the sunshine today! 🌞 #thankful #blessed"
  - "Just had a great workout and feeling so energized! 💪 #fitness #healthyliving"
  - "Spent the day with loved ones and my heart is so full. 💕 #familytime #grateful"
  ```
  > [!IMPORTANT]
  > The `completion` extension uses [LiteLLM](https://github.com/BerriAI/litellm) under the hood, and provided you have the
  > proper environment variables set, you can use any model from the supported [model providers](https://docs.litellm.ai/docs/providers).
  > [!NOTE]
  > Banks uses a cache to avoid generating text again for the same template with the same context. By default
  > the cache is in-memory but it can be customized.

  Banks provides a filter `tool` that can be used to convert a callable passed to a prompt into an LLM function call.
  Docstrings are used to describe the tool and its arguments, and during prompt rendering Banks will perform all the LLM
  roundtrips needed in case the model wants to use a tool within a `{% completion %}` block. For example:
  ```py
  import platform
  from banks import Prompt
  def get_laptop_info():
      """Get information about the user laptop.
      For example, it returns the operating system and version, along with hardware and network specs."""
      return str(platform.uname())
  p = Prompt("""
  {% set response %}
  {% completion model="gpt-3.5-turbo-0125" %}
      {% chat role="user" %}{{ query }}{% endchat %}
      {{ get_laptop_info | tool }}
  {% endcompletion %}
  {% endset %}
  {# the variable 'response' contains the result #}
  {{ response }}
  """)
  print(p.text({"query": "Can you guess the name of my laptop?", "get_laptop_info": get_laptop_info}))


  ```

  Several inference providers support prompt caching to save time and costs, and Anthropic in particular offers
  fine-grained control over the parts of the prompt that we want to cache. With Banks this is as simple as
  using a template filter:
  ```py
  prompt_template = """
  {% chat role="user" %}
  Analyze this book:
  {# Only this part of the chat message (the book content) will be cached #}
  {{ book | cache_control("ephemeral") }}
  What is the title of this book? Only output the title.
  {% endchat %}
  """
  p = Prompt(prompt_template)
  print(p.chat_messages({"book":"This is a short book!"}))








  ```
  The output of `p.chat_messages()` can be fed to the Anthropic client directly.

  We can get the same result as the previous example loading the prompt template from a registry
  instead of hardcoding it into the Python code. For convenience, Banks comes with a few registry types
  you can use to store your templates. For example, the `DirectoryTemplateRegistry` can load templates
  from a directory in the file system. Suppose you have a folder called `templates` in the current path,
  and the folder contains a file called `blog.jinja`. You can load the prompt template like this:
  ```py
  from banks import Prompt
  from banks.registries import DirectoryTemplateRegistry
  registry = DirectoryTemplateRegistry(populated_dir)
  prompt = registry.get(name="blog")
  print(prompt.text({"topic": "retrogame computing"}))
  ```

  To run banks within an `asyncio` loop you have to do two things:
  1. set the environment variable `BANKS_ASYNC_ENABLED=true`.
  2. use the `AsyncPrompt` class that has an awaitable `run` method.
  Example:
  ```python
  from banks import AsyncPrompt
  async def main():
      p = AsyncPrompt("Write a blog article about the topic {{ topic }}")
      result = await p.text({"topic": "AI frameworks"})
      print(result)
  asyncio.run(main())
  ```

  Contributions are very welcome, the [CONTRIBUTING.md](CONTRIBUTING.md) file contains all the details
  about how to do it.

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


pkgId: d8101e73c3abd59d2b01a93b7b92478e14d8d0f8bc6cc3957a8f07437e4c0dc0
name: python-banner
arch: src
version: 0.0.2
epoch: 0
release: 1
summary: banner is a tool for predicting microbiome labels based on hulk sketches
url: http://will-rowe.github.io/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banner-0.0.2-1.src.rpm
checksum_type: sha256
description:
  <div align="center">
      <img src="https://raw.githubusercontent.com/will-rowe/banner/master/misc/logo/banner-logo-with-text.png" alt="banner-logo" width="250">
      <hr>
      <a href="https://travis-ci.org/will-rowe/banner"><img src="https://travis-ci.org/will-rowe/banner.svg?branch=master" alt="travis"></a>
      <a href='http://hulk.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/hulk/badge/?version=latest' alt='Documentation Status' /></a>
      <a href="https://github.com/will-rowe/banner/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-orange.svg" alt="License"></a>
      <a href="https://zenodo.org/badge/latestdoi/144629592"><img src="https://zenodo.org/badge/144629592.svg" alt="DOI"></a>
  </div>

  ***

  ```
  BANNER is still under development - features and improvements are being added, so please check back soon.
  ```

  ***



  `BANNER` is a tool that lives inside [HULK](https://github.com/will-rowe/hulk) and aims to make sense of **hulk sketches**. At the moment, it trains a [Random Forest Classifier](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html) using a set of labelled **hulk sketches**. It can then use this model to predict the label of microbiomes as they are sketches by ``HULK``.

  For example, you could train `BANNER` using a set of microbiomes from patients that either have or haven't received antibiotic treatment. You can then use `BANNER` to predict whether a new microbiome sample exhibits signs of antibiotic dysbiosis. I will post more information and examples soon...





  ```
  conda install banner
  ```

  > note: if using Conda make sure you have added the [Bioconda](https://bioconda.github.io/) channel first



  ```
  pip install banner
  ```



  `BANNER` is called by typing **banner**, followed by the subcommand you wish to run. There are two main subcommands: **train** and **predict**. This quick start will show you how to get things running but it is recommended to follow the [HULK documentation](http://hulk-documentation.readthedocs.io/en/latest/?badge=latest).

  ```bash

  banner train -m hulk-banner-matrix.csv -o banner.rfc


  hulk sketch -f mystery-sample.fastq --stream -p 8 | banner predict -m banner.rfc
  ```




  * only supports 2 labels at the moment

  * there is very limited checking and not many unit tests...


pkgId: 78cdcc5f7a5d956de7e4be638829d8f7d42b3cb9ae5c0a2c4f9d0f9254888816
name: python-banner-storedot
arch: src
version: 2.3.4
epoch: 0
release: 1
summary: light dal package
url: https://https://github.com/storedot/banner
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banner-storedot-2.3.4-1.src.rpm
checksum_type: sha256
description:
  ```shell
  python3 -m pip install --upgrade build
  python3 -m build
  python3 -m pip install --upgrade twine
  ```


  ```shell
  python3 -m twine upload --repository testpypi dist/*
  ```


  ```shell
  python3 -m twine upload --repository pypi dist/*
  ```



      
          - ABS class

      
          - ABS class

      
          - ABS class

      
          - ABS class

      
          - Create Connection object compatible with banner.queries
          - **raises MySQLError for bad connection**

      
          - Create Connection object compatible with banner.queries
          - **raises MySQLError for bad connection**

      
          - Create CacheConnection object compatible with banner.queries


      
          - Getter/Setter for known(default) Connections dict

      
          - Getter/Setter for known(default) CacheConnection

      
          - run a simple string query for Connection
          - connection=None try to get first known connection, **raise KeyError if None found**
          - Cache the result if cache_connection or Queries.CACHE is set (ttl if provided otherwise use CACHE.ttl)
          - Cache=False will not cache the result even if Queries.CACHE is set
          - w2p_parse=True - should parse query according to w2p syntax

      
          - Describes a table in connection
          - Raises OperationalError and KeyError(Failed to find a connection for given key)

      
          - Describe Table names in connection
          - Raises OperationalError and KeyError(Failed to find a connection for given key)

      
          - Queries a given connection for 'SELECT {columns} FROM {table} WHERE {condition}'
          - Accepts both column values and labels
          - raw=True - column names as in db
          - Queries a given Connection(ip)/str of a known connection (or first known) return result as DataFrame
          - Cache the result if cache_connection or Queries.CACHE is set (ttl if provided otherwise use CACHE.ttl)
          - Cache=False will not cache the result even if Queries.CACHE is set
          - Raises OperationalError and KeyError(Failed to find a connection for given key)

      
          - simplified query to retrieve aggregate cache data by condition
          - condition is a valid where clause for given connection type
          - requires keys in the form Iterable(Tuple(ip, device, unit, channel, test)), ex: [(241, 240222, 6, 11, 2818575226)]
          - Cache the result if cache_connection or Queries.CACHE is set (ttl if provided otherwise use CACHE.ttl)
          - Cache=False will not cache the result even if Queries.CACHE is set

      
          - query Connection for device, unit, channel, test
          - connection=None try to get first known connection, **raise KeyError if None found**
          - temperature=True - fetch temperature data
          - raw=False - compute temperature, voltage, current aswell as grouping by auxchl_id
          - dqdv=True -> banner.neware.calc_dq_dv
          - Cache the result if cache_connection or Queries.CACHE is set (ttl if provided otherwise use CACHE.ttl)
          - Cache=False will not cache the result even if Queries.CACHE is set
          - **raises Type err if no data exists**

      
          - Multi Process Queries.neware_query (number of processes = number of distinct connections found for input)
          - Queries all available tests for given table AND experiments AND templates AND tests AND cells
          - Union[list, Number, str] - single/list of numbers or a valid query
          - temperature=True - fetch temperature data
          - raw=False - compute temperature, voltage, current aswell as grouping by auxchl_id
          - dqdv=True -> banner.neware.calc_dq_dv
          - Cache the result if cache_connection or Queries.CACHE is set (ttl if provided otherwise use CACHE.ttl)
          - Cache=False will not cache the result even if Queries.CACHE is set
          - **raises Type err if no data exists**


      
          - Step number : Step Name Dictionary

      
          - calculate neware columns for a valid neware DataFrame

      
          - Calculate DQ/DV for a valid neware df
          - raw=False: remove outliers

      
          - Given data(neware df), cache_data(neware_cache df), tries to merge cache_data into data
          - ** Raises TypeError and Index Error**


      
          - Default Joins dictionary
          - Used when calling DataFrame.join_table without specifing how to join

      
          - Column : Label Dictionary

      
          - Label : Column Dictionary


      

      
          - banner.queries.Queries.table_query

      
          - banner.neware.calculate_neware_columns

      
          - banner.neware.calculate_dq_dv

      
          - Given a table, Join its relevant Data with the current table_query DataFrame!
          - table: any table under the available Connection
          - columns: select specific columns from the table, default=All
          - condition: additional filtering condition on merged data
          - left: columns used to merge left DataFrame, default is picked from banner.utils.web2py.JOINS
          - right: columns used to merge right DataFrame, default is picked from banner.utils.web2py.JOINS
          - how: how to merge left and right, default is picked from banner.utils.web2py.JOINS
          - connection=None try to get first known connection, **raise KeyError if None found**
          - **raise TypeError If failed to join**


pkgId: 116aaeaadc9113f6577e41ab646ad37387edb63d80fa64a64230bd8d67511dec
name: python-banner_DONGUK777
arch: src
version: 0.3.1
epoch: 0
release: 1
summary: Default template for PDM package
url: https://pypi.org/project/banner_DONGUK777/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banner_DONGUK777-0.3.1-1.src.rpm
checksum_type: sha256
description:
  1. banner
  2. pic
  3. lotto



  ```
  $ pip install banner_DONGUK777
  ```



  1. banner

  ```
  $ DONGUK777-banner

      ____  ____  _   __________  ____ __
     / __ \/ __ \/ | / / ____/ / / / //_/
    / / / / / / /  |/ / / __/ / / / ,<
   / /_/ / /_/ / /|  / /_/ / /_/ / /| |
  /_____/\____/_/ |_/\____/\____/_/ |_|
  ```

  2. pic

  ```
  $ DONGUK777-pic


                                                              .......
                                                          .......
                                                 ....::::-+====-:...
                                                 ..-=====--===-===-.
                                                 .======--==+=:...-:
                                                .-=====--..........:  ...........
                                                .======:.....:%@%+... ...........
                                          ....-+=======@@@+..:@%@-:-===--------::.....
                                          ...:+++=====#@+#@=..*@@#++==========----==:.....
                                          ....=++====-+@%@=.:=#*++=========--==+=----:...
                                           ...-++===+=:*@@#::-++++=======-------------=:.
                                             ..-====++-::::-=++++=======---------------=-.
                        .......        ......::-==++++====++++++========----------------=:..
                         ..-=-..        ..=++++==++++=====++++++========----------------==-...
                        .-===:.      ..:++++===-......:=+++*++++========---------------==-.
                 ...:....:===-.........-+++==::.........:-+*+++++========--------------==-...
                 .:===-...-===:...==--.:+++-..:..........::+*+++++==========---------====-. .
                 ..=====-..====-.-====..:+=:.:::..........:-++++++++=====================:
                 ...:-=====++==+++++-.....::.:::..........::=*+++++++++=================:.
                    ....-+===++=====-...  .:.::::.........::-***++++++++++=============:..
                  .....:=+++==++=====.....:+-:--:::.......::-*%#**++++++++++++=======-..
                 .-=======+====+++==+=:...-++=----:::::::::-=*###******+++++++++++=-:..
                 .-===-:-=++=====++++===-.-+**+===---:::::---=*#*###*******+++++=:...
                 .........:=++++++++======++*####++===---------=****##+:::-::.......
                           ...:::.-+++======++**+==++*+=====---::-=+**=....===--:...
                           .........:++++=======++++***##*+==+==--:::-::=+**++++==..
                     ...         ..:+*##*++++========+++++-::-==.. ....*+##*+=====-.
                    .::....      .-+++*###***++++=========:...:::......=+**++++++=-.
                    .-==-..      -+==+=---**++++++=======-.....:+*+:.....***+=====-.
                    .:====-:....:-----=+++++=============:.....:+++*+=+****++++===:.
                    ..-==========+++++++================-......:**++**********++=:.
                    ..:========+++++====================.......:***+******+---:..
                    ...:===============================...........-++=:..........
                      ..:=+==============+++++++++++==............-=====----:....
                      ...:=++===========++============:........:=====---------:..
                        ...:=++++======++=============+=......======----:----=-..
                        ....:-=+++++++++++============+++===-======------::...::....
                          ...:::-=++++++++++=========+++++**+======---:...:-----:...
                           ...::::::-=++++++++++===++===+##+=======-:.:---------:...
                    ...........:----------=++++++++====**++=======:::----------:...
                    .....-==-=++*+++--------====++===+*+=======+-:--====----=-...
                    ...-+++++++**********+++=++++==++*+======++---=======---.
                    ..-=++++++++**++**********+=..=+**======+=--========-:...
                    .:-=+==++++++***********+=....-+*+======-:-=======-:..
                    ..-=+====+++++******=-..........:=====-::---=-----...
                 .....:-=++++++**+++**=...............=++-:----------....................
         . ............--=++++++*####*=-..............:==----------:.................................
      ..................--=+==++*******++-..............:---------...................................
    .....................--===++++++++++++-:::::::::::::::-----::::.................................
    ......................--=++++===++++++=:::::--------------::::::::::::::::.....................
    .................::::::--=++===+++++++=----------------::::::::::::::::::......................
     ................::-------=++++++++++=-----------::::::.......................................
    ....................::----=---=====--------------::::::.......................................
         .....................::----::..........:::::::::::::::::................................
                      .........................................................................
  ```

  3. lotto

  ```
  $ DONGUK777-lotto
  [40, 26, 12, 33, 4, 8]

  $ DONGUK777-lotto
  [25, 29, 33, 45, 42, 40]
  ```


  **출처**
  - https://github.com/pwaller/pyfiglet


pkgId: 725fe583401ea7dad5fbaf0563a378717ce7b787216df151e98da37068c3b733
name: python-banner_hun0219
arch: src
version: 0.3.3
epoch: 0
release: 1
summary: banner output program
url: https://github.com/hun0219/banner_hun0219
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banner_hun0219-0.3.3-1.src.rpm
checksum_type: sha256
description:
  ```
      __                ____ ___  _______
     / /_  __  ______  / __ \__ \<  / __ \
    / __ \/ / / / __ \/ / / /_/ // / /_/ /
   / / / / /_/ / / / / /_/ / __// /\__, /
  /_/ /_/\__,_/_/ /_/\____/____/_//____/

  ```

  ```py
  pip install banner_hun0219==0.3.3
  ```

  ```py
  $ show-banner
      __                ____ ___  _______
     / /_  __  ______  / __ \__ \<  / __ \
    / __ \/ / / / __ \/ / / /_/ // / /_/ /
   / / / / /_/ / / / / /_/ / __// /\__, /
  /_/ /_/\__,_/_/ /_/\____/____/_//____/

  ```

  ```py
  $ hun0219-pic

  ::::--:---:---:-::::-::-:::....     .+=..  .#%.#%.:%: .:..@+    .    ..:::-=+--=:::....
  ::===+:**=-+=++-+=-:==:*=:::...     .##..-**@%.#%.-@+==+@+@@@+         ..::::::::::::...............
  :::*-+:=--:+++=-+:::=::+:::......   .##.....#%.#%.-@- .:@=--@+         ................:::::-:-:-:::
  .............................       .*%%#.##.#%.-@@@@@@=..@+                        .:::*#+=:-::::
    .............................        .@.   ..#%.   ..::::.+-                        ..::-##-::::::
    ..::::::::::::::::::::::::::....     .@@@@@@@@%   .@@=. .*@=                        ..............
    ..:-=%*+::--#:==-#:##:-*::+:::..     .@.     %.  .@*   ..@*
    ..::**#:::+:+-:=:%+=--=-:+::...     .*********.....-@@@@%:..     ....::::::::::::::::::::::::::..
  ```


  ```py
  $ hun0219-lotto
  [19, 13, 18, 29, 14, 41]
  ```


  (https://github.com/hun0219/banner_hun0219)


pkgId: 854047d53b08db33c5447975c9339bf646aef5fc172bfb80beaf489b1bd1f5b3
name: python-banner_whitecapella
arch: src
version: 0.3.9
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://github.com/WhiteCapella/banner_whitecapella
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banner_whitecapella-0.3.9-1.src.rpm
checksum_type: sha256
description:
  This Project is practice project of python packaging, writing user guide, and markdown readme document.



  This Project require python version 3.8 over.
  Use pip installer
  ```
  $ pip install banner-whitecapella
  ```


  Simple to Use. Just write Command.



  ```
  $ whitecapella-banner
  ```
  ![image](https://github.com/user-attachments/assets/ed2e57ba-6815-4dcc-9375-a4f8abb20034)



  ```
  $ whitecapella-pic
  ```




  ```
  $ whitecapella-lotto
  ```


pkgId: 2be66638855dfbc924e1fbb011598105df0529f3d7c53acc07215f902991e0c2
name: python-banquo
arch: src
version: 0.4.0
epoch: 0
release: 1
summary: Banquo: a Python package for building Bayesian Nonparanormal models
url: https://github.com/luizdesuo/banquo
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banquo-0.4.0-1.src.rpm
checksum_type: sha256
description:
  a Python package for building Bayesian Nonparanormal models

  [![Logo](https://raw.githubusercontent.com/luizdesuo/banquo/main/docs/_static/banquo-logo.png)](https://github.com/luizdesuo/banquo)

  [![PyPI](https://img.shields.io/pypi/v/banquo.svg)][pypi status]
  [![Status](https://img.shields.io/pypi/status/banquo.svg)][pypi status]
  [![Python Version](https://img.shields.io/pypi/pyversions/banquo)][pypi status]
  [![License](https://img.shields.io/pypi/l/banquo)][license]

  [![Read the documentation at https://banquo.readthedocs.io/](https://img.shields.io/readthedocs/banquo/latest.svg?label=Read%20the%20Docs)][read the docs]
  [![Release](https://github.com/luizdesuo/banquo/workflows/release/badge.svg)][release]
  [![Codecov](https://codecov.io/gh/luizdesuo/banquo/branch/main/graph/badge.svg)][codecov]

  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
  [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]

  [pypi status]: https://pypi.org/project/banquo/
  [read the docs]: https://banquo.readthedocs.io/
  [release]: https://github.com/luizdesuo/banquo/actions?workflow=release
  [codecov]: https://app.codecov.io/gh/luizdesuo/banquo
  [pre-commit]: https://github.com/pre-commit/pre-commit
  [black]: https://github.com/psf/black



  - TODO



  - TODO



  You can install _Banquo_ via [pip] from [PyPI]:

  ```bash
  pip install banquo
  ```



  Please see the [Command-line Reference] for details.



  Contributions are very welcome. To learn more, see the [Contributor Guide].



  Distributed under the terms of the [MIT license][license], _Banquo_ is free and open
  source software.



  If you encounter any problems, please [file an issue] along with a detailed description.



  This project was generated from [Dinkin Flicka Cookiecutter] template.

  [pypi]: https://pypi.org/
  [dinkin flicka cookiecutter]: https://github.com/luizdesuo/cookiecutter-dinkin-flicka
  [file an issue]: https://github.com/luizdesuo/banquo/issues
  [pip]: https://pip.pypa.io/

  <!-- github-only -->

  [license]: https://github.com/luizdesuo/banquo/blob/main/LICENSE
  [contributor guide]: https://github.com/luizdesuo/banquo/blob/main/CONTRIBUTING.md
  [command-line reference]: https://banquo.readthedocs.io/en/latest/usage.html


pkgId: 046178abee428da61e5f94a516489cf28c49094d5bb8b4b873c72f12f87784f2
name: python-banquo
arch: src
version: 0.5.0
epoch: 0
release: 1
summary: Banquo: a Python package for building Bayesian Nonparanormal models
url: https://github.com/luizdesuo/banquo
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banquo-0.5.0-1.src.rpm
checksum_type: sha256
description:
  a Python package for building Bayesian Nonparanormal models

  [![Logo](https://raw.githubusercontent.com/luizdesuo/banquo/main/docs/_static/banquo-logo.png)](https://github.com/luizdesuo/banquo)

  [![PyPI](https://img.shields.io/pypi/v/banquo.svg)][pypi status]
  [![Status](https://img.shields.io/pypi/status/banquo.svg)][pypi status]
  [![Python Version](https://img.shields.io/pypi/pyversions/banquo)][pypi status]
  [![License](https://img.shields.io/pypi/l/banquo)][license]

  [![Read the documentation at https://banquo.readthedocs.io/](https://img.shields.io/readthedocs/banquo/latest.svg?label=Read%20the%20Docs)][read the docs]
  [![Release](https://github.com/luizdesuo/banquo/workflows/release/badge.svg)][release]
  [![Codecov](https://codecov.io/gh/luizdesuo/banquo/branch/main/graph/badge.svg)][codecov]

  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
  [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]

  [pypi status]: https://pypi.org/project/banquo/
  [read the docs]: https://banquo.readthedocs.io/
  [release]: https://github.com/luizdesuo/banquo/actions?workflow=release
  [codecov]: https://app.codecov.io/gh/luizdesuo/banquo
  [pre-commit]: https://github.com/pre-commit/pre-commit
  [black]: https://github.com/psf/black



  - [Array-API standard]
  - Bayesian inference
  - Semiparametric Bernstein estimator for cumulative distribution function and
    probability density function
  - Nonparanormal model with Bernstein marginals
  - Hilbert space approximation for discrete stochastic heat equation kernel

  See the Banquo architecture below:

  ![Architecture](https://raw.githubusercontent.com/luizdesuo/banquo/main/docs/_static/architecture.png)



  - [array-api-compat]
  - [NumPyro]
  - [ArviZ]



  You can install _Banquo_ via [pip] from [PyPI]:

  ```bash
  pip install banquo
  ```



  Please see the documentation at [Read the Docs] for details.



  Contributions are very welcome. To learn more, see the [Contributor Guide].



  Distributed under the terms of the [MIT license][license], _Banquo_ is free and open
  source software.



  If you encounter any problems, please [file an issue] along with a detailed description.



  This project was generated from [Dinkin Flicka Cookiecutter] template.

  [pypi]: https://pypi.org/project/banquo/
  [dinkin flicka cookiecutter]: https://github.com/luizdesuo/cookiecutter-dinkin-flicka
  [file an issue]: https://github.com/luizdesuo/banquo/issues
  [pip]: https://pip.pypa.io/
  [array-api standard]: https://data-apis.org/array-api/latest/
  [array-api-compat]: https://github.com/data-apis/array-api-compat
  [numpyro]: https://github.com/pyro-ppl/numpyro
  [arviz]: https://github.com/arviz-devs/arviz

  <!-- github-only -->

  [license]: https://github.com/luizdesuo/banquo/blob/main/LICENSE
  [contributor guide]: https://github.com/luizdesuo/banquo/blob/main/CONTRIBUTING.md
  [command-line reference]: https://banquo.readthedocs.io/en/latest/usage.html


pkgId: ca5248004a442360f1c4ec66185ac2fa346c0c6f7b754c80fccfe96debe0aed8
name: python-banrural-bank-parser-gt
arch: src
version: 0.4.4
epoch: 0
release: 1
summary: Banrural Parser
url: https://github.com/gt-banks-parser/banks-parser-base
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-banrural-bank-parser-gt-0.4.4-1.src.rpm
checksum_type: sha256
description:
  Python library to scrap Banrural Website

  The intended use of this library is to make it easy to access Banrural bank data to allow the automatisation of processes that currently banks doesn't allow.






  `pip install banrural-scrapper-gt`

  If you are using requirements.txt just add `banrural-scrapper-gt` into the file






  - Don't access to Banrural website or mobile app while executing some script usign this library.
  - Login with the library will fail if you are logged in from the website or mobile app.



  The recommended method for login is using `with` statement of Python. We initialize the class in the with and will make automatically login with the provided credentials and will logout after finishing all the work and if some exception happens we ensure that logout method is called.

  ```python
  from banrural_bank_gt import BanruralBank, UserPasswordBankLogin

  credentials = UserPasswordBankLogin(username="ENTER YOUR USERNAME", password="ENTER YOUR PASSWORD")
  with BanruralBank(credentials) as connection:
      


  ```



  ```python
  from banrural_bank_gt import BanruralBank, UserPasswordBankLogin

  credentials = UserPasswordBankLogin(username="ENTER YOUR USERNAME", password="ENTER YOUR PASSWORD")
  with BanruralBank(credentials) as connection:
      accounts = connection.fetch_accounts() # Fetch all accounts
          for a in accounts:
              print(a)

  ```



  We can retrieve the movements of an account using `fetch_movements` method in `BanruralBankAccount`

  ```python
  import datetime
  from banrural_bank_gt import BanruralBank, UserPasswordBankLogin
  credentials = UserPasswordBankLogin(username="ENTER YOUR USERNAME", password="ENTER YOUR PASSWORD")

  with BanruralBank(credentials) as connection:
      accounts = connection.fetch_accounts()
      for a in accounts:
          mov = a.fetch_movements(
              datetime.date.today() - datetime.timedelta(days=60),
              datetime.date.today() + datetime.timedelta(days=1),
          )
          for m in mov:
              print(m)
  ```




  It's important to logout after you finish your operations otherwise you can lock yourself and that won't allow you to login from the website, that's due security protections of Banrural.

  Even though `with` statement is the recommended way to make sure logout method is called. You can also execute it manually.

  ```python
      bank = BanruralBank(credentials)
      try:
          bank.login()
          
      except:
          pass
      finally:
          bank.logout()
  ```



  1. Fork it
  2. Create your feature branch
  3. Commit your changes
  4. Push your branch
  5. Create a pull request



  - Why I need to enter my credentials? It is safe?
      - We need your credentials to authenticate in the bank, those credentials are not stored in any place. This is open source library so you can check the code.
  - Can you make some program for me using this library?
      - Of course, this library provides a base for another utilities and potentially any thing that is on the website of banrural is under subject for automatization, if you need some customization or build a program on top of this library please contact me at dev at csimon (dot) dev and I will be happy to help you.


pkgId: 34f9f68b634fc6d404205ba9463acbae5d683a9d8c846ae6545eb000430662ca
name: python-baostock
arch: src
version: 0.8.9
epoch: 0
release: 1
summary: A tool for obtaining historical data of China stock market
url: http://www.baostock.com
rpm_license: BSD License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-baostock-0.8.9-1.src.rpm
checksum_type: sha256
description:
  * It's easy to use because most of the data returned are pandas DataFrame objects
  * We have our own data server, efficient and stable operation
  * Free china stock market data
  * Friendly to machine learning and data mining


pkgId: bdb4885b8a6a0431be55d347c105fe46cfbc715c5a39d041f194b009c47f96b4
name: python-bap-elk-backends
arch: src
version: 0.5.12
epoch: 0
release: 1
summary: GrimoireELK plugic for public-inbox.
url: https://chaoss.github.io/grimoirelab/
rpm_license: GPL-3.0+
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bap-elk-backends-0.5.12-1.src.rpm
checksum_type: sha256
description:
  GrimoireELK backends available in Bitergia Analytics:


  Software for efficiently managing and archiving public mailing
  lists using Git repositories.
  - `projects.json`
  ```
  {
      "linux": {
          "public_inbox": [
              "linux /path/to/mirror/repository"
          ]
      }
  }
  ```

  - `setup.cfg`
  ```
  [public_inbox]
  raw_index = public_inbox_raw
  enriched_index = public_inbox_enriched
  latest-items = false
  ```



  Email discussion platform that facilitates organized group
  communication through dedicated email groups.

  - `projects.json`
  ```
  {
      "Example": {
          "topicbox": [
              "https://example.topicbox.com/groups/group-1",
              "https://example.topicbox.com/groups/group-2"
          ]
      }
  }
  ```

  - `setup.cfg`
  ```
  [topicbox]
  raw_index = topicbox_raw
  enriched_index = topicbox_enriched
  account-id = xxxx  # Look into the Perceval backend
  studies = [ enrich_demography:topicbox ]  # (optional)

  [enrich_demography:topicbox]  # (optional)
  ```



  Web-based localization platform that facilitates collaborative
  translation of software and documentation

  - `projects.json`
  ```
  {
      "Example": {
          "pontoon": [
              "https://pontoon.mozilla.org af",
              "https://pontoon.mozilla.org es"
          ]
      }
  }
  ```

  - `setup.cfg`
  ```
  [pontoon]
  raw_index = pontoon_raw
  enriched_index = pontoon_enriched
  studies = [ enrich_demography:pontoon ]  # (optional)

  [enrich_demography:pontoon]  # (optional)
  ```




   * Python >= 3.9

  You will also need some other libraries for running the tool, you can find the
  whole list of dependencies in [pyproject.toml](pyproject.toml) file.



  There are several ways to install grimoire-elk-public-inbox on your system: packages or source
  code using Poetry or pip.



  grimoire-elk-public-inbox can be installed using pip, a tool for installing Python packages.
  To do it, run the next command:
  ```
  $ pip install grimoire-elk-public-inbox
  ```



  To install from the source code you will need to clone the repository first:
  ```
  $ git clone https://github.com/bitergia-analytics/grimoirelab-elk-public-inbox
  $ cd grimoirelab-elk-public-inbox
  ```

  Then use pip or Poetry to install the package along with its dependencies.


  To install the package from local directory run the following command:
  ```
  $ pip install .
  ```
  In case you are a developer, you should install grimoire-elk-public-inbox in editable mode:
  ```
  $ pip install -e .
  ```


  We use [poetry](https://python-poetry.org/) for dependency management and
  packaging. You can install it following its [documentation](https://python-poetry.org/docs/#installation).
  Once you have installed it, you can install grimoire-elk-public-inbox and the dependencies in
  a project isolated environment using:
  ```
  $ poetry install
  ```
  To spaw a new shell within the virtual environment use:
  ```
  $ poetry shell
  ```



  Licensed under GNU General Public License (GPL), version 3 or later.


pkgId: 345d82f012abbc89176e4f2728391d23228f159cc79aa492385f031f25c1d111
name: python-baram
arch: src
version: 0.4.6
epoch: 0
release: 1
summary: AWS Framework for python
url: https://pypi.org/project/baram/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-baram-0.4.6-1.src.rpm
checksum_type: sha256
description:
  Python based AWS Framework which leverages boto3 and awswrangler.

  Baram means "wind" in Korean which makes cloud move conveniently.



  - TBD
  - Convenient S3 Usage(KMS setting, delete directory ...)
  - Athena Iceberg
  - Athena Performance Management(cache, ctas_approach control)
  - Glue Job Management



  ```bash
  > pip install awswrangler
  ```





  ```python

  from baram.s3_manager import S3Manager

  sm = S3Manager("my_bucket_name")


  sm.upload_file(local_file_path="local_file_path",
                 s3_file_path="s3_file_path")


  sm.download_dir(s3_dir_path="s3_directory_path",
                  local_dir_path="local_directory_path")


  sm.copy_object(from_key="from_s3_key",
                 to_key="to_s3_key")

  ```





  ```python









  ```



  ```python











  ```





  ```python







  ```



  - [How to import Baram in Glue](TBD)
  - [How to import Baram in SageMaker](TBD)
  - [S3 Usage with Baram](TBD)
  - [Athena Usage with Baram](TBD)


pkgId: dcf84f8b2156c2f0634c89acd7cd7538e1624e207f2dfd0e846d552a735fa005
name: python-barc4sr
arch: src
version: 2024.12.4
epoch: 0
release: 1
summary: A Python package for Synchrotron Radiation calculations
url: https://github.com/barc4/barc4sr
rpm_license: GPL-3.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barc4sr-2024.12.4-1.src.rpm
checksum_type: sha256
description:
  **BARC** library for **S**ynchrotron **R**adiation

  This library was created for facilitating the use of [SRW](https://github.com/ochubar/SRW) for a few routine calculations
  such as:

  - undulator emission spectra - on axis or through a slit;
  - power (density) through a slit;
  - undulator radiation spectral and spatial distribution;

  All calculations take either an ideal magnetic field or a tabulated measurement. In the
  case of a tabulated measurement, a Monte-Carlo sampling of the electron-beam phase space
  is necessary for a few calculations and recommended for others.

  This module is inspired by [xoppy](https://github.com/oasys-kit/xoppylib), but but with
  the "multi-electron" calculations and parallelisation of a few routines.



  bar4sr is on PyPi! So it can be installed as ```pip install barc4sr``` _hooray_!!! Otherwise,
  clone the project, fix the (many bugs) and help improve it...



  Ideally, I want to add the same functionalities to bending-magnets and wigglers through SRW.
  I am also considering interfacing [SPECTRA](https://spectrax.org/spectra/index.html), but only if there is the need for that.


  Check the examples! You can learn a lot from them.


pkgId: 1d7ad3b203a0f326fad97355fd45d819dd27fdf14f867c4bfd13587c096e293b
name: python-barcode-server
arch: src
version: 2.4.1
epoch: 0
release: 1
url: https://github.com/markusressel/barcode-server
rpm_license: AGPL-3.0-or-later
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barcode-server-2.4.1-1.src.rpm
checksum_type: sha256
summary:
  A simple daemon to expose USB Barcode Scanner data to other services using Websockets, Webhooks or MQTT.

description:
  A simple daemon to read barcodes from USB Barcode Scanners
  and expose them to other service using HTTP calls, a websocket API or MQTT.

  [![asciicast](https://asciinema.org/a/366004.svg)](https://asciinema.org/a/366004)



  * [x] Autodetect Barcode Scanner devices on the fly
  * [x] Request Server information via [REST API](#rest-api)
  * [x] Subscribe to barcode events using
      * [x] [Websocket API](#websocket-api)
  * [x] Push barcode events using
      * [x] [HTTP requests](#http-request)
      * [x] [MQTT messages](#mqtt-publish)
  * [x] Get [statistics](#statistics) via Prometheus exporter





  Ensure the user running this application is in the correct group for accessing
  input devices (usually `input`), like this:

  ```
  sudo usermod -a -G input myusername
  ```



  **barcode-server** uses [container-app-conf](https://github.com/markusressel/container-app-conf)
  to provide configuration via a YAML or TOML file as well as ENV variables. Have a look at the
  [documentation about it](https://github.com/markusressel/container-app-conf).

  The config file is searched for in the following locations (in this order):

  * `./`
  * `~/.config/`
  * `~/`

  See [barcode_server.yaml](/barcode_server.yaml) for an example in this repo.



  ```shell

  python -m venv ./venv

  source ./venv/bin/activate

  pip install barcode-server

  deactivate


  ./venv/bin/barcode-server -h
  ```

  This will give you an overview of all available commands:

  ```shell
  > ./venv/bin/barcode-server -h
  Usage: barcode-server [OPTIONS] COMMAND [ARGS]...

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

  Commands:
    config  Print the current configuration of barcode-server
    run     Run the barcode-server
  ```



  The docker image will by default be launched with the `run` command, making it easier
  for production deployment. When starting the docker container, make sure to pass through
  input devices as well as the configuration file:

  ```shell
  docker run -it --rm \
    --name barcode \
    --device=/dev/input \
    -v "/home/markus/.config/barcode_server.yaml:/app/barcode_server.yaml" \
    -e PUID=0 \
    -e PGID=0 \
    markusressel/barcode-server
  ```

  **Note:** Although **barcode-server** will continuously try to detect new devices,
  even when passing through `/dev/input` like shown above, new devices can not be detected
  due to the way docker works. If you need to detect devices in real-time, you have to use
  the native approach.

  The user and group id that should be used within the container can be specified using the
  `PUID` and `PGID` environment variables.

  To override the default command, simply specify command arguments directly:

  ```shell
  docker run -it --rm \
    ...
    markusressel/barcode-server --help
  ```



  By default the webserver will listen to `127.0.0.1` on port `9654`.



  When specified in the config, an API token is required to authorize clients, which must
  be passed using a `X-Auth-Token` header when connecting. Since barcode-scanner doesn't rely on any
  persistence, the token is specified in the configuration file and can not be changed on runtime.



  **barcode-server** provides a simple REST API to get some basic information.
  This API can **not** be used to retrieve barcode events. To do that you have to use one of
  the approaches described below.

  | Endpoint   | Description                               |
  |------------|-------------------------------------------|
  | `/devices` | A list of all currently detected devices. |



  In addition to the REST API **barcode-server** also exposes a websocket at `/`, which can be used
  to get realtime barcode scan events.

  To connect to it, you have to provide

  * a `Client-ID` header with a UUID (v4)
  * (optional) an empty `Drop-Event-Queue` header, to ignore events that happened between connections
  * (optional) an `X-Auth-Token` header, to authorize the client

  Messages received on this websocket are JSON formatted strings with the following format:

  ```json
  {
    "id": "33cb5677-3d0b-4faf-9dc4-d19a8ee7d8a1",
    "serverId": "cash-register-1",
    "date": "2020-08-03T10:00:00+00:00",
    "device": {
      "name": "BARCODE SCANNER BARCODE SCANNER",
      "path": "/dev/input/event3",
      "vendorId": "ffff",
      "productId": "0035"
    },
    "barcode": "4250168519463"
  }
  ```

  To test the connection you can use f.ex. `websocat`:

  ```
  > websocat - autoreconnect:ws://127.0.0.1:9654 --text --header "Client-ID:dc1f14fc-a7a6-4102-af60-2b6e0dcf744c" --header "Drop-Event-Queue:" --header "X-Auth-Token:EmUSqjXGfnQwn5wn6CpzJRZgoazMTRbMNgH7CXwkQG7Ph7stex"
  {"date":"2020-12-20T19:35:04.769739","device":{"name":"BARCODE SCANNER BARCODE SCANNER","path":"/dev/input/event3","vendorId":65535,"productId":53},"barcode":"D-t38409355843o52230Lm54784"}
  {"date":"2020-12-20T19:35:06.237408","device":{"name":"BARCODE SCANNER BARCODE SCANNER","path":"/dev/input/event3","vendorId":65535,"productId":53},"barcode":"4250168519463"}
  ```



  When configured, you can let **barcode-scanner** issue a HTTP request (defaults to `POST`) when a
  barcode is scanned, which provides the ability to push barcode events to a server that is unaware
  of any client. The body of the request will contain the same JSON as in the websocket API example.

  To do this simply add the following section to your config:

  ```yaml
  barcode_server:
    [ ... ]
    http:
      url: "https://my.domain.com/barcode"
  ```

  Have a look at the [example config](barcode_server.yaml) for more options.



  When configured, you can let **barcode-scanner** publish barcode events to a MQTT broker.
  The payload of the message will contain the same JSON as in the websocket API example.

  To do this simply add the following section to your config:

  ```yaml
  barcode_server:
    [ ... ]
    mqtt:
      host: "my.mqtt.broker"
  ```

  Have a look at the [example config](barcode_server.yaml) for more options.



  **barcode-server** exposes a prometheus exporter (defaults to port `8000`) to give some statistical insight.
  A brief overview of (most) available metrics:

  | Name                                | Type    | Description                                     |
  |-------------------------------------|---------|-------------------------------------------------|
  | websocket_client_count              | Gauge   | Number of currently connected websocket clients |
  | devices_count                       | Gauge   | Number of currently detected devices            |
  | scan_count                          | Gauge   | Number of times a scan has been detected        |
  | device_detection_processing_seconds | Summary | Time spent detecting devices                    |
  | rest_endpoint_processing_seconds    | Summary | Time spent in a rest command handler            |
  | notifier_processing_seconds         | Summary | Time spent in a notifier                        |





  Yes. Most barcode readers normally work like a keyboard, resulting in their input being evaluated by
  the system, which can clutter up your TTY or other open programs.
  **barcode-server** will try to _grab_ input devices, making it the sole recipient of all
  incoming input events from those devices, which should prevent the device from cluttering
  your TTY.

  If, for some reason, this does not work for you, try this:

  Create a file `/etc/udev/rules.d/10-barcode.rules`:

  ```
  SUBSYSTEM=="input", ACTION=="add", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", RUN+="/bin/sh -c 'echo remove > /sys$env{DEVPATH}/uevent'"
  SUBSYSTEM=="input", ACTION=="add", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", DEVPATH=="*:1.0/*", KERNEL=="event*", RUN+="/bin/sh -c 'ln -sf /dev/input/$kernel /dev/input/barcode_scanner'"
  ```

  Replace the `idVendor` and `idProduct` values with the values of your barcode reader (a 4 digit hex value with leading
  zeros).
  You can find them in the log output of **barcode-reader** or using `lsusb` with the wireless receiver attached to your
  computer.

  Reload udev rules using:

  ```
  udevadm control --reload
  ```

  then remove and reinsert the wireless receiver.
  You should now have a symlink in `/dev/input/barcode_scanner`:

  ```
  ls -lha /dev/input/barcode_scanner
  ```

  which can be used in the `device_paths` section of the **barcode-server** config.

  Source: [This](https://serverfault.com/questions/385260/bind-usb-keyboard-exclusively-to-specific-application/976557#976557)
  and [That](https://stackoverflow.com/questions/63478999/how-to-make-linux-ignore-a-keyboard-while-keeping-it-available-for-my-program-to/63531743#63531743)



  GitHub is for social coding: if you want to write code, I encourage contributions
  through pull requests from forks of this repository. Create GitHub tickets for
  bugs and new features and comment on the ones that you are interested in.



  ```text
  barcode-server 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: af80ff83170bdbe87a64d2adaa7e15c40011fde3dd37e5075a1b7968d35d8d19
name: python-bardapi
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: The python package that returns Response of Google Bard through API.
url: https://github.com/dsdanielpark/Bard-API
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bardapi-1.0.0-1.src.rpm
checksum_type: sha256
description:
  Development Status :: 7 - Inactive

  <br>




  [NOTICE]




  A *unofficial* Python wrapper, [python-gemini-api](https://pypi.org/project/python-gemini-api/), operates through reverse-engineering, utilizing cookie values to interact with [Google Gemini](https://gemini.google.com) for users struggling with frequent authentication problems or unable to authenticate via [Google Authentication](https://developers.google.com/identity/protocols/oauth2?hl=en).

  - Gemini API GitHub: https://github.com/dsdanielpark/Gemini-API
  - PyPi: https://pypi.org/project/python-gemini-api/

  Collaborated competently with [Antonio Cheong](https://github.com/acheong08).



  ```bash
  pip install python-gemini-api
  ```
  ```bash
  pip install git+https://github.com/dsdanielpark/Gemini-API.git
  ```
  For the updated version, use as follows:
  ```
  pip install -q -U python-gemini-api
  ```
  <br><br><br>

  ***

  <br>
  Reflection on the Bard API Project https://github.com/dsdanielpark/Bard-API/issues/289
  <br>



  <p align="left">
  <a href="https://github.com/dsdanielpark/Bard-API"><img alt="PyPI package" src="https://img.shields.io/badge/pypi-BardAPI-black"></a>
  <!-- <a href="https://img.shields.io/pepy/dt/bardapi?logoColor=black"><img alt="Downloads" src="https://pepy.tech/badge/bardapi"></a> -->
  <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/%20downloads-379k-000000.svg"></a>
  <!-- <a><img alt="commit update" src="https://img.shields.io/github/last-commit/dsdanielpark/Bard-API?color=black"></a> -->
  <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
  <a href="https://github.com/dsdanielpark/Bard-API"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fdsdanielpark%2FBARD_API&count_bg=%23000000&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=BardAPI&edge_flat=false"/></a>
  <a href="https://github.com/dsdanielpark/Bard-API/stargazers"><img src="https://img.shields.io/github/stars/dsdanielpark/Bard-API?style=social"></a>
  <a href="https://pypi.org/project/bardapi/"><img alt="PyPI" src="https://img.shields.io/pypi/v/bardapi"></a>
  <!-- <a href="https://www.buymeacoffee.com/parkminwoo"><img src="https://cdn.buymeacoffee.com/buttons/v2/arial-orange.png" height="20px"></a> -->

  </p>


  > The python package that returns response of [Google Bard](https://gemini.google.com/) through value of cookie.

  ![](./assets/bard_api.gif)


  **Please exercise caution and use this package responsibly. This python package is _UNOFFICIAL_.**

  I referred to this github repository([github.com/acheong08/Bard](https://github.com/acheong08/Bard)) where inference process of Bard was reverse engineered. Using `__Secure-1PSID`, you can ask questions and get answers from Google Bard. Please note that the bardapi is not a free service, but rather a tool provided to assist developers with testing certain functionalities due to the delayed development and release of Google Bard's API. It has been designed with a lightweight structure that can easily adapt to the emergence of an official API. Therefore, I strongly discourage using it for any other purposes. If you have access to reliable official [PaLM-2 API](https://blog.google/technology/ai/google-palm-2-ai-large-language-model/) or [Google Generative AI API](https://github.com/GoogleCloudPlatform/generative-ai), replace the provided response with the corresponding official code. Check out https://github.com/dsdanielpark/Bard-API/issues/262.

  <br>

  - [Google Bard API](#google--bard-api)
    - [What is Google Bard?](#what-is-google-gemini)
    - [Install](#install)
    - [Authentication](#authentication)
    - [Usage](#usage)
    - [Further](#further)
      - [Behind a proxy](#behind-a-proxy)
      - [Use rotating proxies](#use-rotating-proxies)
      - [Reusable session object](#reusable-session-object)
      - [Auto Cookie Bard](#auto-cookie-bard)
      - [Bard `ask_about_image` method](#bard-ask_about_image-method)
      - [Text To Speech(TTS) from Bard](#text-to-speechtts-from-bard)
    - [More features](#more-features)
    - [Amazing Bard Prompts Is All You Need!](#amazing-bard-prompts-is-all-you-need)
    - [The Python package hf-transllm](#the-python-package-hf-transllm)
    - [What is Google ~~Bard~~ Gemini?](#what-is-google-gemini)
    - [Google PaLM](#google-palm)
    - [FAQ](#faq)




  <br>


  Bard is a conversational generative artificial intelligence chatbot developed by Google, based initially on the LaMDA family of LLMs(Large Language Models) and later the PaLM LLM. Please check official documents for [updates](https://gemini.google.com/updates) on Bard, including [available regions and languages](https://support.google.com/bard/answer/13575153?hl=en).



  ```
  $ pip install bardapi
  ```
  ```
  $ pip install git+https://github.com/dsdanielpark/Bard-API.git
  ```
  Due to certain dependency packages that are not compatible with 64bit windows(OS), we are releasing a lightweight alpha release of bard that only returns responses for simple requests. This release is a continuation of the pypi `0.1.18` version, which was maintained with lightweight and simple functionality. See [alpha-release github branch](https://github.com/dsdanielpark/Bard-API/tree/alpha-release) for more details.
  ```
  $ pip install bardapi==0.1.23a
  ```

  <br>


  > **Warning** Do not expose the `__Secure-1PSID`. For testing purposes only; avoid direct application use. Cookie values change periodically (every 15-20 minutes). Frequent session changes may briefly block access; headless mode is challenging. Rate limiting applies and changes often. If the cookie changes, log out of your Google account, close the browser, and enter the new cookie value. Or manually reset the cookie for a new value. See FAQ and issue pages for details.
  1. Visit https://gemini.google.com/
  2. F12 for console
  3. Session: Application → Cookies → Copy the value of  `__Secure-1PSID` cookie. Or try to use `SIDCC` as token.

  Note that while I referred to `__Secure-1PSID` or `SIDCC` value as an API key for convenience, it is not an officially provided API key.
  Cookie value subject to frequent changes. Verify the value again if an error occurs. Most errors occur when an invalid cookie value is entered.

  <br>

  If you need to set multiple cookie values:

  - [Multi-cookie Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#multi-cookie-bard) - After confirming that multiple cookie values are required to receive responses reliably in certain countries, I will deploy it for testing purposes. Please debug and create a pull request.


  <br>


  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1zzzlTIh0kt2MdjLzvXRby1rWbHzmog8t?usp=sharing)


  Simple Usage

  ```python
  from bardapi import Bard

  token = 'xxxxxxx'
  bard = Bard(token=token)
  bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
  ```
  Or you can use this
  ```python
  from bardapi import Bard
  import os
  os.environ['_BARD_API_KEY'] = "xxxxxxx"

  Bard().get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
  ```

  To get reponse dictionary
  ```python
  import bardapi


  token = 'xxxxxxx'


  input_text = "나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘"


  response = bardapi.core.Bard(token).get_answer(input_text)
  ```



  Addressing errors caused by delayed responses in environments like Google Colab and containers. If an error occurs despite following the proper procedure, utilize the timeout argument.
  ```python
  from bardapi import Bard
  import os
  os.environ['_BARD_API_KEY']="xxxxxxx"

  bard = Bard(timeout=30) # Set timeout in seconds
  bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
  ```

  <br>



  If you are working behind a proxy, use the following.
  ```python
  from bardapi import Bard



  proxies = {
      'http': 'http://proxy.example.com:8080',
      'https': 'https://proxy.example.com:8080'
  }

  bard = Bard(token='xxxxxxx', proxies=proxies, timeout=30)
  bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
  ```



  If you want to **avoid blocked requests** and bans, then use [Smart Proxy by Crawlbase](https://crawlbase.com/docs/smart-proxy/?utm_source=github_ad&utm_medium=social&utm_campaign=bard_api). It forwards your connection requests to a **randomly rotating IP address** in a pool of proxies before reaching the target website. The combination of AI and ML make it more effective to **avoid CAPTCHAs and blocks**.

  ```python
  from bardapi import Bard
  import requests


  proxy_url = "http://xxxxxxxxxxxxxx:@smartproxy.crawlbase.com:8012"
  proxies = {"http": proxy_url, "https": proxy_url}

  bard = Bard(token='xxxxxxx', proxies=proxies, timeout=30)
  bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
  ```



  You can continue the conversation using a reusable session. However, this feature is limited, and it is difficult for a package-level feature to perfectly maintain conversation_id and context. You can try to maintain the consistency of conversations same way as other LLM services, such as passing some sort of summary of past conversations to the DB.
  ```python
  from bardapi import Bard
  import requests


  token = 'xxxxxxx'

  session = requests.Session()
  session.headers = {
              "Host": "gemini.google.com",
              "X-Same-Domain": "1",
              "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
              "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
              "Origin": "https://gemini.google.com",
              "Referer": "https://gemini.google.com/",
          }

  session.cookies.set("__Secure-1PSID", token)

  bard = Bard(token=token, session=session, timeout=30)
  bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']


  bard.get_answer("What is my last prompt??")['content']
  ```

  <details>
  <summary>Async Bard Code (Click to expand)</summary>

  ```python
  from httpx import AsyncClient
  from bardapi import BardAsync
  import os



  token = 'xxxxxxx'  # Replace with your actual token

  SESSION_HEADERS = {
      "Host": "gemini.google.com",
      "X-Same-Domain": "1",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
      "Origin": "https://gemini.google.com",
      "Referer": "https://gemini.google.com/",
  }
  timeout = 30  # Example timeout
  proxies = {}  # Replace with your proxies if needed

  client = AsyncClient(
      http2=True,
      headers=SESSION_HEADERS,
      cookies={"__Secure-1PSID": token},
      timeout=timeout,
      proxies=proxies,
  )

  bard_async = BardAsync(token=token, client=client)


  async def get_bard_answer(question):
      await bard_async.async_setup()  # Ensure async setup is done
      return await bard_async.get_answer(question)

  response = await get_bard_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")
  print(response['content'])
  ```

  </details>



  Using [browser_cookie3](https://github.com/borisbabic/browser_cookie3) we extract the `__Secure-1PSID` cookie from all browsers, and then we can use the API without passing the token. However, there are still incomplete dependency packages and various variables, so please seek assistance in the following [GitHub Issues](https://github.com/borisbabic/browser_cookie3/issues) or adjust your browser's version.
  - Visit https://gemini.google.com/ in your browser and execute the following command while in the chat-enabled state. Refer to browser_cookie3 for details on how it works. If any issues arise, please restart the browser or log in to your Google account again.
  *Recommended to keep the browser open.*
  ```python
  from bardapi import Bard

  bard = Bard(token_from_browser=True)
  response = bard.get_answer("Do you like cookies?")
  print(response['content'])
  ```


  *It may not work as it is only available for certain accounts, regions, and other restrictions.*
  As an experimental feature, it is possible to ask questions with an image. However, this functionality is only available for accounts with image upload capability in Bard's web UI.

  ```python
  from bardapi import Bard

  bard = Bard(token='xxxxxxx')
  image = open('image.jpg', 'rb').read() # (jpeg, png, webp) are supported.
  bard_answer = bard.ask_about_image('What is in the image?', image)
  print(bard_answer['content'])
  ```


  Business users and high traffic volume may be subject to account restrictions according to Google's policies. Please use the [Official Google Cloud API](https://cloud.google.com/text-to-speech) for any other purpose.
  The user is solely responsible for all code, and it is imperative to consult Google's official services and policies. Furthermore, the code in this repository is provided under the MIT license, and it disclaims any liability, including explicit or implied legal responsibilities.
  ```python
  from bardapi import Bard

  bard = Bard(token='xxxxxxx')
  audio = bard.speech('Hello, I am Bard! How can I help you today?')
  with open("speech.ogg", "wb") as f:
    f.write(bytes(audio['audio']))
  ```

  <br>


  Starting from version `0.1.18`, the GitHub version of BardAPI will be synchronized with the PyPI version and released simultaneously. However, the version undergoing QA can still be used from the GitHub repository.<br>
  ```
  $ pip install git+https://github.com/dsdanielpark/Bard-API.git
  ```

  - [Multi-cookie Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#multi-cookie-bard)
  - [Auto Cookie Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#auto-cookie-bard)
  - [TTS from Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#text-to-speechtts)
  - [Multi-language Bard API](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#multi-language-bard-api)
  - [Get image links](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#get-image-links)
  - [ChatBard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#chatbard)
  - [Export Conversation](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#export-conversation)
  - [Export Code to Repl.it](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#export-code-to-replit)
  - [Executing Python code received as a response from Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#chatbard)
  - [Using Bard Asynchronously](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#using-bard-asynchronously)
  - [Bard Cookies](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#bard-which-can-get-cookies)
  - [Fix Coversation ID (Fix Context)](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#fix-conversation-id-fix-context)
  - [Max_token, Max_sentences](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#max_token-max_sentence)
  - [Translation to another programming language](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#translation-to-another-programming-language)


  <br>




  - Helpful prompts for Google Bard

  <br>


  If you want to comfortably use the open-source LLM models in your native language, which are `released under the Apache License (allowing free commercial use)` in `various languages`, you can try using the [hf-transllm](https://github.com/dsdanielpark/hf-transllm) package. hf-transllm also supports multilingual inference for various LLMs stored in hugging face repository.


  <details>
  <summary>In case the Google package is no longer available due to policy restrictions, here's a simple example code for using open-source language models (LLMs) in both English and multiple languages.</summary>

  <br>


  For the decoder models provided by Hugging Face, you can easily use them by either following a simple approach or overriding the inference method. You can explore various open-source language models at [this link](https://huggingface.co/models). Through the ranking information from [Open LLM Leader Board Report repository](https://github.com/dsdanielpark/Open-LLM-Leaderboard-Report), you can find information about good models.


  ```python
  from transllm import LLMtranslator

  open_llama3b_kor = LLMtranslator('openlm-research/open_llama_3b', target_lang='ko', translator='google') # Korean

  trnaslated_answer = open_llama3b_kor.generate("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")
  print(trnaslated_answer)
  ```


  Refer https://github.com/openlm-research/open_llama or using like this:
  ```python
  from transllm import LLMtranslator

  open_llama3b = LLMtranslator('openlm-research/open_llama_3b)

  answer = open_llama3b.generate("Tell me about the Korean girl group Newjeans.")
  print(answer)
  ```

  </details>

  <br>


  [Gemini](https://deepmind.google/technologies/gemini/#introduction) or formerly knowns as Bard is an advanced, multimodal AI model by [Google DeepMind](https://deepmind.google/), capable of understanding and integrating various information types like text, code, audio, images, and video.

  - Paper: https://storage.googleapis.com/deepmind-media/gemini/gemini_1_report.pdf
  - Web: https://blog.google/technology/ai/google-gemini-ai/#capabilities
  - Code Guide: https://ai.google.dev/tutorials/python_quickstart
  - Official API On [Google AI Studio](https://makersuite.google.com/app/apikey).


  Google AI Studio creates a new Google Cloud project for each new API key. You also can create an API key in an existing Google Cloud project. All projects are subject to the [Google Cloud Platform Terms of Service](https://cloud.google.com/terms).
  - Web: https://makersuite.google.com/app/apikey
  - Note: The Gemini API is currently in public preview. Production applications are not supported yet.


  The Bard API, sourcing responses from [Google ~~Bard~~Gemini's official website](https://gemini.google.com/chat), allows you to receive the same responses as the website. So, if Gemini answers are available on the web, you can also accessed Gemini through the Bard API. However, it's important to note that responses might also come from other models, not exclusively Gemini Pro or Ultra.
  - There is no official Bard API or early access/waiting list for Gemini, although the [PaLM2 API](https://github.com/dsdanielpark/Bard-API#google-palm-api) is available.
    - Google's PaLM2 API differs from Bard, with some aspects of Bard being superior.
    - It's speculated that after expert review, Bard Advanced lineup will likely provide an official API in 2024.
  - Gemini and previous generative AI model responses are provided randomly on Bard Web.
  - The Bard API, with its imperfect extension features(e.g, `ask_about_image`), occasionally demonstrates Gemini's capabilities. This behavior may vary by region, language, or Google account.
  - More information in the [FAQ](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_FAQ.md).

  For more on Gemini:
  - [Official API](https://makersuite.google.com/app/apikey)
  - [Introducing Gemini: our largest and most capable AI model](https://blog.google/technology/ai/google-gemini-ai/)
  - [How it's made: multimodal prompting](https://developers.googleblog.com/2023/12/how-its-made-gemini-multimodal-prompting.html)
  - [YouTube Demo](https://www.youtube.com/watch?v=UIZAiXYceBI)

  <br>




  Try demo at https://makersuite.google.com/app/prompts/new_text.
  ```
  who are you?
  >> I am powered by PaLM 2, which stands for Pathways Language Model 2, a large language model from Google AI.
  ```

  Google Generative AI
  - Official Page: https://blog.google/technology/ai/google-palm-2-ai-large-language-model/
  - GitHub: https://github.com/GoogleCloudPlatform/generative-ai
  - Try Demo: https://makersuite.google.com/app/prompts/new_text.
  - Official Library: https://makersuite.google.com/app/library
  - Get API Key: https://makersuite.google.com/app/apikey
  - Quick Start Tutorial: https://developers.generativeai.google/tutorials/text_quickstart


  ```
  $ pip install -q google-generativeai
  ```

  ```python
  import pprint
  import google.generativeai as palm

  palm.configure(api_key='YOUR_API_KEY')

  models = [m for m in palm.list_models() if 'generateText' in m.supported_generation_methods]
  model = models[0].name
  print(model)

  prompt = "Who are you?"

  completion = palm.generate_text(
      model=model,
      prompt=prompt,
      temperature=0,
      
      max_output_tokens=800,
  )
  print(completion.result)
  ```

  <br>

  <br>



  <a href="https://crawlbase.com/?utm_source=github_ad&utm_medium=social&utm_campaign=bard_api"><img src="./assets/sponsor_ad.png"></a>

  **Use data scraping to train your AI models.**

  - Easy to use **API to crawl and scrape** millions of websites
  - Use crawlbase for efficient [data extraction](https://crawlbase.com/generative-ai-data?utm_source=github_ad&utm_medium=social&utm_campaign=bard_api) for your **LLMs**
  - Average **success rate: 98%**
  - Uptime guarantee: **99.9%**
  - [Simple docs](https://crawlbase.com/docs?utm_source=github_ad&utm_medium=social&utm_campaign=bard_api) to get started in minutes
  - **Asynchronous** Crawling **API** if you need massive amounts of data
  - **GDPR** and **CCPA** compliant

  Used by **70k+** developers.



  Please check the FAQ and open issues for similar questions before creating a new issue. Repeated questions will be kept as open issues. Too many requests can trigger a temporary account block (HTTP 429). Maintain proper intervals, using functions like sleep to avoid rate limits. Policies may vary by country and language, so all users could face temporary or permanent errors via the API.


  In the scripts [folder](./scripts/), I have released a script to help you compare [OpenAI-ChatGPT](./scripts/openai_api.ipynb), [Microsoft-EdgeGPT](./scripts/microsoft_api.ipynb) and [Google-Bard](./scripts/google_api.ipynb). I hope they will help more developers.


  We would like to express our sincere gratitude to all the contributors.

  <a href="https://github.com/dsdanielpark/Bard_API/graphs/contributors">
    <img src="https://contrib.rocks/image?repo=dsdanielpark/Bard_API" />
  </a>


  <br>


  [MIT](https://opensource.org/license/mit/) <br>
  We hold no legal responsibility; for more information, please refer to the bottom of the readme file. We just want you to give me and [them](https://github.com/acheong08/Bard) a star. This project is a personal initiative and is not affiliated with or endorsed by Google. It is recommended to use Google's official API.
  ```
  The MIT License (MIT)

  Copyright (c) 2023 Minwoo Park

  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.
  ```


  Bard's service status and Google's API interfaces are in constant flux. *The number of replies is currently limited, but certain users,* such as those utilizing VPNs or proxy servers, have reported slightly higher message caps. Adaptability is crucial in navigating these dynamic service policies. Please note that the cookie values used in this package are not official API values.


  Sincerely grateful for any reports on new features or bugs. Your valuable feedback on the code is highly appreciated.


  - Core maintainer:
    - [Antonio Cheong](https://github.com/acheong08) / teapotv8@proton.me <br>
    - [Daniel Park](https://github.com/DSDanielPark) / parkminwoo1991@gmail.com


  [1] https://github.com/acheong08/Bard <br>

  > **Warning** Important Notice
    The user assumes all legal responsibilities associated with using the BardAPI package. This Python package merely facilitates easy access to Google Bard for developers. Users are solely responsible for managing data and using the package appropriately. For further information, please consult the Google Bard Official Document.

  > **Warning** Caution
  This Python package is not an official Google package or API service. It is not affiliated with Google and uses Google account cookies, which means that excessive or commercial usage may result in restrictions on your Google account. The package was created to support developers in testing functionalities due to delays in the official Google package. However, it should not be misused or abused. Please be cautious and refer to the Readme for more information.

  <br><br>

  *Copyright (c) 2023 MinWoo Park, South Korea*<br>


pkgId: 8f604b9b29df84b6205d64cf753cafdbdac9efaacd34d6d16bcfc8275533fa8c
name: python-bardolph
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Simple scripting language for LIFX lights
url: https://www.bardolph.org
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bardolph-0.2.0-1.src.rpm
checksum_type: sha256
description:
  ![logo](https://www.bardolph.org/logo.png)
  https://www.bardolph.org



  Al Fontes - [bardolph@fontes.org](mailto:bardolph@fontes.org)

  **Bardolph** is a facility for controlling LIFX (https://www.lifx.com) lights
  through a simple scripting language. It is targeted at people who would like
  to control or experiment with their lights in an automated way, using a minimal
  amount of coding.

  Using their names, you can control individual lights, groups or locations. Or,
  just pick a color for all the lights on your network. If you have any multi-zone
  lights, the language allows you to set colors for specific zones.

  The program does not use the Internet to access the bulbs, and no login is
  required; all of its  communication occurs over the local WiFi network. You
  can edit scripts with a basic text editor and run them from the command line.

  The language may be missing some constructs you might expect, such as loops and
  arithmetic expressons, as it's still under development. However, it is also
  very simple, and should be usable by non-programmers.


  Here is a script, named `all_on.ls`, that will turn on all your lights:
  ```
  duration 1.5 on all
  ```
  You run it with:
  ```
  lsrun all_on.ls
  ```
  In this case, `lsrun` is a bash shell script that become available after you
  install Bardolph.

  The `duration` parameter says to slowly shut off the
  lights over a period of 1.5 seconds, which is a much nicer experience than
  abruptly turning them off with no dimming.

  Another example, `red.ls`, sets all the lights to a deep shade of red:
  ```
  duration 1.5 hue 350 saturation 80 brightness 80 kelvin 2700
  set all
  ```
  To run it:
  ```
  lsrun red.ls
  ```
  The application executes in the foreground as long as a script is running. In this
  example, the application will run for 5 minutes.

  As a convenience, you can pass a script as a command-line parameter using
  `lsrun -s`, followed by the script code in a quoted string. For example, to
  turn off all the lights from the keyboard:

  ```
  lsrun -s 'off all'
  ```


  ![web screenshot](https://www.bardolph.org/web_mobile.png)

  The web server component makes scripts available in a user-friendly manner.
  It implements a simple web page that lists available scripts and provides a
  1:1 mapping betwen scripts and URL's. The server is designed to run locally,
  on your WiFi network.

  For example, if have a machine with the hostname
  `myserver.local`, you could launch the  `all_on.ls` script by going to
  `http://myserver.local/all-on` with any browser on your WiFi network.
  Because scripts can run over a long period of time, even indefinitely,
  a cheap, dedicated device like a Raspberry Pi is an ideal way to host the
  web server.


  I've attempted to make it easy to use Bardolph scripts in your Python code.
  For some uses, this may be significantly easier than learning and using a
  full-purpose Python library. For example, here's a complete program that
  waits 5 seconds, turns all the lights off, and turns them on again after
  another 5 seconds:

  ```
  from bardolph.controller import ls_module

  ls_module.configure()
  ls_module.queue_script('time 5 off all on all')
  ```


  The program has been tested on Python versions at or above 3.7.

  Because I haven't done any stress testing, I don't know the limits on
  script size. Note that the application loads the encoded script into memory
  before executing it.

  I've tested the program on MacOS Monterey 12.0.1, a Raspberry Pi Zero W
  controlling 6 devices, a Raspberry Pi 3 and Raspberry Pi 4.


  For full documentation and download options, please see
  [the main website](http://www.bardolph.org).

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 2019 Alfred Fontes Jr.  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


pkgId: a452aa3f9522a0a38831f04488e7ab26f096fc2a6a0145c6e7a6eaafa1966fa7
name: python-bare-script
arch: src
version: 3.0.16
epoch: 0
release: 1
summary: bare-script
url: https://github.com/craigahobbs/bare-script
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bare-script-3.0.16-1.src.rpm
checksum_type: sha256
description:
  [![PyPI - Status](https://img.shields.io/pypi/status/bare-script)](https://pypi.org/project/bare-script/)
  [![PyPI](https://img.shields.io/pypi/v/bare-script)](https://pypi.org/project/bare-script/)
  [![GitHub](https://img.shields.io/github/license/craigahobbs/bare-script-py)](https://github.com/craigahobbs/bare-script-py/blob/main/LICENSE)
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/bare-script)](https://pypi.org/project/bare-script/)

  [BareScript](https://craigahobbs.github.io/bare-script/language/)
  is a simple, lightweight, and portable programming language. Its Pythonic syntax is influenced by
  JavaScript, C, and the Unix Shell. BareScript also has a library of built-in functions for common
  programming operations. BareScript can be embedded within applications or used as a stand-alone
  programming language using the command-line interface.

  There are two implementations of BareScript:
  [BareScript for Python](https://github.com/craigahobbs/bare-script-py#readme)
  (this package) and
  [BareScript for JavaScript](https://github.com/craigahobbs/bare-script#readme).
  Both implementations have 100% unit test coverage with identical unit test suites, so you can be
  confident that BareScript will execute the same regardless of the underlying runtime environment.




  - [The BareScript Language](https://craigahobbs.github.io/bare-script/language/)
  - [The BareScript Library](https://craigahobbs.github.io/bare-script-py/library/)
  - [The BareScript Expression Library](https://craigahobbs.github.io/bare-script-py/library/expression.html)
  - [API Documentation](https://craigahobbs.github.io/bare-script-py/)
  - [Source code](https://github.com/craigahobbs/bare-script-py)




  To execute a BareScript script, parse the script using the
  [parse_script](https://craigahobbs.github.io/bare-script-py/scripts.html#parse-script)
  function. Then execute the script using the
  [execute_script](https://craigahobbs.github.io/bare-script-py/scripts.html#execute-script)
  function. For example:

  ~~~ python
  from bare_script import execute_script, parse_script


  script = parse_script('''\

  function double(n):
      return n * 2
  endfunction

  return N + ' times 2 is ' + double(N)
  ''')


  globals = {'N': 10}
  print(execute_script(script, {'globals': globals}))
  ~~~

  This outputs:

  ~~~
  10 times 2 is 20
  ~~~




  [The BareScript Library](https://craigahobbs.github.io/bare-script-py/library/)
  includes a set of built-in functions for mathematical operations, object manipulation, array
  manipulation, regular expressions, HTTP fetch and more. The following example demonstrates the use
  of the
  [systemFetch](https://craigahobbs.github.io/bare-script-py/library/#var.vGroup='System'&systemfetch),
  [objectGet](https://craigahobbs.github.io/bare-script-py/library/#var.vGroup='Object'&objectget), and
  [arrayLength](https://craigahobbs.github.io/bare-script-py/library/#var.vGroup='Array'&arraylength)
  functions.

  ~~~ python
  import urllib.request

  from bare_script import execute_script, fetch_http, parse_script


  script = parse_script('''\

  docs = jsonParse(systemFetch('https://craigahobbs.github.io/bare-script-py/library/library.json'))


  return 'The BareScript Library has ' + arrayLength(objectGet(docs, 'functions')) + ' functions'
  ''')


  print(execute_script(script, {'fetchFn': fetch_http}))
  ~~~

  This outputs:

  ~~~
  The BareScript Library has 105 functions
  ~~~




  To evaluate a
  [BareScript expression](https://craigahobbs.github.io/bare-script/language/#expressions),
  parse the expression using the
  [parse_expression](https://craigahobbs.github.io/bare-script-py/expressions.html#parse-expression)
  function. Then evaluate the expression using the
  [evaluate_expression](https://craigahobbs.github.io/bare-script-py/expressions.html#evaluate-expression)
  function.

  Expression evaluation includes the
  [BareScript Expression Library](https://craigahobbs.github.io/bare-script-py/library/expression.html),
  a set of built-in, spreadsheet-like functions.

  For example:

  ~~~ python
  from bare_script import evaluate_expression, parse_expression


  expr = parse_expression('2 * max(a, b, c)')


  variables = {'a': 1, 'b': 2, 'c': 3}
  print(evaluate_expression(expr, None, variables))
  ~~~

  This outputs:

  ~~~
  6
  ~~~




  You can run BareScript from the command line using the BareScript CLI, "bare". BareScript script
  files use the ".bare" file extension.

  ~~~
  bare script.bare
  ~~~

  **Note:** In the BareScript CLI, import statements and the
  [systemFetch](https://craigahobbs.github.io/bare-script-py/library/#var.vGroup='System'&systemfetch)
  function read non-URL paths from the local file system.
  [systemFetch](https://craigahobbs.github.io/bare-script-py/library/#var.vGroup='System'&systemfetch)
  calls with a non-URL path and a
  [request body](https://craigahobbs.github.io/bare-script-py/library/model.html#var.vName='SystemFetchRequest')
  write the body to the path.




  [MarkdownUp](https://craigahobbs.github.io/markdown-up/)
  is a Markdown Viewer that executes BareScript embedded within Markdown documents.
  MarkdownUp includes the
  [MarkdownUp Library](https://craigahobbs.github.io/markdown-up/library/),
  which extends the
  [BareScript Library](https://craigahobbs.github.io/bare-script-py/library/)
  with functions for dynamically rendering Markdown text, drawing SVG images, etc.

  For example:

  ```


  This is a Markdown document with embedded BareScript:

  ~~~ markdown-script
  markdownPrint('Hello, Markdown!')
  ~~~
  ```




  This package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).
  It was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:

  ~~~
  template-specialize python-template/template/ bare-script-py/ -k package bare-script -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs'
  ~~~


pkgId: 17dd17f4adca1fa89a879cf7fa8a8f243e455ffd4d92b99749ba2ac126ca022a
name: python-bareasgi
arch: src
version: 4.4.1
epoch: 0
release: 1
summary: A lightweight ASGI framework
url: https://github.com/rob-blackbourn/bareasgi
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bareasgi-4.4.1-1.src.rpm
checksum_type: sha256
description:
  A lightweight Python [ASGI](user-guide/asgi) web server framework
  (read the [docs](https://rob-blackbourn.github.io/bareASGI/)).



  This is a _bare_ ASGI web server framework. The goal is to provide
  a minimal implementation, with other facilities (serving static files, CORS,
  sessions, etc.) being implemented by optional packages.

  The framework is targeted at micro-services which require a light footprint
  (in a container for example), or as a base for larger frameworks.

  Python 3.8+ is required.



  - [bareASGI-cors](https://github.com/rob-blackbourn/bareASGI-cors) for cross origin resource sharing,
  - [bareASGI-static](https://github.com/rob-blackbourn/bareASGI-static) for serving static files,
  - [bareASGI-jinja2](https://github.com/rob-blackbourn/bareASGI-jinja2) for [Jinja2](https://github.com/pallets/jinja) template rendering,
  - [bareASGI-graphql-next](https://github.com/rob-blackbourn/bareASGI-graphql-next) for [GraphQL](https://github.com/graphql-python/graphql-core) and [graphene](https://github.com/graphql-python/graphene),
  - [bareASGI-rest](https://github.com/rob-blackbourn/bareASGI-rest) for REST support,
  - [bareASGI-prometheus](https://github.com/rob-blackbourn/bareASGI-prometheus) for [prometheus](https://prometheus.io/) metrics,
  - [bareASGI-session](https://github.com/rob-blackbourn/bareASGI-session) for sessions.



  The framework provides the basic functionality required for developing a web
  application, including:

  - Http,
  - WebSockets,
  - Routing,
  - Lifecycle,
  - Middleware



  Here is a simple server with a request handler that returns some text.

  ```python
  import uvicorn
  from bareasgi import Application, HttpRequest, HttpResponse, text_writer

  async def example_handler(request: HttpRequest) -> HttpResponse:
      return HttpResponse(
          200,
          [(b'content-type', b'text/plain')],
          text_writer('This is not a test')
      )

  app = Application()
  app.http_router.add({'GET'}, '/', example_handler)

  uvicorn.run(app, port=9009)
  ```


pkgId: 843238cb4285a2b94102cda268bb508c5f96c475061833fa6d9ec3392e20d5c9
name: python-bareclient
arch: src
version: 5.0.1
epoch: 0
release: 1
summary: A lightweight asyncio HTTP client
url: https://github.com/rob-blackbourn/bareClient
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bareclient-5.0.1-1.src.rpm
checksum_type: sha256
description:
  An asyncio HTTP Python client package supporting HTTP versions 1.0, 1.1
  and 2 (read the [docs](https://rob-blackbourn.github.io/bareClient/)).

  This is the client companion to the ASGI server side web framework
  [bareASGI](https://github.com/rob-blackbourn/bareASGI) and follows the same
  "bare" approach. It provides only the essential functionality and makes little
  attempt to provide any helpful features which might do unnecessary work.

  This package is suitable for:

  - A foundation for async HTTP/2 clients,
  - Async REST client API's,
  - Containers requiring a small image size,
  - Integration with ASGI web servers requiring async HTTP client access.



  The client has the following notable features:

  - Lightweight
  - Uses asyncio
  - Supports HTTP versions 1.0, 1.1, 2
  - Supports middleware



  The package can be installed with pip.

  ```bash
  pip install bareclient
  ```

  This is a Python3.7 and later package.

  It has dependencies on:

  - [bareUtils](https://github.com/rob-blackbourn/bareUtils)
  - [h11](https://github.com/python-hyper/h11)
  - [h2](https://github.com/python-hyper/hyper-h2)



  The basic usage is to create an `HttpClient`.

  ```python
  import asyncio
  from typing import List, Optional
  from bareclient import HttpClient

  async def main(url: str) -> None:
      async with HttpClient(url) as response:
          if response.ok and response.more_body:
              async for part in response.body:
                  print(part)

  asyncio.run(main('https://docs.python.org/3/library/cgi.html'))
  ```


pkgId: c1bc3787232ee2a1d0cf763b2989c37ec92b2619a964472c44203add58a57080
name: python-bareos-restapi
arch: src
version: 23.1.0
epoch: 0
release: 1
summary: REST API for Bareos console access.
url: https://github.com/bareos/bareos/
rpm_license: AGPLv3
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bareos-restapi-23.1.0-1.src.rpm
checksum_type: sha256
description:
  Experimental and subject to enhancements and changes.

  This is an experimental backend for development purposes.

  It provides a REST API using fastapi and python-bareos to connect to
  a Bareos director.

  * https://fastapi.tiangolo.com/
  * https://www.openapis.org/





  We recommend to create a dedicated Python environment for the installation in an own directory:

  ```
  python3 -m venv env

  source env/bin/activate

  pip install bareos-restapi
  ```

  Note: The optional module _sslpsk_ can be installed manually, if you want encrypted communication between the API and the Bareos director.



  The module directory contains a sample ini-file. Change into this directory (something like */lib/python3.x/site-packages/bareosRestapiModels* on most operating systems) and copy _api.ini.sample_ to _api.ini_ and adapt it to your director. Make sure to generate an own secret-key for the _JWT_ section.

  Your director configuration in _api.ini_ should look like:
  ```
  [Director]
  Name=bareos-dir
  Address=127.0.0.1
  Port=9101
  ```

  Note: you will need a *named console* (user/password) to acces the Bareos director using this API. Read more about Consoles here:
  https://docs.bareos.org/Configuration/Director.html#console-resource




  From inside the module directory run:

  ```
  uvicorn bareos-restapi:app --reload
  ```

  * Serve the Swagger UI to explore the REST API: http://127.0.0.1:8000/docs
  * Alternatively you can use the redoc format: http://127.0.0.1:8000/redoc



  The Swagger UI contains documentation and online-tests. Use "authorize" to connect to your Bareos director using a named console. Read here to learn how to configure
  a named console: https://docs.bareos.org/Configuration/Director.html#console-resource

  The Swagger documentation also contains CURL statements for all available endpoints.



  The API will be extended by some methods provided by the Bareos console, that are not yet implemented. It is also planned to add delete / update options for configuration in the director and REST API. If you are interested in support and / or funding enhancements, please visit https://www.bareos.com

  TODO:
  - define and document response model
  - add possibility to connect to a choice of directors
  - add start-script with ini-file name as parameter


pkgId: 8a16a6df0e25ee7d48872596b519a81e1eb113c74cfbdae90a6282feb8b25443
name: python-baretypes
arch: src
version: 3.6.4
epoch: 0
release: 1
summary: Types for bareASGI and bareClient
url: https://github.com/rob-blackbourn/bareTypes
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-baretypes-3.6.4-1.src.rpm
checksum_type: sha256
description:
  Types for [bareASGI](https://github.com/rob-blackbourn/bareASGI)
  and [bareClient](https://github.com/rob-blackbourn/bareClient)
  (read the [docs](https://rob-blackbourn.github.io/bareTypes/)).



  The package can be installed with pip.

  ```bash
  pip install baretypes
  ```

  This is a Python 3.7 and later package with no dependencies.


pkgId: ac29b075342d5d80f34158fb4ee0f6ecc58c73f1b2339e14fe5c26e25000b331
name: python-bareunpy
arch: src
version: 1.6.4
epoch: 0
release: 1
summary: The bareun python library using grpc
url: https://bareun.ai/
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bareunpy-1.6.4-1.src.rpm
checksum_type: sha256
description:
  `bareunpy` is the python 3 library for bareun.

  Bareun is a Korean NLP,
  which provides tokenizing, POS tagging for Korean.



  ```shell
  pip3 install bareunpy
  ```


  - Go to https://bareun.ai/.
    - With registration, for the first time, you can get a API-KEY to use it freely.
    - With API-KEY, you can install the `bareun1` server.
    - Or you can make a call to use this `bareunpy` library to any servers.
  - Or use docker image. See https://hub.docker.com/r/bareunai/bareun
  ```shell
  docker pull bareunai/bareun:latest
  ```



  ```python
  import sys
  import google.protobuf.text_format as tf
  from bareunpy import Tagger




  API_KEY = "koba-ABCDEFG-1234567-LMNOPQR-7654321" # <- 본인의 API KEY로 교체(Replace this with your own API KEY)


  my_tagger = Tagger(API_KEY, 'localhost')

  my_tagger = Tagger(API_KEY, '10.8.3.211', 15656)



  res = tagger.tags(["안녕하세요.", "반가워요!"])


  m = res.msg()
  tf.PrintMessage(m, out=sys.stdout, as_utf8=True)
  print(tf.MessageToString(m, as_utf8=True))
  print(f'length of sentences is {len(m.sentences)}')

  print(f'length of tokens in sentences[0] is {len(m.sentences[0].tokens)}')
  print(f'length of morphemes of first token in sentences[0] is {len(m.sentences[0].tokens[0].morphemes)}')
  print(f'lemma of first token in sentences[0] is {m.sentences[0].tokens[0].lemma}')
  print(f'first morph of first token in sentences[0] is {m.sentences[0].tokens[0].morphemes[0]}')
  print(f'tag of first morph of first token in sentences[0] is {m.sentences[0].tokens[0].morphemes[0].tag}')


  for sent in m.sentences:
      for token in sent.tokens:
          for m in token.morphemes:
              print(f'{m.text.content}/{m.tag}:{m.probability}:{m.out_of_vocab})


  jo = res.as_json()
  print(jo)


  pa = res.pos()
  print(pa)

  ma = res.morphs()
  print(ma)
  na = res.nouns()
  print(na)
  va = res.verbs()
  print(va)


  cust_dic = tagger.custom_dict("my")
  cust_dic.copy_np_set({'내고유명사', '우리집고유명사'})
  cust_dic.copy_cp_set({'코로나19'})
  cust_dic.copy_cp_caret_set({'코로나^백신', '"독감^백신'})
  cust_dic.update()


  cust_dict2 = tagger.custom_dict("my")
  cust_dict2.load()

  tagger.set_domain('my')
  tagger.pos('코로나19는 언제 끝날까요?')
  ```




  ```python
  import sys
  import google.protobuf.text_format as tf
  from bareunpy import Tokenizer




  API_KEY = "koba-ABCDEFG-1234567-LMNOPQR-7654321" # <- 본인의 API KEY로 교체(Replace this with your own API KEY)


  my_tokenizer = Tokenizer(API_KEY, 'localhost')

  my_tokenizer = Tagger(API_KEY, '10.8.3.211', 15656)



  tokenized = tokenizer.tokenize_list(["안녕하세요.", "반가워요!"])


  m = tokenized.msg()
  tf.PrintMessage(m, out=sys.stdout, as_utf8=True)
  print(tf.MessageToString(m, as_utf8=True))
  print(f'length of sentences is {len(m.sentences)}')

  print(f'length of tokens in sentences[0] is {len(m.sentences[0].tokens)}')
  print(f'length of segments of first token in sentences[0] is {len(m.sentences[0].tokens[0].segments)}')
  print(f'tagged of first token in sentences[0] is {m.sentences[0].tokens[0].tagged}')
  print(f'first segment of first token in sentences[0] is {m.sentences[0].tokens[0].segments[0]}')
  print(f'hint of first morph of first token in sentences[0] is {m.sentences[0].tokens[0].segments[0].hint}')


  for sent in m.sentences:
      for token in sent.tokens:
          for m in token.segments:
              print(f'{m.text.content}/{m.hint})


  jo = tokenized.as_json()
  print(jo)


  ss = tokenized.segments()
  print(ss)
  ns = tokenized.nouns()
  print(ns)
  vs = tokenized.verbs()
  print(vs)

  ps = tokenized.postpositions()
  print(ps)

  ass = tokenized.adverbs()
  print(ass)
  ss = tokenized.symbols()
  print(ss)

  ```


pkgId: 9ce30deaea73d37a6a426ef1bef18a501af7ba14c1601f8c4b4e29f58455958d
name: python-bareutils
arch: src
version: 4.0.2
epoch: 0
release: 1
summary: Utilities for bareASGI and bareClient
url: https://github.com/rob-blackbourn/bareutils
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bareutils-4.0.2-1.src.rpm
checksum_type: sha256
description:
  Utilities for [bareASGI](https://github.com/rob-blackbourn/bareASGI)
  and [bareClient](https://github.com/rob-blackbourn/bareClient)
  (read the [docs](https://rob-blackbourn.github.io/bareUtils/)).



  The package can be installed with pip.

  ```bash
  pip install bareutils
  ```

  This is a Python3.7 and later package.


pkgId: a89c40cbc464d0a3ee4fefe6e7cb3176189b351d2aaaf3616a4d77d6421a95af
name: python-bark
arch: src
version: 0.1.5
epoch: 0
release: 1
summary: Bark text to audio model
url: https://pypi.org/project/bark/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bark-0.1.5-1.src.rpm
checksum_type: sha256
description:
  [![](https://dcbadge.vercel.app/api/server/J2B2vsjKuE?style=flat&compact=True)](https://discord.gg/J2B2vsjKuE)
  [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/OnusFM.svg?style=social&label=@OnusFM)](https://twitter.com/OnusFM)
  <a href="http://www.repostatus.org/#active"><img src="http://www.repostatus.org/badges/latest/active.svg" /></a>

  [Examples](https://suno-ai.notion.site/Bark-Examples-5edae8b02a604b54a42244ba45ebc2e2) • [Suno Studio Waitlist](https://3os84zs17th.typeform.com/suno-studio) • [Updates](#-updates) • [How to Use](#-usage-in-python) • [Installation](#-installation) • [FAQ](#-faq)

  [//]: <br> (vertical spaces around image)
  <br>
  <p align="center">
  <img src="https://user-images.githubusercontent.com/5068315/235310676-a4b3b511-90ec-4edf-8153-7ccf14905d73.png" width="500"></img>
  </p>
  <br>

  Bark is a transformer-based text-to-audio model created by [Suno](https://suno.ai). Bark can generate highly realistic, multilingual speech as well as other audio - including music, background noise and simple sound effects. The model can also produce nonverbal communications like laughing, sighing and crying. To support the research community, we are providing access to pretrained model checkpoints, which are ready for inference and available for commercial use.


  Bark was developed for research purposes. It is not a conventional text-to-speech model but instead a fully generative text-to-audio model, which can deviate in unexpected ways from provided prompts. Suno does not take responsibility for any output generated. Use at your own risk, and please act responsibly.



  [![Open in Spaces](https://img.shields.io/badge/🤗-Open%20in%20Spaces-blue.svg)](https://huggingface.co/spaces/suno/bark)
  [![Open on Replicate](https://img.shields.io/badge/®️-Open%20on%20Replicate-blue.svg)](https://replicate.com/suno-ai/bark)
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1eJfA2XUa-mXwdMy7DoYKVYHI1iTd9Vkt?usp=sharing)



  **2023.05.01**
  - ©️ Bark is now licensed under the MIT License, meaning it's now available for commercial use!
  - ⚡ 2x speed-up on GPU. 10x speed-up on CPU. We also added an option for a smaller version of Bark, which offers additional speed-up with the trade-off of slightly lower quality.
  - 📕 [Long-form generation](notebooks/long_form_generation.ipynb), voice consistency enhancements and other examples are now documented in a new [notebooks](./notebooks) section.
  - 👥 We created a [voice prompt library](https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c). We hope this resource helps you find useful prompts for your use cases! You can also join us on [Discord](https://discord.gg/J2B2vsjKuE), where the community actively shares useful prompts in the **#audio-prompts** channel.
  - 💬 Growing community support and access to new features here:

       [![](https://dcbadge.vercel.app/api/server/J2B2vsjKuE)](https://discord.gg/J2B2vsjKuE)

  - 💾 You can now use Bark with GPUs that have low VRAM (<4GB).

  **2023.04.20**
  - 🐶 Bark release!



  <details open>
    <summary><h3>🪑 Basics</h3></summary>

  ```python
  from bark import SAMPLE_RATE, generate_audio, preload_models
  from scipy.io.wavfile import write as write_wav
  from IPython.display import Audio


  preload_models()


  text_prompt = """
       Hello, my name is Suno. And, uh — and I like pizza. [laughs]
       But I also have other interests such as playing tic tac toe.
  """
  audio_array = generate_audio(text_prompt)


  write_wav("bark_generation.wav", SAMPLE_RATE, audio_array)


  Audio(audio_array, rate=SAMPLE_RATE)
  ```

  [pizza.webm](https://user-images.githubusercontent.com/5068315/230490503-417e688d-5115-4eee-9550-b46a2b465ee3.webm)

  </details>

  <details open>
    <summary><h3>🌎 Foreign Language</h3></summary>
  <br>
  Bark supports various languages out-of-the-box and automatically determines language from input text. When prompted with code-switched text, Bark will attempt to employ the native accent for the respective languages. English quality is best for the time being, and we expect other languages to further improve with scaling.
  <br>
  <br>

  ```python

  text_prompt = """
      추석은 내가 가장 좋아하는 명절이다. 나는 며칠 동안 휴식을 취하고 친구 및 가족과 시간을 보낼 수 있습니다.
  """
  audio_array = generate_audio(text_prompt)
  ```
  [suno_korean.webm](https://user-images.githubusercontent.com/32879321/235313033-dc4477b9-2da0-4b94-9c8b-a8c2d8f5bb5e.webm)

  *Note: since Bark recognizes languages automatically from input text, it is possible to use for example a german history prompt with english text. This usually leads to english audio with a german accent.*

  </details>

  <details open>
    <summary><h3>🎶 Music</h3></summary>
  Bark can generate all types of audio, and, in principle, doesn't see a difference between speech and music. Sometimes Bark chooses to generate text as music, but you can help it out by adding music notes around your lyrics.
  <br>
  <br>

  ```python
  text_prompt = """
      ♪ In the jungle, the mighty jungle, the lion barks tonight ♪
  """
  audio_array = generate_audio(text_prompt)
  ```
  [lion.webm](https://user-images.githubusercontent.com/5068315/230684766-97f5ea23-ad99-473c-924b-66b6fab24289.webm)
  </details>

  <details open>
  <summary><h3>🎤 Voice Presets</h3></summary>

  Bark supports 100+ speaker presets across [supported languages](#supported-languages). You can browse the library of speaker presets [here](https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c), or in the [code](bark/assets/prompts). The community also often shares presets in [Discord](https://discord.gg/J2B2vsjKuE).

  Bark tries to match the tone, pitch, emotion and prosody of a given preset, but does not currently support custom voice cloning. The model also attempts to preserve music, ambient noise, etc.
  <br>
  <br>

  ```python
  text_prompt = """
      I have a silky smooth voice, and today I will tell you about
      the exercise regimen of the common sloth.
  """
  audio_array = generate_audio(text_prompt, history_prompt="v2/en_speaker_1")
  ```

  [sloth.webm](https://user-images.githubusercontent.com/5068315/230684883-a344c619-a560-4ff5-8b99-b4463a34487b.webm)
  </details>



  By default, `generate_audio` works well with around 13 seconds of spoken text. For an example of how to do long-form generation, see this [example notebook](notebooks/long_form_generation.ipynb).

  <details>
  <summary>Click to toggle example long-form generations (from the example notebook)</summary>

  [dialog.webm](https://user-images.githubusercontent.com/2565833/235463539-f57608da-e4cb-4062-8771-148e29512b01.webm)

  [longform_advanced.webm](https://user-images.githubusercontent.com/2565833/235463547-1c0d8744-269b-43fe-9630-897ea5731652.webm)

  [longform_basic.webm](https://user-images.githubusercontent.com/2565833/235463559-87efe9f8-a2db-4d59-b764-57db83f95270.webm)

  </details>






  ```
  pip install git+https://github.com/suno-ai/bark.git
  ```

  or

  ```
  git clone https://github.com/suno-ai/bark
  cd bark && pip install .
  ```
  *Note: Do NOT use 'pip install bark'. It installs a different package, which is not managed by Suno.*




  Bark has been tested and works on both CPU and GPU (`pytorch 2.0+`, CUDA 11.7 and CUDA 12.0).

  On enterprise GPUs and PyTorch nightly, Bark can generate audio in roughly real-time. On older GPUs, default colab, or CPU, inference time might be significantly slower. For older GPUs or CPU you might want to consider using smaller models. Details can be found in out tutorial sections here.

  The full version of Bark requires around 12GB of VRAM to hold everything on GPU at the same time.
  To use a smaller version of the models, which should fit into 8GB VRAM, set the environment flag `SUNO_USE_SMALL_MODELS=True`.

  If you don't have hardware available or if you want to play with bigger versions of our models, you can also sign up for early access to our model playground [here](https://3os84zs17th.typeform.com/suno-studio).



  Bark is fully generative tex-to-audio model devolved for research and demo purposes. It follows a GPT style architecture similar to [AudioLM](https://arxiv.org/abs/2209.03143) and [Vall-E](https://arxiv.org/abs/2301.02111) and a quantized Audio representation from [EnCodec](https://github.com/facebookresearch/encodec). It is not a conventional TTS model, but instead a fully generative text-to-audio model capable of deviating in unexpected ways from any given script. Different to previous approaches, the input text prompt is converted directly to audio without the intermediate use of phonemes. It can therefore generalize to arbitrary instructions beyond speech such as music lyrics, sound effects or other non-speech sounds.

  Below is a list of some known non-speech sounds, but we are finding more every day. Please let us know if you find patterns that work particularly well on [Discord](https://discord.gg/J2B2vsjKuE)!

  - `[laughter]`
  - `[laughs]`
  - `[sighs]`
  - `[music]`
  - `[gasps]`
  - `[clears throat]`
  - `—` or `...` for hesitations
  - `♪` for song lyrics
  - CAPITALIZATION for emphasis of a word
  - `[MAN]` and `[WOMAN]` to bias Bark toward male and female speakers, respectively



  | Language | Status |
  | --- | --- |
  | English (en) | ✅ |
  | German (de) | ✅ |
  | Spanish (es) | ✅ |
  | French (fr) | ✅ |
  | Hindi (hi) | ✅ |
  | Italian (it) | ✅ |
  | Japanese (ja) | ✅ |
  | Korean (ko) | ✅ |
  | Polish (pl) | ✅ |
  | Portuguese (pt) | ✅ |
  | Russian (ru) | ✅ |
  | Turkish (tr) | ✅ |
  | Chinese, simplified (zh) | ✅ |

  Requests for future language support [here](https://github.com/suno-ai/bark/discussions/111) or in the **#forums** channel on [Discord](https://discord.com/invite/J2B2vsjKuE).



  - [nanoGPT](https://github.com/karpathy/nanoGPT) for a dead-simple and blazing fast implementation of GPT-style models
  - [EnCodec](https://github.com/facebookresearch/encodec) for a state-of-the-art implementation of a fantastic audio codec
  - [AudioLM](https://github.com/lucidrains/audiolm-pytorch) for related training and inference code
  - [Vall-E](https://arxiv.org/abs/2301.02111), [AudioLM](https://arxiv.org/abs/2209.03143) and many other ground-breaking papers that enabled the development of Bark



  Bark is licensed under the MIT License.

  Please contact us at `bark@suno.ai` to request access to a larger version of the model.



  - [Twitter](https://twitter.com/OnusFM)
  - [Discord](https://discord.gg/J2B2vsjKuE)



  We’re developing a playground for our models, including Bark.

  If you are interested, you can sign up for early access [here](https://3os84zs17th.typeform.com/suno-studio).




  * Bark uses Hugging Face to download and store models. You can see find more info [here](https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables#hfhome).



  * Bark is a GPT-style model. As such, it may take some creative liberties in its generations, resulting in higher-variance model outputs than traditional text-to-speech approaches.


  * Bark supports 100+ speaker presets across [supported languages](#supported-languages). You can browse the library of speaker presets [here](https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c). The community also shares presets in [Discord](https://discord.gg/J2B2vsjKuE). Bark also supports generating unique random voices that fit the input text. Bark does not currently support custom voice cloning.


  * Bark is a GPT-style model, and its architecture/context window is optimized to output generations with roughly this length.


  * The full version of Bark requires around 12Gb of memory to hold everything on GPU at the same time. However, even smaller cards down to ~2Gb work with some additional settings. Simply add the following code snippet before your generation:

  ```python
  import os
  os.environ["SUNO_OFFLOAD_CPU"] = True
  os.environ["SUNO_USE_SMALL_MODELS"] = True
  ```


  * Bark generates audio from scratch. It is not meant to create only high-fidelity, studio-quality speech. Rather, outputs could be anything from perfect speech to multiple people arguing at a baseball game recorded with bad microphones.

rpm_license:
  MIT License  Copyright (c) Suno, Inc  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: d6e88df5133b7af81253fc78980fb78542496f9c2c3a6cb840d6e7197ec97faf
name: python-barkshark-sql
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Connection pool and query builder for dbapi 2.0 database drivers
url: https://git.barkshark.xyz/barkshark/bsql
rpm_license: CNPL 7+
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barkshark-sql-0.2.0-1.src.rpm
checksum_type: sha256
description:
  Connection pool and query builder for SQL (currently only sqlite and postgresql) database drivers.

  [Documentation](https://docs.barkshark.xyz/barkshark-sql)

  <!--[![PyPI - Version](https://img.shields.io/pypi/v/barkshark-sql.svg)](https://pypi.org/project/barkshark-sql)
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/barkshark-sql.svg)](https://pypi.org/project/barkshark-sql)-->



  `Barkshark SQL` is distributed under the terms of the [CNPL 7+](https://thufie.lain.haus/NPL.html) license.


pkgId: 3e3410fcc8c2432d94e5842dfd878a76456e596f228e4898b06019ca729a4e97
name: python-barladb
arch: src
version: 0.2.70
epoch: 0
release: 1
summary: Module for working with JSON file data
url: https://github.com/barlin41k/barladb
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barladb-0.2.70-1.src.rpm
checksum_type: sha256
description:
  - **English interface**
  - **Minor changes to the interface and commands**


  - **None**



  - `BarlaDB` is a library that is created for working with local databases in `.json` format. Has well-developed functions and logging! And most importantly, it has a very easy-to-learn interface, even for a beginner!


  ```python
  from barladb import db #Imports DB functions
  from barladb import config #imports config
  import socket
  config.debug = True #Debug ON
  config.log = True #Log ON

  barladb = db.BarlaDB() #Creating an instance of a class
  data = barladb.get("example.json") #We get the contents of the database and save it into the "data" variable



  print("Hello, User! Your computer name already in example.json.")
  data["name"] = socket.gethostname()
  barladb.save("example.json", data) #Saving the "data" variable to example.json
  """
  My example.json looks like this:
      {
      "name": "barlin41k"
      }
  In column "name", should be your hostname, but since mine is barlin41k, it comes out like this.
  Let me remind you that this is just a short example of using the module.
  """
  ```

  - `pip install barladb`


  - Has an easy and intuitive interface.
  - Has no dependencies
  - Everything is built in the popular `.json` data format.


  - [Documentation](https://sites.google.com/view/barladb/)
  - [Github](https://github.com/barlin41k/barladb/)
  - [PyPi](https://pypi.org/project/barladb/)


pkgId: b0f52c9c4cf00202b9ddb87230251df78b4951410fc48265d4faa79d1fb43309
name: python-barman
arch: src
version: 3.11.1
epoch: 0
release: 1
summary: Backup and Recovery Manager for PostgreSQL
url: https://www.pgbarman.org/
rpm_license: GPL-3.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barman-3.11.1-1.src.rpm
checksum_type: sha256
description:
  Barman (Backup and Recovery Manager) is an open-source administration
  tool for disaster recovery of PostgreSQL servers written in Python.
  It allows your organisation to perform remote backups of multiple
  servers in business critical environments to reduce risk and help DBAs
  during the recovery phase.

  Barman is distributed under GNU GPL 3 and maintained by EnterpriseDB.


pkgId: f36ec2acdccb0899646930231f7f689d6629c96ebfea860ccabc60b6a7a33f84
name: python-baron
arch: src
version: 0.10.1
epoch: 0
release: 1
summary: Full Syntax Tree for python to make writing refactoring code a realist task
url: https://github.com/PyCQA/baron
rpm_license: lgplv3+
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-baron-0.10.1-1.src.rpm
checksum_type: sha256
description:
  Baron is a Full Syntax Tree (FST) library for Python. By opposition to an [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) which
  drops some syntax information in the process of its creation (like empty lines,
  comments, formatting), a FST keeps everything and guarantees the operation
  <code>fst\_to\_code(code\_to\_fst(source\_code)) == source\_code</code>.


pkgId: 60bba1fbd35fd40fc74d89392359230c8c3563aa45791b44bbc51d548adf12df
name: python-barplots
arch: src
version: 1.2.1
epoch: 0
release: 1
summary: Python package to easily make barplots from multi-indexed dataframes.
url: https://github.com/LucaCappelletti94/barplots
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barplots-1.2.1-1.src.rpm
checksum_type: sha256
description:
  [![pip](https://badge.fury.io/py/barplots.svg)](https://pypi.org/project/barplots/)
  [![downloads](https://pepy.tech/badge/barplots)](https://pepy.tech/project/barplots)
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/LucaCappelletti94/barplots/blob/master/LICENSE)
  [![CI](https://github.com/LucaCappelletti94/barplots/actions/workflows/python.yml/badge.svg)](https://github.com/LucaCappelletti94/barplots/actions)

  Python package to easily make barplots from multi-indexed dataframes.



  As usual, just download it using pip:

  ```shell
  pip install barplots
  ```



  Most methods, in particular those exposed to user usage, are provided with docstrings. Consider reading these docstrings to learn about the most recent updates to the library.



  The dataframe to be provided to the barplots library may look like the following:

  | miss_rate  | fall_out | mcc       | evaluation_type | unbalance | graph_name                 | normalization_name |
  |------------|----------|-----------|-----------------|-----------|----------------------------|--------------------|
  | 0.0332031  | 0.705078 | 0.353357  | train           | 10        | AlligatorSinensis           | Traditional        |
  | 0.240234   | 0.478516 | 0.289591  | train           | 1         | CanisLupus                  | Right Laplacian     |
  | 0.0253906  | 0.931641 | 0.101643  | train           | 100       | AlligatorSinensis           | Right Laplacian     |
  | 0.121094   | 0.699219 | 0.220219  | train           | 10        | HomoSapiens                 | Traditional        |
  | 0.0136719  | 0.292969 | 0.722095  | test            | 1         | CanisLupus                  | Right Laplacian     |
  | 0.0605469  | 0.90625  | 0.0622185 | test            | 10        | AmanitaMuscariaKoideBx008    | Traditional        |
  | 0.0078125  | 0.4375   | 0.614287  | train           | 100       | AmanitaMuscariaKoideBx008    | Traditional        |
  | 0.171875   | 0.869141 | -0.0572194| train           | 100       | AlligatorSinensis           | Traditional        |
  | 0.0859375  | 0.810547 | 0.150206  | train           | 10        | MusMusculus                 | Right Laplacian     |
  | 0.0273438  | 0.646484 | 0.415357  | test            | 10        | MusMusculus                 | Right Laplacian     |

  Specifically, in this example, we may create bar plots for the features **Miss rate**, **fallout**, and **Matthew Correlation Coefficient** by grouping on the `evaluation_type`, `unbalance`, `graph_name`, and `normalization_name` columns.

  An example CSV file can be seen [here](https://github.com/LucaCappelletti94/barplots/blob/master/tests/test_case.csv).



  Here follows a set of examples of common usages. Basically, every graph shows either the same data or a mean based on the provided group by indices. Choose whatever representation is best for visualizing your data, as one is not necessarily better than another for every dataset.

  > **Note**: The data used in the following examples are **randomly generated** for testing purposes. **DO NOT** consider these values as valid results for experiments using the same labels (cell lines, etc.), which are only used to show possible usages.

  For every example, the considered dataframe `df` is loaded as follows:

  ```python
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  ```

  Also, for every example, the `custom_defaults` used to sanitize the labels specific to the dataset is:

  ```python
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }
  ```



  In the following example, we will plot the bars horizontally, rotating the group labels by 90 degrees, and displaying the bar labels as a shared legend.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["task", "model"],
      orientation="horizontal",
      show_legend=True,
      minor_rotation=90,
      custom_defaults=custom_defaults
  )
  ```

  Result can be seen [here](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/horizontal_legend_minor_rotation_val_auroc.png?raw=true).



  In this example, we will plot the top index as multiple subplots with horizontal bars, rotating the group labels by 90 degrees, and displaying the bar labels as a shared legend.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["cell_line", "task", "model"],
      orientation="horizontal",
      show_legend=True,
      subplots=True,
      minor_rotation=90,
      custom_defaults=custom_defaults
  )
  ```

  ![Horizontal Example B](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/horizontal_legend_subplots_minor_rotation_val_auroc.png?raw=true)



  In this example, we will plot horizontal bars, rotating the top group labels by 90 degrees, and displaying the bar labels as minor ticks.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["task", "model"],
      orientation="horizontal",
      show_legend=False,
      major_rotation=90,
      custom_defaults=custom_defaults
  )
  ```

  Result can be seen [here](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/horizontal_major_rotation_val_auroc.png?raw=true).



  In this example, we will plot the top index as multiple subplots with horizontal bars, rotating the group labels by 90 degrees, and displaying the bar labels as minor ticks.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["cell_line", "task", "model"],
      orientation="horizontal",
      show_legend=False,
      major_rotation=90,
      subplots=True,
      custom_defaults=custom_defaults
  )
  ```

  ![Horizontal Example D](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/horizontal_subplots_major_rotation_val_auroc.png?raw=true)



  In this example, we will plot the bars vertically and display the bar labels as a shared legend.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["task", "model"],
      orientation="vertical",
      show_legend=True,
      custom_defaults=custom_defaults
  )
  ```

  Result can be seen [here](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/vertical_legend_val_auroc.png).



  In this example, we will plot the top index as multiple subplots with vertical bars, displaying the bar labels as a shared legend.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["cell_line", "task", "model"],
      orientation="vertical",
      show_legend=True,
      subplots=True,
      custom_defaults=custom_defaults
  )
  ```

  ![Vertical Example B](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/vertical_legend_subplots_val_auroc.png)



  In this example, we will plot vertical bars, rotating the minor group labels by 90 degrees, and displaying the bar labels as minor ticks.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["task", "model"],
      orientation="vertical",
      show_legend=False,
      minor_rotation=90,
      custom_defaults=custom_defaults
  )
  ```

  Result can be seen [here](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/vertical_minor_rotation_val_auroc.png).



  In this example, we will plot the top index as multiple subplots with vertical bars, rotating the minor group labels by 90 degrees, and displaying the bar labels as minor ticks.

  ```python
  from barplots import barplots
  import pandas as pd

  df = pd.read_csv("tests/test_case.csv")
  custom_defaults = {
      "P": "promoters",
      "E": "enhancers",
      "A": "active ",
      "I": "inactive ",
      "+": " and ",
      "": "anything",
      "Validation": "val"
  }

  barplots(
      df,
      groupby=["cell_line", "task", "model"],
      orientation="vertical",
      show_legend=False,
      minor_rotation=90,
      subplots=True,
      custom_defaults=custom_defaults
  )
  ```

  ![Vertical Example D](https://github.com/LucaCappelletti94/barplots/blob/master/examples/1/vertical_subplots_minor_rotation_val_auroc.png)


pkgId: 53e04dcdef0435f1db850a78ef0e1e5b4f6f77bbbeae5a03fbbca1d893c80594
name: python-barrel.py
arch: src
version: 0.4
epoch: 0
release: 1
summary: A simple Discord bot package.
url: https://pypi.org/project/barrel.py/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barrel.py-0.4-1.src.rpm
checksum_type: sha256
description:
  Barrel is a lightweight and powerful custom Discord bot package designed for simplicity and efficiency. With Barrel, you can easily manage commands, handle errors, and customize your bot's interactions with Discord's API.



  - **Custom Commands**: Easily add and manage commands for your bot.
  - **Seamless Integration**: Connects smoothly with Discord’s API.
  - **Error Handling**: Built-in error handling to ensure smooth operation.
  - **Embed Support**: Create and send rich embeds for enhanced message formatting.
  - **Latency Checking**: Built-in command to check the bot's latency.



  To install Barrel, use pip:

  ```bash
  pip3 install barrel.py
  ```





  **Create a new Python file for your bot, e.g., `main.py`.**

  ```python

  from barrel import Bot  # Importing the Bot class


  barrel_bot = Bot(command_prefix="!")  # Command prefix defaults to "!" if not provided


  @barrel_bot.command()
  async def greet(ctx):
      """Command to greet users with an embed."""
      title = "Greetings from BarrelBot!"
      description = "This is a message sent using an embed."
      await barrel_bot.send_embed(ctx, title, description)

  @barrel_bot.command()
  async def my_command(ctx):
      await ctx.send("This is a custom command!")


  barrel_bot.run('YOUR_BOT_TOKEN_HERE')  # Replace with your actual bot token
  ```



  To add custom commands to your bot:

  **Define a command using the `@barrel_bot.command()` decorator:**

  ```python

  @barrel_bot.command()
  async def my_command(ctx, *args):
      """Your custom command description."""
      
      await ctx.send("This is a custom command!")
  ```



  To run your bot:

  **Make sure your `main.py` includes:**

  ```python

  if __name__ == "__main__":
      barrel_bot.run('YOUR_BOT_TOKEN_HERE')  # Replace with your actual bot token
  ```

  **Execute your script:**

  ```bash
  python3 main.py
  ```

  Feel free to replace `'YOUR_BOT_TOKEN_HERE'` with your actual bot token when running the bot.


pkgId: b21d37ed58d9b61b40ca4c6ffb27de0787b4f947b190d5e78ea7acb17a586618
name: python-barrins-codex
arch: src
version: 9.6.0
epoch: 0
release: 1
summary: "A Collection of Duel Commander commented games in French",
url: https://github.com/Spigushe/barrins-codex
rpm_license: "MIT"
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barrins-codex-9.6.0-1.src.rpm
checksum_type: sha256
description:
  [![License](https://img.shields.io/badge/License-MIT-blue)](https://opensource.org/licenses/MIT)
  [![Python version](https://img.shields.io/badge/python-3.8-blue)](https://www.python.org/downloads/)
  [![Validation](https://github.com/Spigushe/barrins-codex/actions/workflows/static.yml/badge.svg)](https://github.com/Spigushe/barrins-codex/actions/workflows/static.yml)
  [![PyPI version](https://badge.fury.io/py/barrins-codex.svg)](https://badge.fury.io/py/barrins-codex)
  [![Code Style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
  [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

  A website about MtG Duel Commander Strategy


  I started working with [lionel-panhaleux](https://github.com/lionel-panhaleux)
  on a project during first lockdown (around April 2020). We worked on his
  [Codex of the Damned](https://codex-of-the-damned.org/)
  ([repo](https://github.com/lionel-panhaleux/codex-of-the-damned)) to support
  internationalisation. The whole structure of this project is derived from his
  Codex, hence the name as a small tribute.


  Contributions are welcome.
  - [Pull Requests](https://github.com/Spigushe/barrins-codex/pulls) will be merged if they respect the general style.
  - [Issues](https://github.com/Spigushe/barrins-codex/issues) will be dealt with as quickly as possible.

  This site uses [Flask](https://flask.palletsprojects.com) to generate pages
  dynamically .


  To install a working developpment version of the site, use `pip`:

  ```bash
  python3 -m venv venv
  source venv/bin/activate
  pip install -e ".[dev]"
  ```


  You can run the development version of the site using the `codex` entrypoint:

  ```bash
  $ codex
  * Serving Flask app "barrins_codex" (lazy loading)
  * Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  * Debug mode: off
  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  ```

  The Makefile has a command to start codex in debug : `make codex`


  The version number take the form X.Y.Z where X, Y, and Z are non-negative
  integers, and do not contain leading zeroes. X is the major version, Y is the
  minor version, and Z is the patch version. Each element MUST increase
  numerically. For instance: `1.9.0` -> `1.10.0` -> `1.11.0`.

  Given a version number MAJOR.MINOR.PATCH, I increment the:
  1. MAJOR version when I make a backend evolution or a design evolution,
  1. MINOR version when I add content (most likely a match), and
  1. PATCH version when I make bug and typo fixes.

  Additional labels for pre-release and build metadata are available as
  extensions to the MAJOR.MINOR.PATCH format.


pkgId: b47ed035f28263b2f9e9fa84b98d4fd335bc669a487dae0bd1f195de3735f3e3
name: python-barter-auth
arch: src
version: 0.2.24
epoch: 0
release: 1
summary: Barter authentication package
url: https://github.com/kabilovtoha/barter_auth
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barter-auth-0.2.24-1.src.rpm
checksum_type: sha256
description:
  This package allows you to authorize users through a shared redis


  ```shell
  pip install barter-auth
  ```



  - `REDIS_AUTH_URL` default 'redis://localhost:6378/1' # depracated
  - `REDIS_AUTH_HOST` default '127.0.0.1'
  - `REDIS_AUTH_PORT` default 6379
  - `REDIS_AUTH_PASSWORD` default None
  - `REDIS_AUTH_DB` default 0
  - `REDIS_AUTH_ACCESS_PREFIX` default = 'access'
  - `REDIS_AUTH_REFRESH_PREFIX` default = 'refresh'
  - `REDIS_AUTH_TOTP_PREFIX` default = 'totp'
  - `REDIS_AUTH_PROFILE_PREFIX` default = 'profile'
  - `REDIS_AUTH_TOKEN_STORAGE` default = 'headers'



  ```python

  from rest_framework.permissions import AllowAny, IsAuthenticated
  from barter_auth.auth import ApiTokenRedisAuthentication
  class SomeView(APIView):
      authentication_classes = [ApiTokenRedisAuthentication]
      permission_classes = [IsAuthenticated]



  ```

  ```python


  class BloggerConfig(AppConfig):
      name = 'apps.base'

      def ready(self):
          HttpRequest.extuser = property(get_user)
          HttpRequest.profile = property(get_profile)


  def get_user(self):
      from barter_auth.auth import get_token_from_cookies, get_token_from_header
      from barter_auth.providers import RedisAccessClient
      from django.contrib.auth.models import AnonymousUser
      from django.conf import settings

      token = get_token_from_header(self)
      if not token:
          token = get_token_from_cookies(self)
      if token:
          token_service = RedisAccessClient(host=settings.REDIS_AUTH_HOST)
          user = token_service.get_user(token)
          return user or AnonymousUser()
      return AnonymousUser()

  def get_profile(self):
      from barter_auth.models import AnonymousProfile
      extuser = self.extuser
      if extuser.is_authenticated:
          try:
              profile = RedisProfileClient().get_model(key=self.headers.get('Profile'))
          except:
              profile = AnonymousProfile()
          if profile.user_id and profile.user_id == extuser.id:
              
              return profile
      return AnonymousProfile()

  ```


  ```python

  REST_FRAMEWORK = {
      "DEFAULT_AUTHENTICATION_CLASSES": [
          "barter_auth.auth.ApiTokenRedisAuthentication",
      ],
      "EXCEPTION_HANDLER": '<your path>.api_exception_handler',
      
  }


  from rest_framework.response import Response
  from rest_framework.views import exception_handler, set_rollback
  from barter_auth.exceptions import BAuthAPIException

  def api_exception_handler(exc, context):
      
      
      if isinstance(exc, BAuthAPIException):
          headers = {}
          if getattr(exc, 'auth_header', None):
              headers['WWW-Authenticate'] = exc.auth_header
          if getattr(exc, 'wait', None):
              headers['Retry-After'] = '%d' % exc.wait

          if isinstance(exc.detail, (list, dict)):
              data = exc.detail
          else:
              data = {'detail': exc.detail}
          set_rollback()
          return Response(data, status=exc.status_code, headers=headers)

      response = exception_handler(exc, context)

      
      if response is not None:
          response.data['status_code'] = response.status_code

      return response

  ```


pkgId: 2f773fa1d3a5374b1281aef99cc5d89690d94b4bbd6e3b8863a2ff4f4c1535f4
name: python-barterdude
arch: src
version: 1.3.2
epoch: 0
release: 1
summary: Message exchange engine to build pipelines using brokers like RabbitMQ
url: https://github.com/olxbr/BarterDude/
rpm_license: Apache 2
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barterdude-1.3.2-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://travis-ci.com/olxbr/BarterDude.svg?branch=master)](https://travis-ci.com/olxbr/BarterDude)
  [![Coverage Status](https://coveralls.io/repos/github/olxbr/BarterDude/badge.svg?branch=master)](https://coveralls.io/github/olxbr/BarterDude?branch=master)

  Message exchange engine to build pipelines using brokers like RabbitMQ. This project is build on top of the great [async-worker](https://github.com/async-worker/async-worker).

  ![barter](https://github.com/olxbr/BarterDude/blob/master/barterdude.jpg)



  Using Python 3.6+

  ```sh
  pip install barterdude
  ```



  Build your consumer with this complete example:

  ```python
  import logging
  from barterdude import BarterDude
  from barterdude.monitor import Monitor
  from barterdude.hooks.healthcheck import Healthcheck
  from barterdude.hooks.logging import Logging
  from barterdude.hooks.metrics.prometheus import Prometheus
  from barterdude.message import Message
  from barterdude.conf import getLogger





  barterdude = BarterDude(
      hostname="localhost",
      username="guest",
      password="guest",
      prefetch=256,
  )


  labels = dict(
      app_name="my_app",
      team_name="my_team"
  )
  healthcheck = Healthcheck(barterdude) # automatic and customizable healthcheck
  prometheus = Prometheus(labels) # automatic and customizable Prometheus integration

  self.logger = getLogger("my_app", logging.DEBUG) # automatic json log with barterdude namespace



  monitor = Monitor(
      healthcheck,
      prometheus,
      
      Logging() # automatic and customizable logging
  )

  my_metric = prometheus.metrics.counter(name="fail", description="fail again")  # It's the same as https://github.com/prometheus/client_python


  @barterdude.consume_amqp(
      ["queue1", "queue2"],
      monitor,
      coroutines = 10,  # number of coroutines spawned to consume messages (1 per message)
      bulk_flush_interval = 60.0,  #  max waiting time for messages to start process n_coroutines
      requeue_on_fail = True  # should retry or not the message
  )
  async def your_consumer(msg: Message): # you receive only one message and we parallelize processing for you
      await barterdude.publish_amqp(
          exchange="my_exchange",
          data=msg.body
      )
      if msg.body == "fail":

          my_metric.inc() # you can use prometheus metrics
          healthcheck.force_fail() # you can use your hooks inside consumer too
          msg.reject(requeue=False) # You can force to reject a message, exactly equal https://b2wdigital.github.io/async-worker/src/asyncworker/asyncworker.rabbitmq.html#asyncworker.rabbitmq.message.RabbitMQMessage

      if msg.body == "exception":
          raise Exception() # this will reject the message and requeue

      


  barterdude.run() # you will start consume and start a server on http://localhost:8080


  ```





  These hooks are called when message retreive, have success and fail.

  ```python
  from barterdude.hooks import BaseHook
  from asyncworker.rabbitmq.message import RabbitMQMessage

  class MyCounterHook(BaseHook):
      _consume = _fail = _success = 0

      async def on_success(self, message: RabbitMQMessage):
          self._success += 1

      async def on_fail(self, message: RabbitMQMessage, error: Exception):
          self._fail += 1

      async def before_consume(self, message: RabbitMQMessage):
          self._consume += 1

  ```



  These hooks can do everything simple hook does, but responding to a route.

  ```python
  from aiohttp import web
  from barterdude.hooks import HttpHook
  from asyncworker.rabbitmq.message import RabbitMQMessage

  class MyCounterHttpHook(HttpHook):
      _consume = _fail = _success = 0

      async def __call__(self, req: web.Request):
          return web.json_response(dict(
              consumed=self._consume,
              success=self._success,
              fail=self._fail
          ))

      async def on_success(self, message: RabbitMQMessage):
          self._success += 1

      async def on_fail(self, message: RabbitMQMessage, error: Exception):
          self._fail += 1

      async def before_consume(self, message: RabbitMQMessage):
          self._consume += 1


  ```



  Following the approach found in [async-worker](https://b2wdigital.github.io/async-worker/userguide/asyncworker-app/storage.html) and in [aiohttp](https://docs.aiohttp.org/en/stable/web_advanced.html#data-sharing-aka-no-singletons-please),
  `BarterDude` discourages the use of global variables, aka singletons.

  To share data states globally in an application, `BarterDude` behaves like a `dict`.
  As an example, one can save a global-like variable in a  `BarterDude` instance:

  ```python
  from barterdude import BarterDude

  barterdude = BarterDude()
  baterdude["my_variable"] = data
  ```

  and get it back in a consumer

  ```python
  async def consumer_access_storage(msg):
      data = baterdude["my_variable"]
  ```



  If you run extra modules on your application, like workers or services, you can include them in the healthcheck.

  First, you need to update your module to implement the interface `HealthcheckMonitored`:
  ```python
  from barterdude.hooks.healthcheck import HealthcheckMonitored

  class ExtraService(HealthcheckMonitored):
  ```

  Implementing that interface will require the definition of the method `healthcheck` in your module. It should return a boolean value indicating if your module is healhty or not:
  ```python
      def healthcheck(self):
          return self._thread.is_alive()
  ```

  Finally, you need to make the BarterDude and Healthcheck module be aware of your module. To do so, you'll use the Data Sharing feature:
  ```python
  from barterdude import BarterDude
  from app.extra_service import ExtraService

  barterdude = BarterDude()
  barterdude["extra_service"] = ExtraService()
  ```

  If you are already running your extra modules on BartedDude startup using the data sharing model, it's all done:
  ```python
  @app.run_on_startup
  async def startup(app):
      app["client_session"] = ClientSession()
      app["extra_service"] = ExtraService()
  ```

  The healthcheck module will identify all shared modules that implement the interface `HealthcheckMonitored` and run its healthcheck method automatically.
  The result of all monitored modules will be included in the result body of the healthcheck endpoint and if any of the modules fail, the healthcheck endpoint will indicate that:
  ```json
  {
      "extra_service": "ok",
      "message": "Success rate: 1.0 (expected: 0.9)",
      "fail": 0,
      "success": 1,
      "status": "ok"
  }
  ```



  Consumed messages can be validated by json schema:

  ```python
  @barterdude.consume_amqp(
      ["queue1", "queue2"],
      monitor,
      validation_schema={
              "$schema": "http://json-schema.org/draft-04/schema#",
              "$id": "http://example.com/example.json",
              "type": "object",
              "title": "Message Schema",
              "description": "The root schema comprises the entire JSON document.",
              "additionalProperties": True,
              "required": [
                  "key"
              ],
              "properties": {
                  "key": {
                      "$id": "#/properties/key",
                      "type": "string",
                      "title": "The Key Schema",
                      "description": "An explanation about message.",
                      "default": ""
                  }
              }
          },
      requeue_on_validation_fail=False # invalid messages are removed without requeue
  )
  ```

  You can still validate messages before produce them or when you want:

  ```python
  from barterdude.message import MessageValidation

  validator = MessageValidation(json_schema)
  validator.validate(message)
  ```



  Barterdude takes in account GDPR data protection and by default doesn't log message body, but you can deactivate with environment variable `BARTERDUDE_LOG_REDACTED=0`

  Now messages body will be logged by Logging hook.

  This configuration just controls BarterDude's default Logging Hook and doesn't have effect on user custom user log. If you want to control your log with this configuration use:

  ```python
  from baterdude.conf import BARTERDUDE_LOG_REDACTED
  ```





  If you want to expose and HTTP endpoint, you can easily do that to your Barterdude worker by adding a route mapped to a hook.

  ```python
  barterdude.add_endpoint(
      routes=["/some_hook"],
      methods=["GET"],
      hook=some_hook,
  )
  ```



  You can also expose an HTTP endpoint that calls the worker's callback to emulate a message being consumed and processed from a queue. This way you can make a request passing a body and header of a message and the response of this request will have all information of what the worker would do without really publishing the message.

  ```python
  barterdude.add_callback_endpoint(
      routes=["/execute"],
      hook=execute,
  )
  ```

  In order to use a mock instance of the barterdude object, you also need to modify the signature of your callback method to receive a optional argument for the barterdude mock. Then you'll have to choose which one to use. Only the callback endpoint calls will pass the barterdude object to your callback.

  ```python
  async def execute(rabbitmq_message: RabbitMQMessage, barterdude_arg=None):
      bd = barterdude_arg if barterdude_arg is not None else barterdude
  ```


  ```json

  {
  	"body": {
  		"list_id": 105515152
  	},
  	"headers": {
  		"trace_id": "random_id"
  	}
  }


  {
  	"message_calls": [
  		{
  			"method": "accept",
  			"args": [],
  			"kwargs": {}
  		}
  	],
  	"barterdude_calls": [
  		{
  			"method": "publish_amqp",
  			"args": [],
  			"kwargs": {
  				"exchange": "NEXT_EXCHANGE_TO_BE_CALLED",
  				"data": {
  					"list_id": 1055151521,
  					"subject": "vendo samsung galaxy s21",
  					"timestamp": 1657231231000
  				},
  				"properties": {
  					"headers": {
  						"has_failed": false,
  						"trace_id": "random_id"
  					}
  				}
  			}
  		}
  	]
  }
  ```



  If your callback has services with side-effects such as inserting a row in a database or updating an API, you can pass fake instances of these services that are going to be injected to prevent side-effects from happenning.

  ```python
  barterdude.add_callback_endpoint(
      routes=["/execute"],
      hook=execute,
      mock_dependencies=[
          (
              fake_database_service,  # fake service instance to be used by the worker
              "database_service",     # name used in the data sharing/dependency injection
          ),
      ]
  )
  ```



  If you want the message to be published when calling the callback endpoint, you can pass the parameter `should_mock_barterdude: false`. This way the message will be published. Also, you don't have to mock the services used by your worker, all side-effects will happen and you'll have your worker processing your message just like it would be when consuming from a queue.


  ```json

  {
  	"body": {
  		"list_id": 105515152
  	},
  	"headers": {
  		"trace_id": "random_id"
  	},
          "should_mock_barterdude": false
  }


  {
  	"message_calls": [
  		{
  			"method": "accept",
  			"args": [],
  			"kwargs": {}
  		}
  	]
      
  }
  ```



  To test async consumers we recommend `asynctest` lib

  ```python
  from asynctest import TestCase


  class TestMain(TestCase):
      def test_should_pass(self):
          self.assertTrue(True)
  ```

  We hope you enjoy! :wink:



  For development and contributing, please follow [Contributing Guide](https://github.com/olxbr/BarterDude/blob/master/CONTRIBUTING.md) and **ALWAYS** respect the [Code of Conduct](https://github.com/olxbr/BarterDude/blob/master/CODE_OF_CONDUCT.md)


pkgId: 9f6010df46c4033d169d9fc9e8b37008c60f2a3a3e8697723f7048d7957be666
name: python-barycorrpy
arch: src
version: 0.4.4
epoch: 0
release: 1
summary: Barycentric Velocity correction at 1 cm/s level
url: https://github.com/shbhuk/barycorrpy
rpm_license: GPLv3
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-barycorrpy-0.4.4-1.src.rpm
checksum_type: sha256
description:
  To sign up for updates, please join the Google Group linked here -
  https://groups.google.com/g/barycorrpy

  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1115856.svg)](https://doi.org/10.5281/zenodo.1115856)

  [Barycorrpy](http://iopscience.iop.org/article/10.3847/2515-5172/aaa4b7) is the Python version of Jason Eastman and Jason Wright's IDL code [BaryCorr](http://astroutils.astronomy.ohio-state.edu/exofast/pro/exofast/bary/zbarycorr.pro) based on [Wright and Eastman (2014)](https://arxiv.org/pdf/1409.4774.pdf). BCPy can be used to calculate the barycentric velocity correction for a star with an accuracy well below 1 cm/s .
  To do this, it takes into consideration the following effects-

  1. Revolution of the Earth to consider position and velocity of the geocenter with respect to the Solar System barycenter
  2. Rotation of the Earth
  3. Precession, nutation and polar motion of the Earth, along with the above to calculate the position and velocity of the observatory with respect to the geocenter
  4. Gravitational time dilation due to objects of the Solar System
  5. Leap second offset
  6. Proper motion and systemic radial velocity of the star
  7. Parallax
  8. Shapiro delay



  The installation instructions and the guide on how to run and use the code are explained in the [wiki](https://github.com/shbhuk/barycorrpy/wiki

  There is also a video tutorial (courtesy of the [Exoplanet Modeling and Analysis Center](https://emac.gsfc.nasa.gov/) ) available [here](https://www.youtube.com/watch?v=5SqmL6TdJjs), describing how to get started with barycorrpy.

  It is important to note that the code does not just output a barycentric velocity which must be subtracted from the raw Radial Velocity. It outputs the net radial velocity after correcting for barycentric correction. This is because the correction involves a cross term due to the relativistic addition. Therefore include the zmeas in the input parameters.




  As explained in [Eastman et al. 2010](http://adsabs.harvard.edu/abs/2010PASP..122..935E), we also include a JDUTC to BJDTDB time converter.

  We include the following corrections -

  1. Clock Correction - To correct for difference between UTC and TDB time scales.
  2. Geometric Correction - Light travel time from observatory to Solar System Barycenter.
  3. Einstein Correction - Relativistic correction since Earth is not an inertial frame.

  The output of our function - utc_tdb.JDUTC_to_BJDTDB() matches the [web applet converter](http://astroutils.astronomy.ohio-state.edu/time/utc2bjd.html) to about 0.2ms . Therefore for applications requiring higher precision it should not be used.
  We advocate not using the standard Astropy converter this due to the same leap second staleness issue. Therefore for cases requiring such high precision, the leap second should be checked for and be updated as is done by this code.




  The instructions for installation and getting started for this package are detailed in the [wiki](https://github.com/shbhuk/barycorrpy/wiki).


  To cite using this code you can cite this paper - [RNAAS](http://iopscience.iop.org/article/10.3847/2515-5172/aaa4b7).

  Guidelines to cite this package can be found [here](https://github.com/AASJournals/Tutorials/blob/master/Repositories/CitingRepositories.md).

  To sign up for updates, please join the Google Group linked here -
  https://groups.google.com/forum/#!forum/barycorrpy


pkgId: 06a9d780f65c3437010c03ca4f614399375d85b6d2ae1565cc22852ed475c2ab
name: python-bas-air-unit-network-dataset
arch: src
version: 0.5.0
epoch: 0
release: 1
summary: Utility to process routes and waypoints used by the British Antarctic Survey (BAS) Air Unit
url: https://github.com/antarctica/bas-air-unit-network-dataset
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bas-air-unit-network-dataset-0.5.0-1.src.rpm
checksum_type: sha256
description:
  Utility to process routes and waypoints used by the British Antarctic Survey (BAS) Air Unit.



  **Note:** This project is focused on needs within the British Antarctic Survey. It has been open-sourced in case it is
  of interest to others. Some resources, indicated with a '🛡' or '🔒' symbol, can only be accessed by BAS staff or
  project members respectively. Contact the [Project Maintainer](#project-maintainer) to request access.



  To support the BAS Air Unit manage their network of routes and waypoints such that:

  * information is internally consistent, through defined structures and constraints
  * information is interoperable between different systems, through the use of open/standard formats
  * information is well described and sharable with other teams, through distribution as datasets (through the
    [Ops Data Store 🛡](https://gitlab.data.bas.ac.uk/MAGIC/ops-data-store))



  This project was developed in response to discussions and requests with the BAS Air Unit to review and simplify the
  process they used to manage their network of waypoints, and to ensure its future sustainability.

  BAS staff can read more about this background in this
  [GitLab issue 🛡](https://gitlab.data.bas.ac.uk/MAGIC/ops-support/-/issues/134).



  This service has a number of limitations, including:

  * the Air Unit Network utility does not support multiple, or additional, networks
  * the Air Unit Network utility does not require route names to follow the required naming convention
  * the Air Unit Network utility does not require waypoint identifiers to be unique across all waypoints
  * the Air Unit Network utility does not require waypoint comments to follow the required GPX comment structure
  * the Air Unit Network utility does not require waypoints within imported routes to be listed as standalone waypoints
  * comments for waypoints use an overly complex structure to support an ad-hoc serialisation format within GPX files
  * Unicode characters (such as emoji) are unsupported in route/waypoint names, comments, etc.

  Some or all of these limitations may be addressed in future improvements to this project. See the project
  [issue tracker 🛡](https://gitlab.data.bas.ac.uk/MAGIC/ops-data-store/-/issues) for details.



  ```
  $ python -m pip install bas-air-unit-network-dataset
  ```





  If loading waypoints and routes from a GPX file, these requirements must be met in addition to the constraints from the
  [Information Model](IMPLEMENTATION.md#information-model):

  - the GPX comment field should consist of 8 elements, in the order below, separated with a vertical bar (`|`):
    - *name*: a full, or formal name for the waypoint (maximum 17 characters)
    - *co-located with*: name of a related depot, instrument and/or other feature - use `N/A` if not applicable
    - *last accessed at*: date waypoint was last accessed in the form `YYYY-MM-DD` - use `N/A` if unvisited
    - *last accessed by*: pilot that that last accessed waypoint - use `N/A` if unvisited
    - *fuel*: amount of fuel at a waypoint, as a positive whole number - use `N/A` if not applicable
    - *elevation_ft*: elevation at waypoint, as a positive whole number - use `N/A` if not applicable
    - *comment*: any other information - use `N/A` if not applicable
    - *category*: a grouping value - use `N/A` if not applicable

  For example (a co-located, previously visited, waypoint with a full name, additional information and a category):

  * identifier: `ALPHA`
  * comment: `Alpha 001 | Dog | 2014-12-24 | CW | 10 | 130 | Bring treats. | Animals`

  For example (a standalone, unvisited, waypoint with no full/formal name or additional information):

  * identifier: `BRAVO`
  * comment: `N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A`

  **Note:** Only the 'name' in a comment will be included in FPL waypoints.



  See the [`tests/create_outputs.py`](tests/create_outputs.py) for an example of converting a set of input waypoints and
  routes into output formats, creating an [Output Directory](#output-directory), using an instance of the
  `MainAirUnitNetwork` class.

  The `Network` class (on which the `MainAirUnitNetwork` class is based) includes a built-in method for loading features
  from a GPX file (used in the example above). To load data from other data sources, construct `Waypoint` and `Route`
  features directly and add to a `Network` object.



  When using the `MainAirUnitNetwork` class from this project to process waypoints and routes, an output directory
  similar to the example below will be created:

  ```
  /path/to/output/directory
  ├── CSV
  │   ├── 00_WAYPOINTS_DDM_2023_12_03.csv
  │   └── 00_WAYPOINTS_DD_2023_12_03.csv
  ├── FPL
  │   ├── 00_NETWORK_2023_12_03.fpl
  │   ├── 01_BRAVO_TO_ALPHA.fpl
  │   ├── 02_BRAVO_TO_BRAVO.fpl
  │   └── 03_BRAVO_TO_LIMA.fpl
  ├── GPX
  │   ├── 00_NETWORK_2023_12_03.gpx
  └── PDF
      └── 00_WAYPOINTS_2023_12_03.pdf
  ```



  The Air Unit Network utility does not include access control. If needed, access controls should be applied to the
  output directory, as is the case for the [Ops Data Store 🛡](https://gitlab.data.bas.ac.uk/MAGIC/ops-data-store) for
  example.



  See [Implementation](IMPLEMENTATION.md) documentation.



  See [Developing](DEVELOPING.md) documentation.



  - [all releases 🛡](https://gitlab.data.bas.ac.uk/MAGIC/air-unit-network-dataset/-/releases)
  - [latest release 🛡](https://gitlab.data.bas.ac.uk/MAGIC/air-unit-network-dataset/-/releases/permalink/latest)
  - [PyPi](https://pypi.org/project/bas-air-unit-network-dataset/)



  British Antarctic Survey ([BAS](https://www.bas.ac.uk)) Mapping and Geographic Information Centre
  ([MAGIC](https://www.bas.ac.uk/teams/magic)). Contact [magic@bas.ac.uk](mailto:magic@bas.ac.uk).

  The project lead is [@felnne](https://www.bas.ac.uk/profile/felnne).



  Copyright (c) 2022 - 2024 UK Research and Innovation (UKRI), British Antarctic Survey (BAS).

  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: fc32df84ff2cf67055aa85c65cc3743291177841f7470e9ff04c37b34ecd9793
name: python-bas-metadata-library
arch: src
version: 0.15.1
epoch: 0
release: 1
summary: Python library for generating metadata records
url: https://github.com/antarctica/metadata-library
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bas-metadata-library-0.15.1-1.src.rpm
checksum_type: sha256
description:
  Python library for generating metadata and data records.



  **Note:** This project is focused on needs within the British Antarctic Survey. It has been open-sourced in case it is
  of interest to others. Some resources, indicated with a '🛡' or '🔒' symbol, can only be accessed by BAS staff or
  project members respectively. Contact the [Project Maintainer](#project-maintainer) to request access.



  This library is designed to assist in generating metadata and data records, primarily for the discovery of datasets,
  services, features and related resources. This project is intended to be used as an underpinning library within tools,
  to avoid the need to duplicate the implementation of complex and verbose metadata and data standards.

  At a high level, this library allows a configuration object, representing the fields/structure of a standard, to be
  encoded into its formal representation set out by that standard (typically using XML). It also allows such a formal
  representation to be decoded back into a configuration object, which can be more easily used or manipulated.



  | Standard                                                        | Implementation                                                  | Library Namespace                                   | Introduced In                                                                                        |
  |-----------------------------------------------------------------|-----------------------------------------------------------------|-----------------------------------------------------|------------------------------------------------------------------------------------------------------|
  | [ISO 19115:2003](https://www.iso.org/standard/26020.html)       | [ISO 19139:2007](https://www.iso.org/standard/32557.html)       | `bas_metadata_library.standards.iso_19115_0_v1`     | [#46 🛡️](https://gitlab.data.bas.ac.uk/uk-pdc/metadata-infrastructure/metadata-library/issues/46)   |
  | [ISO 19115-2:2009](https://www.iso.org/standard/39229.html)     | [ISO 19139-2:2012](https://www.iso.org/standard/57104.html)     | `bas_metadata_library.standards.iso_19115_2_v1`     | [#50 🛡️](https://gitlab.data.bas.ac.uk/uk-pdc/metadata-infrastructure/metadata-library/issues/50)   |
  | [IEC 61174:2015](https://webstore.iec.ch/publication/23128)     | [IEC 61174:2015](https://webstore.iec.ch/publication/23128)     | `bas_metadata_library.standards.iec_pas_61174_0_v1` | [#139 🛡️](https://gitlab.data.bas.ac.uk/uk-pdc/metadata-infrastructure/metadata-library/issues/139) |
  | [IEC PAS 61174:2021](https://webstore.iec.ch/publication/67774) | [IEC PAS 61174:2021](https://webstore.iec.ch/publication/67774) | `bas_metadata_library.standards.iec_pas_61174_1_v1` | [#139 🛡️](https://gitlab.data.bas.ac.uk/uk-pdc/metadata-infrastructure/metadata-library/issues/144) |

  **Note:** In this library, starting from version v0.11.0, the *ISO 19115:2003* standard is referred to as *ISO-19115-0*
  (`iso_19115_0`). Prior to this version it was (incorrectly) referred to as *ISO-19115-1* (`iso_19115_1`). To avoid
  confusion, when the [ISO 19115-1:2014](https://www.iso.org/standard/53798.html) standard is implemented, it will be
  referred to as *ISO-19115-3* (`iso_19115_3`).



  | Standard  | Profile                                                                                               | Introduced In                                                                                    |
  |-----------|-------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
  | ISO 19115 | [MAGIC Discovery Metadata V1](https://metadata-resources.data.bas.ac.uk/profiles/magic-discovery-v1/) | [#250](https://gitlab.data.bas.ac.uk/uk-pdc/metadata-infrastructure/metadata-library/issues/250) |



  | Standard           | Profile | Configuration Version                                                                                                     | Status  | Notes                                 |
  |--------------------|---------|---------------------------------------------------------------------------------------------------------------------------|---------|---------------------------------------|
  | ISO 19115:2003     | -       | [`v1`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-1-v1.json)     | Retired | Replaced by `v2`, no longer supported |
  | ISO 19115:2003     | -       | [`v2`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-1-v2.json)     | Retired | Replaced by `v3`, no longer supported |
  | ISO 19115:2003     | -       | [`v3`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v3/iso-19115-1-v3.json)     | Retired | Replaced by `v4`, no longer supported |
  | ISO 19115:2003     | -       | [`v4`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v3/iso-19115-0-v4.json)     | Stable  | Currently supported version           |
  | ISO 19115-2:2009   | -       | [`v1`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v1.json)     | Retired | Replaced by `v2`, no longer supported |
  | ISO 19115-2:2009   | -       | [`v2`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v2.json)     | Retired | Replaced by `v3`, no longer supported |
  | ISO 19115-2:2009   | -       | [`v3`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v3.json)     | Retired | Replaced by `v4`, no longer supported |
  | ISO 19115-2:2009   | -       | [`v4`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v4.json)     | Stable  | Currently supported version           |
  | IEC 61174:2015     | -       | [`v1`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iec-pas-61174-0-v1.json) | Stable  | Currently supported version           |
  | IEC PAS 61174:2021 | -       | [`v1`](https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iec-pas-61174-1-v1.json) | Stable  | Currently supported version           |



  This library is built around the needs of the British Antarctic Survey and the NERC (UK) Polar Data Centre. This means
  only standards, and elements of these standards, used by BAS or the UK PDC are supported. However, additions that would
  enable this library to be useful to other organisations and use-case are welcome as contributions providing they do not
  add significant complexity or maintenance.

  | Standard           | Coverage | Coverage Summary                                                                                     |
  |--------------------|----------|------------------------------------------------------------------------------------------------------|
  | ISO 19115:2003     | Good     | All mandatory elements are supported with a good number of commonly used additional elements         |
  | ISO 19115-2:2009   | Minimal  | No elements from this extension are supported, with the exception of the root element                |
  | IEC 61174:2015     | Minimal  | All mandatory elements are supported, plus a limited number of optional route information attributes |
  | IEC PAS 61174:2021 | Minimal  | All mandatory elements are supported, plus a limited number of optional route information attributes |

  **Note:** ISO 19115 extensions (i.e. `gmd:metadataExtensionInfo` elements) are not supported.



  As required by the IEC 61174 standard, this library supports the following properties within this standard:

  | Element                                        | Reference | Obligation |
  |------------------------------------------------|-----------|------------|
  | `route`                                        | *4.5.2*   | Mandatory  |
  | `route.routeInfo.routeAuthor`                  | *4.5.3*   | Optional   |
  | `route.routeInfo.routeName`                    | *4.5.3*   | Mandatory  |
  | `route.routeInfo.routeStatus`                  | *4.5.3*   | Optional   |
  | `route.waypoints`                              | *4.5.4*   | Mandatory  |
  | `route.waypoints.*.waypoint.id`                | *4.5.6*   | Mandatory  |
  | `route.waypoints.*.waypoint.revision`          | *4.5.6*   | Mandatory  |
  | `route.waypoints.*.waypoint.position.lat`      | *4.5.6*   | Mandatory  |
  | `route.waypoints.*.waypoint.position.lon`      | *4.5.6*   | Mandatory  |
  | `route.waypoints.*.waypoint.position.geometry` | *4.5.6*   | Optional   |

  This list is exhaustive. No extensions are supported.

  References in the above table relate to the IEC PAS 61174:2021 standards document:
  https://webstore.iec.ch/publication/67774.

  Full citation:

  > IEC 61174:2015, Maritime navigation and radiocommunication equipment and systems – Electronic chart display and
  > information system (ECDIS) – Operational and performance requirements, methods of testing and required test results



  This package can be installed using Pip from [PyPi](https://pypi.org/project/bas-metadata-library):

  ```
  $ pip install bas-metadata-library
  ```

  This package depends on native libraries for XML encoding and decoding:

  * `libxml2`
  * `libxslt`

  This package depends on native binaries for XML validation:

  * `xmllint`

  Most Operating Systems include these libraries and packages by default. However, others, particularly minimal OSes,
  require these packages to be installed separately. Notably:

  | Operating System | Required Packages              |
  |------------------|--------------------------------|
  | Linux (Alpine)   | `libxslt-dev`, `libxml2-utils` |
  | Linux (Debian)   | `libxml2-utils`                |





  To generate an ISO 19115 metadata record from a Python record configuration and return it as an XML document:

  ```python
  from datetime import date

  from bas_metadata_library.standards.iso_19115_2 import MetadataRecordConfigV4, MetadataRecord

  minimal_record_config = {
      "$schema": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-1-v4.json",
      "hierarchy_level": "dataset",
      "metadata": {
          "language": "eng",
          "character_set": "utf8",
          "contacts": [{"organisation": {"name": "UK Polar Data Centre"}, "role": ["pointOfContact"]}],
          "date_stamp": date(2018, 10, 18),
      },
      "identification": {
          "title": {"value": "Test Record"},
          "dates": {"creation": {"date": date(2018, 1, 1), "date_precision": "year"}},
          "abstract": "Test Record for ISO 19115 metadata standard (no profile) with required properties only.",
          "character_set": "utf8",
          "language": "eng",
          "topics": ["environment", "climatologyMeteorologyAtmosphere"],
          "extents": [
              {
                  "identifier": "bounding",
                  "geographic": {
                      "bounding_box": {
                          "west_longitude": -45.61521,
                          "east_longitude": -27.04976,
                          "south_latitude": -68.1511,
                          "north_latitude": -54.30761,
                      }
                  },
              },
          ],
      },
  }
  configuration = MetadataRecordConfigV4(**minimal_record_config)
  record = MetadataRecord(configuration=configuration)
  document = record.generate_xml_document()


  print(document.decode())
  ```

  See the [HTML Entities](#html-entities) section for guidance on using accents and symbols in descriptions.

  You will need to use a `date_precision` property for partial dates. See the [Date Precision](#date-precision) section
  for more information.



  ```python
  from bas_metadata_library.standards.iso_19115_2 import MetadataRecord

  with open(f"minimal-record.xml") as record_file:
      record_data = record_file.read()

  record = MetadataRecord(record=record_data)
  configuration = record.make_config()
  minimal_record_config = configuration.config


  print(minimal_record_config)
  ```



  To encode to a RTZ file:

  ```python
  from bas_metadata_library.standards.iec_pas_61174_0_v1 import MetadataRecordConfigV1, MetadataRecord

  minimal_record_config = {"route_name": "minimal-test-route",
      "waypoints": [
          {"id": 1001, "revision": 0, "position": {"lat": 5, "lon": 50}},
          {"id": 1002, "revision": 0, "position": {"lat": 5, "lon": 50}},
          {"id": 1003, "revision": 0, "position": {"lat": 5, "lon": 50}},
      ],
  }
  configuration = MetadataRecordConfigV1(**minimal_record_config)
  record = MetadataRecord(configuration=configuration)
  document = record.generate_xml_document()


  print(document.decode())
  ```

  To encode to a RTZP package:

  ```python
  from pathlib import Path

  from bas_metadata_library.standards.iec_pas_61174_0_v1 import MetadataRecordConfigV1, MetadataRecord

  output_path = str('/path/to/file.rtzp')

  minimal_record_config = {"route_name": "minimal-test-route",
      "waypoints": [
          {"id": 1001, "revision": 0, "position": {"lat": 5, "lon": 50}},
          {"id": 1002, "revision": 0, "position": {"lat": 5, "lon": 50}},
          {"id": 1003, "revision": 0, "position": {"lat": 5, "lon": 50}},
      ],
  }
  configuration = MetadataRecordConfigV1(**minimal_record_config)
  record = MetadataRecord(configuration=configuration)
  record.generate_rtzp_archive(file=Path(output_path))
  ```



  To decode from a RTZ file:

  ```python
  from bas_metadata_library.standards.iec_pas_61174_0_v1 import MetadataRecord

  with open(f"minimal-record.rtz") as record_file:
      record_data = record_file.read()

  record = MetadataRecord(record=record_data)
  configuration = record.make_config()
  minimal_record_config = configuration.config


  print(minimal_record_config)
  ```

  To decode from a RTZP package:

  ```python
  from pathlib import Path

  from bas_metadata_library.standards.iec_pas_61174_0_v1 import MetadataRecord

  input_path = str('/path/to/file.rtzp')

  record = MetadataRecord()
  record.load_from_rtzp_archive(file=Path(input_path))
  configuration = record.make_config()
  minimal_record_config = configuration.config


  print(minimal_record_config)
  ```



  **The example below is for the ISO 19115 standard but this applies to all standards.**

  The `load()` and `loads()` methods on the configuration class can be used to load a record configuration encoded as a
  JSON file or JSON string respectively:

  ```python
  from pathlib import Path

  from bas_metadata_library.standards.iso_19115_2 import MetadataRecordConfigV4

  input_path = str('/path/to/file.json')

  configuration = MetadataRecordConfigV4()
  configuration.load(file=Path(input_path))
  ```



  **The example below is for the ISO 19115 standard but this applies to all standards.**

  The `dump()` and `dumps()` methods on the configuration class can be used to dump a record configuration to a JSON
  encoded file or string respectively:

  ```python
  from datetime import date
  from pathlib import Path

  from bas_metadata_library.standards.iso_19115_2 import MetadataRecordConfigV4

  output_path = str('/path/to/file.json')

  minimal_record_config = {
      "$schema": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v4.json",
      "hierarchy_level": "dataset",
      "metadata": {
          "language": "eng",
          "character_set": "utf8",
          "contacts": [{"organisation": {"name": "UK Polar Data Centre"}, "role": ["pointOfContact"]}],
          "date_stamp": date(2018, 10, 18),
      },
      "identification": {
          "title": {"value": "Test Record"},
          "dates": {"creation": {"date": date(2018, 1, 1), "date_precision": "year"}},
          "abstract": "Test Record for ISO 19115 metadata standard (no profile) with required properties only.",
          "character_set": "utf8",
          "language": "eng",
          "topics": ["environment", "climatologyMeteorologyAtmosphere"],
          "extents": [
              {
                  "identifier": "bounding",
                  "geographic": {
                      "bounding_box": {
                          "west_longitude": -45.61521,
                          "east_longitude": -27.04976,
                          "south_latitude": -68.1511,
                          "north_latitude": -54.30761,
                      }
                  },
              },
          ],
      },
  }
  configuration = MetadataRecordConfigV4(**minimal_record_config)
  configuration.dump(file=Path(output_path))
  ```



  **The example below is for the ISO 19115 standard but this applies to all standards.**

  The formal encoding of a record can be validated against one or more XML schemas relevant to each metadata or data
  standard. Records are not validated automatically, and so must be validated explicitly:

  ```python
  from datetime import date

  from bas_metadata_library import RecordValidationError
  from bas_metadata_library.standards.iso_19115_2 import MetadataRecordConfigV4, MetadataRecord

  minimal_record_config = {
      "$schema": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v4.json",
      "hierarchy_level": "dataset",
      "metadata": {
          "language": "eng",
          "character_set": "utf8",
          "contacts": [{"organisation": {"name": "UK Polar Data Centre"}, "role": ["pointOfContact"]}],
          "date_stamp": date(2018, 10, 18),
      },
      "identification": {
          "title": {"value": "Test Record"},
          "dates": {"creation": {"date": date(2018, 1, 1), "date_precision": "year"}},
          "abstract": "Test Record for ISO 19115 metadata standard (no profile) with required properties only.",
          "character_set": "utf8",
          "language": "eng",
          "topics": ["environment", "climatologyMeteorologyAtmosphere"],
          "extents": [
              {
                  "identifier": "bounding",
                  "geographic": {
                      "bounding_box": {
                          "west_longitude": -45.61521,
                          "east_longitude": -27.04976,
                          "south_latitude": -68.1511,
                          "north_latitude": -54.30761,
                      }
                  },
              },
          ],
      },
  }
  configuration = MetadataRecordConfigV4(**minimal_record_config)
  record = MetadataRecord(configuration=configuration)

  try:
      record.validate()
  except RecordValidationError as e:
      print('Record invalid')
      print(e)
  ```

  Where the contents of the record is invalid, a `RecordValidationError` exception will be raised. Printing this
  exception will return validation errors.

  These errors should not happen, and if they do are considered internal bugs and [Reported](#project-maintainer).

  See the [Record Schemas](#record-schemas) section for more information on how validation works.



  **The example below is for the ISO 19115 standard but this applies to all standards.**

  Record configurations will be automatically validated using a JSON Schema for the metadata or data standard used.

  Where a record configuration states compliance with one or more [Supported Profiles](#supported-profiles) applicable to
  the metadata or data standard, it will also be automatically validated using a JSON Schema for each profile.

  To explicitly validate a record configuration:

  ```python
  from datetime import date

  from jsonschema import ValidationError
  from bas_metadata_library.standards.iso_19115_2 import MetadataRecordConfigV4

  minimal_record_config = {
      "$schema": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v4.json",
      "hierarchy_level": "dataset",
      "metadata": {
          "language": "eng",
          "character_set": "utf8",
          "contacts": [{"organisation": {"name": "UK Polar Data Centre"}, "role": ["pointOfContact"]}],
          "date_stamp": date(2018, 10, 18),
      },
      "identification": {
          "title": {"value": "Test Record"},
          "dates": {"creation": {"date": date(2018, 1, 1), "date_precision": "year"}},
          "abstract": "Test Record for ISO 19115 metadata standard (no profile) with required properties only.",
          "character_set": "utf8",
          "language": "eng",
          "topics": ["environment", "climatologyMeteorologyAtmosphere"],
          "extents": [
              {
                  "identifier": "bounding",
                  "geographic": {
                      "bounding_box": {
                          "west_longitude": -45.61521,
                          "east_longitude": -27.04976,
                          "south_latitude": -68.1511,
                          "north_latitude": -54.30761,
                      }
                  },
              },
          ],
      },
  }
  configuration = MetadataRecordConfigV4(**minimal_record_config)

  try:
      configuration.validate()
  except ValidationError as e:
      print('Record configuration invalid')
      print(e)
  ```

  Where the contents of the record is invalid, a
  [`ValidationError`](https://python-jsonschema.readthedocs.io/en/stable/errors/#jsonschema.exceptions.ValidationError)
  exception will be raised by the underlying JSON Schema library. Printing this exception will return validation errors.

  **Note:** The first validation error encountered will stop further validation.

  See the [Record Configuration Schemas](#configuration-schemas) section for more information.



  Do not include HTML entities in input to this library, as they will be double escaped by [Lxml](https://lxml.de), the
  underlying XML processing library used by this project. Instead, literal characters should be used (e.g. `>`), which
  will be escaped as needed automatically. This applies to any unicode character, such as accents (e.g. `å`) and
  symbols (e.g. `µ`).

  E.g. If `&gt;`, the HTML entity for `>` (greater than), were used as input, it would be escaped again to `&amp;gt;`
  which will not be valid output.



  When using Python for record configurations, date or date times must be structured as dictionaries with a `date`
  value (which can be a Python date or date time object), and optional `date_precision` property for indicating elements
  in the date or date time object should be ignored when encoding records. This property can be set to either:

  * `year` (month and day are unknown)
  * `month` (day is unknown)

  When decoding a record, partial dates or date times will be detected and a `date_precision` property added
  automatically. Unknown elements of a date or date time should, or will, use '1' as a conventional value, which can
  effectively be ignored. This is necessary as Python does not allow unknown date elements to be omitted.

  When using JSON for record configurations, date or date times must be written as strings. Partial dates or date
  times can be expressed naturally (e.g. `2012-04`), without the need for a `date_precision` property. This library will
  automatically convert strings to or from dictionaries, with a `date_precision` property if needed, when loading from,
  or saving to, JSON.

  Summary table:

  | Date Precision | Python Encoding                                                                | JSON Encoding           | XML Encoding            |
  |----------------|--------------------------------------------------------------------------------|-------------------------|-------------------------|
  | Year           | `{'date': date(year=2012, month=1, day=1), 'date_precision': 'year'}`          | `"2012"`                | `"2012"`                |
  | Month          | `{'date': date(year=2012, month=4, day=1), 'date_precision': 'month'}`         | `"2012-04"`             | `"2012-04"`             |
  | Day            | `{'date': date(year=2012, month=4, day=14)}`                                   | `"2012-04-14"`          | `"2012-04-14"`          |
  | Hour           | `{'date': datetime(year=2012, month=4, day=14, hour=6)}`                       | `"2012-04-14T06"`       | `"2012-04-14T06"`       |
  | Minute         | `{'date': datetime(year=2012, month=4, day=14, hour=6, minute=30)}`            | `"2012-04-14T06:30"`    | `"2012-04-14T06:30"`    |
  | Second         | `{'date': datetime(year=2012, month=4, day=14, hour=6, minute=30, second=42)}` | `"2012-04-14T06:30:42"` | `"2012-04-14T06:30:42"` |

  **Note:** For date times, the UTC timezone is assumed unless set.



  In ISO 19115, there is no formal mechanism to associate file distribution formats and transfer options. As this library
  seeks to be fully reversible between a configuration object and formal XML encoding, associations between these elements
  would be lost when records are encoded as XML. These associations are used to produce download tables such as [1].

  In [Record Configurations](#configuration-classes), these associations are encoded using a 'distribution option'
  concept. In formal XML records, these associations are encoded using `xsd:ID` attributes in `gmd:MD_Format` and
  `gmd:DigitalTransferOptions` elements, with values that allow these associations to be reconstructed when decoding XML.

  **Note:** Do not modify automatically assigned IDs, as this will break this functionality.

  See the [Automatic transfer option / format IDs](#iso-19115-automatic-transfer-option-format-ids) section for more
  information.

  [1]

  | Format     | Size   | Download Link                |
  |------------|--------|------------------------------|
  | CSV        | 68 kB  | [Link](https://example.com/) |
  | GeoPackage | 1.2 MB | [Link](https://example.com/) |



  This library is implemented in Python and consists of a set of classes used to generate XML metadata and data records
  from a configuration object, or to generate a configuration object from an XML record.

  Each [supported Standard](#supported-standards) is implemented as a module under `bas_metadata_library.standards`. Each
  [Supported Profile](#supported-profiles) is implemented as modules under their respective standard.



  For each standard and profile, instances of these base classes are defined:

  * `Namespaces`
  * `MetadataRecord`
  * `MetadataRecordConfig`

  The `namespaces` class is a set of mappings between XML namespaces, their shorthand aliases and their definitions XSDs.

  The `MetadataRecord` class represents a metadata record and defines the Root [Element](#record-element-classes). This
  class provides methods to generate an XML document for example.

  The `MetadataRecordConfig` class represents the [Configuration](#configuration-classes) used to define values within a
  `MetadataRecord`, either for new records, or derived from existing records. This class provides methods to validate the
  configuration used in a record for example.



  Each supported element, in each [supported standard](#supported-standards), inherit and use the `MetadataRecordElement`
  class to:

  * encode configuration values into an XML fragment of at least one element
  * decode an XML fragment into one or more configuration values

  Specifically, at least two methods are implemented:

  * `make_element()` which builds an XML element using values from a configuration object
  * `make_config()` which uses typically XPath expressions to build a configuration object from XML

  These methods may be simple (if encoding or decoding a simple free text value for example), or quite complex, using
  sub-elements (which themselves may contain sub-elements as needed).



  Allowed elements, attributes and values for each [supported Standard](#supported-standards), and if applicable,
  [Supported Profile](#supported-profiles) are defined using one or more [XML Schemas](https://www.w3.org/XML/Schema).
  These schemas define any required entities, and any entities with enumerated values. Schemas are usually published by
  standards organisations to facilitate record validation.

  For performance reasons, and to ensure required schemas are not unavailable (due to remote locations being reorganised,
  or during server maintenance etc.), these schema files are stored within this package. Schemas are stored as XML Schema
  Definition (XSD) files in the `bas_metadata_library.schemas.xsd` module, and loaded as resource files for use in record
  validation.

  **Note:** To support local validation, imported or included schema locations in local versions of XML schemas, have
  been modified. These changes do not usually change the substance of any schema.

  **Note:** In some cases, material changes *have* been made to local versions of schemas, in order to workaround
  specific issues. These changes are documented and explained below.



  The ISO *Geographic Metadata (GMD)* schema (used directly for the ISO 19115-0 standard, and indirectly in the ISO
  19115-2 standard) has been modified to:

  1. include the ISO *Geographic Metadata XML (GMX)* schema:
      * in order to allow Anchor elements to substitute primitive/simple values (such as character strings and integers),
      * as defined in the ISO 19139:2007 and ISO 19139:2012 standards



  The configuration of each metadata record is held in a Python dictionary, within a `MetadataRecordConfig` class. This
  class includes methods to validate its configuration against a relevant [Configuration Schema](#configuration-schemas).

  Configuration classes are defined at the root of each standard, alongside its root
  [Metadata Element](#record-element-classes) and XML namespaces.

  A configuration class will exist for each supported configuration schema with methods to convert from one version to
  another.



  Allowed properties and values for record configurations for each [supported Standard](#supported-standards) and
  [Supported Profile](#supported-profiles) are defined using a [JSON Schema](https://json-schema.org). These schemas
  define any required properties, and any properties with enumerated values.

  Configuration schemas are stored as JSON files in the `bas_metadata_library.schemas` module, and loaded as resource
  files from within this package to validate record configurations. Schemas are also made available externally through
  the BAS Metadata Standards Resources website, `https://metadata-resources.data.bas.ac.uk`, to allow:

  1. other applications to ensure their output will be compatible with this library - where they can't, or don't want to,
     use this library directly
  2. schema inheritance/extension - for standards that inherit from other standards (such as extensions or profiles)

  **Note:** These schemas used to be available at `https://metadata-standards.data.bas.ac.uk`, these URLs no longer work.

  Configuration schemas are versioned (e.g. `v1`, `v2`) to allow for backwards incompatible changes to be made.
  Upgrade/Downgrade methods will be provided for a limited time to assist migrating record configurations between schema
  versions.



  Standards and profiles usually inherit from other standards and profiles. In order to prevent this creating huge
  duplication within configuration schemas, inheritance is used to incorporate a base schema and extend it as needed. For
  example, the ISO 19115-2 standard extends, and therefore incorporates the configuration schema for, ISO 19115-1.

  JSON Schema references and identifier properties are used to implement this, using URIs within the BAS Metadata
  Standards website. Unfortunately, this creates a problem when developing these schemas, as if Schema B relies on Schema
  A, using its published identifier as a reference, the published instance of the schema will be used (i.e. the remote
  schema will be downloaded when Schema B is validated). If Schema A is being developed, and is not ready to be
  republished, there is a difference between the local and remote schemas used, creating unreliable tests for example.

  To avoid this problem, a set of *source* schemas are used which use references to avoid duplication, from which a set
  of *distribution* schemas are generated. These distribution schemas inline any references contained in their source
  counterpart. These distribution schemas are therefore self-contained and can be updated locally without any
  dependencies on remote sources. Distribution schemas are used by [Configuration Classes](#configuration-classes) and
  published to the BAS Metadata Standards website, they are located in the `bas_metadata_library.schemas.dist` module.

  When editing configuration schemas, you should edit the source schemas, located in the
  `bas_metadata_library.schemas.src` module, then
  [generate distribution schemas](/DEVELOPING.md#generating-configuration-schemas).

  JSON Schema's can be developed using [jsonschemavalidator.net](https://www.jsonschemavalidator.net).

  For ISO 19115 schemas only, which are currently essentially identical, a shortcut is taken for resolving references
  whereby the common members of the two schemas are directly copied from the ISO 19115-0 schema to ISO 19115-2.



  ID attributes are automatically added to `gmd:MD_Format` and `gmd:MD_DigitalTransferOptions` elements in order to
  reconstruct related formats and transfer options (see the
  [Linking transfer options and formats](#iso-19115-linkages-between-transfer-options-and-formats) section for more
  information).

  When a record is encoded, ID values are generated by hashing a JSON encoded string of the distribution object. This
  ID is used as a shared base between the format and transfer option, with `-fmt` appended for the format and `-tfo`
  for the transfer option.

  When a record is decoded, ID values are extracted (stripping the `-fmt`/`-tfo` suffixes) to index and then match up
  format and transfer options back into distribution options. Any format and transfer options without an ID value, or
  without a corresponding match, are added as partial distribution options.

  As a worked example for encoding a (simplified) distribution object such as:

  ```python
  do = {
     'format': 'csv',
     'transfer_option': {
        'size': '40',
        'url': 'https://example.com/foo.csv'
     }
  }
  ```

  Becomes:

  ```
  '{"format":"csv","transfer_option":{"size":40,"url":"https://example.com/foo.csv"}}'
  ```

  When encoded as a JSON encoded string, which when hashed becomes:

  ```
  16b7b5df78a664b15d69feda7ccc7caed501f341
  ```

  The ID value added to the `gmd:MD_Format` element would be:

  ```xml
  <gmd:MD_Format id="bml-16b7b5df78a664b15d69feda7ccc7caed501f341-fmt" />
  ```

  And for the `gmd:MD_DigitalTransferOptions` element:

  ```xml
  <gmd:MD_DigitalTransferOptions id="bml-16b7b5df78a664b15d69feda7ccc7caed501f341-tfo" />
  ```

  The `bml-` prefix is added to ensure all IDs begin with a letter (as required by XML), and to allow IDs generated by
  this library to be detected. The `-fmt`/`-tfo` prefixes are used to allow the same ID value to uniquely identify two
  elements uniquely.



  See [setup](DEVELOPING.md#setup) documentation.



  See [Developing](DEVELOPING.md) documentation.



  - [latest release 🛡️](https://gitlab.data.bas.ac.uk/uk-pdc/metadata-infrastructure/metadata-library/-/releases/permalink/latest)
  - [all releases 🛡️](https://gitlab.data.bas.ac.uk/uk-pdc/metadata-infrastructure/metadata-library/-/releases)
  - [PyPi](https://pypi.org/project/bas-metadata-library/)



  British Antarctic Survey ([BAS](https://www.bas.ac.uk)) Mapping and Geographic Information Centre
  ([MAGIC](https://www.bas.ac.uk/teams/magic)). Contact [magic@bas.ac.uk](mailto:magic@bas.ac.uk).

  The project lead is [@felnne](https://www.bas.ac.uk/profile/felnne).



  Copyright (c) 2019-2024 UK Research and Innovation (UKRI), British Antarctic Survey (BAS).

  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: 59c6e4e9bd2a224bd71c64e6afaba13581d5e3cb71adaeebc3688b8ce149e079
name: python-bas-style-kit-jinja-templates
arch: src
version: 0.7.1
epoch: 0
release: 1
summary: A set of Jinja2 templates implementing the BAS Style Kit
url: https://github.com/antarctica/bas-style-kit-jinja-templates
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-bas-style-kit-jinja-templates-0.7.1-1.src.rpm
checksum_type: sha256
description:
  A set of [Jinja2](http://jinja.pocoo.org) templates implementing the [BAS Style Kit](https://style-kit.web.bas.ac.uk).





  The recommended way to install these templates is via its PyPi package,
  [`bas-style-kit-jekyll-templates`](https://pypi.org/project/bas-style-kit-jinja-templates/).

  **Note:** Since version 0.7.0, this package requires Jinja 3.0 or greater for compatibility with Flask 2.0.





  For a typical Flask application add this wherever your Flask application is defined:

  ```python
  from flask import Flask, render_template
  from jinja2 import PrefixLoader, PackageLoader, FileSystemLoader

  from bas_style_kit_jinja_templates import BskTemplates

  app = Flask(__name__)
  app.jinja_loader = PrefixLoader({
      'app': FileSystemLoader('templates'),
      'bas_style_kit': PackageLoader('bas_style_kit_jinja_templates'),
  })
  app.config['BSK_TEMPLATES'] = BskTemplates()


  app.config['BSK_TEMPLATES'].site_title = 'Example service'
  app.config['BSK_TEMPLATES'].site_description = 'Service to act as an example'
  app.config['BSK_TEMPLATES'].bsk_site_nav_brand_text = 'Example service'
  app.config['BSK_TEMPLATES'].bsk_site_development_phase = 'beta'
  app.config['BSK_TEMPLATES'].bsk_site_feedback_href = '/feedback'
  app.config['BSK_TEMPLATES'].bsk_site_footer_policies_cookies_href = '/legal/cookies'
  app.config['BSK_TEMPLATES'].bsk_site_footer_policies_copyright_href = '/legal/copyright'
  app.config['BSK_TEMPLATES'].bsk_site_footer_policies_privacy_href = '/legal/privacy'


  app.config['BSK_TEMPLATES'].site_styles.append({'href': '/css/app.css'})

  app.config['BSK_TEMPLATES'].site_scripts.append({'href': 'https://example.com/js/example.js', 'integrity': 'abc123'})

  app.config['BSK_TEMPLATES'].site_analytics['id'] = '1234'

  app.config['BSK_TEMPLATES'].bsk_container_classes = ['bsk-container']

  app.config['BSK_TEMPLATES'].bsk_site_nav_primary.append({'value': 'Item', 'href': '#'})
  app.config['BSK_TEMPLATES'].bsk_site_nav_secondary.append({
      'value': 'Dropdown',
      'items': [
          {'value': 'Sub-item 1', 'href': '#', 'target': '_blank'}
      ]
  })
  app.config['BSK_TEMPLATES'].bsk_site_nav_launcher.append({'value': 'Related service', 'href': 'https://example.com'})


  @app.route('/')
  def index():
      
      return render_template(f"app/index.j2")
  ```

  See the [Jinja setup](#jinja-setup) section for other ways of loading templates.

  Where `app/index.j2` is a view located in `templates/index.j2` which extends an application layout:

  ```jinja2
  {% extends 'app/layouts/app.j2' %}
  {% block main_content %}
  <p>Index view content...</p>
  {% endblock %}
  ```

  This layout in turn extends a layout provided by this package:

  ```jinja2
  {% extends 'bas_style_kit/layouts/bsk_standard.j2' %}
  ```



  To create a page in an application based on a [Page pattern](#page-patterns), such as the
  [page not found](https://style-kit.web.bas.ac.uk/patterns/page-not-found/) pattern, create a template (e.g.
  `templates/errors/404.j2`) with the following:

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_page-not-found.j2' %}
  ```

  To use this template as the 404 error handler in a Flask application for example:

  ```python
  @app.errorhandler(404)
  def page_not_found(e):
      
      return render_template('app/errors/404.j2'), 404
  ```



  To use a [Component pattern](#component-pattern), such as the
  [ORCID iD](https://style-kit-testing.web.bas.ac.uk/patterns/orcid-id/) pattern, import and call the relevant Macro:

  ```jinja2
  {% from "bas_style_kit/macros/bsk_pattern_orcid_id.j2" import pattern_orcid_id %}

  <p>{{ pattern_orcid_id('https://sandbox.orcid.org/0000-0001-8373-6934') }}</p>
  ```



  Non-Style Kit CSS an/or JavaScript resources can be included either as references to files, or as inline content.

  **Note:** This won't work if you are using the [Blank layout](#layouts).

  * CSS resources are outputted in the [styles block](#blocks), at the end of the `<head>` element
  * JS resources are outputted in the [scripts block](#blocks), at the end of the `<body>` element



  * CSS files are added as a resource object to the `site_styles` property of the `BskTemplates` class instance
  * JS files are added as a resource object to the `site_scripts` property of the `BskTemplates` class instance

  Files will be included after the Style Kit's own resources (where a Style Kit layout is used) to ensure they have
  priority.

  Each file reference consists of an object with these properties:

  | Property    | Data Type | Required | Allowed Values | Example Value                                         |
  | ----------- | --------- | -------- | -------------- | ----------------------------------------------------- |
  | `href`      | String    | Yes      | Any URL        | */css/app.css* / *https://example.com/js/app.js*      |
  | `integrity` | String    | No       | Any SRI value  | *sha256-ClILH8AIH4CkAybtlKhzqqQUYR4eSDiNTK5LIWfF4qQ=* |

  For example (using a Flask application with a `css/app.css` file with the default
  [static files route](http://flask.pocoo.org/docs/1.0/tutorial/static/)):

  ```python
  app.config['bsk_templates'] = BskTemplates()
  app.config['bsk_templates'].site_styles.append({'href': '/static/css/app.css'})
  ```

  The `integrity` property is used to specify a
  [Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) value for
  a resource. If specified an `integrity` attribute and will be added to the generated markup. A `crossorigin`
  attribute will also be added for
  [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) support with a
  hard-coded, anonymous, value.



  * CSS content should be appended to the [styles block](#blocks)
  * JS content should be appended to the [scripts block](#blocks)
  * inline content will be added after any files to ensure they have priority

  **Note:** To append to a block use `{{ super() }}`, rather than replacing the contents of a block.

  For example (using a Jinja template):

  ```jinja2
  {% block scripts %}
      {{ super() }}
      console.log('jQuery version: ' + jQuery.fn.jquery);
  {% endblock %}
  ```



  When using the [bsk_standard layout](#layouts), a [navbar](https://style-kit.web.bas.ac.uk/components/navbar/) is
  included as part of the 'standard header', which consists of a cookie banner, navbar and site development phase banner.

  This navbar consists of three menus (and other elements, documented elsewhere):

  * a primary navigation menu - aligned left, after [brand elements](#navbar-branding)
  * a secondary navigation menu - aligned right, before the launcher menu
  * a navigation launcher menu - aligned right, after the secondary navigation menu

  The navigation launcher is a restricted menu, used to link to other BAS websites and applications. By default it
  contains links to the [BAS public website](https://www.bas.ac.uk) and the [BAS data catalogue](https://data.bas.ac.uk).
  Other websites and applications can be added as well where relevant.

  * primary navigation menu items should be added to the `BskTemplates.bsk_site_nav_primary` variable
  * secondary navigation menu items should be added to the `BskTemplates.bsk_site_nav_secondary` variable
  * navigation launcher menu items should be added to the `BskTemplates.bsk_site_nav_launcher` variable

  The primary and secondary navigation menu's support:

  * [navbar items](https://style-kit.web.bas.ac.uk/components/navbar/#item)
  * [navbar drop-down menus](https://style-kit.web.bas.ac.uk/components/navbar/#drop-down-menus)
  * [navbar drop-down menu items](https://style-kit.web.bas.ac.uk/components/navbar/#drop-down-menus)

  The navigation launcher menu, which is implemented as a drop-down menu, supports:

  * [navbar drop-down menu items](https://style-kit.web.bas.ac.uk/components/navbar/#drop-down-menus)

  Menu item objects have the following properties:

  | Property    | Data Type | Required | Allowed Values             | Example Value                              | Notes                                 |
  | ----------- | --------- | -------- | -------------------------- | ------------------------------------------ | ------------------------------------- |
  | `value`     | String    | Yes      | Any string                 | *About*                                    | -                                     |
  | `href`      | String    | Yes      | Any URL                    | */about* / *https://www.example.com/about* | Ignored if `items` set                |
  | `items`     | Array     | No       | Array of menu item objects | -                                          | Ignored for navigation launcher items |
  | *Any*       | String    | No       | As per attribute           | -                                          | Arbitrary attribute/value key/values  |

  **Note:** The `items` property is only recursed once, deeper objects will be ignored.

  For example (using a Flask application):

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_nav_primary.push({'value': 'Item', 'href': '/about'})
  app.config['BSK_TEMPLATES'].bsk_site_nav_primary.push({'value': 'Another Item', 'href': '#', 'target': '_blank'})
  ```

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_nav_secondary.push({
      'value': 'Dropdown',
      'items': [
          {'value': 'Sub-item 1', 'href': 'https://www.example.com'}
      ]
  })
  ```

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_nav_launcher.push({'value': 'Related service', 'href': 'https://example.com'})
  ```



  These templates will automatically add the `.bsk-active` class to the relevant navigation item, and if relevant,
  sub-item, where its `href` attribute exactly matches the current URL given by `{{ request.path }}`.

  For example for a navigation item `{'value': 'About', 'href': '/about'}`, when visiting `https://www.example/about`,
  the about navigation item will be made active, as the current path `/about` matches the `href` attribute.

  This support doesn't support URL patterns, such as `/foo/{id}` where `{id}` is a dynamic value. In these cases the
  `active_nav_item` variable can be set to the `href` value of a navigation item to make it active explicitly.

  For example (using flask application):

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_nav_primary.push({'value': 'Foo', 'href': '/foo'})

  @app.route('/foo/<foo_id>')
  def foo_details(foo_id: str):
      foo = get_foo(foo_id)

      return render_template(f"app/views/foo-details.j2", foo=foo, active_nav_item='/foo')
  ```



  Navbars are used to display the name/identity of a website or application, to remind users where they are. These
  elements are referred to as 'brand' elements within the Style Kit.

  Supported brand elements:

  * [brand text](https://style-kit.web.bas.ac.uk/components/navbar/#brand-text) - set using the
  `BskTemplates.bsk_site_nav_brand_text` property
  * [brand image](https://style-kit.web.bas.ac.uk/components/navbar/#brand-image) - set using the
  `BskTemplates.bsk_site_nav_brand_img_href` property

  Brand elements can be used together or individually, with fix classes applied automatically as needed.

  Brand elements are linked to a location specified by the `bsk_attributes.site_nav_brand_href` variable, which should be,
  and is by default, the index of each website or application (i.e. `/`).

  For example (using a Flask application):

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_nav_brand_text = 'Example service'
  ```

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_nav_brand_img_href = '/assets/img/navbar-brand-img.png'
  ```



  The site development phase indicates the stage of development for a website or application, e.g. alpha or live.
  Conventional phases are described in the
  [Style Kit documentation](https://style-kit.web.bas.ac.uk/core/colours/#development-phase-colours).

  For websites or applications that are not firmly in the 'live' phase, a banner should be shown to inform users and
  request feedback. This forms part of the 'standard header' of cookie banner, navbar and site development phase banner.

  In these templates, the `BskTemplates.bsk_site_development_phase` property is used to specify the current phase for a
  website or application. When using the [bsk_standard layout](#layouts) the banner will be shown automatically.

  To disable this banner, use the `live-stable`. Strictly speaking this isn't a real phase but is recommended by these
  templates to distinguish between a newly released or mature and well-established website or application.

  For example (using a Flask application):

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_development_phase = 'beta'
  ```



  Where a website or application is in a staging environment, or otherwise used for development/testing activities, the
  site phase can be set to `experimental` to use the conventional
  [experimental phase](https://style-kit.web.bas.ac.uk/core/colours/#variants).

  For example (using a Flask application):

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_development_phase = 'experimental'
  ```



  To include the Google Analytics universal tracking library (gtag), set the `BskTemplates.bsk_site_analytics['id']`
  property to relevant Google Analytics property ID.

  **Note:** When used the anonymise IP option in Google Analytics is enabled by default.

  For example (using a Flask application):

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  app.config['BSK_TEMPLATES'].bsk_site_analytics['id'] = 'UA-12345678'
  ```



  Add custom footer content to the `footer_content` block. It will be shown between the
  [divider](https://style-kit.web.bas.ac.uk/components/footer/#divider) and
  [Governance](https://style-kit.web.bas.ac.uk/components/footer/#governance) footer components.

  It is recommended to include a [spacer](https://style-kit.web.bas.ac.uk/components/footer/#spacer) component after any
  footer content to balance the whitespace within the footer.

  For example:

  ```jinja2
  {% block footer_content %}
  <div>Footer content</div>
  <div role="separator" class="bsk-footer-spacer"></div>
  {% endblock %}
  ```

  You can also set custom classes on the footer element by appending to the `bsk_footer_classes` list, or replacing all
  classes by overriding the list.



  [Patterns](https://style-kit.web.bas.ac.uk/patterns/) demonstrate preferred ways to ask information from, or
  provide information to, end users for various tasks.

  There are two types of pattern used in the Style Kit and these templates:

  * [Pages](#page-patterns) - standalone pages designed to be used with or without customisation
  * [Components](#component-patterns) - inline elements designed to be used without customisation using [Macros](#macros)



  Page patterns define content for common pages such as [*Page not found* (404) pages](#using-a-page-pattern).

  These templates implement page patterns as layouts/views. Blocks can be used to provide required or additional
  information as needed.



  For example:

  (basic variant)

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_page-not-found.j2' %}
  ```



  Blocks:

  `pattern_content`
  : General content, including contact information.

  For example:

  (basic variant)

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_problem-with-service.j2' %}

  {% block pattern_content %}
  <p>Contact the <a href="mailto:team@example.com">Example team</a> for more information.</p>
  {% endblock %}
  ```



  Variables:

  `availability`
  : Set to `replaced` for the [replaced](https://style-kit.web.bas.ac.uk/patterns/service-unavailable/#replaced) variant.
    Set to `closed` for the [closed](https://style-kit.web.bas.ac.uk/patterns/service-unavailable/#closed) variant.

  Blocks:

  `pattern_content`
  : General content, including contact information.

  For example:

  (basic variant)

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_service-unavailable.j2' %}

  {% block pattern_content %}
  Contact the <a href="mailto:servicedesk.bas.ac.uk">BAS IT Service Desk</a> for more information.
  {% endblock %}
  ```

  (closed variant)

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_service-unavailable.j2' %}

  {% set availability = 'closed' %}

  {% block pattern_content %}
  Contact the <a href="mailto:servicedesk.bas.ac.uk">BAS IT Service Desk</a> for more information.
  {% endblock %}
  ```



  Variables:

  `call_to_action_url`
  : Set to the href the call to action button should go to

  `call_to_action_variant`
  : Set to `default` for a standard 'start now' call to action button
    Set to `sign-in-microsoft` for a combined 'sign-in to continue' and 'start now' button

  Blocks:

  `pattern_content_uses`
  : Set to an unordered list of items for the 'use this service to:' list

  `pattern_content`
  : General content, including 'more information' for contact information and 'before you begin' section if needed

  For example:

  (basic variant)

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_start.j2' %}

  {% set call_to_action_url = '#' %}

  {% block pattern_content_uses %}
  <ul>
      <li>A task</li>
      <li>Another task</li>
  </ul>
  {% endblock %}

  {% block pattern_content %}
      <section class="bsk-before-you-start">
          <h2 class="bsk-h3">Before you start</h2>
          <p>Before you start information</p>
      </section>
      <section class="bsk-more-information">
          <h2 class="bsk-h3">More information</h2>
          <p>Contact the <a href="mailto:servicedesk.bas.ac.uk">BAS IT Service Desk</a> for more information.</p>
      </section>
  {% endblock %}
  ```

  (more information variant)

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_start.j2' %}

  {% set call_to_action_url = '#' %}
  {% set call_to_action_variant = 'sign-in-microsoft' %}

  {% block pattern_content_uses %}
      <ul>
          <li>A task</li>
          <li>Another task</li>
      </ul>
  {% endblock %}

  {% block pattern_content %}
      <section class="bsk-before-you-start">
          <h2 class="bsk-h3">Before you start</h2>
          <p>Before you start information</p>
      </section>
      <section class="bsk-more-information">
          <h2 class="bsk-h3">More information</h2>
          <p>Contact the <a href="mailto:servicedesk.bas.ac.uk">BAS IT Service Desk</a> for more information.</p>
          <p>More information</p>
      </section>
  {% endblock %}
  ```



  Variables:

  `call_to_action_url`
  : Set to the href the call to action button should go to

  Blocks:

  `pattern_content`
  : Additional, optional, content if needed

  For example:

  (basic variant)

  ```jinja2
  {% extends 'bas_style_kit/patterns/bsk_sign-in-microsoft.j2' %}

  {% set call_to_action_url = '#' %}
  ```



  These templates include macros for all component patterns. Macro parameters are used for customising each instance of
  the component.

  **Note:** Macro parameters are positional, meaning you need to ensure values are provided in the right order to work.
  See the [Style Kit documentation](https://style-kit.web.bas.ac.uk/) for general information on using these patterns.



  Parameters:

  `item_type`
  : The type or kind of thing the item is, e.g. if the item is a person, it's type is 'person'.

  `item_title`
  : A label specific to the item, e.g. if the item is a person their name.

  ```jinja2
  {{ pattern_item_type_header('Item type', 'Item title') }}
  ```

  For example:

  ```jinja2
  {{ pattern_item_type_header('Person', 'Connie Watson') }}
  ```



  Parameters:

  `orcid_id`
  : The ORCID iD of an individual as a URL

  ```jinja2
  {{ pattern_orcid_id('orcid_id') }}
  ```

  For example:

  ```jinja2
  {{ pattern_orcid_id('https://sandbox.orcid.org/0000-0001-8373-6934') }}
  ```



  All components are located in the `bas_style_kit_jinja_templates` package. Variables are
  defined in `bas_style_kit_jinja_templates/__init__.py`, with all other components defined in
  `bas_style_kit_jinja_templates//templates/`.

  Components that are specific to the Style Kit are prefixed with `bsk--` or `bsk_`.



  These templates require a *PrefixLoader* and *PackageLoader*
  [Jinja loader](http://jinja.pocoo.org/docs/2.10/api/#loaders) to be loaded into an application:

  ```python
  loader = PrefixLoader({
      'bas_style_kit': PackageLoader('bas-style-kit-jekyll-templates')
  })
  ```

  To set [Variable](#variables) values used in these templates, a `BskTemplates` class instance is needed. These templates
  assume this instance will be available in Jinja's environment as `config.BSK_TEMPLATES`

  For Flask applications this will occur automatically by adding the class instance to the
  [Flask config object](https://flask.palletsprojects.com/en/1.1.x/config/):

  ```python
  app.config['BSK_TEMPLATES'] = BskTemplates()
  ```

  Typically applications have their own templates too, which can be loaded under a different prefix (such as `app`) using
  a relevant loader, such as the default *FileSystemloader*.

  ```python
  loader = PrefixLoader({
      'app': FileSystemLoader('templates'),
      'bas_style_kit': PackageLoader('bas-style-kit-jekyll-templates')
  })
  ```

  Or a *PackageLoader* (this assumes there is a package named `foo` and that has a module conventionally named
  `templates`:

  ```python
  loader = PrefixLoader({
      'app': PackageLoader('foo'),
      'bas_style_kit': PackageLoader('bas-style-kit-jekyll-templates')
  })
  ```

  In either case, use of a *PrefixLoader* means references to resources should include a prefix and a deliminator
  (`/` by default).

  For example calling an application layout would change from:

  ```jinja2
  {% extends "layouts/base.j2" %}
  ```

  To:

  ```jinja2
  {% extends "app/layouts/base.j2" %}
  ```

  Or to use a layout from these templates:

  ```jinja2
  {% extends "bas_style_kit/layouts/bsk_base.j2" %}
  ```



  Layouts are 'base' templates from which views or other layouts inherit. Layouts in these templates are hierarchical,
  with each layout extending the last in this order:

  1. `blank.j2`: lowest level layout, intentionally as minimal as possible and not intended for direct use, unless
      non-HTML output is needed
  2. `html.j2`: defines a minimal, accessible, HTML5 structure with some recommended best practices for cross-platform
      compatibility
  3. `bsk_base.j2`: intentionally implements the BAS Style Kit as minimally as possible and not intended for direct use,
      unless the `bsk_standard.j2` layout is unsuitable
  4. `bsk_standard.j2`: defines an opinionated, conventional, page layout with a 'standard' header/footer, recommended as
      a base for application/website layouts

  Layouts can be used using the `extend` keyword and defining content in the relevant block:

  | Layout            | Content Block  |
  | ----------------- | -------------- |
  | `blank.j2`        | `content`      |
  | `html.j2`         | `main_content` |
  | `bsk_base.j2`     | `main_content` |
  | `bsk_standard.j2` | `main_content` |

  For example:

  ```jinja2
  {% extends 'bas_style_kit/layouts/bsk_standard.j2' %}

  {% block main_content %}
  Layout content
  {% endblock %}
  ```



  [Blocks](http://jinja.pocoo.org/docs/2.10/templates/#template-inheritance) are used for template inheritance and provide
  a logical structure/hierarchy.

  Blocks are defined in [Layouts](#layouts), typically with default content using [Includes](#includes). Some blocks are
  empty, designed for user content or extensibility.

  To implement or override a block, redefine it in a template or view:

  ```jinja2
  {% block example_block %}
  content ...
  {% endblock %}
  ```

  To append to a block, without overriding its existing content, use the special `{{ super() }}` variable:

  ```jinja2
  {% block example_block %}
  {{ super() }}
  content ...
  {% endblock %}
  ```



  [Includes](http://jinja.pocoo.org/docs/2.10/templates/#include) are used for organising content, to make management
  easier, and to allow common elements to be used in multiple places, typically in [Blocks](#blocks).

  For example the content needed for [using Google Analytics](#google-analytics) is encapsulated in the
  `body--analytics-script.j2` include.



  [Macros](http://jinja.pocoo.org/docs/2.10/templates/#macros) are used to provide configurable, reusable, functionality.

  They are used within other components, such as the [navigation menus](#navigation-menu-items) macro for processing
  primary and secondary navigation menus the same way, and to implement [Component patterns](#component-patterns).



  Various elements in these templates are configurable, such as the name of the application or website, or the CSS/JS
  resources to include. A Python class `BskTemplates` is used to configure these elements and which should be passed to
  the [Jinja environment](#jinja-setup).

  These variables should be changed or set for each website or application:

  `site_title`
  : Name of the application or website

  `site_description`
  : Description of the application or website

  `site_analytics.id`
  : Google Analytics property ID

  `bsk_site_nav_brand_text`
  : Name of the application or website

  `bsk_site_nav_primary`
  : [Primary navigation menu items](#navigation-menu-items)

  `bsk_site_development_phase`
  : [Site development phase](#site-development-phase)

  `bsk_site_feedback_href`
  : URL or `mailto:` value for application or website feedback

  `bsk_site_footer_policies_cookies_href`
  : URL to application or website cookies policy

  `bsk_site_footer_policies_copyright_href`
  : URL to application or website copyright notice

  `bsk_site_footer_policies_privacy_href`
  : URL to application or website privacy policy

  These variables may, but don't need to be, changed or set for each website or application:

  `site_styles`
  : Array of additional CSS files

  `site_scripts`
  : Array of additional JS files

  `container_classes`
  : Array of non-Style Kit classes which set the layout of content, including main content and headers/footers which
    should align the same way

  `main_content_classes`
  : Array of non-Style Kit classes which should only be applied to main page content

  `bsk_container_classes`
  : Array of Style Kit classes which should set the layout of content, including main content and headers/footers which
    should align the same way

  `bsk_main_content_classes`
  : Array of Style Kit classes which should only be applied to main page content

  `bsk_footer_classes`
  : Array of Style Kit classes which should be applied to the standard footer element

  `bsk_site_favicon`
  : Name of the [Favicon](https://style-kit.web.bas.ac.uk/core/favicon) to include (valid options: [`default`])

  `bsk_site_nav_secondary`
  : [Secondary navigation menu items](#navigation-menu-items)

  `bsk_site_nav_brand_img_href`
  : URL to [Navbar brand image](#navbar-branding)

  `bsk_site_nav_brand_href`
  : URL for [Navbar brand elements](#navbar-branding), which should be the index or home of the application or website

  `bsk_site_nav_launcher`
  : [Navigation launcher items](#navigation-menu-items)

  These variables do not normally, and should not, need to be changed or set:

  `site_back_to_top_target_id`
  : ID of the anchor element representing the top of the current page/view

  `site_main_content_target_id`
  : ID of the element representing the main content in a page/view (i.e. skipping navigation elements)

  `bsk_site_footer_ogl_symbol_a_href`
  : URL to the Open Government Licence symbol

  `bsk_site_footer_ogl_text_href`
  : URL to the Open Government Licence text (i.e. the actual licence)

  `bsk_site_footer_ogl_text_version`
  : Version of the Open Government Licence used

  These variables must not be changed and should be treated as read only:

  `templates_version`
  : Version of these templates

  `bsk_version`
  : Version of the Style Kit used by these templates



  These templates are developed as a Python library `bas_style_kit_jinja_templates`. A bundled Flask application
  (`app.py`) is used to simulate its usage.



  Git and [Poetry](https://python-poetry.org) are required to set up a local development environment of this application.

  **Note:** If you use [Pyenv](https://github.com/pyenv/pyenv), this project sets a local Python version for consistency.

  If you have access to the [BAS GitLab instance](https://gitlab.data.bas.ac.uk):

  ```shell

  $ git clone https://gitlab.data.bas.ac.uk/web-apps/bsk/bas-style-kit-jinja2-templates.git


  $ git clone https://github.com/antarctica/bas-style-kit-jinja-templates.git


  $ cd bas-style-kit-jinja2-templates
  $ poetry install
  ```

  To run the bundled Flask app:

  ```shell
  $ poetry run flask run
  ```

  Then visit: [localhost:5000](http://localhost:5000).



  PEP-8 style and formatting guidelines must be used for this project, except the 80 character line limit.
  [Black](https://github.com/psf/black) is used for formatting, configured in `pyproject.toml` and enforced as part of
  [Python code linting](#code-linting-python).

  Black can be integrated with a range of editors, such as
  [PyCharm](https://black.readthedocs.io/en/stable/integrations/editors.html#pycharm-intellij-idea), to apply formatting
  automatically when saving files.

  To apply formatting manually:

  ```shell
  $ poetry run black src/ app.py
  ```



  [Flake8](https://flake8.pycqa.org) and various extensions are used to lint Python files. Specific checks, and any
  configuration options, are documented in the `./.flake8` config file.

  To check files manually:

  ```shell
  $ poetry run flake8 src/
  ```

  Checks are run automatically in [Continuous Integration](#continuous-integration).



  Python dependencies for this project are managed with [Poetry](https://python-poetry.org) in `pyproject.toml`.

  Non-code files, such as static files, can also be included in the [Python package](#python-package) using the
  `include` key in `pyproject.toml`.



  To add a new (development) dependency:

  ```shell
  $ poetry add (--dev) [dependency]
  ```

  Then update the Docker image used for CI/CD builds and push to the BAS Docker Registry (which is provided by GitLab):

  ```shell
  $ docker build -f gitlab-ci.Dockerfile -t docker-registry.data.bas.ac.uk/web-apps/bsk/bas-style-kit-jinja2-templates:latest .
  $ docker push docker-registry.data.bas.ac.uk/web-apps/bsk/bas-style-kit-jinja2-templates:latest
  ```



  ```shell
  $ poetry update
  ```

  See the instructions above to update the Docker image used in CI/CD.



  The [Safety](https://pypi.org/project/safety/) package is used to check dependencies against known vulnerabilities.

  **IMPORTANT!** As with all security tools, Safety is an aid for spotting common mistakes, not a guarantee of secure
  code. In particular this is using the free vulnerability database, which is updated less frequently than paid options.

  This is a good tool for spotting low-hanging fruit in terms of vulnerabilities. It isn't a substitute for proper
  vetting of dependencies, or a proper audit of potential issues by security professionals. If in any doubt you MUST seek
  proper advice.

  Checks are run automatically in [Continuous Integration](#continuous-integration).

  To check locally:

  ```shell
  $ poetry export --without-hashes -f requirements.txt | poetry run safety check --full-report --stdin
  ```



  To ensure the security of this API, source code is checked against [Bandit](https://github.com/PyCQA/bandit)
  and enforced as part of [Python code linting](#code-linting-python).

  **Warning:** Bandit is a static analysis tool and can't check for issues that are only be detectable when running the
  application. As with all security tools, Bandit is an aid for spotting common mistakes, not a guarantee of secure code.

  To check manually:

  ```shell
  $ poetry run bandit -r src/ app.py
  ```

  Checks are run automatically in [Continuous Integration](#continuous-integration).





  All commits will trigger a Continuous Integration process using GitLab's CI/CD platform, configured in `.gitlab-ci.yml`.

  Pip dependencies are also [checked and monitored for vulnerabilities](#dependency-vulnerability-scanning).



  This project is distributed as a Python package, hosted in
  [PyPi](https://pypi.org/project/bas-style-kit-jinja-templates/).

  Source and binary packages are built and published automatically using
  [Poetry](https://python-poetry.org) in [Continuous Deployment](#continuous-deployment).

  **Note:** Except for tagged releases, Python packages built in CD will use `0.0.0` as a version to indicate they are
  not formal releases.



  A Continuous Deployment process using GitLab's CI/CD platform is configured in `.gitlab-ci.yml`.





  1. create a `release` branch
  2. close release in CHANGELOG.md
  3. bump the package version as needed in `pyproject.toml`
  4. push changes, merge the `release` branch into `main` and tag with version

  The project will be built and published to PyPi automatically through [Continuous Deployment](#continuous-deployment).



  1. create a `next-release` branch
  2. bump `templates_version` variable in `bas_style_kit_jinja_templates/__init__.py`
  4. push changes and merge the `next-release` branch into `master`



  The maintainer of this project is the BAS Web & Applications Team, they can be contacted at:
  [servicedesk@bas.ac.uk](mailto:servicedesk@bas.ac.uk).



  This project uses issue tracking, see the
  [Issue tracker](https://gitlab.data.bas.ac.uk/web-apps/bsk/bas-style-kit-jinja2-templates/issues) for more information.

  **Note:** Read & write access to this issue tracker is restricted. Contact the project maintainer to request access.



  Copyright (c) 2019-2024 UK Research and Innovation (UKRI), British Antarctic Survey (BAS).

  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.


