Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Mail Ship: A powerful Python library for email automation and testing. It offers Gmail integration, real-time inbox monitoring, content extraction, and seamless Selenium integration. Perfect for developers navigating complex email-based workflows and testing scenarios.
Here’s a more concise and focused README.md
tailored specifically for the PyPI package, including a link to the GitHub repository for detailed documentation.
MailShip is a Python library designed to simplify Gmail automation for developers and testers. It offers tools for email generation, email content extraction, and seamless integration with CI/CD pipelines and testing frameworks.
Install the library using pip:
pip install mailship
Before using MailShip, you need to set up a Google Cloud project and configure OAuth credentials. Follow the steps below:
client_secrets.json
file and place it in your project directory.After getting your credentials, you can initialize the setup process:
Run one of the following commands to set up your Gmail API credentials:
Run the following command to set up your Gmail API credentials without automatic token refreshing setup.
Note: TOkens would expire if app is not used for long periods of time
mail-ship-setup
This will guide you through the setup process, including storing credentials and setting environment variables.
mail-ship-setup --setup-cron
mail-ship-setup --setup-task
For more detailed setup instructions, visit the GitHub repository.
Here’s a quick example of how to use MailShip:
from mailship import GmailAutomator
automator = GmailAutomator(verbose=True)
# Generate a unique email for testing
email = automator.generate_email()
print(f"Generated email: {email}")
# Wait for an email
received_email = automator.wait_for_email(email, timeout=120)
if received_email:
print(f"Received email: {received_email['subject']}")
# Extract a token from the email
token = automator.extract_token(received_email)
print(f"Extracted token: {token}")
else:
print("No email received within the timeout period.")
MailShip is designed to work seamlessly in CI/CD pipelines. Add the following step in your GitHub Actions workflow to refresh Gmail API tokens:
- name: Refresh Tokens
env:
GMAIL_CLIENT_ID: ${{ secrets.GMAIL_CLIENT_ID }}
GMAIL_CLIENT_SECRET: ${{ secrets.GMAIL_CLIENT_SECRET }}
GMAIL_AUTH_REFRESH_TOKEN: ${{ secrets.GMAIL_AUTH_REFRESH_TOKEN }}
GMAIL_AUTH_SALT: ${{ secrets.GMAIL_AUTH_SALT }}
run: python -m mailship.setup_auth --refresh-tokens
For detailed documentation, advanced features, and contributing guidelines, visit the GitHub repository.
This project is licensed under a Custom Repository License. See the GitHub repository for details.
For questions or support, reach out on:
This README.md
is concise, focused on installation and usage, and directs users to the GitHub repository for in-depth information. Let me know if you’d like further refinements!
FAQs
Mail Ship: A powerful Python library for email automation and testing. It offers Gmail integration, real-time inbox monitoring, content extraction, and seamless Selenium integration. Perfect for developers navigating complex email-based workflows and testing scenarios.
We found that mailship demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.