commit 6bb95fb52e7a0381c5d9367d1cfe70ca29d320fd Author: crunk Date: Fri Dec 11 16:54:09 2020 +0100 first commit of the varia library website diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/library/csvparser/__pycache__/csvparser.cpython-39.pyc b/library/csvparser/__pycache__/csvparser.cpython-39.pyc new file mode 100644 index 0000000..b2c4c02 Binary files /dev/null and b/library/csvparser/__pycache__/csvparser.cpython-39.pyc differ diff --git a/library/csvparser/csvparser.py b/library/csvparser/csvparser.py new file mode 100644 index 0000000..7d1ebe8 --- /dev/null +++ b/library/csvparser/csvparser.py @@ -0,0 +1,24 @@ +import csv +import os + +script_dir = os.path.dirname(__file__) + + +def parsecsv(): + libcsv = open(os.path.join(script_dir, "varlib.csv"), "r") + with libcsv: + csv_as_dict = csv.DictReader(libcsv) + return csv_as_dict + + +def getpublications(): + libcsv = open(os.path.join(script_dir, "varlib.csv"), "r") + with libcsv: + csv_as_dict = csv.DictReader(libcsv) + listofbooks = [] + for row in csv_as_dict: + listofbooks.append(row["Publication"]) + return listofbooks + + +parsecsv() diff --git a/library/csvparser/varlib.csv b/library/csvparser/varlib.csv new file mode 100644 index 0000000..676ca1c --- /dev/null +++ b/library/csvparser/varlib.csv @@ -0,0 +1,22 @@ +Id,Publication,Author,Year,Custodian,Fields,Pubtype,Publishers,License,Highlights,Comments,"Borrowedby" +1,"The Economics of Anarchism",Anarcho,2012,Varia,"Economics, Anarchism",Zine,theanarchistlibrary.org,Anti-copyright,"""The labourer retains, even after he has recieved his wages, a natural right in the thing he has produced""",, +2,"Identity Politics - An Anthology","The Anarchist Library",,Varia,"Identity politics",Zine,"Paper Jam Collective","No license mentioned",,"Skipping through, I'm not sure if this is in line with our own politics. (ccl)", +3,"The mythology of work",CrimeThinc.com,,Varia,"Work, Anticapitalism",Zine,CrimeThinc.com,"No license mentioned",,"A selection from 'Work', a 376-page analysis of contemporary capitalism", +4,"Forget Shorter Showers - Why Personal Change Does Not Equal Political Change","Derrick Jensen",2009,Varia,"Environmental justice",Zine,,"No license mentioned","""Green consumerism isn't enough.""",, +5,Choreo-Graphic-Hypothesis,"",2018,Varia,"Live Coding, Choreography",Paperback,"Self published: Joana Chicau","Free Art Liceense 1.3","""Theatrical actions are not necessary to the performance, Avoid if at all possible""",, +6,"Point of no Return",,2013,Varia,"Anarchism in the West",Zine,,"No license mentioned",,"Stories about becoming an anarchist in the West in the 80s", +7,"Waar slapen de kroegtijgers van Oud Charlois","Jacco Weener",,Varia,"Oud Charlois, Drawing",Paperback,Self-published,"No license mentioned",,, +8,"Dubbeldruk Play with me","Editorial team: Karin de Jong, Giulia de Giovanelli, Floor van Luijk",2019,Varia,"Copyright, Publishing, Printing",Parazine,Printroom,"Free art license",,"Confusing licenses mentioned in the about text on the back of the publication, FAL, Copy-left and copy right all mentioned", +9,"To Boldly Go: a starters guide to hand made and diy films","Film Werkplaats Worm Rotterdam",2008,Varia,"Experimental film, Analog film, DIY, Hand-made",Paperback,"Knust (Nijmegen)","'No license mentioned",,, +10,"Anarchism: Basic concepts and ideas","Peter Storm",2018,Varia,"Anarchism, Dutch Theory",Zine,"Ravotr Editions in collaboration with Paper Jam","""Feel free to use and copy this text as you see fit. Mentioning source and author would be greatly appreciated.""",,"Revised text of a transcribed lecture Storm gave in Rotterdam.", +11,"Queering Anarchism","Deric Shannon, Abbey Willis",,Varia,"Anarchism, Queer Theory",Zine,"Paper Jam Collective","No license mentioned",,, +12,"Abolish restaurants",Prole.info,2010,Varia,"Labour, Food industry",Paperback,"Pm Press","Copyright 2010","""Drawing on a range of anti-capitalist ideas as well as a heaping plate of personal experience""",, +13,"Elk Woord Een Vonk: Verboden Teksten, verwerpelijke vervolging: de zaak Joke Kaviaar","Steungroep 13 September",2014,"Varia (or Luke?)","Joke Kaviaar, Immigration, Activism, Forbidden Texts, Incarceration","Soft cover",Self-published,Copyleft,,https://13-september.nl, +14,"A NO BORDERS manifesto","Ill Will Editions",2015,Varia,"Migrant justice",Zine,Self-published,"No license mentioned",,, +15,"Short Circuit: Towards an Arnarchist to Gentrification",,,Varia,"Gentrification, Anarchism",Zine,Self-published,"No license mentioned","""Anarchists understandably feel an intrinsic and visceral opposition to gentrification",, +16,"Futur Musique","De fanfare voor vooruit strevende volksmuziek",2018,Varia,"Musical Instruments, DIY",Zine,Self-published,"No license mentioned",,"Copied instructions on building one's own musical instruments", +17,"Franchir le cap","Quentin Juhel",2019,Varia,"Convivial computation",Zine,Self-publsihed,"Creative commons CC-BY-SA",,, +18,"Consensus: Decision Making","Seeds For Change UK",2010,Varia,"Decision making, Consensus",Zine,Self-published,"No license mentioned",,"Short guide ", +19,"Waar ook op gestemd wordt, wij laten ons niet regeren","Anarchistische Groep Nijmegen",2014,Varia,Democracy,Zine,Self-published,"No license mentioned",,, +20,"The NGO sector: the trojan horse of capitalism","Crn Blok",,Varia,"Anti-capitalism, NGO",Zine,Self-published,Copyleft,,, +21,"Messing Around With Packet Radio",,,,,,,,,, diff --git a/library/page.py b/library/page.py new file mode 100644 index 0000000..b054710 --- /dev/null +++ b/library/page.py @@ -0,0 +1,36 @@ +"""This is the main flask page code""" + + +import flask +from flask import render_template + +from csvparser.csvparser import getpublications + +APP = flask.Flask(__name__, static_folder="static") + + +@APP.route("/") +def index(): + """Main path""" + # parse csv, render template with a few elements from the csv + titles = getpublications() + return render_template("index.html", titles=titles) + + +@APP.route("/") +def show_book(publication): + """Path for a publication""" + # parse csv, render template with full list. + return render_template("publication.html", publication=publication) + + +@APP.route("/") +def upload_book(publication): + """upload a new book""" + # + return render_template("upload form") + + +if __name__ == "__main__": + APP.debug = True + APP.run(port=5000) diff --git a/library/static/css/style.css b/library/static/css/style.css new file mode 100644 index 0000000..e2f8d31 --- /dev/null +++ b/library/static/css/style.css @@ -0,0 +1,56 @@ +html, body { + margin: 0; +} + +body:after { + font-size: .8em; + background-color: #EB4377; + /*color: rgba(223, 183, 180, .3);*/ + position: fixed; + width: 100%; + bottom: 1em; + text-align: center; +} + +#cloud { + overflow: hidden; + width: 1px; height: 1px; + transform: translate(-100%, -100%); + border-radius: 50%; + filter: url(#filter); + z-index: -1; +} + +@font-face { + font-family: alphaClouds; + src: url(../fonts/AlphaClouds.ttf); +} + +#varia { + line-height: 1.03em; + position: absolute; + top: 10%; + left: 50%; + transform: translate(-50%, -50%); + color: #FFFFFF; + text-shadow: 2px 2px #8B5B7F; + font-size: 60px; + text-align: center; + font-family: alphaClouds; + mix-blend-mode: exclusion; +} +@supports (-webkit-text-stroke: 1px lightpink) { + #varia { + -webkit-text-stroke: 1px lightpink; + } +} +.container { + margin 0 auto; +} +button { + z-index: 10; + border: 5px solid black; + color: black; + min-width: auto; + background-color: white; +} diff --git a/library/static/fonts/AlphaClouds.ttf b/library/static/fonts/AlphaClouds.ttf new file mode 100644 index 0000000..0210697 Binary files /dev/null and b/library/static/fonts/AlphaClouds.ttf differ diff --git a/library/static/js/script.js b/library/static/js/script.js new file mode 100644 index 0000000..a2fa29c --- /dev/null +++ b/library/static/js/script.js @@ -0,0 +1,26 @@ +function rn(from, to) { + return ~~(Math.random() * (to - from + 1)) + from; +} + +function rs() { + return arguments[rn(1, arguments.length) - 1]; +} + +function boxShadows(max) { + let ret = []; + for (let i = 0; i < max; ++i) { + ret.push(` + ${ rn(1, 100) }vw ${ rn(1, 100) }vh ${ rn(20, 40) }vmin ${ rn(1, 20) }vmin + ${ rs('#F52D75', '#CCBD4F', '#32497F', '#EB4377') } + `) + } + return ret.join(','); +} + +const cloud = document.querySelector('#cloud'); +function update() { + cloud.style.boxShadow = boxShadows(120); +} + +window.addEventListener('load', update); +document.addEventListener('click', update); diff --git a/library/static/style.css b/library/static/style.css new file mode 100644 index 0000000..5592b8f --- /dev/null +++ b/library/static/style.css @@ -0,0 +1,76 @@ +html, body { + margin: 0; +} + +body:after { + font-size: .8em; + background-color: #EB4377; + /*color: rgba(223, 183, 180, .3);*/ + position: fixed; + width: 100%; + bottom: 1em; + text-align: center; +} + +#cloud { + overflow: hidden; + width: 1px; height: 1px; + transform: translate(-100%, -100%); + border-radius: 50%; + filter: url(#filter); +} + +@font-face { + font-family: alphaClouds; + src: url(../fonts/AlphaClouds.ttf); +} + +#varia { + line-height: 1.03em; + position: absolute; + top: 10%; + left: 50%; + transform: translate(-50%, -50%); + color: #FFFFFF; + text-shadow: 2px 2px #8B5B7F; + font-size: 60px; + text-align: center; + font-family: alphaClouds; +} + +.container { + margin 0 auto; + width: 100vw; + display: grid; + grid-template-columns: 250px 250px 250px 250px; + grid-template-rows: 200px 200px 200px; + grid-column-gap: 10px; + grid-row-gap: 15px; + justify-content: space-evenly; +} +.item-a { + z-index: 10; + border: 5px solid black; + color: black; + min-width: auto; + background-color: white; +} +.item-b { + z-index: 10; + border: 5px solid black; + width: auto; + background-color: white; +} +.item-c { + z-index: 10; + border: 5px solid black; + width: auto; + background-color: white; +} + +td, th { + border: 1px solid black; +} +table { + border-collapse: collapse; +} diff --git a/library/templates/base.html b/library/templates/base.html new file mode 100644 index 0000000..9717d9f --- /dev/null +++ b/library/templates/base.html @@ -0,0 +1,28 @@ + + + + + varia library zone + + + +
+ + + + + + +

VARIA LIBRARY COLLECTION

+ +
+ {% block main %} + {% endblock %} +
+ + + diff --git a/library/templates/index.html b/library/templates/index.html new file mode 100644 index 0000000..49cb90a --- /dev/null +++ b/library/templates/index.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} + +{% block main %} + +{% for titles in titles %} + {{ titles }} +{% endfor%} + +{% endblock %}