Skip to main content

Pypostman allows users to parse postman environments and postman collections.

Project description

Python Postman

pypostman is a command-line interface that allows to automate multiple api calls from postman collections, additionally it also allow you to compress and save the response to a local directory or to an AWS S3 bucket. Thereby allowing you to manage your api calls using postman, then automate and process their response using python.

Example:

from pypostman.postman import Postman
from pypostman.modules.http import Request

postman = Postman()

collections_dir = "../collections"
collections = postman._get_collections(dir=collections_dir)
pokeapi_collection = postman._get_collection(name="PokeAPI", collections=collections)
pokeapi_requests = postman._get_requests(collection=pokeapi_collection)

def pokemon(self, **kwargs):
    # Make an API request.
    # The request name should match the Postman request name.
    name = "/pokemon"
    pokemon = postman._get_request(name=name, requests=pokeapi_requests)
    prepared_request: Request = Request(request=pokemon)
    prepared_request.set_path_vars(kwargs)
    prepared_request.set_params(kwargs)
    response = prepared_request.send
    return response

What is Included?

  • The pypostman source code.
  • collections
    • Coinmarketcap.postman_collection.json
    • PokeAPI.postman_collection.json
  • models
    • coinmarketcap_example.py
    • pokeapi_example.py

Included Modules

  • file.py
  • http.py
  • logger.py

Installation

Python >= 3.8

Pypi Test:

pip install -i https://test.pypi.org/simple/ python-postman

Pypi (Not implemented Yet):

pip install python-postman

How to Use It

See examples.

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

python-postman-0.3.0.tar.gz (18.8 kB view hashes)

Uploaded Source

Built Distribution

python_postman-0.3.0-py3-none-any.whl (18.9 kB view hashes)

Uploaded Python 3

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