semvec/pypi-packages huggingface dataset:
mobility-graph 0.0.5
This package has the necessary tools to read, analyze and turn mobility data into a graph object
Keywords: gtfs,transit,mobility

# Mobility Graph
Mobility Graph is a Python package for the creation, manipulation, 
and study of the mobility systems, dynamics, and functions of complex intermodal
mobility networks.
 ---
## A graph tool for a better network analysis:
The objective of this package is to build a directed (or a multi directed) graph 
that contains all the basic tools to manipulate the graph and study changes
with a focalization on mobility specific functions such as shortest path and network density and connectivity.
###### Graph structure:
* Nodes for stops, edges for connected stops with the respective mode.
###### Analysis tools:
* Reads different mobility data and builds an adaptive graph to the mode of mobility. 
* Many standard graph algorithms
* Standard mobility networks analysis tools
###### Search Algorithm tools:
* Search algorithm to find all possible paths from origin to destination with the respective modes. 
###### Best Path Algorithm:
* Search Algorithm to define the best possible route based on the chosen filter. (Mode, walk score, affluence) 

---
## Documentation
If you meet the following error on a Windows machine:

> A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.

>[Click here](https://docs.google.com/document/d/1PF0l9LtsrhsUs3WZcB8eT20CzDM3_sy-0xHDDod95Vo/edit?usp=sharing) for a complete walkthrough.
---

##Usage
This repository contains all project files. 
## Simple example
```python
"""
Create a generic graph with two nodes and one edge
"""
from mobility_graph import Graph


g = Graph() # creating a graph object

g.add_node(stop_id='a', stop_name='Origin', stop_lon='1', stop_lat='3') 
g.add_node(stop_id='b', stop_name='Destination', stop_lon='5', stop_lat='2')

g.add_edge('a', 'b', 20, 'walk')

for node in g:
    for w in node.get_connections():
        vid = node.get_id()
        wid = w.get_id()
        print ('( %s , %s, %s, %s)' % (vid, wid, node.get_weight(w), node.get_mode(w)))

for node in g:
    print('g.node_dict[%s]=%s' % (node.get_id(), g.node_dict[node.get_id()]))

```
## Installing the package
```
pip install mobility-graph
```
## Installing Requirements
```
$ pip install -U -r requirements.txt
```
## Roadmap
The objective of this tool is to contribute to a larger intermodal trip planning framework. For more info please check the this [whitepaper](https://docs.google.com/document/d/1wl_YGfecbTujSkPWsCfECim2OPL1EkT04-U0yEIWXBg/edit?usp=sharing) 
## Contribution 
You are welcome to create a pull request, for major changes and ideas to improve the framework feel free to open a discussion
or send me an [email](ayman.mahmoud@student-cs.fr) to collaborate.

## License
The MIT License (MIT)

Copyright (c) 2020 Transport for Cairo (see LICENSE.txt)
twistream 0.1.4
Automate Twitter Stream data collection
Keywords: Social Media,Twitter,Data Mining,Data Collection

# Twistream: Twitter Stream API data collection

[![CircleCI](https://circleci.com/gh/guillermo-carrasco/twistream.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs)
[![PyPI version](https://badge.fury.io/py/twistream.svg)](https://badge.fury.io/py/twistream)

Twistream helps you automatically collect and store data from Twitter Stream API.

## Installation

Latest stable release:

    pip install twistream

From source:

    git clone https://github.com/guillermo-carrasco/twistream.git
    cd twistream
    pip install .

### Setting up

#### Twitter credentials
You need your twitter credentials in order to be able to use Twitter API. For that,
create an application [here](https://apps.twitter.com). Once created, save the credentials to configure
twistream

#### Create a configuration file

You can use the command `twistream init` to help you create a correctly formatted configuration file
for your collections.

Once created, you will have a file that will luke like this:

```
~> cat ~/.twistream/twistream.yml      

twitter:                  
  consumer_key: your_consumer_key                   
  consumer_secret: your_consumer_secret             
  access_token_key: your_access_token_key             
  access_token_secret: your_access_token_secret       
      

backend: backend_name                  

backend_params:
    username: db_username
    password: db_password
```

## Usage

__**Remember that `--help` is always an available option**__

Once created a configuration file, start collecting tweets!

```
twistream collect --tracks tracks,to,follow config.yaml
```

Refer to the [twitter documentation][streaming-docs] to know what tracks are, in short: 

> A comma-separated list of phrases which will be used to determine what Tweets will be delivered 
> on the stream. A phrase may be one or more terms separated by spaces, and a phrase will match 
> if all of the terms in the phrase are present in the Tweet, regardless of order and ignoring case.
> By this model, you can think of commas as logical ORs, while spaces are equivalent to 
> logical ANDs (e.g. ‘the twitter’ is the AND twitter, and ‘the,twitter’ is the OR twitter).

If what you want is to follow **hashtags**, don't forget to include the `#` character.

### Supported backends

From version 0.1.3, twistream supports two backends. A relational database (SQLite) and a no-sql database (MongoDB). 

NOTE that the SQLite backend will only save a couple of tweet fields, whilst the MongoDB backend will save the whole blob.
It is a trade off between information and storage space. 

#### Backend params format

##### SQLite

```
backend: sqlite

backend_params:
    db_path: /path/to/your/db
```

##### MongoDB

```
backend: mongodb

backend_params:
    db_string: database_connection_string
```

(See database connection string documentation)

[streaming-docs]: https://developer.twitter.com/en/docs/tweets/filter-realtime/guides/basic-stream-parameters
[connection-string]: https://pymongo.readthedocs.io/en/stable/tutorial.html#making-a-connection-with-mongoclient