semvec/pypi-packages huggingface dataset:
python-yapi 0.1.3
python yapi sdk
License: MIT license
Keywords: yapi,python-yapi,pyyapi,yapi-client

# python-yapi
Python Client for [YApi](https://github.com/YMFE/yapi) based on HTTP Api.


![Languate - Python](https://img.shields.io/badge/language-python-blue.svg)
![PyPI - License](https://img.shields.io/pypi/l/python-yapi)
![PyPI](https://img.shields.io/pypi/v/python-yapi)
![PyPI - Downloads](https://img.shields.io/pypi/dm/python-yapi)

## Install
```shell
pip install python-yapi
```

## Simple Use

### Register and Login
```python
from python_yapi import YApi
yapi = YApi(base_url='http://localhost:3000')

username, email, password = 'Kevin', 'kevin@126.com', 'abc123'

yapi.register(username, email, password)  # return a dict
yapi.login( email, password) # return a dict
```


### Simple Use

```python
import json

from python_yapi import YApi

yapi = YApi(base_url='http://localhost:3000')
email, password = 'kevin@126.com', 'abc123'
yapi.login(email, password)

# Create a private project in user default group, with auto basepath, random color and random icon.
project = yapi.add_project('Demo Project')
project_id = project['_id']

# Create a private "GET" interface in project default category with a sample json response.
yapi.add_interface(project_id=project_id,
                   title='Calc Add',
                   method='GET',
                   path='/add',
                   req_query=[
                       {"name": "a", "required": "1", "example": "1", "desc": "变量a"},
                       {"name": "b", "required": "1", "example": "2", "desc": "变量b"},
                   ],
                   res_body_type="json",
                   res_body=json.dumps({"code": 0, "message": "success", "data": {"result": "3"}}),
                   res_body_is_json_schema=False,
                   status='done')

# Create a private "POST" interface in project default category with a sample json data and a sample json response.
yapi.add_interface(project_id=project_id,
                   title='Calc Sub',
                   method='POST',
                   path='/sub',
                   req_headers=[{"name": "Content-Type", "value": "application/json"}],
                   req_body_type="json",
                   req_body_other=json.dumps({"a": "5", "b": "1"}),
                   req_body_is_json_schema=False,

                   res_body_type="json",
                   res_body=json.dumps({"code": 0, "message": "success", "data": {"result": "4"}}),
                   res_body_is_json_schema=False,
                   status='done')
```
easy-yapi 0.1.2
Yapi Python SDK
License: MIT license
Requires Python: >=3.6
Keywords: easy_yapi,yapi

=========
easy-yapi
=========


.. image:: https://img.shields.io/pypi/v/easy_yapi.svg
        :target: https://pypi.python.org/pypi/easy_yapi

.. image:: https://img.shields.io/travis/nocoding126/easy_yapi.svg
        :target: https://travis-ci.com/nocoding126/easy_yapi

.. image:: https://readthedocs.org/projects/easy-yapi/badge/?version=latest
        :target: https://easy-yapi.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status




Yapi Python SDK


* Free software: MIT license
* Documentation:

Installation and Usage
----------------------
.. code-block:: python

   pip install easy_yapi

示例-login
----------
.. code-block:: python

    from easy_yapi import Yapi


    yapi = Yapi(base_url='http://82.156.152.141:3000')
    res = yapi.login(email='nocoding@126.com', password='ymfe.org')
    print(res.text)


Features
--------

* 该库主要用于快速生成yapi接口文档
* 该库是一个练习项目，并未完全实现所有Yapi接口的封装
* 已实现功能
    - 项目管理
    - 分组管理
    - 用户管理

Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.1.0 (2023-06-29)
------------------

* First release on PyPI.