semvec/pypi-packages huggingface dataset:
drf_mockable 0.0.3
This package makes building mockable APIs a breeze for Django developers.
License: MIT
Keywords: mock,DRF,mockable,APIs,REST,Django

## Synopsis

This is a package which makes building mockable APIs a breeze for Django developers. The dependencies for this package are:

* Django >= 1.8
* Django Rest Framework (DRF) >= 3.5


## Installation

pip install drf-mockable


## Code Example

In your view class, just inherit the MockableView and define your mock_response. Thats it !!

```python

from drf_mockable.mockable import MockableView

class MyMockAPI(MockableView):
    ''' 
        My Mock API which will return a mock response in case a need arises
    '''
    
    mock_response = {
        "message": "Here I am with a mock response", 
        "status": "success"
    }

    def post(self, request):
        '''
        '''
        print("Do your stuff here if mocked response is not required")

```

Now, just hit your MockAPI from any REST client with a header 'Mockable' set as 'True' and you should be able to get the mocked response. 

Sample Curl Request: 

```shell

curl -X <MY_HTTP_REQUEST_METHOD> http://<PATH_TO_MY_MOCK_API>/ -H 'content-type: application/json' -H 'mockable: True' -d '<MY_REQUEST_DATA>'

```

In case you do not want the mock response and want the API to run normally, just remove the Mockable header and your API will work normally.


## Motivation

In the world of APIs and Microservices, it often happens the front-end team (Mobile or UI Development) needs a sample API for testing out their integrations. The backend developers need to create mock APIs to help them in this regard. This package solves two problems which occur during this process:

1) Provide backend developers with a fast & easy way to get the mock APIs up and running.
2) In case the backend APIs are internally calling other third-party APIs and in case those third-party APIs are down, this will still allow you to keep your API unaffected with a mock response.


## License

This package comes under the MIT License.
abathur 1.0.1
Template manager
License: MIT
Keywords: manage project templates and build project with template

=======
Abathur
=======

.. image:: https://travis-ci.org/yeyuexia/dummie.svg?branch=master
   :target: https://travis-ci.org/yeyuexia/dummie

Simple Template manager to manage template and create project based on template.

Requirements
------------

* Python 3.6+
* Works on Linux, Windows, Mac OSX, BSD

Install
-------

pip::

  pip install abathur

Usage
-----

Presume you have a template like this::

  template/src
  ├── main
  │   ├── java
  │   │   └── com
  │   │       └── abathur
  │   │           └── {PROJECT_NAME}
  │   │               └── {PROJECT_NAME_IN_CLASS}Application.java
  │   │                   ├── domain
  │   │                   │   ├── entity
  │   │                   │   │   └── {PROJECT_NAME_IN_CLASS}.java
  │   │                   │   ├── repository
  │   │                   │   │   └── {PROJECT_NAME_IN_CLASS}Repository.java
  │   │                   │   └── service
  │   │                   │       └── {PROJECT_NAME_IN_CLASS}Service.java
  │   │                   ├── facade
  │   │                   │   ├── {PROJECT_NAME_IN_CLASS}DtoMapper.java
  │   │                   │   └── {PROJECT_NAME_IN_CLASS}Facade.java
  │   │                   ├── infrastructure
  │   │                   │   └── persistence
  │   │                   │       ├── {PROJECT_NAME_IN_CLASS}Po.java
  │   │                   │       └── {PROJECT_NAME_IN_CLASS}Repository.java
  │   │                   └── resource
  │   │                      └── {PROJECT_NAME_IN_CLASS}Resource.java
  │   └── resources
  │       └── application.yml
  └── test
      ├── java
      │   └── com
      │       └── abathur
      │           └── {PROJECT_NAME}
      │               └── resource
      │                   └── {PROJECT_NAME_IN_CLASS}ResourceTest.java
      └── resources


You can put all placeholders surrounding with {} like {PROJECT_NAME} and {PROJECT_NAME_IN_CLASS} in the file sources and directory, you can write a file named `.abathur` in the root path like::

  cat .abathur
  PROJECT_NAME_IN_CLASS
  TABLE_NAME

`.abathur` include all keywords used in template and split with \n, abathur will load it and surround the with {}(Abathur would auto add `PROJECT_NAME` into keyword list), then

Create alias::

  abathur add alias ~/template


Build project based on template::

  abathur build -a name project_name

When build project, abathur will let user fix replace the words notified in `.abathur` and replace the placeholders in template.

* You can use --output special the project path.

* You can use --config special a config file auto fill replaceholders

List aliases::

  abathur list

Remove alias::

  abathur remove alias