All Projects → k3rn3l-p4n1c → postpython

k3rn3l-p4n1c / postpython

Licence: other
Postman collection runner library for python

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to postpython

education
Knowledge base of OmiSoft.net
Stars: ✭ 18 (-59.09%)
Mutual labels:  postman
postman-runtime
www.postman.com/downloads
Stars: ✭ 160 (+263.64%)
Mutual labels:  postman
media-api-samples
Sample Code | Media APIs | Dolby.io
Stars: ✭ 20 (-54.55%)
Mutual labels:  postman
postman-to-k6
Converts Postman collections to k6 script code
Stars: ✭ 269 (+511.36%)
Mutual labels:  postman
kb-proxy
kb-proxy 是一个可本地部署的、提供代理功能、接口测试管理、支持在线Mock、Host环境管理的在线工具平台。
Stars: ✭ 52 (+18.18%)
Mutual labels:  postman
PostmanCollection
PlayFab Postman Collection
Stars: ✭ 32 (-27.27%)
Mutual labels:  postman
trello-postman-collection
A Postman collection for Trello REST API
Stars: ✭ 20 (-54.55%)
Mutual labels:  postman
my-demo
Demo Application for Dubbo, Mycat, Sharding-Proxy, Seata, SkyWalking, PinPoint, ZipKin, Docker, Kubernetes, Istio, Postman/Newman, FitNesse
Stars: ✭ 37 (-15.91%)
Mutual labels:  postman
jersey-jwt-springsecurity
Example of REST API with JWT authentication using Spring Boot, Spring Security, Jersey and Jackson.
Stars: ✭ 44 (+0%)
Mutual labels:  postman
postman-to-markdown
Generate documentation in markdown from postman documentation.
Stars: ✭ 30 (-31.82%)
Mutual labels:  postman
node-server-template
This is Node.js server tidy template / boilerplate with Express (with asyncified handlers, custom error handler) framework and MongoDb. The server use ES6 and above. On different branches you can see different techniques' and technologies' usage, such as Kafka, nodemailer, file download... You also can find postman collections.
Stars: ✭ 116 (+163.64%)
Mutual labels:  postman
laravel-api
A repository containing a starter kit that can help you develop api in your Laravel applications.
Stars: ✭ 25 (-43.18%)
Mutual labels:  postman
awesome-newman-html-template
😎 A newman html report very detailed
Stars: ✭ 63 (+43.18%)
Mutual labels:  postman
Newman-to-Slack
Runs a Newman test script and outputs the summary to a Slack webhook
Stars: ✭ 26 (-40.91%)
Mutual labels:  postman
mapi-action
🤖 Run a Mayhem for API scan in GitHub Actions
Stars: ✭ 16 (-63.64%)
Mutual labels:  postman
CSharpCampReCapProject
Kodlama.io | C# Camp | Recap Project | Car Rental System | 2021
Stars: ✭ 17 (-61.36%)
Mutual labels:  postman
postman-webex
Postman collections for Webex REST APIs
Stars: ✭ 97 (+120.45%)
Mutual labels:  postman
restler
Restler is a beautiful and powerful Android app for quickly testing REST API anywhere and anytime.
Stars: ✭ 120 (+172.73%)
Mutual labels:  postman
phdevsdir
WIP: A Directory app for web devs in Port Harcourt, Nigeria. Built with React and Express
Stars: ✭ 14 (-68.18%)
Mutual labels:  postman
httpyac
Command Line Interface for *.http and *.rest files. Connect with http, gRPC, WebSocket and MQTT
Stars: ✭ 103 (+134.09%)
Mutual labels:  postman

Postpython

Postpython is a library for Postman that run Postman's collections. If you are using postman, but collection runner is not flexible enough for you and postman codegen is too boring, Postpython is here for your continuous integration.

Why use Postpython instead of postman codegen?

  • Postman codegen should be applied one by one for each request and it's boring when your API changes, but with postpython, you don't need to generate code. Just export collection with Postman and use it with Postpython.
  • In code generation, you don't have environment feature anymore and variables are hard coded.

Why user Postpython instead of Postman collection runner?

  • With postpython, you write your own script. But collection runner just turns all your requests one by one. So with Postpython, you can design more complex test suites.

How to install?

Postpython is available on PyPI and you can install it using pip:

$ pip install postpython

How to use?

Import PostPython

from postpython.core import PostPython

Make an instance from PostPython and give the address of postman collection file.

runner = PostPython('/path/to/collection/Postman echo.postman_collection')

Now you can call your request. Folders' name change to upper camel case and requests' name change to lowercase form. In this example the name of folder is "Request Methods" and it's change to RequestMethods and the name of request was "GET Request" and it's change to get_request. So you should call a function like runner.YourFolderName.you_request_name()

response = runner.RequestMethods.get_request()
print(response.json())
print(response.status_code)

Variable assignment

In Postpython you can assign values to environment variables in runtime.

runner.environments.update({'BASE_URL': 'http://127.0.0.1:5000'})
runner.environments.update({'PASSWORD': 'test', 'EMAIL': '[email protected]'})

AttributeError

Since RequestMethods and get_request does not really exists your intelligent IDE cannot help you. So Postpython tries to correct your mistakes. If you spell a function or folder wrong it will suggest you the closest name.

>>> response = runner.RequestMethods.get_requasts()

Traceback (most recent call last):
  File "test.py", line 11, in <module>
    response = runner.RequestMethods.get_requasts()
  File "/usr/local/lib/python3.5/site-packages/postpython/core.py", line 73, in __getattr__
    'Did you mean %s' % (item, self.name, similar))
AttributeError: get_requasts request does not exist in RequestMethods folder.
Did you mean get_request

You can also use help() method to print all available requests.

>>> runner.help()
Posible requests:
runner.AuthOthers.hawk_auth()
runner.AuthOthers.basic_auth()
runner.AuthOthers.oauth1_0_verify_signature()
runner.RequestMethods.get_request()
runner.RequestMethods.put_request()
runner.RequestMethods.delete_request()
runner.RequestMethods.post_request()
runner.RequestMethods.patch_request()
...

>>> runner.RequestMethods.help()
runner.RequestMethods.delete_request()
runner.RequestMethods.patch_request()
runner.RequestMethods.get_request()
runner.RequestMethods.put_request()
runner.RequestMethods.post_request()

Contribution

Feel free to share your ideas or any problems in issues. Contributions are welcomed. Give postpython a star to encourage me to continue its development.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].