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
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
python-postman-0.3.0.tar.gz
(18.8 kB
view hashes)
Built Distribution
Close
Hashes for python_postman-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d906ffcaee8555bffc1acec3a02ff5270ef4c7cce8cfab07166345b56e448a68 |
|
MD5 | 4001e8b6f5a8dc080f0ca5a7bdaccb50 |
|
BLAKE2b-256 | 193ada466ea6624fa29e1c3432ea80b29382fe50250897718318eaaaf63d9441 |