Giter Site home page Giter Site logo

sanity-pdf-to-text's Introduction

Extract text from pdf uploads to Sanity.io

This is a proof of concept example of how to use lambdas on Zeit’s Now to annotate asset documents for pdf uploads to Sanity.io with the embedded text (if there is any).

Getting started

First change projectId and dataset in now.json to yours. Then run the following in the command line:

$ npm i -g now && npm i
# install dependencies

$ now secrets add SANITY_TOKEN <your token with write rights>
# add token to be able to patch asset documents

$ now
# deploy on now

When you have the URL for your deployment on Now, you can add it to a webhook for your Sanity.io project. Note that you want to point to the path /api/extract on your Now deployment.

$ sanity hook create
? Hook name: <Your descriptive name>
? Select dataset hook should apply to (Use arrow keys)
> <a specific of all datasets>
? Hook URL: <your domain on now>/api/extract

Feedback? Need help?

You're welcome to join the community Slack, or ping me on twitter, if you want to discuss this proof of concept.

sanity-pdf-to-text's People

Contributors

kmelve avatar rexxars avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rexxars

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.