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.2.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

python_postman-0.2.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file python-postman-0.2.0.tar.gz.

File metadata

  • Download URL: python-postman-0.2.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for python-postman-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4434f9c422aa5f36eea81b78d0abc01e4d0e021d2663aeacae9f974ec6f93644
MD5 4c3d20aa1b0f610996b1035ca917737f
BLAKE2b-256 71c42ec03d4ed9319d8d02552ccd6a345f220212066e7574b3744bc27e244fee

See more details on using hashes here.

Provenance

File details

Details for the file python_postman-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_postman-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 605d6c5d5452cc65105545199a7240bffabe1eb49c8ec22bf8491f2d6352ac75
MD5 8f81f9cfdc8dd8958b4af2805709baa7
BLAKE2b-256 069fd871ce453bc9af855ccdc628a222fb578c0aadd4823aa93a0215cf5a1725

See more details on using hashes here.

Provenance

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