From b08bcf5eb41b3d7959e6c7936fa75f9c70f523b9 Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Thu, 24 Nov 2022 17:38:14 +0000 Subject: [PATCH] Adding files related to adding a coworking space. --- static/add_coworking_spaces.py | 25 +++++++++++++++++++++++++ static/coworking_spaces.csv | 6 ++++++ static/coworking_spaces.db | Bin 0 -> 8192 bytes static/test | 20 ++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 static/add_coworking_spaces.py create mode 100644 static/coworking_spaces.csv create mode 100644 static/coworking_spaces.db create mode 100644 static/test diff --git a/static/add_coworking_spaces.py b/static/add_coworking_spaces.py new file mode 100644 index 0000000..9fcc1b7 --- /dev/null +++ b/static/add_coworking_spaces.py @@ -0,0 +1,25 @@ +import flask +import csv + +name_Value = "NEWNEWNEW" +address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" +MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" +AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" +description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." +website_Value = "123https://www.thisiscodebase.com" +email_Value = "123info@thisiscodebase.com" +PN_Value = "123Hi(+44) 0131 560 2003" +OH_Value = "12308:00 - 17:00" +CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" + +recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] + +def addWorkingSpaces(values): + + with open('coworking_spaces.csv', 'a') as addToFile: + csvWriter = csv.writer(addToFile) + csvWriter.writerow(values) + addToFile.close() + return (f"{values} added.") + +addWorkingSpaces(recordValues) diff --git a/static/coworking_spaces.csv b/static/coworking_spaces.csv new file mode 100644 index 0000000..d2b3226 --- /dev/null +++ b/static/coworking_spaces.csv @@ -0,0 +1,6 @@ +Name,Address,Main_Photo,Additional_Photos,Description,Website,Email,Phone_Number,Opening_Hours,Checkin_Instructions +Codebase,"CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL",https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w,"https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w","Hi. We’re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words ""tech cluster"" probably do it best. Please get in touch! We’re friendly people who are geeky about building tech startups, managing disruption and innovation.",https://www.thisiscodebase.com,info@thisiscodebase.com,(+44) 0131 560 2003,08:00 - 17:00,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Catalyst,"Titanic Quarter, Queens Road, Belfast, BT3 9DT",https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg,"https://wearecatalyst.org/wp-content/uploads/2022/03/DSC07673-scaled-2048x1570.jpg,https://wearecatalyst.org/wp-content/uploads/2021/01/2F6A1513.jpg","We are an independent, not-for-profit organisation working together for the greater good, enabling a connected community of like-minded innovators in an entrepreneurial eco-system that is the key driver of the knowledge economy in Northern Ireland.",https://wearecatalyst.org,enquiries@wearecatalyst.org,+44(0)28 9073 7800,08:00 - 18:00,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +C4DI,"C4DI Campus, 31-38 Queen Street, Hull, HU1 1UU",https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w,"https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346951023-V0QWKQI35IDUACMOJ0WM/_MKL2718.jpg?format=750w,https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346977833-LGY6P9473H2C5JF6I2UG/_K5M5505.jpg?format=750w","C4DI is an incubator that helps tech companies grow, and traditional businesses innovate.",http://www.c4di.co.uk,lc@c4di.net,+44 1482 304244,9am - 5pm,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Dogpatch Labs,"Custom House Quay, Dublin, D01 Y6H7",https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg,"https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2021/07/bordered.jpg,https://dogpatchlabs.com/wp-content/uploads/2020/03/UG_3-1.jpg","Dogpatch Labs is a startup hub, located in the heart of Dublin’s Digital Docklands.",https://dogpatchlabs.com,info@dogpatchlabs.com,,8:30 - 5:30,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Stafion F,"5 Parvis Alan Turing, Paris",https://stationf.co/img/misc/create-zone.jpg,",https://stationf.co/img/flatmates/coffee-restaurant.jpg","Based in central Paris, STATION F gathers a whole entrepreneurial ecosystem under one roof. We help entrepreneurs bring their ambitious ideas to life.",https://stationf.co,,,0:00 - 0:00,Book through the Tramshed Tech app diff --git a/static/coworking_spaces.db b/static/coworking_spaces.db new file mode 100644 index 0000000000000000000000000000000000000000..73b2146c58484292d12e86ed6c341bb8f9a265ac GIT binary patch literal 8192 zcmeIuJqp5548ZZc;wtt6g^aqmcmS=^t&7?VRD8-q`@!Qay_bjaI9jmKt-JgKAt4DF ze&=KEg4J8&t1{?DVlhT`sv;7N(){|_w+_+IrXrH{_C4>fVv)sb>YP0S2q1s}0tg_0 z00IagfB*srj0Ex|F)oysr>&b{t2T5)jSi<QEix_AeV*ws)up?ttAo8;udR1g={tSc dZZ-NzivR)$Ab<b@2q1s}0tg_000Mt1@BwpnA*BES literal 0 HcmV?d00001 diff --git a/static/test b/static/test new file mode 100644 index 0000000..7286449 --- /dev/null +++ b/static/test @@ -0,0 +1,20 @@ +def getFieldnames(csvFile): + + fieldnames = [] + with open(csvFile, 'r') as readFile: + csvReader = csv.reader(readFile) + fieldnames = next(csvReader) + readFile.close() + return fieldnames + +dictKeys = getFieldnames('coworking_spaces.csv') + +""" +""" + +newRecord = {} +for x in range(len(keys)): + newRecord[keys[x]] = values[x] + +""" +""" -- GitLab