Git Product home page Git Product logo

duncanritchie / velut-json-generator Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 111 KB

Converts tab-delimited data copied from Excel into the Json format required for the MongoDB database used by velut (my Latin vocabulary website). Not really useful to anyone but me!

Home Page: https://www.duncanritchie.co.uk/velut-json-generator/

HTML 30.78% CSS 0.88% JavaScript 68.34%
json vanilla-javascript mongoimport json-generator latin words

velut-json-generator's Introduction

Json Generator for velut

See it live.

A rudimentary webpage for converting tab-delimited data to mongoimport-flavoured Json. Useful for me, but possibly no-one else.

How it works for me

I have a website, named velut, that fetches Latin vocabulary from a MongoDB database. But I generate and store all the data for it in Excel, in a 90MB+ file with many elaborate formulae. I made this Json generator to ease the process of passing my Excel data up to MongoDB.

All the data for velut are in two Excel tables, which correspond to two MongoDB collections and two schemata hardcoded into my Json generator. When I want to update the database, I copy a table from Excel, paste it into the first input box and click “Generate Json”.

Since I’m always copying from either my “words” table or my “lemmata” table (including the header-row), the generator will pick the correct schema and generate the Json accordingly.

I copy (or download) the resulting Json into a file, which is in a private repo, check the diff and ensure the data are all correct, commit it, and then run a mongoimport command to import it into the database. So I can say that this Json generator works for my extremely limited use of it, and that’s good enough for me for the time being.

Since I add vocabulary to my Excel file at least once a month, I can go through this process fairly frequently.

Update: Now that I’ve made the velut Word Data Generator, I no longer use this page for the “words” data. I still use it for the “lemmata” data, but at some point I won’t use it for that either.

Limitations

I supply a few rows of sample data for each table so you can see the page working. However, if you’re copying from an Excel table of your own and your data don’t match one of my schemata, you may get strange results. I cannot guarantee that the data-types will be what you want, or that the Json will even be valid. (In fact, if there are any more than one row of data after the header-row, the Json is guaranteed to be invalid in contexts other than mongoimport, because the objects are not comma-delimited and not enclosed in square brackets as an array.)

Long term

Prior to making this webpage, I wrote (guess what?!) Excel formulae to convert the data to Json, then copied the results from Excel into the Json files. But that was a little tedious, especially since I was generating more rows of Json than can fit in an Excel sheet. I have a long-term ambition to move velut away from Excel and into more efficient/robust/accessible platforms; indeed, the very creation of the velut website was part of that. The creation of this Json generator is another step in this direction; I will be making more webpages like it.

Screenshot

Screenshot of the webpage

velut-json-generator's People

Contributors

duncanritchie avatar

Watchers

 avatar  avatar

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.