Giter Club home page Giter Club logo

extraction_tutorial's Introduction

This repository is an Example project using Graphene and flask-graphql to create a GraphQL server and client pair in Python.

The example server will crawl websites and extract summaries using the extraction library (mostly relying on Opengraph metadata).

You can query the server via GraphiQL by running the server and visiting http://localhost:5000.


Queries against the server look like:

{
  website(url: "https://lethain.com/migrations") {
    title
image
description
  }
}

And responses look like:

{
  "data": {
    "website": {
  "title":"Migrations: the sole scalable fix to tech debt.",
  "image":"https://lethain.com/static/blog/2018/migrations-hero.png",
  "description":"Migrations are both essential and frustratingly frequent as your codebase ages and your business grows: most tools and processes only support about one order magnitude of growth before becoming ineffective, so rapid growth makes them a way of life. This post takes a look at why migrations are so important, and also how to run them effectively."
}
  }
}

Take a look at the extraction_tutorial directory for more.

Setup

git clone [email protected]:lethain/extraction_tutorial.git
cd extraction_tutorial
python3 -m venv env
. ./env/bin/activate
pip install -r requirements.txt
pip install -e .
python extraction_tutorial/server.py &
python extraction_tutorial/http_client.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.