{"id":21828969,"url":"https://github.com/kyuvi/hctb","last_synced_at":"2026-05-07T14:48:03.966Z","repository":{"id":170460679,"uuid":"597417202","full_name":"Kyuvi/hctb","owner":"Kyuvi","description":"Helsinki City Bike App","archived":false,"fork":false,"pushed_at":"2023-02-05T16:42:41.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T08:41:56.768Z","etag":null,"topics":["clojure","csv-import","sql"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kyuvi.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":"2023-02-04T13:42:32.000Z","updated_at":"2023-02-04T14:13:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8a4c76d-0527-4f90-8415-6ef8bf2737de","html_url":"https://github.com/Kyuvi/hctb","commit_stats":null,"previous_names":["kyuvi/hctb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyuvi%2Fhctb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyuvi%2Fhctb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyuvi%2Fhctb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyuvi%2Fhctb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kyuvi","download_url":"https://codeload.github.com/Kyuvi/hctb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244800341,"owners_count":20512447,"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":["clojure","csv-import","sql"],"created_at":"2024-11-27T18:19:31.024Z","updated_at":"2025-10-15T13:10:13.684Z","avatar_url":"https://github.com/Kyuvi.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hctb\n\n### Helsinki city bike app \n\nThe final aim of this project is to create a web app to view the city-bike stations and the data of the journeys between those stations.\n\nAt this point only the backend is finalised (in Clojure) with the fronend intended to be written in clojurescript\n\nThe app expects a running postgreSQL database and csv files containing the journey and staion data to be located in a directory on the computer running it. The directory should contain csv files containing data of either the bike journeys or bike stations either loose or organised into sub-directories that the database tables should be based on. \n\nThe backend reads the csv files from said folder and loads the data into the PostgreSQL database. if the given directory (which defaults to /tmp/bike-data on a Linux machine)\ncontains sub-directories it creates a table based on the name of the sub-directory with columns based on the data from the (first line of the) first file in the directory and loading the data from that file into the database validating that the data of each row element is of the correct type for the corressponding column . It then tries to load data from subsequent files in that directory into the same table. if a file in the sub-directory has a different data set (with a different column count) it creates a table based on that file name (overwiting/dropping any previous tables created with the same name) and loads the data into that table.\n\nIf the directory contains loose files, it creates a table named after each file and loads that file data into it.\n\n### Data \nIt validates the data based on the following criteria, if the criteria is not met by one element of the row, the whole row is discarded.\n\n- Timestamps are valid timestamps without timezones and the return time is after the departure time.\n\n- Journeys are have a duration in integers longer than 10 seconds and cover a distance more than 10 meters.\n\n- Longtitude and latitude are valid floating point numbers.\n\n- Ids are positive integers.\n\n- There are no empty strings (strings contining only spaces are recognized as valid).\n\nThis app has only been tested and used on a machine running linux with postgreSQL (running in docker). The default directory and database options reflect this. There is a possibility to change the defaults (see [usage](#usage) below) but I have not tested them on another OS yet (nor with another database).\n\n## Installation\n\nDownload from https://github.com/Kyuvi/hctb .\n\nThen run `lein uberjar` from the directory with the project.clj file (and this README.md)\n\nThe target/uberjar directory should contatin a file ending '*-standalone.jar' this can then be used to transfer data from the correct csv files to a postgreSQL database \n\n\n## Usage\nAs mentioned earlier, this app  expects a postgreSQL database to have been set up and be running.\n\nIt can be run directly from the command line with `lein run`\n\nor after building a standalone.jar file (see [installation](#installation) above), with \n\n    $ java -jar hctb-0.1.0-standalone.jar [\"/path/to/csvdir\"]\nor\n\n    $ CSVDIR=/path/to/csvdir java -jar hctb-0.1.0-standalone.jar \n     \n    \nIt accepts one argument which should be a string of a path to the folder/directory  containing the csv files.\n    \nIf that is not given, it then checks the system for the 'CSVDIR' environment variable which can be prepended to the call to execte the jar file as shown above. \nNOTE: if both the CSVDIR environment variable and an argument are provided the CSVDIR environment variable is used.\n\nIt also checks for the following environment variables\n\n    POSTGRES_HOST\n    POSTGRES_DB\n    POSTGRES_USER\n    POSTGRES_PASS\n    \nFor the database host, database name, database user, and database password  respectively. \n\nif it finds none it reverts to the defaults specified in the source code.\n\n\n...\n\n### Bugs\n\nPlease open an issue if one is found, thanks\n\n...\n\n## License\n\nCopyright © 2023 Kyuvi\n\nThis program and the accompanying materials are made available under the terms of the GNU General Public License 3.0 or later which is available at https://www.gnu.org/licenses/gpl-3.0.html with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyuvi%2Fhctb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyuvi%2Fhctb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyuvi%2Fhctb/lists"}