semvec/pypi-packages huggingface dataset:
ssh-session-manager 0.5.1
Execute commands on multiple remote SSH sessions
Requires Python: >=3.7

# ssh_session_manager

Execute commands on multiple remote SSH sessions

[PyPI](https://pypi.org/project/ssh-session-manager/)


## Example 1: Using the `SSHSession`

```python
from ssh_session_manager.Command import Command
from ssh_session_manager.SSHSession import SSHSession


ls_command = Command("ls -la")
ps_command = Command("ps -ax")

commands = [
    ls_command,
    ps_command
]

with SSHSession("Silver Server", "10.0.0.57", "user", "password") as ssh_session:
    for command in commands:
        ssh_session.run_command_in_ssh_session(command)

command_output_dictionary = ssh_session.get_command_output_dictionary(ps_command)

standard_output_lines = command_output_dictionary["standard_output_lines"]
standard_error_lines = command_output_dictionary["standard_error_lines"]
exit_status = command_output_dictionary["exit_status"]
```

## Example 2: Using the `SSHSessionManager`

```python
from ssh_session_manager.Command import Command
from ssh_session_manager.SSHSession import SSHSession
from ssh_session_manager.SSHSessionManager import SSHSessionManager


ssh_session_1 = SSHSession("Silver Server", "10.0.0.57", "user", "password")
ssh_session_2 = SSHSession("Black Server", "10.0.0.58", "user", "password")

ssh_sessions = [
    ssh_session_1,
    ssh_session_2
]

ls_command = Command("ls -la")
ps_command = Command("ps -ax")

commands = [
    ls_command,
    ps_command
]

with SSHSessionManager(ssh_sessions) as ssh_session_manager
    ssh_session_manager.run_commands_in_ssh_sessions(commands)

command_output_dictionary = ssh_session_manager.get_command_output_dictionary(ssh_session_1, ls_command)

standard_output_lines = command_output_dictionary["standard_output_lines"]
standard_error_lines = command_output_dictionary["standard_error_lines"]
exit_status = command_output_dictionary["exit_status"]
```
elasticwrapper 0.0.1
Automatically chooses between versioned Elasticsearch imports

# elasticwrapper

Elasticsearch offers (major) API-versioned packages for its Python SDK, called `elasticsearch2`,
`elasticsearch5` and so on.
This wrapper connects to the given URL, retrieves the major version and imports the versioned
module according to that.

Usage examples:

```python
from elasticwrapper import elasticsearch

es = elasticsearch.Elasticsearch()

res = es.search(index="*", body={})
```

This will connect to the default `http://localhost:9200/` URL.

## Customizing the wrapper

You can override defaults in the following ways:

### With environment variables

You can set the Elasticsearch URL with the following environment variable:

```sh
ELASTICWRAPPER_URL=http://localhost:9200 python -c "from elasticwrapper import elasticsearch; print(elasticsearch)"
```

And the connect timeout with:
`ELASTICWRAPPER_TIMEOUT`
(specified in seconds)


### Through `builtins`

The URL can be set from code as well, either by setting the above environment variable (before)
the import, or by through the `builtins` module:

```python
# anywhere in the code before the `elasticwrapper` import
import builtins
builtins.elasticwrapper_url = "http://localhost:9200"
builtins.elasticwrapper_timeout = 30

# anywhere in the code after variables has been set up in `builtins`
from elasticwrapper import elasticsearch
```

# Caveats

Elasticwrapper (currently) does nothing more than selecting the right (major) `elasticsearch`
module to be imported and imports it under `elasticwrapper.elasticsearch`.

Be aware, that `elasticsearch` might be incompatible with your Elasticsearch cluster even in the
same major version (like `7.x`).
Also, `elasticwrapper` currently does nothing to provide API compatibility, so different SDK versions
might (and will) need different syntax.
cursed-datatypes 0.1.0
"list & tuple datatypes alowing floating point indices and slices"
Requires Python: >=3.6

## cursed\_dataypes is a library offering cursed variations of standard Python datatypes (so far limited to cursed\_list)

---

### install: `pip install cursed-datatypes`

### import: `from cursed_datatypes import cursed_list, cursed_tuple`


### What is cursed about these datatypes?

well, you know how you absolutely never thought "I wonder what element 2.345 of this list is"? 

cursed\_list allows you to find out! 

cursed\_list extends the builtin list type to allow floating point indices, or floating point slices.

It interpolates the values of the list elements to get these fractional elements; 

e.g. `cursed_list([1,2,3])[0.333])` would give `1.333`

floating point slices work similarly, including if the step is a float 

Note: this means the number of elements of a slice of a cursed\_list can be *more* than the length of the 
      original cursed\_list object. 

cursed\_tuple works similarly, except it is immutable.

---

![cursed list demo screenshot](cursed_python.png)

---

### Limitations:
Can only assign to cursed\_list slices as if it were a normal list; no floats

Can't handle complex number indices - I have no idea what that should even look like

### Where should I use this?
You probably shouldn't, definitely not for anything serious. 

The whole point of this is to be like nails on a chalkboard for programmers.