Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
linusnorton committed Sep 10, 2018
0 parents commit 6677844
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
node_modules/
.idea/
typings/
npm-debug.log
dist/
gtfs.zip
9 changes: 9 additions & 0 deletions .npmignore
@@ -0,0 +1,9 @@
node_modules/
npm-shrinkwrap.json
.idea/
npm-debug.log
src/
test/
tsconfig.json
.travis.yml
gtfs.zip
52 changes: 52 additions & 0 deletions README.md
@@ -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).

2 changes: 2 additions & 0 deletions bin/transxchange2gtfs.sh
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require("../dist/src/cli.js");
33 changes: 33 additions & 0 deletions package.json
@@ -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 added resource/Stops.zip
Binary file not shown.
22 changes: 22 additions & 0 deletions tsconfig.json
@@ -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/"
]
}

79 changes: 79 additions & 0 deletions tslint.json
@@ -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"
]
}
}

0 comments on commit 6677844

Please sign in to comment.