Metadata-Version: 2.1
Name: telegeo
Version: 0.0.7
Summary: This is a python package for scraping Telegram data based on geolocation.
Author-email: Wanjiang Jacob Zhang <zwj1994code@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Jacob_code
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: geopy~=2.2.0
Requires-Dist: pandas>=1.3.5
Requires-Dist: plotly~=5.10.0
Requires-Dist: telethon~=1.24.0
Requires-Dist: tqdm~=4.64.0
Description-Content-Type: text/markdown

# telegeo

This is a python package for scraping Telegram:iphone: based on geolocation:earth_asia:.

[:loudspeaker:Check this package on PyPI](https://pypi.org/project/telegeo/)

## Installing
```py
pip install telegeo
```

## Dependencies:
(If nothing odd happens, users will install all the following dependencies of telegeo automatically after running "pip install telegeo"):  
`pandas`  
`geopy`  
`plotly`  
`tqdm`  
`telethon`  

## How to use
`step1:` import telegeo
```py
from telegeo import telegeo
```

`step2:` generating all coordinates within the specified latitude and longitude range.  
use the map_range() fucntion in telegeo to generate the coordinates you need.

users should provide the following parameters⬇  
★**lat_max**: max latitude of the map range.  
★**lon_max**: max longitude of the map range.  
★**lat_min**: min latitude of the map range.  
★**lon_min**: min longitude of the map range.  
★**distance**: the distance between two coordinates on the map.  
★**save_path**: the path and filename for saving a csv file, which records all the coordinates.  
_(see Figure 1 for the first 5 parameters)_

Example:   
Move every 500 meters to generate all coordinates covering Hong Kong.
And, save as csv.
```py
telegeo.map_range(22.560100,114.404948,22.155232,113.835564,0.5,'geo_range_hk_r500.csv')
```
`step3:` generate a interactive map for displaying and checking the coordinates on a world map.  
use the map_show() function in telegeo to create the map based on the above csv file.

```py
telegeo.map_show('geo_range_hk_r500.csv')
```
![Figure 2](https://user-images.githubusercontent.com/60833574/187110262-5f72ae26-171d-4493-9844-e67ced0e90d7.png)


More tutorial: To Be Continued...
