Skip to content

A simple Python wrapper around some of the Socialcast API

License

Notifications You must be signed in to change notification settings

ihuston/socialcasting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socialcasting

A simple Python helper for the Socialcast API

Author: Ian Huston

This small package provides a simple interface to the Socialcast API.

To specify your API endpoint and your credentials use the SOCIALCAST_API, SOCIALCAST_USERNAME and SOCIALCAST_PASSWORD environmental variables.

The following high level commands are useful:

  • get_all_messages(storage_dir) Get all the messages from the company stream and store as JSON.
  • transform_dataframe(msg_list) Convert a raw message list into a Pandas DataFrame.
  • flag_topics(df, topics_by_name) Given a dictionary of regex expressions, add flags identifying which contain these topics.
  • daily_counts(df) Make daily counts of the number of messages in each topic.

Requirements

Main requirements: Pandas, Requests

Test requirements: Pytest, Responses

As Pandas depends on NumPy, the recommend way to install is using Conda. You can create a new conda environment and install this package with the following:

$ git clone https://github.com/ihuston/socialcasting.git
$ cd socialcasting
$ conda create -n socialcasting python=3 numpy pandas requests
$ source activate socialcasting
$ python setup.py install

Installation

Clone this repo and run python setup.py install.

Testing

Use Pytest or run python setup.py test.

License

MIT License, see LICENSE.txt

About

A simple Python wrapper around some of the Socialcast API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages