semvec/pypi-packages huggingface dataset:
curl2 1.1.2
cURL To Lang
License: MIT
Requires Python: >=3.5.0


## cURL2

cURL code convert to some programming languages.

Thanks for curlconverter!

Currently supported languages: go, python, node, php, r, strest, rust, elixir, dart, json, ansible, matlab, etc.

## Install curl2
```
pip3 install -U curl2
```

## How to use
### Python
```
curl2 -c "curl https://leesoar.com"
```

* OutPut
```python
import requests

response = requests.get('https://leesoar.com/')

```

### Go
```
curl2 -c "curl https://leesoar.com -l go"
```

* OutPut
```go
package main

import (
        "fmt"
        "io/ioutil"
        "log"
        "net/http"
)

func main() {
        client := &http.Client{}
        req, err := http.NewRequest("GET", "https://leesoar.com", nil)
        if err != nil {
                log.Fatal(err)
        }
        resp, err := client.Do(req)
        if err != nil {
                log.Fatal(err)
        }
        bodyText, err := ioutil.ReadAll(resp.Body)
        if err != nil {
                log.Fatal(err)
        }
        fmt.Printf("%s\n", bodyText)
}

```

### node
```
curl2 -c "curl https://leesoar.com -l node"
```

* OutPut
```node
var request = require('request');

var options = {
    url: 'https://leesoar.com'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

```


### php
```
curl2 -c "curl https://leesoar.com -l php"
```

* OutPut
```php
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array();
$response = Requests::get('https://leesoar.com', $headers);
```
dingtalk-lite 1.0.2
Lite SDK for Dingtalk
License: MIT
Keywords: dingtalk,dingding

#Dingtalk lite SDK
##A lite Dingtalk SDK to simplify sending message
#Example
###To send a message with markdown format:
```
text = "### I am the header\n" + \
       "#### This is a test message, do not worry.\n" + \
       "![girl](https://c-ssl.duitang.com/uploads/item/201605/08/20160508134621_KjzNa.thumb.700_0.gif)\n" + \
       "1. This is the first line\n" + \
       "2. This is the second line\n"
token = 'your-dingtalk-robot-token'
client = Client("https://oapi.dingtalk.com/robot/send")
response = client.send_markdown(token, '[Ambari Alert]', text)
```
###If you want to @ somebody:
```
token = 'your-dingtalk-robot-token'
client = Client("https://oapi.dingtalk.com/robot/send")
at_mobiles = ['185xxxxxxxx', '137xxxxxxxx']
response = client.send_text(token, "[Ambari Alert] This is a test message, do not worry.", at_mobiles)
```
###See client_test.py to get more usages
slobad 0.0.3
Caching of Pandas DataFrames
License: MIT
Requires Python: >=3.6

# slobad

Caching of pandas DataFrames.


## Setup

```
pip install slobad
```

Requires `pandas` and `pyarrow`.


## Usage


Create a `Slobad` object that has a `create` method. The `create` method must
return a non-empty `pandas` `DataFrame`.

```python
import pandas as pd
from slobad import Slobad

class CreateData(Slobad):
    #each Slobad class requires a create method
    def create(self):
        data = [[0] * 10] * (10 ** 6)
        cols = [f'{i}' for i in range(10)]
        df = pd.DataFrame(data, columns=cols)
        return df
```

Execute the built-in `run` method which calls `create` internally.

```python
>>> df = CreateData().run()
```
```
Running CreateData...
Execute create finished in 1.26s.
Write to cache finished in 0.09s.
Load from cache finished in 0.03s.
```

The second time `run` is executed for the identitical object, the DataFrame
is loaded from the cache.

```python
>>> cached = CreateData().run()
```
```
Running CreateData...
Load from cache finished in 0.03s.
```
```python
>>> df.equals(cached)
True
```

See the examples folder for more.
env-credentials 0.1.0
A library to maintain and use encrypted .env files.
License: MIT
Requires Python: >=3.6,<4.0
Keywords: dotenv,credentials,encrypted,settings,environment variables,env

# Env Credentials

Manage environment variables use the dotenv pattern with encrypted files.

This project is an attempted port of the [credentials pattern](https://edgeguides.rubyonrails.org/security.html#custom-credentials)
found in Ruby on Rails.

## Installation

Using pip:

```bash
pip install env-credentials[django]
```

Using poetry:

```bash
poetry add env-credentials[django]
```

## Usage

Initializing and editing the encrypted credentials file is only supported with Django at this time. Additional CLI
tooling can be built for framework-less projects or projects using other frameworks.

### Django

After adding the dependency to your project, add the Django app

```python
INSTALLED_APPS = [
    # ...
    'django_credentials',
    # ...
]
```

You can then initialize the credentials files with

```bash
./manage.py init_credentials
```

This will create a two new files called `master.key` and `credentials.env.enc` in your root folder. If a `.gitignore`
file exists in the same directory, it will also add `master.key` to it.

**Be sure to ignore your master.key file if the gitignore file cannot be automatically updated.**

You can then edit the values in the file using

```bash
./manage.py edit_credentials
```

Be sure that your `$EDITOR` environment variable is set, as that is what the decrypted file will be opened with.

Finally, to load the values into your environment, you should add the following code to your `wsgi.py` and `manage.py`
files

```python
from env_credentials.credentials import Credentials

Credentials().load()
```
aiomihome 1.0.4
Python asyncio implementation of Xiaomi Aqara Hub API
License: MIT
Requires Python: >=3.6.0
Keywords: xiaomi,aqara

# aiomihome

Asyncio version of https://github.com/Danielhiversen/PyXiaomiGateway

## Description
The API only includes a thin layer with out proper handling of devices or sensors with seprate 

Library consist of two classes
* **Service**<br>
  Manage the multisocket interface to the xiaomi bridge and connecting to a gateway. Includes service for discovery of gateways

* **Gateway**<br>
  Handles the connection to the gateway


The bridge needs to be i local mode and key needs to be provided to communicate with the gateway
  
## Usage

Create a new service object. The gateway config key is required to be able to communicate with the gateway. If discovery is used and only one gateway exist only key is needed, if several provide sid or host.

See example folder for runnable code.

### Connect go gateway
#### Run auto discover:
```python
gateways_config = [
    {
      "host": "10.0.4.104", 
      "sid": "7811dcb07917",
      "port": 9898,
      "key": key
     }
]
service = XiaomiService(gateways_config=gateways_config)

# Start the mulitcast socket listner
await service.listen()

# Run the auto discover
gateways = await service.discover()

print("Number of gateways found: {}".format(len(gateways)))

# Get first gateway
gateway = gateways[0]
```

#### Directly connect to gateway:

```python
service = XiaomiService()

# Start the mulitcast socket listner
await service.listen()

# Create a gatewate connetion
gateway = await service.add_gateway("10.0.4.104", 9898, "7811dcb07917", key)
```

#### Close conections
```python
await service.close()
```

### Listners
```python
async def heartbeat_callback(data):
    print("HEARTBEAT RECIVED", data)

async def device_callback(data):
    print("Device data RECIVED", data)

gateway.heartbeat_callback = heartbeat_callback
gateway.device_callback = device_callback
```

### Interact with the gateway
#### Print devices
```python
print("Turn on light")
for device_type, devices in gateway.devices.items():
  print(device_type, len(devices))
  for device in devices:
    print("     ", device['model'])
    print(device)
      for value_key, value in device['data'].items():
        print("         ", value_key, value)
```
#### Set the gateway light
```python
# Red
await gateway.set_color(255, 0, 0)
await asyncio.sleep(1)
# Green
await gateway.set_color(0, 255, 0)
await asyncio.sleep(1)
# Blue
await gateway.set_color(0, 0, 255)
await asyncio.sleep(1)
# Off
await gateway.turn_off_light()
```