# st-social-media-links
![example](https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/example.png)
[Live Demo](https://social-media-links.streamlit.app)
## About
A Python package designed to assist in displaying social media links within Streamlit apps.
## Install
```python
pip install st_social_media_links
```
## Usage
```python
from st_social_media_links import SocialMediaIcons
social_media_links = [
"https://www.facebook.com/ThisIsAnExampleLink",
"https://www.youtube.com/ThisIsAnExampleLink",
"https://www.instagram.com/ThisIsAnExampleLink",
"https://www.github.com/jlnetosci/st-social-media-links",
]
social_media_icons = SocialMediaIcons(social_media_links)
social_media_icons.render()
```
<p align="center" width="100%">
<img src="https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/icons1.png">
</p>
---
### Customization options
**`SocialMediaIcons`** takes two arguments:
- `social_media_links`: a list with web links. You can choose the order of the icons through the order of the web links, each icon will be displayed in its respective position.
- `colors`: an optional list of custom colors for the icons. If it is not given, icons show their default color. If given, it should have the same length as `social_media_links`, if it does not, all icons will show their default color. Accepted values include [HTML color names](https://www.w3schools.com/tags/ref_colornames.asp), as well as HEX color codes.
```python
from st_social_media_links import SocialMediaIcons
social_media_links = [
"https://www.facebook.com/ThisIsAnExampleLink",
"https://www.youtube.com/ThisIsAnExampleLink",
"https://www.instagram.com/ThisIsAnExampleLink",
"https://www.github.com/jlnetosci/st-social-media-links",
]
colors = ["#000000", "Brown", "SteelBlue", "Lime"]
social_media_icons = SocialMediaIcons(social_media_links, colors)
social_media_icons.render()
```
<p align="center" width="100%">
<img src="https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/colors1.png">
</p>
----
If you do not want to customize all colors, you can use `None` at any index in `colors` and that icon will show its default color.
```python
from st_social_media_links import SocialMediaIcons
social_media_links = [
"https://www.facebook.com/ThisIsAnExampleLink",
"https://www.youtube.com/ThisIsAnExampleLink",
"https://www.instagram.com/ThisIsAnExampleLink",
"https://www.github.com/jlnetosci/st-social-media-links",
]
colors = ["#000000", None, "SteelBlue", None]
social_media_icons = SocialMediaIcons(social_media_links, colors)
social_media_icons.render()
```
<p align="center" width="100%">
<img src="https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/colors2.png">
</p>
----
**`render`** has two optional arguments:
- `sidebar`
- `justify_content`
`sidebar` is a boolean and therefore can be `True` or `False`. Its default value is `False`. It is possible to render with both options simultaneously, if you want to display the icons with social media links in both the main-page and the sidebar, i.e.:
```python
social_media_icons.render(sidebar=False) #will render in the main-page
social_media_icons.render(sidebar=True) #will render in the sidebar
```
If you want to have the icons exclusively in the sidebar, you only need to render it once:
```python
social_media_icons.render(sidebar=True) #will render in the sidebar
```
---
`justify_content` gives some freedom regarding icon placement. In brief, it completes the [CSS `justify-content` property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) used, and therefore may take the same options e.g. `center`, `start`, `end`, `space-between`, `space-around`, `space-evenly`, etc. Its default value is `center`. `justify_content` can have different values for separate renderings:
```python
# Rendering in the main-page with icons centered
social_media_icons.render(sidebar=False, justify_content="center")
# Rendering in the sidebar with icons evenly spaced
social_media_icons.render(sidebar=True, justify_content="space-evenly")
```
---
## Platforms supported
In version 0.1.4, **`st-social-media-links`** supports links to:
Buy Me a Coffee, Discord, Facebook, Flickr, Github, Gitlab, Instagram, Ko-fi, Linkedin, Medium, Patreon, Pinterest, Reddit, Skype, Slack, Snapchat, Spotify, Stack Overflow, Telegram, Threads, TikTok, TradingView, Tumblr, Twitch, Twitter, Vimeo, Whatsapp, X, and Youtube.
## Tips
When paired with `st.divider()` the icon sets look very aesthetically pleasing.
Even though I have not tested it much, [`add_vertical_space`](https://arnaudmiribel.github.io/streamlit-extras/extras/add_vertical_space/) might help you achieve the positioning you want for your social media icons.
## Acknowlegments
For this project, I do have to acknowledge [Font Awesome](https://fontawesome.com/) for their huge selection of icons and the ease with which they implemented. The Awesome in their name is well deserved!
Thanks to Raúl Pérula Martínez (raulperula @ github) for suggesting the addition of Medium. Thanks to Pedro Damasceno (pcDamasceno @ github) for suggesting the addition of Buy Me a Coffee, Flickr, Skype, Slack, Snapchat, Spotify, Stack Overflow, Telegram, TradingView, Vimeo, and Whatsapp.
Raw data
{
"_id": null,
"home_page": "https://github.com/jlnetosci/st_social_media_links",
"name": "st-social-media-links",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "streamlit social media links",
"author": "Jo\u00e3o L. Neto",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8f/c8/fbd90ca8f7b2152455862ec97e70981f7da321a714b6c957e72497598130/st_social_media_links-0.1.4.tar.gz",
"platform": null,
"description": "# st-social-media-links\n\n![example](https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/example.png)\n[Live Demo](https://social-media-links.streamlit.app)\n\n## About\nA Python package designed to assist in displaying social media links within Streamlit apps.\n\n## Install\n```python\npip install st_social_media_links\n```\n\n## Usage\n```python\nfrom st_social_media_links import SocialMediaIcons\n\nsocial_media_links = [\n \"https://www.facebook.com/ThisIsAnExampleLink\",\n \"https://www.youtube.com/ThisIsAnExampleLink\",\n \"https://www.instagram.com/ThisIsAnExampleLink\",\n \"https://www.github.com/jlnetosci/st-social-media-links\",\n]\n\nsocial_media_icons = SocialMediaIcons(social_media_links)\n\nsocial_media_icons.render()\n```\n\n<p align=\"center\" width=\"100%\">\n <img src=\"https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/icons1.png\"> \n</p>\n\n---\n\n### Customization options\n**`SocialMediaIcons`** takes two arguments: \n\n- `social_media_links`: a list with web links. You can choose the order of the icons through the order of the web links, each icon will be displayed in its respective position. \n\n- `colors`: an optional list of custom colors for the icons. If it is not given, icons show their default color. If given, it should have the same length as `social_media_links`, if it does not, all icons will show their default color. Accepted values include [HTML color names](https://www.w3schools.com/tags/ref_colornames.asp), as well as HEX color codes.\n \n```python\nfrom st_social_media_links import SocialMediaIcons\n\nsocial_media_links = [\n \"https://www.facebook.com/ThisIsAnExampleLink\",\n \"https://www.youtube.com/ThisIsAnExampleLink\",\n \"https://www.instagram.com/ThisIsAnExampleLink\",\n \"https://www.github.com/jlnetosci/st-social-media-links\",\n]\n\ncolors = [\"#000000\", \"Brown\", \"SteelBlue\", \"Lime\"]\n\nsocial_media_icons = SocialMediaIcons(social_media_links, colors)\n\nsocial_media_icons.render()\n```\n\n<p align=\"center\" width=\"100%\">\n <img src=\"https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/colors1.png\"> \n</p>\n\n----\n\nIf you do not want to customize all colors, you can use `None` at any index in `colors` and that icon will show its default color.\n\n```python\nfrom st_social_media_links import SocialMediaIcons\n\nsocial_media_links = [\n \"https://www.facebook.com/ThisIsAnExampleLink\",\n \"https://www.youtube.com/ThisIsAnExampleLink\",\n \"https://www.instagram.com/ThisIsAnExampleLink\",\n \"https://www.github.com/jlnetosci/st-social-media-links\",\n]\n\ncolors = [\"#000000\", None, \"SteelBlue\", None]\n\nsocial_media_icons = SocialMediaIcons(social_media_links, colors)\n\nsocial_media_icons.render()\n```\n<p align=\"center\" width=\"100%\">\n <img src=\"https://raw.githubusercontent.com/jlnetosci/st-social-media-links/main/img/colors2.png\"> \n</p>\n\n----\n\n**`render`** has two optional arguments:\n\n - `sidebar` \n\n - `justify_content`\n\n`sidebar` is a boolean and therefore can be `True` or `False`. Its default value is `False`. It is possible to render with both options simultaneously, if you want to display the icons with social media links in both the main-page and the sidebar, i.e.:\n\n```python\nsocial_media_icons.render(sidebar=False) #will render in the main-page\nsocial_media_icons.render(sidebar=True) #will render in the sidebar\n```\n\nIf you want to have the icons exclusively in the sidebar, you only need to render it once: \n\n```python\nsocial_media_icons.render(sidebar=True) #will render in the sidebar\n```\n\n---\n\n`justify_content` gives some freedom regarding icon placement. In brief, it completes the [CSS `justify-content` property](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) used, and therefore may take the same options e.g. `center`, `start`, `end`, `space-between`, `space-around`, `space-evenly`, etc. Its default value is `center`. `justify_content` can have different values for separate renderings: \n\n```python\n# Rendering in the main-page with icons centered\nsocial_media_icons.render(sidebar=False, justify_content=\"center\")\n\n# Rendering in the sidebar with icons evenly spaced\nsocial_media_icons.render(sidebar=True, justify_content=\"space-evenly\")\n```\n\n---\n\n## Platforms supported\n\nIn version 0.1.4, **`st-social-media-links`** supports links to: \n \nBuy Me a Coffee, Discord, Facebook, Flickr, Github, Gitlab, Instagram, Ko-fi, Linkedin, Medium, Patreon, Pinterest, Reddit, Skype, Slack, Snapchat, Spotify, Stack Overflow, Telegram, Threads, TikTok, TradingView, Tumblr, Twitch, Twitter, Vimeo, Whatsapp, X, and Youtube. \n\n## Tips\n\nWhen paired with `st.divider()` the icon sets look very aesthetically pleasing. \n\nEven though I have not tested it much, [`add_vertical_space`](https://arnaudmiribel.github.io/streamlit-extras/extras/add_vertical_space/) might help you achieve the positioning you want for your social media icons.\n\n## Acknowlegments\n\nFor this project, I do have to acknowledge [Font Awesome](https://fontawesome.com/) for their huge selection of icons and the ease with which they implemented. The Awesome in their name is well deserved!\n\nThanks to Ra\u00fal P\u00e9rula Mart\u00ednez (raulperula @ github) for suggesting the addition of Medium. Thanks to Pedro Damasceno (pcDamasceno @ github) for suggesting the addition of Buy Me a Coffee, Flickr, Skype, Slack, Snapchat, Spotify, Stack Overflow, Telegram, TradingView, Vimeo, and Whatsapp.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package designed to assist in displaying social media links within Streamlit apps.",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/jlnetosci/st_social_media_links"
},
"split_keywords": [
"streamlit",
"social",
"media",
"links"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "298ed9cbd7213e332de7b0438339dcd4604defd6f25cca6ac144f964e9cd5088",
"md5": "8dd4b5160622ecf29ff32e1d39514321",
"sha256": "cb5883d85bdcce8fa87ed85879792f5253932ee2eec87a3aee567a21dd739b0b"
},
"downloads": -1,
"filename": "st_social_media_links-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8dd4b5160622ecf29ff32e1d39514321",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 14353,
"upload_time": "2024-12-31T17:59:43",
"upload_time_iso_8601": "2024-12-31T17:59:43.787467Z",
"url": "https://files.pythonhosted.org/packages/29/8e/d9cbd7213e332de7b0438339dcd4604defd6f25cca6ac144f964e9cd5088/st_social_media_links-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8fc8fbd90ca8f7b2152455862ec97e70981f7da321a714b6c957e72497598130",
"md5": "fb0fe194dc2ae8b9764719c169ce6bb5",
"sha256": "29c24972fe3a8a91939438a950d0ba18dd6c8309a9d5a1cb9ea40b556317081d"
},
"downloads": -1,
"filename": "st_social_media_links-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "fb0fe194dc2ae8b9764719c169ce6bb5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 16290,
"upload_time": "2024-12-31T17:59:48",
"upload_time_iso_8601": "2024-12-31T17:59:48.287545Z",
"url": "https://files.pythonhosted.org/packages/8f/c8/fbd90ca8f7b2152455862ec97e70981f7da321a714b6c957e72497598130/st_social_media_links-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-31 17:59:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jlnetosci",
"github_project": "st_social_media_links",
"github_not_found": true,
"lcname": "st-social-media-links"
}