Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PierreEtienneJ/twitter-graph-auto-report
A python script to write a report automatically in docx for a twitter-graph
https://github.com/PierreEtienneJ/twitter-graph-auto-report
Last synced: 3 months ago
JSON representation
A python script to write a report automatically in docx for a twitter-graph
- Host: GitHub
- URL: https://github.com/PierreEtienneJ/twitter-graph-auto-report
- Owner: PierreEtienneJ
- Created: 2022-02-11T08:59:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-14T13:26:01.000Z (over 2 years ago)
- Last Synced: 2024-05-29T23:20:00.863Z (5 months ago)
- Language: Python
- Size: 587 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twitter-graph : auto-report
| WARNING: This repo is under test ! |
| --- |The main objective is to write an automatic report to facilitate the analysis of a twitter graph.
| Twitter-graph : To know how to make a twitter-graph, look [eleurent's repo](https://github.com/eleurent/twitter-graph): |
| --- |## Installation
**Testing with python3.8**
Need pip packages:
| pip packages | tested version |
| --- | --- |
| python-docx | 0.8.11 |
| numpy | 1.19.5 |
| pandas | 0.25.3 |
| igraph | 0.9.9 |
| textdistance | 4.2.2 |
| matplotlib | 3.4.2 |Install requirements with :
> pip3 install -r requirements.txt## How to use
```python
from autoReport import *autoReport("nodes.csv", "edges.csv",
{2339:"magenta",
2433:"limegreen",
2566:"deepskyblue",
1052:"saddlebrown",
2498:"darkorange",
1583:"red"},
{"name":"Antoine Bondaz",
"at":"@AntoineBondaz",
"description":"""Foodie - π΅πΌβResearch @FRS_org - π¨πΌβπ« Teach @SciencesPo - π¨π³πΉπΌπ°π·π°π΅'s foreign & security policies - Ph.D."""},
rank_col_name="pageranks",
class_col_name="modularity_class",
).makeReport("out.docx",
per_edeges=1,
show_internal_link=False)```
Creates a report _out.docx_ for Antoine Bondaz, with 6 class. nodes.csv have two columns : one with the rank of the nodes (default **pageranks**) and one with class (default **modularity_class**). If columns have special name, specify the argument class_col_name for class columns name and rank_col_name for rank column name in the construct.
### Advice
- If your graph comes from the tweets search, you can add the tweets.json file with the tweets_path parameter (on the constructor) to have more graphics.
- To test quickly, you can add the per_edeges=0.1 parameter (to the makeReport method) to test the link graph with 10% of edges. Important to verify the correct installation of igraphIf the size of the nodes is calculated with In-Degree and In-Degree is not in the columns of the csv nodes, you can specify `InDegree` for the `rank_col_name` parameter, it will calculate it.
## The report
The report is divided into 2 parts: the first one looks at the whole graph, the second one at each class.
### Introduction
#### Class distribution
![Class distribution](example/[email protected])
#### Links between class
![Links between class](example/[email protected])
#### Most common words
![Most common words](example/[email protected])
#### Similarity of descriptions
![Similarity of descriptions](example/[email protected])
## Class analysis
### Class magenta ( 20.9%)
#### Most 10 common words
![Class magenta Most 10 common words](example/[email protected])