semvec/pypi-packages huggingface dataset:
hahusms 0.0.1
A simple python package to send SMS via HahuCloud API
Requires Python: >=3.7

# API Guide for Hahu Cloud SMS Gateway

This is simple python api for [hahucloud sms](https://sms.hahucloud.com). It is a RESTful API, and you can use it to send SMS messages to your customers. It is a simple and easy to use API.

This is **unofficial API**, and it is **not** supported by **Hahu Clouds**. It is just a guide for you to use Hahu SMS API. If you have any questions, please contact us.

Contact Information:

    - Email: chapimenge3@gmail.com
    - Telegram: @chapimenge
    - Twitter: @chapimenge
    - Linkedin: https://www.linkedin.com/in/chapimenge/

## Installation

hahusms is available on PyPI:

```bash
python -m pip install hahusms
```

Hahusms officially supports Python 3.7 and above.

## User Guide

Simple API Reference:

```python
from hahusms import SMS

sms = SMS(api_key='your_api_key')

response = sms.send_message(to='+86xxxxxxxx', message='Hello world!')
print(response['status'])
print(response['message'])
print(response['data'])

# Or you can use the following to make the response from json to object

sms = SMS(api_key='your_api_key', response_format="obj")
response = sms.send_message(to='+86xxxxxxxx', message='Hello world!')
print(response.status)
print(response.message)
print(response.data.message)
```

## API Reference

The SMS class the base class for all API calls. You can set the following parameters when you initialize the SMS class:

    - api_key: Your API key.
    - response_format: The response format. It can be "json" or "obj".
    - device (optional): The device id to set your own default device.
    - sim (optional): The sim slot to set your own default sim slot.
    - priority (optional): The priority of the message. It can be 0 or 1.

To use the above parameters we can use as below

```python

from hahusms import SMS
sms = SMS(api_key='your_api_key', response_format="json",
          device='your_device_id(int)', sim='your_sim_slot(int)',
          priority=1)

```

You can pass the parameters when you call the API.

```python
sms = SMS(api_key='your_api_key', response_format="obj")
params = {
    "id": 1
}
response = sms.get_device(params=params)
print(response.status)
print(response.message)
print(response.data.name) # The response is object type because we set response_format="obj"
```

you can always override the SMS class and define your own custom methods to call the API.

## Available Methods

**SMS** class have the following methods:

    - create_contact
    - create_group
    - delete_contact
    - delete_group
    - get_contacts
    - get_groups
    - get_device
    - get_devices
    - get_pending
    - get_received
    - get_received
    - send
    - send_message - required parameters: to, message

You can find the official **Postman Collection** for each method in the [API Reference](https://sms.hahucloud.com/HahuCloudSMS.postman_collection.json).
tweego 1.1.0
Generate ego networks for users from Twitter.

# Tweego

Generate second order ego networks for users from Twitter. Create egocentric graphs with the twitter api. Tweego allows you to resume data collection over multiple sessions.

# Usage

## Installation

```
pip install tweego
```

## CLI

```
tweego [OPTIONS]

Options:
  -fo, --first-order            Flag: Collect first order ego
  -u, --users                   Flag: Collect user data
  -so, --second-order           Flag: Collect second order ego
  -g, --graph                   Flag: Generate graph file
  -d, --dir PATH                Directory to store data
  -k, --keys-file PATH          Location of the api keys JSON file
  -n, --screen-name TEXT        The screen name of the ego center user
  -f, --follower-limit INTEGER  Number of followers for the second order ego
  --version                     Show the version and exit.
  --help                        Show this message and exit.
```

### Example

Collect everything:

```
tweego -d "dataset" -k "keys.json" -n "github" --fo --u --so -g
```

Collect first order connections only:

```
tweego -d "dataset" -k "keys.json" -n "github" --fo
```

Collect users and second order connections only:

```
tweego -d "dataset" -k "keys.json" -n "github" --u --so
```

## API keys format

Tweego supports multiple api keys to speed up the data collection process. The api keys should be in a JSON file with the following format.

You can get these details from the [Twitter developer website](https://developer.twitter.com/en/portal/projects-and-apps) by creating a standalone app and then generating the keys and tokens.

```json
[
    ...
    {
        "app_key": "<<app_key>>",
        "app_secret": "<<app_secret>>",
        "oauth_token": "<<oauth_token>>",
        "oauth_token_secret": "<<oauth_token_secret>>"
    },
    {
        "app_key": "<<app_key>>",
        "app_secret": "<<app_secret>>",
        "oauth_token": "<<oauth_token>>",
        "oauth_token_secret": "<<oauth_token_secret>>"
    },
    ...
]
```

# Folder Structure

Once Tweego is done, the folder structure should look like this:

```
dir
├── users
│   ├── user_id_1.json
│   ├── user_id_2.json
│   └── ...
├── screen_name
│   ├── user_id_1
│   |   └── user_id_1.txt
│   ├── user_id_2
│   |   └── user_id_2.txt
│   └── ...
├── screen_name.txt
└── screen_name.gml
```

The `users` directory contains information about each user, the `screen_name` directory contains the follower ids of users. The `screen_name.gml` file contains the ego network and an application like `Gephi` can be used to analyze it.