Python module for scraping the Slack App Directory.
You can install the package using pip:
pip install slack-apps-python
import app_directory
app_directory.get_categories()
app_directory.get_category(slug)
app_directory.get_applications(slug, page)
app_directory.get_application(slug)
Returns a list of dictionaries representing the categories in the Slack App Directory.
>>> from app_directory import get_categories
>>> categories = get_categories()
>>> print(categories)
[
{
'name': 'Featured',
'slack_id': 'At0EFWTR6D',
'slug': 'At0EFWTR6D-featured',
'url': 'https://slack.com/apps/category/At0EFWTR6D-featured'
},
...
]
Returns a dictionary containing information for a single category. The category may have additional data such as a description.
>>> from app_directory import get_category
>>> category = get_category('At0MQP5BEF-bots')
>>> print(category)
{
'description': 'Bots are like having a virtual team member — they can help you manage tasks, run your team standup, poll the office, and more!',
'name': 'Bots',
'slack_id': 'At0MQP5BEF',
'slug': 'At0MQP5BEF-bots',
'url': 'https://slack.com/apps/category/At0MQP5BEF-bots'
}
Returns a list of dictionaries representing a single page of applications in a category.
>>> from app_directory import get_applications
>>> applications = get_applications('At0EFWTR6D-featured', 1)
>>> print(applications)
[
{
'avatar': 'https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2016-05-03/39674680625_65ad135f72eff91b6ddf_96.jpg',
'is_slack_owned': False,
'name': '@must-read',
'position': 1,
'short_description': 'Controllable must-read lists for your team in Slack 📕📗📘',
'slack_id': 'A15KDN02Y',
'slug': 'A15KDN02Y-must-read',
'url': 'https://slack.com/apps/A15KDN02Y-must-read'
},
...
]
Returns a dictionary containing information for a single application.
>>> from app_directory import get_application
>>> application = get_application('A15KDN02Y-must-read')
>>> print(application)
{
'avatar': 'https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2016-05-03/39674680625_65ad135f72eff91b6ddf_512.jpg',
'categories': [
{
'name': 'Featured',
'slack_id': 'At0EFWTR6D',
'slug': 'At0EFWTR6D-featured',
'url': 'https://slack.com/apps/category/At0EFWTR6D-featured'
},
...
],
'description': '@must-read transforms any important message into micro-task...',
'help_url': 'https://finalem.com/must-read/help',
'name': '@must-read',
'privacy_policy_url': 'https://finalem.com/must-read/privacy-policy',
'screenshots': [
'https://s3-us-west-2.amazonaws.com/slack-files2/images/2017-07-20/216663485463_0196a3e4ff408839be40_1600.png',
...
],
'short_description': 'Controllable must-read lists for your team in Slack 📕📗📘',
'slack_id': 'A15KDN02Y',
'slug': 'A15KDN02Y-must-read',
'url': 'https://slack.com/apps/A15KDN02Y-must-read'
}
You can run the included unit tests with python -m unittest
.