semvec/pypi-packages huggingface dataset:
auto-zorder 0.1.1
The project aims to remove the guesswork of selecting columns to be used in the ZORDER statement. It achieves this by analyzing the logged execution plan for each cluster provided and returns the top n columns that were used in filter/where clauses.
Keywords: python,databricks,delta,spark


### Installation

pip install in your Databricks Notebook

```python
%pip install auto_zorder
```

### Example Usage

**Note**: If the cluster log delivery has not been active for very long then you may not see any results.

#### Basic Usage

```python
optimize_cmd = auto_zorder(
                    cluster_ids=['cluster_id_1', 'cluster_id_2'],
                    optimize_table='my_db.my_table'
                    )

print(optimize_cmd)
>>> 'OPTIMIZE my_db.my_table ZORDER BY (col1, col2, col3, col4, col5)'

# To run the OPTIMIZE Command
spark.sql(optimize_cmd)
```

#### Limit the Number of ZORDER columns

```python
optimize_cmd = auto_zorder(
                    cluster_ids=['cluster_id_1', 'cluster_id_2'],
                    optimize_table='my_db.my_table',
                    number_of_cols=2
                    )

print(optimize_cmd)
>>> 'OPTIMIZE my_db.my_table ZORDER BY (col1, col2)'
```

#### Save auto zorder analysis

```python
optimize_cmd = auto_zorder(
                    cluster_ids=['cluster_id_1'],
                    optimize_table='my_db.my_table',
                    save_analysis='my_db.my_analysis'
                    )
```

#### Run auto zorder using analysis instead of cluster logs

```python
optimize_cmd = auto_zorder(
                    use_analysis='my_db.my_analysis',
                    optimize_table='my_db.my_table'
                    )
```

#### Include additional columns and location in ZORDER

```python
optimize_cmd = auto_zorder(
                    cluster_ids=['cluster_id_1', 'cluster_id_2'],
                    optimize_table='my_db.my_table',
                    use_add_cols=[('add_col1', 0), ('add_col2', 4)]
                    )

print(optimize_cmd)
>>> 'OPTIMIZE my_db.my_table ZORDER BY (add_col1, auto_col1, auto_col2, auto_col3, add_col2, auto_col4, auto_col5)'
```
resurrector 0.0.7
Restoring MySQL Databases from their backups
Keywords: python,mysql,database,backup,restore


# Resurrector
Resurrector helps you to restore your backed-up MySQL Databases to any specified instance.

##### Pip
You can install this package from pip by running the following command :
```html
pip install resurrector
```

#### Pros

- Restore multiple databases at once
- No need o know CLI commands to treat backup files
- No need to know an OS to handle this process
- You can specify which databases should be restored and exclude dbs which are should not.
- You can restore only missing databases in the instance (no need to treat the existing ones)
- Automatic decompression

#### Good to know
Depending on your MySql instance settings (such as user permissions or global variable specifications) you may need
to deal with input parameters of the Ressurector (see below).

#### Parameters

Name | Description | Type | Default
--- | --- | --- | --- 
source | Input Folder (.zip or just normal folder) | string | -
host | MySQL Instance Ip | string | localhost
user | MySQL Instance User | string | root
port | MySQL Instance Port | integer | 3306
skip_dbs | List of Databases to skip | array | None
skip_existing | Should it skip the existing Databases? | boolean | True
mysql_global_vars | Global variables which should be run before each restoration | string (if multiple then semicolon sepearated) | SET @@GLOBAL.GTID_PURGED='';
exclude_sql_parts | SQL contents which should be removed | string | SET GLOBAL max_allowed_packet=268435456;
charset | Database charset | string | utf8
collate | Database collation | string | utf8_general_ci
debug | Debug the process on console | boolean | False



### How it works
Resurrector reads a folder (either as zipped or not) and searches for .gz files in it, these must contain .sql files which were
backed up in your servers either automatically or manually. After connecting to the given database instance it creates these databases by
and "fills" them one by one (executes the whole .sql file (query) on each respective database).

### Simple usage

```python

import resurrector

resurrector.resurrect(source='files/2022-07-06',
                      host='localhost',
                      user='root',
                      password='',
                      port=3306, skip_existing=True, debug=True)

```
tornado-ping 0.3.1
Tornado ping implementation
Requires Python: ==2.7
Keywords: network,icmp,ping,tornado

tornado-ping is a fast Tornado implementation of ICMP (ping) protocol.

Forked from https://github.com/stellarbit/aioping to use the Tornado event loop and work with Python 2.7

## Installation

tornado-ping requires Python 2.7.

Use pip to install it from the PyPI::

    $ pip install tornado-ping

Or use the latest version from the master (if you are brave enough)::

    $ pip install git+https://github.com/mgenti/tornado-ping

## Using tornado-ping

There are 2 ways to use the library.

First one is interactive, which sends results to standard Python logger.
Please make sure you are running this code under root, as only
root is allowed to send ICMP packets:

    import tornado_ping
    import logging
    import tornado

    logging.basicConfig(level=logging.INFO)     # or logging.DEBUG
    tornado.ioloop.IOLoop.instance().run_sync(lambda: verbose_ping('8.8.8.8'))

Alternatively, you can call a ping function, which returns a
ping delay in milliseconds or returns None in case of an error:

    import tornado_ping
    import tornado

    @gen.coroutine
    def do_ping(host):
        delay = yield ping(host)
        if delay:
            print "Ping response in %s ms" % (delay * 1000, )
        else:
            print "Timed out"


    tornado.ioloop.IOLoop.instance().run_sync(lambda: do_ping('8.8.8.8'))

## Methods

``ping(dest_addr, timeout=10, family=None)``

- ``dest_addr`` - destination address, IPv4, IPv6 or hostname
- ``timeout`` - timeout in seconds (default: ``10``)
- ``family`` - family of resolved address - ``socket.AddressFamily.AF_INET`` for IPv4, ``socket.AddressFamily.AF_INET6``
  for IPv6 or ``None`` if it doesn't matter (default: ``None``)

``verbose_ping(dest_addr, timeout=2, count=3, family=None)``

- ``dest_addr`` - destination address, IPv4, IPv6 or hostname
- ``timeout`` - timeout in seconds (default: ``2``)
- ``count`` - count of packets to send (default: ``3``)
- ``family`` - family of resolved address - ``socket.AddressFamily.AF_INET`` for IPv4, ``socket.AddressFamily.AF_INET6``
  for IPv6 or ``None`` if it doesn't matter (default: ``None``)

## Credits

- Original Version from Matthew Dixon Cowles:
  ftp://ftp.visi.com/users/mdc/ping.py

- Rewrite by Jens Diemer:
  http://www.python-forum.de/post-69122.html#69122

- Rewrite by Samuel Stauffer:
  https://github.com/samuel/python-ping

- Rewrite by Anton Belousov / Stellarbit LLC <anton@stellarbit.com>
  http://github.com/stellarbit/aioping
  
- Generous contributions from GitHub users:

  - https://github.com/JackSlateur
  - https://github.com/harriv
  - https://github.com/asantoni
  - https://github.com/eddebc
  - https://github.com/wise0wl
  - https://github.com/nARN
  - https://github.com/hergla
  - https://github.com/hanieljgoertz
  - https://github.com/Crypto-Spartan

- Tornado version by Mark Guagenti


## License

tornado-ping is licensed under GPLv2.