semvec/pypi-packages huggingface dataset:
itinerary 1.0.1
A tool to apply pure SQL migrations to PostgreSQL databases at runtime.
License: MIT

# itinerary

A tool to apply pure SQL migrations to PostgreSQL databases at runtime.

Itinerary uses PostgreSQL’s [advisory locks][lock] feature to prevent multiple
instances from running migrations simultaneously. As such, it’s suitable for use
in horizontally scalable applications.

## Installation

``` sh
pip install itinerary
```

## Usage

Put raw SQL files in your migration directory, e.g.:

```
migrations/0001_create_table.sql
migrations/0002_add_column.sql
migrations/0003_create_index.sql
```

Then run the `auto_migrate` function before your application starts.

### Flask example

``` python
import itinerary
from flask import Flask
app = Flask(__name__)

if __name__ == '__main__':
    conn = psycopg2.connect(host='localhost')
    itinerary.auto_migrate(conn)
    app.run()
```

### uWSGI example

``` python
import itinerary
from uwsgidecorators import postfork

@postfork
def migrate_db():
    conn = psycopg2.connect(host='localhost')
    itinerary.auto_migrate(conn)
```

## Configuration

``` python
itinerary.auto_migrate(connection, path='migrations',
                       version_table='_version', lock_id=0)
```

* **path** – Directory to scan for migration files.
* **version_table** – Table to use to keep track of applied migrations. If it
  doesn’t exist, itinerary will create it.
* **lock_id** – The key to use when acquiring and releasing a PostgreSQL
  advisory lock.
  
[lock]: https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LOCKS
yfoptions-dl 1.0.2
Download option chain data from Yahoo Finance
License: MIT

# yfoptions_dl
`yfoptions_dl` is a Python library for downloading daily option chain data from yahoo finance. Data is retrieved using yahoo finance's API, then parsed into a `pandas` dataframe.



## Installing yfoptions_dl

The easiest way to install `yfoptions_dl` is from Python Package Index using `pip`:

    pip install yfoptions_dl



## Example

  
To get all available data fields:

      aapl = optionChain('aapl')
      >>> aapl.data_header
    ['contractSymbol', 'strike', 'currency', 'lastPrice', 'change', 'percentChange', 'volume', 'openInterest', 'bid', 'ask', 'contractSize', 'expiration', 'lastTradeDate', 'impliedVolatility', 'inTheMoney']



To get all available strikes for the front month options:
    
    >>> aapl.strikes
    [57.5, 58.75, 60.0, 61.25, 62.5, 63.75, 65.0, 66.25, 67.5, 68.75, 70.0, .....]

To get the entire call option chain:

    >>> aapl.calls
             contractSymbol  strike  ...                       date  type
    0   AAPL200925C00057500   57.50  ... 2020-09-22 16:24:11.085367     C
    1   AAPL200925C00058750   58.75  ... 2020-09-22 16:24:11.085367     C
    2   AAPL200925C00060000   60.00  ... 2020-09-22 16:24:11.085367     C
    3   AAPL200925C00061250   61.25  ... 2020-09-22 16:24:11.085367     C
    4   AAPL200925C00062500   62.50  ... 2020-09-22 16:24:11.085367     C
    ..                  ...     ...  ...                        ...   ...
    26  AAPL230120C00180000  180.00  ... 2020-09-22 16:24:15.772460     C
    27  AAPL230120C00185000  185.00  ... 2020-09-22 16:24:15.772460     C
    28  AAPL230120C00190000  190.00  ... 2020-09-22 16:24:15.772460     C
    29  AAPL230120C00195000  195.00  ... 2020-09-22 16:24:15.772460     C
    30  AAPL230120C00200000  200.00  ... 2020-09-22 16:24:15.772460     C
    
    [2119 rows x 17 columns]


To get hte entire put option chain:



 

    >>> a.puts
                 contractSymbol  strike  ...                       date  type
        0   AAPL200925P00057500   57.50  ... 2020-09-22 16:24:11.107355     P
        1   AAPL200925P00058750   58.75  ... 2020-09-22 16:24:11.107355     P
        2   AAPL200925P00060000   60.00  ... 2020-09-22 16:24:11.107355     P
        3   AAPL200925P00061250   61.25  ... 2020-09-22 16:24:11.107355     P
        4   AAPL200925P00062500   62.50  ... 2020-09-22 16:24:11.107355     P
        ..                  ...     ...  ...                        ...   ...
        18  AAPL230120P00140000  140.00  ... 2020-09-22 16:24:15.782454     P
        19  AAPL230120P00150000  150.00  ... 2020-09-22 16:24:15.782454     P
        20  AAPL230120P00155000  155.00  ... 2020-09-22 16:24:15.782454     P
        21  AAPL230120P00160000  160.00  ... 2020-09-22 16:24:15.782454     P
        22  AAPL230120P00200000  200.00  ... 2020-09-22 16:24:15.782454     P
        
        [2016 rows x 17 columns]
switcher 0.1.8
python SDK for switch service to publish messages on topics
License: MIT
Keywords: pubsub,events

# swtich-py

[![PyPI version](https://badge.fury.io/py/switcher.svg)](https://badge.fury.io/py/switcher)
[![Build Status:](https://github.com/Kareem-Emad/switch-py/workflows/build/badge.svg)](https://github.com/Kareem-Emad/switch-py/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

python version of switch sdk, allows to publish messages on any topic to trigger all configured
subscribers at switch service.
<https://github.com/Kareem-Emad/switch>

## Setup

To install the package

```shell
pip install switcher
```

## How To Use

first make sure you set up the env variable properlly for:

- `SWITCH_JWT_SECRET` the secret key used to sign tokens for switch service, should be same env as the service itself

- `SWITCH_BASE_URL` the base url of the hosted switch service

```python
from switcher import publisher
publisher.publish('hellow', 'me', {'body': {'hello': 'world'}})
```

params in order:

- `topic` the topic name you wish to trigger subscribers on
- `author` your service identifier string(anything you want)
- `options` a dict containing the data you wish to include in your request:

  - `body` body dict of your request if it's a post/patch/.. request
  - `headers` headers to be sent to the subscriber in the request headers
  - `query_params` a dict containing any query params you wish to add to the subscribers' url (`{param: value}` `=>` `https://google.com?param=value`)
  - `path_params` a dict containing any path variables you wish to subtitute if exits in any of the subscirbers url, example `{id: 1}` `https://googl.com/:id` will be transformed to `https://googl.com/1`
  - `http_method` string representing the http method you wish to use when triggering the subscribers for this topic
selenium-crawler-template 0.4.0
Boilerplate for developing crawler with Selenium.
License: MIT
Requires Python: >=3
Keywords: chromedriver chrome selenium splinter

# Selenium Crawler Template
Boilerplate for developing crawler with Selenium.

## Installation

```bash
pip install selenium-crawler-template
```

## Usage
```python
from selenium_crawler_template import Crawler

class MyCrawler(Crawler):
    @Crawler.open_url_in_new_tab
    def _get_email_from_profile(self, _):
        return self.find_element('a#email').get_attribute('href')

    def crawl(self, **kwargs):
        self.driver.get(kwargs['url'])
        
        for profile in self.find_elements('ul > .profile'):
            _ = self._get_email_from_profile(profile.get_attribute('href'))
           
        self._scroll_to_bottom()
```