{"id":17070391,"url":"https://github.com/owainkenwayucl/miscell","last_synced_at":"2026-02-06T19:31:21.619Z","repository":{"id":81522336,"uuid":"62238869","full_name":"owainkenwayucl/miscell","owner":"owainkenwayucl","description":"A language for writing spreadsheets","archived":false,"fork":false,"pushed_at":"2017-07-15T12:08:14.000Z","size":170,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-12T05:58:20.682Z","etag":null,"topics":["csv","python3","spreadsheet"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owainkenwayucl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-29T15:55:09.000Z","updated_at":"2023-09-24T04:51:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"48bd0978-9c08-44ee-9c10-c50cd12df632","html_url":"https://github.com/owainkenwayucl/miscell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2Fmiscell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2Fmiscell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2Fmiscell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2Fmiscell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owainkenwayucl","download_url":"https://codeload.github.com/owainkenwayucl/miscell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415928,"owners_count":20935384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","python3","spreadsheet"],"created_at":"2024-10-14T11:31:02.196Z","updated_at":"2026-02-06T19:31:21.566Z","avatar_url":"https://github.com/owainkenwayucl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# miscell\n## A language for writing spreadsheets\n\nOn Wednesday 22nd of June 2016, I attended a [talk](https://github.com/triangle-man/intro-to-cellular-talk) given by James Geddes ([@triangle-man](https://github.com/triangle-man)) about his Cellular project which aims to bridge the divide between coding and spreadsheets.  In it he described a fairly large and complex system he intends to build which will allow users to write some code in a to be designed programming language, put it through a compiler and have it spit out a spreadsheet.\n\nAs part of the talk he described an intermediate language which looks something like this...\n\n```none\nA1:=45\nA2:=57.3\nB1:=A1*A2\n```\n\n... and is the text file representation of the data you enter into a spreadsheet.\n\nI am an impatient man, and I really want to be able to not edit spreadsheets as soon as possible, and this intermediate language looks friendly enough for me, so I decided to start writing something to parse a language like that and generate a .CSV file which could be loaded into your spreadsheet of choice.\n\nOver a couple of lunch breaks, I've written this prototype which I fully intend to re-write and expand on with more features as time goes on.  Currently it's exceedingly basic, a proof of concept more than anything else and you probably shouldn't use it at all, but I'm putting it in github so I can easily work on it wherever I am.\n\nIt's MIT licensed, so knock yourselves out.\n\n## Language \n\nAt the moment miscell can cope with only one type of statement, and that's one where you assign some expression to a cell on the left side of the statement.\n\ne.g.\n\n```none\nA1 \u003c- 56\n```\n\nwhen compiled will produce a spreadsheet where A1 is 56.\n\nYou can also assign the other way so:\n\n```none\n56 -\u003e A1\n```\n\nIs the same as the previous statement.\n\nYou can include expressions in \"spreadsheet language\" and they'll be interpreted (or at least they are in LibreOffice and Excel).\n\n```none\nA1 \u003c- 2\nA2 \u003c- 3\nB1 \u003c- = A1 * A2\n=A1 * A2 -\u003e B2 #B2 will have the same value as B1\n```\n\nWill generate a spreadsheet where A1 is 2, A2 is 3 and B1 and B2 are the expression \"= A1 * A2\".\n\nComments *must* start with a \"\\#\".\n\nYou can import other CSV files to use as datafiles.  This can be done with statements like:\n\n```none\ndata: A6 examples/data.csv ,\n```\n\nwhich would import the file *examples/data.csv* into the current sheet starting at location A6, and that the separator in *examples/data.csv* is a comma.\n\nYou can import JSON fimes to use as data files *(note that this is very flimsy at the moment)*:\n\n```none\njson: A3 \"files/petition.json\" \"data attributes signatures_by_country\" \"name signature_count\"\n```\n\nWould import *files/petition.json*, navigate the JSON structure *data* -\u003e *attriibutes* -\u003e *signatures_by_country* and then add the fields *name* and *signature_count* to the spreadsheet as columns starting at A3.\n\n## Operation\n\nFirst, write a program in your editor of choice.\n\n![Commute example](images/commute-source.png)\n\nThen invoke miscell withe the *miscellc.py* command like so:\n\n```bash\n$ ./miscellc.py -i examples/commute.mcl -o commute.csv\n```\n\nBy default, miscell uses a pipe \"|\" as a separator, but you can specify any string you like with the *-s* option.\n\nYou can then open the CSV file with your chosen spreadsheet, remembering to set the separator appropriately.\n\n![Import in LibreOffice](images/import.png)\n\nAnd there you have it.\n\n![commute.csv in LibreOffice](images/commute.png)\n\nYou can convert CSV files to MCL files with the *-b* option.\n\n```bash\n$ ./miscellc.py -b -i examples/data.csv  -s , -o data.mcl\n```\n\nThis converts *examples/data.csv* (which uses the separator *,*) to *data.mcl*.\n\n## To come(!)\n\n* Support re-writing of \"data\" CSV sheets\n* Robustness (there is currently little as this is a proof of concept)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainkenwayucl%2Fmiscell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowainkenwayucl%2Fmiscell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainkenwayucl%2Fmiscell/lists"}