Skip to main content

This script automates the process of setting up GitHub Actions workflows for Postman collections. It supports both GitHub repository integration and local workflow setup, allowing for flexible usage in various scenarios.

Project description

PostmanxGithub Action Automatic Sync

This Python package automates the process of setting up GitHub Actions workflows for Postman collections. It supports both GitHub repository integration and local workflow setup, allowing for flexible usage in various scenarios.

Features

  • Export Postman collections using a UID or from a local file
  • Add Postman collections to GitHub repositories (new or existing)
  • Create or update GitHub Actions workflows
  • Set up workflows locally without GitHub interaction
  • Use custom YAML templates for GitHub Actions workflows
  • Support for both new and existing repositories

Installation

You can install the package using pip:

pip install postman-github-sync

Usage

After installation, you can use the package in two ways:

  1. As a command-line tool:
postman_github_sync [--local] [--template PATH_TO_TEMPLATE]
  1. As a Python module:
from postman_github_sync import main

main()

Command-line Options

  • --local: Set up the workflow files locally without interacting with GitHub.
  • --template PATH_TO_TEMPLATE: Use a custom YAML template for the GitHub Actions workflow.

Environment Variables

  • GITHUB_TOKEN: Your GitHub personal access token (required for GitHub operations)
  • POSTMAN_API_KEY: Your Postman API key (required for exporting collections by UID)

Examples

  1. Setting up a workflow in a GitHub repository:

    postman_github_sync
    
  2. Setting up a local workflow:

    postman_github_sync --local
    
  3. Using a custom template for GitHub setup:

    postman_github_sync --template my_template.yml
    

Development

To set up the development environment:

  1. Clone the repository:

    git clone https://github.com/yourusername/postman_github_sync.git
    cd postman_github_sync
    
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
    
  3. Install the package in editable mode with development dependencies:

    pip install -e ".[dev]"
    
  4. Run tests:

    pytest
    

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

postman_github_sync-0.1.0.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

postman_github_sync-0.1.0.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file postman_github_sync-0.1.0.1.tar.gz.

File metadata

  • Download URL: postman_github_sync-0.1.0.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for postman_github_sync-0.1.0.1.tar.gz
Algorithm Hash digest
SHA256 912095b4fb5e04d6b22daf3d020d3e112a5145c1145866e7d17eda197172fe37
MD5 0a22bea5e0bc14904cdc94729c90caeb
BLAKE2b-256 8c9803d536df79fb53ecc78199a3f9be14e9db8046625ca1b4ce2013af7dae93

See more details on using hashes here.

File details

Details for the file postman_github_sync-0.1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for postman_github_sync-0.1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4333f840e0b9707852ebc79714a7591669088c1e11a8d16815410f31f382101
MD5 8f688344cd75a12267d7a8ad21f05b93
BLAKE2b-256 4b8a82efcbe3f0e4a231949105b7582c93f3169a9b95287472d11a00aa273854

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page