Multi-platform social media publishing tool
Project description
Publish-Socials
A multi-platform social media publishing tool that allows you to publish content across X (Twitter), Reddit, Medium, Substack, and LinkedIn from a single interface.
Features
- Multi-Platform Publishing: Publish content to multiple platforms simultaneously
- Template Support: Use markdown templates for consistent formatting
- API Integration: Connect to platform APIs with secure configuration
- Batch Publishing: Publish to multiple platforms with a single command
- Content Management: Manage and track published content
- Smart Formatting: Automatically adapt content for each platform's requirements
Supported Platforms
- X (Twitter): Publish tweets and threads
- Reddit: Post to subreddits with proper formatting
- Medium: Publish articles with metadata
- Substack: Create and publish newsletters
- LinkedIn: Share posts on professional network
Installation
PyPI Installation (Recommended)
pip install Publish-Socials
Development Installation
# Clone the repository
git clone https://github.com/299-Labs/Publish-Socials.git
cd Publish-Socials
# Install in development mode
pip install -e .
# Install development dependencies
pip install -r requirements.txt
Publishing to PyPI
This project uses OpenID Connect (OIDC) for secure, credential-free publishing to PyPI. No API tokens are required!
For Maintainers:
- Releases are automatically published to PyPI when you create a GitHub release
- The workflow uses GitHub's OIDC integration with PyPI
- No manual intervention or API credentials needed
To create a release:
- Update the version in
pyproject.toml - Create and push a git tag:
git tag v1.0.1 && git push origin v1.0.1 - Create a GitHub release for the tag
- PyPI package is automatically published via GitHub Actions
Configuration
Create a .env file in your project directory with your API credentials:
# X (Twitter) API
X_API_KEY=your_x_api_key
X_API_SECRET=your_x_api_secret
X_ACCESS_TOKEN=your_x_access_token
X_ACCESS_SECRET=your_x_access_secret
# Reddit API
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
REDDIT_USER_AGENT=your_reddit_user_agent
REDDIT_USERNAME=your_reddit_username
REDDIT_PASSWORD=your_reddit_password
# Medium API
MEDIUM_API_TOKEN=your_medium_api_token
MEDIUM_USER_ID=your_medium_user_id
# Substack API
SUBSTACK_EMAIL=your_substack_email
SUBSTACK_PASSWORD=your_substack_password
SUBSTACK_DOMAIN=your_substack_domain
# LinkedIn API
LINKEDIN_ACCESS_TOKEN=your_linkedin_access_token
LINKEDIN_PROFILE_URN=your_linkedin_profile_urn
Usage
Basic Publishing
from publish_socials import Publisher
# Initialize publisher
publisher = Publisher()
# Create content
content = {
"title": "Your Post Title",
"content": "Your content in markdown",
"tags": ["technology", "programming"],
"publish_date": "2024-01-01"
}
# Publish to all platforms
publisher.publish_to_all(content)
# Publish to specific platforms
publisher.publish_to_x(content)
publisher.publish_to_reddit(content, subreddit="programming")
publisher.publish_to_medium(content)
publisher.publish_to_substack(content)
publisher.publish_to_linkedin(content)
Using Templates
# Use markdown templates
template = """
# {title}
{content}
Tags: {tags}
"""
content = {
"title": "Your Post Title",
"content": "Your content",
"tags": ["technology", "programming"]
}
publisher.publish_with_template(content, template)
API Documentation
X (Twitter)
Publish tweets and threads to X.
Configuration Required:
- X_API_KEY
- X_API_SECRET
- X_ACCESS_TOKEN
- X_ACCESS_SECRET
Usage:
publisher.publish_to_x(content)
Post content to specific subreddits with proper formatting.
Configuration Required:
- REDDIT_CLIENT_ID
- REDDIT_CLIENT_SECRET
- REDDIT_USER_AGENT
- REDDIT_USERNAME
- REDDIT_PASSWORD
Usage:
publisher.publish_to_reddit(content, subreddit="programming")
Medium
Publish articles with metadata and tags.
Configuration Required:
- MEDIUM_API_TOKEN
- MEDIUM_USER_ID
Usage:
publisher.publish_to_medium(content)
Substack
Create and publish newsletters.
Configuration Required:
- SUBSTACK_EMAIL
- SUBSTACK_PASSWORD
- SUBSTACK_DOMAIN
Usage:
publisher.publish_to_substack(content)
Share posts on professional network.
Configuration Required:
- LINKEDIN_ACCESS_TOKEN
- LINKEDIN_PROFILE_URN
Usage:
publisher.publish_to_linkedin(content)
Error Handling
The publisher includes comprehensive error handling for:
- API authentication failures
- Rate limiting
- Network connectivity issues
- Invalid content formatting
- Platform-specific restrictions
Development
Adding New Platforms
To add support for a new platform:
- Create a new method in the
Publisherclass - Add required configuration variables to the
.envtemplate - Implement error handling for platform-specific issues
- Add tests for the new platform
Testing
Run tests to ensure all platforms work correctly:
# Run all tests
pytest
# Run tests with coverage
pytest --cov=publish_socials --cov-report=html
# Run specific test file
pytest tests/test_config.py
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions:
- Create an issue on GitHub
- Check the documentation
- Review the API documentation for each platform
- Join our discussions
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Disclaimer
This tool is for educational and personal use. Users are responsible for:
- Complying with platform terms of service
- Respecting content ownership and copyright
- Following platform-specific posting guidelines
- Managing API rate limits appropriately
- Ensuring content quality and appropriateness
Version History
- 1.0.0 - Initial release with support for X, Reddit, Medium, Substack, and LinkedIn
Changelog
See GitHub Releases for detailed changelog.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters