semvec/pypi-packages huggingface dataset:
subgram 0.0.4
Python SDK for subgram.io
Requires Python: >=3.8

# Subgram python sdk

This SDK will help you to integrate subscriptions into your Telegram bot.


## Init the module.

Get your `SUBGRAM_TOKEN`: https://t.me/subgram_merchant_bot

``` python
from subgram import Subgram

subgram = Subgram(SUBGRAM_TOKEN)
```


## Check if a user has paid

Get your `PRODUCT_ID`: https://t.me/subgram_merchant_bot

``` python
async def show_paid_functionallity(update, context):
    if await subgram.has_access(
        user_id=update.effective_user.id,
        product_id=SUBGRAM_PRODUCT_ID,
    ):
        await update.effective_user.send_message("You paid!")
```


## Create a checkout page

If you want to send to your user a checkout page link or if your user wants to manage a subscription (same link):


``` python
async def manage_subscription(update, context):
    checkout_page = await subgram.create_checkout_page(
        product_id=SUBGRAM_PRODUCT_ID,
        user_id=update.effective_user.id,
        name=update.effective_user.name,  # for invoices
        language_code=update.effective_user.language_code,  # for localization
    )

    await update.effective_user.send_message(
        "You can manage your subscription by clicking this button:",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("Manage Subscription", 
            web_app=WebAppInfo(url=checkout_page.checkout_url))
        ]]),
    )
```

## Listen to payment events

Instead of forcing your developers to rent a server, purchase a domain name and setting up SSL certificates for classic webhook updates, we replicated a long polling approach which is widely used among Telegram bot developers.


``` python
# define a function which will listen 
# to Subgram updates in the background
async def post_init(application: Application) -> None:
    asyncio.create_task(handle_subgram_events())

# best place to run it -- while building the Application:
def main() -> None:
    application = (
        Application
        .builder()
        .post_init(post_init)
        .token(settings.TELEGRAM_TOKEN)
        .build()
    )
    ...
```

In `handle_subgram_events` you should write your own handlers for each received event type. The function can look like this:

``` python
async def handle_subgram_events():
    bot = Bot(TELEGRAM_TOKEN)  # bot instance to send messages

    # Async Generator 
    async for event in subgram.event_listener():
        if event.type == EventType.SUBSCRIPTION_STARTED:
            await bot.send_message(
                chat_id=event.object.customer.telegram_id,
                text=f"Thank you for subscribing! You have access until: {event.object.status.ending_at}.",
            )
```

All event types are defined in src/subgram/constants.py:

``` python
# from subgram.constants import EventType

class EventType(str, Enum):
    SUBSCRIPTION_STARTED = "subscription.started"
    SUBSCRIPTION_RENEWED = "subscription.renewed"
    SUBSCRIPTION_RENEW_FAILED = "subscription.renew_failed"
    SUBSCRIPTION_CANCELLED = "subscription.cancelled"
    SUBSCRIPTION_UPGRADED = "subscription.upgraded"

```
alex-search 0.3.4
A command-line tool for quickly searching and extracting research papers from openAlex database

Usage
=====

Installation
------------

To install Alex Search, you can use pip:

.. code-block:: bash

    pip install alex-search

Search Command
--------------

The ``search`` command allows you to search for papers using various filters.

Usage:

.. code-block:: bash

    alex-search search [OPTIONS] "Machine learning for fun"

Options:


- ``--author``: Filter search results by specific author(s).
- ``--journal``: Filter search results by specific journal(s).
- ``--cited-by``: Filter search results by the number of times the paper has been cited by other papers.
- ``--cited``: Filter search results by the number of times the paper has cited other papers.
- ``--limit``: Limit the number of search results returned.
pure-html 0.2
Purify HTML by filtering tags and classes
Requires Python: >=3.6

# Pure-HTML
Purify HTML by filtering tags and classes

## Install

```sh
pip install --upgrade pure-html
```

## Usage

```python
from pure_html import batch_purify_html
from pathlib import Path

html_root = Path(__file__).parent / "samples"
html_paths = list(html_root.glob("*.html"))
html_path_and_purified_content_list = batch_purify_html(html_paths)
for item in html_path_and_purified_content_list:
    html_path = item["html_path"]
    purified_content = item["purified_content"]
    print(html_path)
    print(purified_content)
```
nanh-easy-google-search 1.0.0
Google搜索工具

# Google搜索工具
Google官方出的搜索工具无法直接使用代理，就对官方的进行了改动与精简。
根据关键字进行搜索，通过 `BeautifulSoup` 对内容进行解析，并返回搜索的连接地址
项目依赖：
- beautifulsoup4
- Requests
- urllib3

# 安装
## 源码安装
```bash
git clone https://github.com/877007021/easy_google_search.git
pip install -r requirements.txt

```

## pip 安装
```bash
pip install nanh-easy-google-search==0.0.1
```

# 示例
``` python
from nanh_easy_google_search.google import search
# or from google import search  
  
proxies = {  
    'http': 'http://127.0.0.1',  
    'https': 'http://127.0.0.1',  
}  
  
search_link_list = search("easy_google_search", proxies=proxies)  
[print(link) for link in search_link_list]
```
如果此工具有任何问题或错误，请提出问题。
makeitseg2 1.0.0
makeitseg2
Keywords: segy,su,seismic,seg2,segy to seg2 converter,su to seg2 converter,segy to dat file converter,su to dat file converter,segy to dat file converter using python

# makeitseg2

`makeitseg2` is a Python module that converts SEGY or SU (Seismic Un*x) files to SEG2 (or DAT) files. It also supports converting stream data to SEG2 format.

### Getting Started

A working example is provided in the "test.ipynb" file.

### Prerequisites

Before installing `makeitseg2`, ensure that `obspy` is installed. You can install it via pip using the following command:

``` bash
pip install obspy
```

## Installation

Since the pip installation for the latest version of makeitseg2 is not yet available, you can download the repository and install it using the setup file.

``` bash
git clone https://github.com/yourusername/makeitseg2.git
cd makeitseg2
python setup.py install
```
## How it works

To use makeitseg2, you can import it and call the from_file function to convert SEGY or SU files to SEG2 format. Optionally, you can call the from_data function to convert stream data to SEG2 format.

``` python
import makeitseg2

# Convert SEGY or SU file to SEG2
makeitseg2.from_file(SEGY_or_SU_filename, newConverted_SEG2_file_name)

# Convert stream data to SEG2
makeitseg2.from_data(src_rcvr_location, sampling_interval, trace_Array, newConverted_SEG2_file_name)
```
If `newConverted_SEG2_file_name` is not provided, the new SEG2 file will have the same name as the original and will be placed in the `Converted_SEG2` folder.
rabbitmq_worker 0.0.7
Library to create simple rabbitmq workers resilient to connection/channel shutdown and simple producers.
Requires Python: >=3.8

# RabbitmqWorker - Python worker for Rabbitmq

RabbitmqWorker is a worker for rabbitmq which automatically reconnect to the broker if any disconnection occurs.

## Why?

The main library used to manage asynchronous tasks in python is Celery. Celery has its own internal message pattern that must be respected for celery to be able to interpret the messages correctly. In our architecture, we use microservices with multiple language where their task client does not follow Celery's message principle. 

The scope of this library is to make an simple library to manage every kind of message from rabbitmq.

## Installation

RabbitmqWorker is avaiable from [PyPI](https://pypi.python.org/). You can install it with pip.
```
$ pip install rabbitmq_worker
```

## Usage

Instanciate a `RabbitmqWorker` with the appropriate configuration to your needs and run it. E.g:
```python
def process_message(channel, basic_deliver, properties, body):
    print(body)
    channel.basic_ack(basic_deliver.delivery_tag)

rabbitmq_worker = RabbitmqWorker(
    amqp_url="amqp://guest:guest@localhost:5672/%2F",
    queue_name="my_queue",
    callback=process_message
)
rabbitmq_worker.run()
```

RabbitmqWorker use [pika](https://pika.readthedocs.io/en/stable/) under the hood so your amqp_url must be compliant with `URLParameters`(https://pika.readthedocs.io/en/stable/modules/parameters.html#urlparameters) object.
pylfmap 0.3.1
Python wrapper for LFmap software

# pylfmap

This code provides a python interface for the [LFmap](http://www.astro.umd.edu/~emilp/LFmap/LFmap_1.0.tar) galaxy radio sky map generator. For more about LFmap read [here](https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.192.5753&rep=rep1&type=pdf). With the pylfmap class one can use all the features provided by the [healpy](https://github.com/healpy/healpy) (or other relevant python packages).

## Install

The most convenient install method is to use pip which retrieves the latest version of the software and also takes care of any missing dependencies:

        pip install pylfmap

or install using the git:

        pip install git+https://github.com/F-Tomas/pylfmap

Alternatively, clone the directory and run the setup.py:

        git clone https://github.com/F-Tomas/pylfmap
        python setup.py install
        
During the installation, the original C++ LFmap will be downloaded, and on the first run, sky model data in the range from 30 to 80 MHz with 0.1 MHz spacing will be generated.

## Examples

Checkout the `working_example.ipynb` jupyter notebook example.