question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mimesis Simple HTTP Server

See original GitHub issue

Implement very simple http server like in module http.server, which returns generated data by mimesis.

The idea is to pass template in header, and ignore body and query arguments, for future integration with another server.

For example:

Template:

{
  "id": ":uuid",
  "version": "0.1.2",
  "owner.full_name": ":name :personal.surname",
  "owner.email": {"_type": "str", "_field": ":email", "_key": "lower"},
  "owner.phones": {"_type": "list", "_count": 5, "_field": [":telephone", "other1", "other2"]}
}

Output:

{
  "id": "dfcfd2f3-0799-b519-1a94-326c978b10c6",
  "version": "0.1.2",
  "owner": {
    "full_name": "Charley Parker",
    "email": "cheetah1869@yandex.com",
    "phones": ["776.907.0588", "717.592.4382", "168.028.7210", "other1", "other2"]
  }
}

Or we can implement something like jinja2 templating system for open customize output

Some header examples:

  • Mimesis-Template - Template for response
  • Mimesis-Count - Count of outputs. Default: 0
    • 0 - Response contain object.
    • 1-99 - Response contain array of objects.
  • Mimesis-Locale - Response locale. Default: en

It’s may be helpful for prototyping some RESTful/GRAPHql api.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:23 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
lk-geimfaricommented, Mar 8, 2018

We should not want to reject proposals simply without justifying them. Therefore, if you will allow me, I will express my opinion. That’s looks really useful and i like it, but we should keep in mind that Mimesis is library for generating data. We have added special section related to subject to documentation: What Mimesis is, What Mimesis is Not.

Let’s create it in another repository. In this repository we will concentrate on improving the existing functional and data.

@duckyou @sobolevn If you agree with me, let’s close this issue.

1reaction
duckyoucommented, Feb 15, 2018

For mimesis http server i created one file server.py with 200+ lines of code. This is 'very'*100 simple feature without complicated design. Its like http.server but for mimesis.

Also about mimesis-clod. Here’s an idea. What if we write not just data provider service, but something like proxy. I can explain in more detail in the mimesis-lab if you want it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mimesis - Simple Test Server in 10 lines - gists · GitHub
Mimesis - Simple Test Server in 10 lines. GitHub Gist: instantly share code, notes, and snippets.
Read more >
A System's Approach to Data Privacy on Public Cloud - USENIX
Abstract. Users are increasingly storing, accessing, and ex- changing data through public cloud services such as those provided by Google, ...
Read more >
Mimesis Aegis: A Mimicry Privacy Shield - College of Computing
unintended data access, and 4) data servers can be com- ... Basic Reference Model: The Basic Model. http://www.ecma-.
Read more >
Simple HTTP Server - Apps on Google Play
An application that will allow you to run a small local http server with static content. You can select any folder and it...
Read more >
AEmulatio, Imitatio and Mimesis in Tertiary Education
Emulation, imitation and mimicry are fundamental processes by which all children, adolescents and adults learn new skills,.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found