pygtfslib


Namepygtfslib JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryA Python Library for GTFS
upload_time2023-01-16 13:14:34
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2023 geOps Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords public transport gtfs library efficient
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyGTFSLib

A python library for the [GTFS format](https://gtfs.org/).

So far, this is only a loose, incomplete collection of rather low-level tools for parsing GTFS feeds.
The motivation for this library is to consolidate GTFS related code used at [geOps](https://geops.com/en)
in a single library. This is still work in progress, so breaking changes are to be expected.

This library aims to be efficient in terms of parsing time and memory usage to allow processing
a large number of feeds.

## Installation

Install the latest stable release from PyPI with pip:

```bash
pip install pygtfslib
```

## Modules

### Spatial

The `pygtfslib.spatial` module contains classes and functions related to spatial data.
So far, there is only one function `read_shapes` that can be used to parse `shapes.txt` using
a generic factory that accepts an iterable of `pygtfslib.spatial.ShapeRow` instances.

### Temporal

The `pygtfslib.temporal` module contains classes and functions related to temporal data.
So far, it provides functions to parse calendar and frequency entries and stop times.
It also provides a `TimeCache` class that accelerates conversion of GTFS timezone, operating day
and time delta to a timezone-aware python `datetime.datetime`.

### MOT

The `pygtfslib.mot` module contains tools related to GTFS route types / mode of transportation.
So far, there is a function `route_type_to_mot` that can convert a GTFS route type or extended route type
to a MOT string that can be used in the [geOps routing engine](https://geops.com/en/solution/routing).

### CSV

The `pygtfslib.fast_csv` module contains low-level tools for CSV parsing.
There are two generator functions that allow to iterate over a CSV file yielding rows as `dict`s
or `namedtuple`s. They are built on top of the builtin python CSV reader but they are faster than
the builtin `DictReader`.

## Issue Tracker

Please use [the GitHub issue tracker](https://github.com/geops/pygtfslib/issues) to report bugs/issues.

## Development

### Contributing

If you want to contribute to the pygtfslib library, you can make a pull request at [GitHub](https://github.com/geops/pygtfslib).
Before working on major features/changes, please consider contacting us about your plans.
See [our GitHub page](https://github.com/geops) for contact details.

### Editable Installation

Clone this repo and enter the corresponding directory.
Create a virtual environment, then install frozen requirements, dev-requirements
and this library in editable mode:

```bash
python3.7 -m venv env
. env/bin/activate
pip install -U pip
pip install -r requirements.txt -r dev-requirements.txt -e .
```

Keep env activated for all following instructions.

### Pre-Commit Hooks

Enable pre-commit hooks:

```bash
pre-commit install
```

From time to time (not automated yet) run

```bash
pre-commit autoupdate
```

to update frozen revs.

### Run tests

Run tests and analyze code coverage:

```bash
pytest --cov=pygtfslib --cov-report term --cov-fail-under=35 pygtfslib
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pygtfslib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Alexander Held | geOps <alexander.held@geops.com>",
    "keywords": "public transport,GTFS,library,efficient",
    "author": "",
    "author_email": "Alexander Held | geOps <alexander.held@geops.com>",
    "download_url": "https://files.pythonhosted.org/packages/35/3d/3a09005e847e18db26ee128481da670facf0a0c8d74301827a0167ca0a62/pygtfslib-0.1.0.tar.gz",
    "platform": null,
    "description": "# PyGTFSLib\n\nA python library for the [GTFS format](https://gtfs.org/).\n\nSo far, this is only a loose, incomplete collection of rather low-level tools for parsing GTFS feeds.\nThe motivation for this library is to consolidate GTFS related code used at [geOps](https://geops.com/en)\nin a single library. This is still work in progress, so breaking changes are to be expected.\n\nThis library aims to be efficient in terms of parsing time and memory usage to allow processing\na large number of feeds.\n\n## Installation\n\nInstall the latest stable release from PyPI with pip:\n\n```bash\npip install pygtfslib\n```\n\n## Modules\n\n### Spatial\n\nThe `pygtfslib.spatial` module contains classes and functions related to spatial data.\nSo far, there is only one function `read_shapes` that can be used to parse `shapes.txt` using\na generic factory that accepts an iterable of `pygtfslib.spatial.ShapeRow` instances.\n\n### Temporal\n\nThe `pygtfslib.temporal` module contains classes and functions related to temporal data.\nSo far, it provides functions to parse calendar and frequency entries and stop times.\nIt also provides a `TimeCache` class that accelerates conversion of GTFS timezone, operating day\nand time delta to a timezone-aware python `datetime.datetime`.\n\n### MOT\n\nThe `pygtfslib.mot` module contains tools related to GTFS route types / mode of transportation.\nSo far, there is a function `route_type_to_mot` that can convert a GTFS route type or extended route type\nto a MOT string that can be used in the [geOps routing engine](https://geops.com/en/solution/routing).\n\n### CSV\n\nThe `pygtfslib.fast_csv` module contains low-level tools for CSV parsing.\nThere are two generator functions that allow to iterate over a CSV file yielding rows as `dict`s\nor `namedtuple`s. They are built on top of the builtin python CSV reader but they are faster than\nthe builtin `DictReader`.\n\n## Issue Tracker\n\nPlease use [the GitHub issue tracker](https://github.com/geops/pygtfslib/issues) to report bugs/issues.\n\n## Development\n\n### Contributing\n\nIf you want to contribute to the pygtfslib library, you can make a pull request at [GitHub](https://github.com/geops/pygtfslib).\nBefore working on major features/changes, please consider contacting us about your plans.\nSee [our GitHub page](https://github.com/geops) for contact details.\n\n### Editable Installation\n\nClone this repo and enter the corresponding directory.\nCreate a virtual environment, then install frozen requirements, dev-requirements\nand this library in editable mode:\n\n```bash\npython3.7 -m venv env\n. env/bin/activate\npip install -U pip\npip install -r requirements.txt -r dev-requirements.txt -e .\n```\n\nKeep env activated for all following instructions.\n\n### Pre-Commit Hooks\n\nEnable pre-commit hooks:\n\n```bash\npre-commit install\n```\n\nFrom time to time (not automated yet) run\n\n```bash\npre-commit autoupdate\n```\n\nto update frozen revs.\n\n### Run tests\n\nRun tests and analyze code coverage:\n\n```bash\npytest --cov=pygtfslib --cov-report term --cov-fail-under=35 pygtfslib\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 geOps  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Python Library for GTFS",
    "version": "0.1.0",
    "split_keywords": [
        "public transport",
        "gtfs",
        "library",
        "efficient"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0ef1511de75d0291bd6c60d1e8c1e768489dbad2680afa600630012986e2ac5",
                "md5": "27ce96f7c90f679b53a6906215e4906e",
                "sha256": "a22bb65681f94da704825aa8b5fce25a6587a8fb76d705600cd081b2434057a7"
            },
            "downloads": -1,
            "filename": "pygtfslib-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "27ce96f7c90f679b53a6906215e4906e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12526,
            "upload_time": "2023-01-16T13:14:32",
            "upload_time_iso_8601": "2023-01-16T13:14:32.327552Z",
            "url": "https://files.pythonhosted.org/packages/f0/ef/1511de75d0291bd6c60d1e8c1e768489dbad2680afa600630012986e2ac5/pygtfslib-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "353d3a09005e847e18db26ee128481da670facf0a0c8d74301827a0167ca0a62",
                "md5": "ad0041f8b31540b8ea8aeb64c372b019",
                "sha256": "1115f5fecea10beb1695b9c228608b01e02914607d730e4cd0e0bd8e3364bfbf"
            },
            "downloads": -1,
            "filename": "pygtfslib-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ad0041f8b31540b8ea8aeb64c372b019",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14989,
            "upload_time": "2023-01-16T13:14:34",
            "upload_time_iso_8601": "2023-01-16T13:14:34.127816Z",
            "url": "https://files.pythonhosted.org/packages/35/3d/3a09005e847e18db26ee128481da670facf0a0c8d74301827a0167ca0a62/pygtfslib-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-16 13:14:34",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "pygtfslib"
}
        
Elapsed time: 0.04138s