Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6677844
Showing
8 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
.idea/ | ||
typings/ | ||
npm-debug.log | ||
dist/ | ||
gtfs.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules/ | ||
npm-shrinkwrap.json | ||
.idea/ | ||
npm-debug.log | ||
src/ | ||
test/ | ||
tsconfig.json | ||
.travis.yml | ||
gtfs.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
transxchange2gtfs | ||
========================= | ||
|
||
transxchange2gtfs converts [transxchange](http://naptan.dft.gov.uk/transxchange/index.htm) timetable data into a [GTFS](https://developers.google.com/transit/gtfs/) zip. | ||
|
||
## Current status | ||
|
||
Non-functional, in development. | ||
|
||
## Usage | ||
|
||
**transxchange2gtfs requires [node 10.x](https://nodejs.org) or above** | ||
|
||
transxchange2gtfs is a CLI tool that can be installed via NPM: | ||
|
||
``` | ||
npm install -g transxchange2gtfs | ||
``` | ||
|
||
It can be run by specifying the input and output files as CLI arguments: | ||
|
||
``` | ||
transxchange2gtfs transxchange.xml gtfs.zip | ||
``` | ||
|
||
Or using unix pipes: | ||
|
||
``` | ||
cat transxchange.xml | transxchange2gtfs > gtfs.zip | ||
``` | ||
|
||
## Notes | ||
|
||
- All timezones are UTC | ||
- Stop data is derived from [NapTAN](http://naptan.app.dft.gov.uk/datarequest/help) | ||
|
||
## Contributing | ||
|
||
Issues and PRs are very welcome. To get the project set up run | ||
|
||
``` | ||
git clone git@github.com:planarnetwork/transxchange2gtfs | ||
npm install --dev | ||
npm test | ||
``` | ||
|
||
If you would like to send a pull request please write your contribution in TypeScript and if possible, add a test. | ||
|
||
## License | ||
|
||
This software is licensed under [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env node | ||
require("../dist/src/cli.js"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "transxchange2gtfs", | ||
"version": "1.0.0", | ||
"description": "Converts transxchange data to GTFS", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"bin": { | ||
"transxchange2gtfs": "bin/transxchange2gtfs.sh" | ||
}, | ||
"scripts": { | ||
"start": "ts-node src/cli.ts", | ||
"prepublishOnly": "rm -r dist;tsc -p ./ --outDir dist/; cp -r ./resource ./dist/", | ||
"test": "npm run lint && mocha --require ts-node/register 'test/**/*.spec.ts'", | ||
"lint-raw": "tslint --project tsconfig.json", | ||
"lint": "npm run lint-raw -- -t stylish" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/planarnetwork/transxchange2gtfs.git" | ||
}, | ||
"keywords": [ | ||
"transxchange", | ||
"gtfs", | ||
"transit", | ||
"data" | ||
], | ||
"author": "Linus Norton <linusnorton@gmail.com>", | ||
"license": "GPL-3.0", | ||
"bugs": { | ||
"url": "https://github.com/planarnetwork/transxchange2gtfs/issues" | ||
}, | ||
"homepage": "https://github.com/planarnetwork/transxchange2gtfs#readme" | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"module": "commonjs", | ||
"target": "es2017", | ||
"sourceMap": false, | ||
"experimentalDecorators": true, | ||
"strict": true, | ||
"declaration": true, | ||
"lib": [ | ||
"es2017.object", | ||
"es2015", | ||
"es2017", | ||
"dom" | ||
] | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"dist/" | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"rules": { | ||
"align": [ | ||
true, | ||
"parameters", | ||
"arguments", | ||
"statements" | ||
], | ||
"ban": false, | ||
"class-name": true, | ||
"comment-format": [ | ||
true, | ||
"check-space" | ||
], | ||
"curly": false, | ||
"eofline": false, | ||
"forin": false, | ||
"indent": [ true, "spaces" ], | ||
"interface-name": [true, "never-prefix"], | ||
"jsdoc-format": true, | ||
"jsx-no-lambda": false, | ||
"jsx-no-multiline-js": false, | ||
"label-position": true, | ||
"max-line-length": false, | ||
"member-ordering": false, | ||
"no-any": false, | ||
"no-arg": true, | ||
"no-bitwise": true, | ||
"no-console": false, | ||
"no-construct": true, | ||
"no-debugger": true, | ||
"no-duplicate-variable": true, | ||
"no-empty": true, | ||
"no-eval": true, | ||
"no-shadowed-variable": true, | ||
"no-string-literal": false, | ||
"no-switch-case-fall-through": true, | ||
"no-trailing-whitespace": false, | ||
"no-unused-expression": true, | ||
"one-line": [ | ||
true, | ||
"check-open-brace", | ||
"check-whitespace" | ||
], | ||
"quotemark": [true, "double", "jsx-double"], | ||
"radix": true, | ||
"semicolon": [true, "always", "ignore-interfaces", "ignore-bound-class-methods"], | ||
"switch-default": true, | ||
|
||
"trailing-comma": [false], | ||
|
||
"triple-equals": [ true, "allow-null-check" ], | ||
"typedef": [ | ||
true, | ||
"parameter", | ||
"property-declaration" | ||
], | ||
"typedef-whitespace": [ | ||
true, | ||
{ | ||
"call-signature": "nospace", | ||
"index-signature": "nospace", | ||
"parameter": "nospace", | ||
"property-declaration": "nospace", | ||
"variable-declaration": "nospace" | ||
} | ||
], | ||
"variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case"], | ||
"whitespace": [ | ||
true, | ||
"check-branch", | ||
"check-decl", | ||
"check-operator", | ||
"check-separator", | ||
"check-type", | ||
"check-typecast" | ||
] | ||
} | ||
} |