=========
Partridge
=========
.. image:: https://img.shields.io/pypi/v/partridge.svg
:target: https://pypi.python.org/pypi/partridge
.. image:: https://img.shields.io/travis/remix/partridge.svg
:target: https://travis-ci.org/remix/partridge
Partridge is a Python 3.6+ library for working with `GTFS <https://developers.google.com/transit/gtfs/>`__ feeds using `pandas <https://pandas.pydata.org/>`__ DataFrames.
Partridge is heavily influenced by our experience at `Remix <https://www.remix.com/>`__ analyzing and debugging every GTFS feed we could find.
At the core of Partridge is a dependency graph rooted at ``trips.txt``. Disconnected data is pruned away according to this graph when reading the contents of a feed.
Feeds can also be filtered to create a view specific to your needs. It's most common to filter a feed down to specific dates (``service_id``) or routes (``route_id``), but any field can be filtered.
.. figure:: dependency-graph.png
:alt: dependency graph
Philosophy
----------
The design of Partridge is guided by the following principles:
**As much as possible**
- Favor speed
- Allow for extension
- Succeed lazily on expensive paths
- Fail eagerly on inexpensive paths
**As little as possible**
- Do anything other than efficiently read GTFS files into DataFrames
- Take an opinion on the GTFS spec
Installation
------------
.. code:: console
pip install partridge
**GeoPandas support**
.. code:: console
pip install partridge[full]
Usage
-----
**Setup**
.. code:: python
import partridge as ptg
inpath = 'path/to/caltrain-2017-07-24/'
Examples
--------
The following is a collection of gists containing Jupyter notebooks with transformations to GTFS feeds that may be useful for intake into software applications.
* `Find the busiest week in a feed and reduce its file size <https://gist.github.com/csb19815/aadef16178dfcb5ba7a8d88fbf718749>`_
* `Combine routes by route_short_name <https://gist.github.com/csb19815/67c0247d1eed2286ca0b323a02a1179f>`_
* `Merge GTFS with shapefile geometries <https://gist.github.com/csb19815/535ddb5d36a081abac3430f1a58bd875>`_
* `Merge multiple agencies into one <https://gist.github.com/csb19815/682e0f6f30844313213fa5715e48df8c>`_
* `Rewrite a feed to clean up formatting issues <https://gist.github.com/csb19815/659c8eba4742cc3f1b8f23d66a760a0c>`_
* `If a feed has stop_code, replace the contents of stop_id with the contents of stop_code <https://gist.github.com/csb19815/5bf7923ffb1ce7ec155ac9a94a83ea70>`_
* `Diff the number of service hours in two feeds <https://gist.github.com/csb19815/476335cb299ddb3d5a1a4b898424bb35>`_
* `Investigate the the distance in meters of each stop to the closest point on a shape <https://gist.github.com/sgoel/bff9384129974967817404abe80e7c6a>`_
* `Convert frequencies.txt to an equivalent trips.txt <https://gist.github.com/invisiblefunnel/6c9f3a9b537d3f0ad192c24777b6ae57>`_
* `Calculate headway for a stop <https://gist.github.com/invisiblefunnel/6015e65684325281e65fa9339a78229b>`_
Inspecting the calendar
~~~~~~~~~~~~~~~~~~~~~~~
**The date with the most trips**
.. code:: python
date, service_ids = ptg.read_busiest_date(inpath)
# datetime.date(2017, 7, 17), frozenset({'CT-17JUL-Combo-Weekday-01'})
**The week with the most trips**
.. code:: python
service_ids_by_date = ptg.read_busiest_week(inpath)
# {datetime.date(2017, 7, 17): frozenset({'CT-17JUL-Combo-Weekday-01'}),
# datetime.date(2017, 7, 18): frozenset({'CT-17JUL-Combo-Weekday-01'}),
# datetime.date(2017, 7, 19): frozenset({'CT-17JUL-Combo-Weekday-01'}),
# datetime.date(2017, 7, 20): frozenset({'CT-17JUL-Combo-Weekday-01'}),
# datetime.date(2017, 7, 21): frozenset({'CT-17JUL-Combo-Weekday-01'}),
# datetime.date(2017, 7, 22): frozenset({'CT-17JUL-Caltrain-Saturday-03'}),
# datetime.date(2017, 7, 23): frozenset({'CT-17JUL-Caltrain-Sunday-01'})}
**Dates with active service**
.. code:: python
service_ids_by_date = ptg.read_service_ids_by_date(path)
date, service_ids = min(service_ids_by_date.items())
# datetime.date(2017, 7, 15), frozenset({'CT-17JUL-Caltrain-Saturday-03'})
date, service_ids = max(service_ids_by_date.items())
# datetime.date(2019, 7, 20), frozenset({'CT-17JUL-Caltrain-Saturday-03'})
**Dates with identical service**
.. code:: python
dates_by_service_ids = ptg.read_dates_by_service_ids(inpath)
busiest_date, busiest_service = ptg.read_busiest_date(inpath)
dates = dates_by_service_ids[busiest_service]
min(dates), max(dates)
# datetime.date(2017, 7, 17), datetime.date(2019, 7, 19)
Reading a feed
~~~~~~~~~~~~~~
.. code:: python
_date, service_ids = ptg.read_busiest_date(inpath)
view = {
'trips.txt': {'service_id': service_ids},
'stops.txt': {'stop_name': 'Gilroy Caltrain'},
}
feed = ptg.load_feed(path, view)
**Read shapes and stops as GeoDataFrames**
.. code:: python
service_ids = ptg.read_busiest_date(inpath)[1]
view = {'trips.txt': {'service_id': service_ids}}
feed = ptg.load_geo_feed(path, view)
feed.shapes.head()
# shape_id geometry
# 0 cal_gil_sf LINESTRING (-121.5661454200744 37.003512297983...
# 1 cal_sf_gil LINESTRING (-122.3944115638733 37.776439059278...
# 2 cal_sf_sj LINESTRING (-122.3944115638733 37.776439059278...
# 3 cal_sf_tam LINESTRING (-122.3944115638733 37.776439059278...
# 4 cal_sj_sf LINESTRING (-121.9031703472137 37.330157067882...
minlon, minlat, maxlon, maxlat = feed.stops.total_bounds
# -122.412076, 37.003485, -121.566088, 37.77639
Extracting a new feed
~~~~~~~~~~~~~~~~~~~~~
.. code:: python
outpath = 'gtfs-slim.zip'
service_ids = ptg.read_busiest_date(inpath)[1]
view = {'trips.txt': {'service_id': service_ids}}
ptg.extract_feed(inpath, outpath, view)
feed = ptg.load_feed(outpath)
assert service_ids == set(feed.trips.service_id)
Features
--------
- Surprisingly fast :)
- Load only what you need into memory
- Built-in support for resolving service dates
- Easily extended to support fields and files outside the official spec
(TODO: document this)
- Handle nested folders and bad data in zips
- Predictable type conversions
Thank You
---------
I hope you find this library useful. If you have suggestions for
improving Partridge, please open an `issue on
GitHub <https://github.com/remix/partridge/issues>`__.
=======
History
=======
1.1.2 (2022-11-23)
------------------
Code changes:
* Remove references to deprecated NumPy types (https://github.com/remix/partridge/pull/69 - thanks @BlackSpade741!)
* Switch from `cChardet <https://github.com/PyYoshi/cChardet>`_ to `charset-normalizer <https://github.com/Ousret/charset_normalizer>`_ for Python 3.10 support (https://github.com/remix/partridge/pull/76 - thanks @brockhaywood!)
Other changes:
* Miscellaneous improvements to tests, code formatting, and documentation (https://github.com/remix/partridge/pull/61 - thanks @invisiblefunnel!)
* Relocate usage examples from wiki to README (https://github.com/remix/partridge/pull/70 - thanks @landonreed!)
* README tweaks (https://github.com/remix/partridge/pull/74 - thanks @chelsey!)
* Use GitHub Actions for automated testing (https://github.com/remix/partridge/pull/79 - thanks @dget!). **Note:** we now test against Python versions 3.8, 3.9, 3.10, and 3.11.
1.1.1 (2019-09-13)
------------------
* Improve file encoding sniffer, which was misidentifying some Finnish/emoji unicode. Thanks to @dyakovlev!
1.1.0 (2019-02-21)
------------------
* Add ``partridge.load_geo_feed`` for reading stops and shapes into GeoPandas GeoDataFrames.
1.0.0 (2018-12-18)
------------------
This release is a combination of major internal refactorings and some minor interface changes. Overall, you should expect your upgrade from pre-1.0 versions to be relatively painless. A big thank you to @genhernandez and @csb19815 for their valuable design feedback. If you still need Python 2 support, please continue using version 0.11.0.
Here is a list of interface changes:
* The class ``partridge.gtfs.feed`` has been renamed to ``partridge.gtfs.Feed``.
* The public interface for instantiating feeds is ``partridge.load_feed``. This function replaces the previously undocumented function ``partridge.get_filtered_feed``.
* A new function has been added for identifying the busiest week in a feed: ``partridge.read_busiest_date``
* The public function ``partridge.get_representative_feed`` has been removed in favor of using ``partridge.read_busiest_date`` directly.
* The public function ``partridge.writers.extract_feed`` is now available via the top level module: ``partridge.extract_feed``.
Miscellaneous minor changes:
* Character encoding detection is now done by the ``cchardet`` package instead of ``chardet``. ``cchardet`` is faster, but may not always return the same result as ``chardet``.
* Zip files are unpacked into a temporary directory instead of reading directly from the zip. These temporary directories are cleaned up when the feed is garbage collected or when the process exits.
* The code base is now annotated with type hints and the build runs ``mypy`` to verify the types.
* DataFrames are cached in a dictionary instead of the ``functools.lru_cache`` decorator.
* The ``partridge.extract_feed`` function now writes files concurrently to improve performance.
0.11.0 (2018-08-01)
-------------------
* Fix major performance issue related to encoding detection. Thank you to @cjer for reporting the issue and advising on a solution.
0.10.0 (2018-04-30)
-------------------
* Improved handling of non-standard compliant file encodings
* Only require functools32 for Python < 3
* ``ptg.parsers.parse_date`` no longer accepts dates, only strings
0.9.0 (2018-03-24)
------------------
* Improves read time for large feeds by adding LRU caching to ``ptg.parsers.parse_time``.
0.8.0 (2018-03-14)
------------------
* Gracefully handle completely empty files. This change unifies the behavior of reading from a CSV with a header only (no data rows) and a completely empty (zero bytes) file in the zip.
0.7.0 (2018-03-09)
------------------
* Fix handling of nested folders and zip containing nested folders.
* Add ``ptg.get_filtered_feed`` for multi-file filtering.
0.6.1 (2018-02-24)
------------------
* Fix bug in ``ptg.read_service_ids_by_date``. Reported by @cjer in #27.
0.6.0 (2018-02-21)
------------------
* Published package no longer includes unnecessary fixtures to reduce the size.
* Naively write a feed object to a zip file with ``ptg.write_feed_dangerously``.
* Read the earliest, busiest date and its ``service_id``'s from a feed with ``ptg.read_busiest_date``.
* Bug fix: Handle ``calendar.txt``/``calendar_dates.txt`` entries w/o applicable trips.
0.6.0.dev1 (2018-01-23)
-----------------------
* Add support for reading files from a folder. Thanks again @danielsclint!
0.5.0 (2017-12-22)
------------------
* Easily build a representative view of a zip with ``ptg.get_representative_feed``. Inspired by `peartree <https://github.com/kuanb/peartree/blob/3bfc3f49ae6986d6020913b63c8ee32582b3dcc3/peartree/paths.py#L26>`_.
* Extract out GTFS zips by agency_id/route_id with ``ptg.extract_{agencies,routes}``.
* Read arbitrary files from a zip with ``feed.get('myfile.txt')``.
* Remove ``service_ids_by_date``, ``dates_by_service_ids``, and ``trip_counts_by_date`` from the feed class. Instead use ``ptg.{read_service_ids_by_date,read_dates_by_service_ids,read_trip_counts_by_date}``.
0.4.0 (2017-12-10)
------------------
* Add support for Python 2.7. Thanks @danielsclint!
0.3.0 (2017-10-12)
------------------
* Fix service date resolution for raw_feed. Previously raw_feed considered all days of the week from calendar.txt to be active regardless of 0/1 value.
0.2.0 (2017-09-30)
------------------
* Add missing edge from fare_rules.txt to routes.txt in default dependency graph.
0.1.0 (2017-09-23)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/remix/partridge",
"name": "partridge",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6, <4",
"maintainer_email": "",
"keywords": "partridge",
"author": "Danny Whalen",
"author_email": "daniel.r.whalen@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/75/76/4bcf12ceb495f9e1d9861ed9211e348dd15fabb86208be0491e7ab1b3a96/partridge-1.1.2.tar.gz",
"platform": null,
"description": "=========\nPartridge\n=========\n\n\n.. image:: https://img.shields.io/pypi/v/partridge.svg\n :target: https://pypi.python.org/pypi/partridge\n\n.. image:: https://img.shields.io/travis/remix/partridge.svg\n :target: https://travis-ci.org/remix/partridge\n\n\nPartridge is a Python 3.6+ library for working with `GTFS <https://developers.google.com/transit/gtfs/>`__ feeds using `pandas <https://pandas.pydata.org/>`__ DataFrames.\n\nPartridge is heavily influenced by our experience at `Remix <https://www.remix.com/>`__ analyzing and debugging every GTFS feed we could find.\n\nAt the core of Partridge is a dependency graph rooted at ``trips.txt``. Disconnected data is pruned away according to this graph when reading the contents of a feed.\n\nFeeds can also be filtered to create a view specific to your needs. It's most common to filter a feed down to specific dates (``service_id``) or routes (``route_id``), but any field can be filtered.\n\n.. figure:: dependency-graph.png\n :alt: dependency graph\n\n\nPhilosophy\n----------\n\nThe design of Partridge is guided by the following principles:\n\n**As much as possible**\n\n- Favor speed\n- Allow for extension\n- Succeed lazily on expensive paths\n- Fail eagerly on inexpensive paths\n\n**As little as possible**\n\n- Do anything other than efficiently read GTFS files into DataFrames\n- Take an opinion on the GTFS spec\n\n\nInstallation\n------------\n\n.. code:: console\n\n pip install partridge\n\n\n**GeoPandas support**\n\n.. code:: console\n\n pip install partridge[full]\n\n\nUsage\n-----\n\n**Setup**\n\n.. code:: python\n\n import partridge as ptg\n\n inpath = 'path/to/caltrain-2017-07-24/'\n\n\nExamples\n--------\n\nThe following is a collection of gists containing Jupyter notebooks with transformations to GTFS feeds that may be useful for intake into software applications.\n\n* `Find the busiest week in a feed and reduce its file size <https://gist.github.com/csb19815/aadef16178dfcb5ba7a8d88fbf718749>`_\n* `Combine routes by route_short_name <https://gist.github.com/csb19815/67c0247d1eed2286ca0b323a02a1179f>`_\n* `Merge GTFS with shapefile geometries <https://gist.github.com/csb19815/535ddb5d36a081abac3430f1a58bd875>`_\n* `Merge multiple agencies into one <https://gist.github.com/csb19815/682e0f6f30844313213fa5715e48df8c>`_\n* `Rewrite a feed to clean up formatting issues <https://gist.github.com/csb19815/659c8eba4742cc3f1b8f23d66a760a0c>`_\n* `If a feed has stop_code, replace the contents of stop_id with the contents of stop_code <https://gist.github.com/csb19815/5bf7923ffb1ce7ec155ac9a94a83ea70>`_\n* `Diff the number of service hours in two feeds <https://gist.github.com/csb19815/476335cb299ddb3d5a1a4b898424bb35>`_\n* `Investigate the the distance in meters of each stop to the closest point on a shape <https://gist.github.com/sgoel/bff9384129974967817404abe80e7c6a>`_\n* `Convert frequencies.txt to an equivalent trips.txt <https://gist.github.com/invisiblefunnel/6c9f3a9b537d3f0ad192c24777b6ae57>`_\n* `Calculate headway for a stop <https://gist.github.com/invisiblefunnel/6015e65684325281e65fa9339a78229b>`_\n\n\nInspecting the calendar\n~~~~~~~~~~~~~~~~~~~~~~~\n\n\n**The date with the most trips**\n\n.. code:: python\n\n date, service_ids = ptg.read_busiest_date(inpath)\n # datetime.date(2017, 7, 17), frozenset({'CT-17JUL-Combo-Weekday-01'})\n\n\n**The week with the most trips**\n\n\n.. code:: python\n\n service_ids_by_date = ptg.read_busiest_week(inpath)\n # {datetime.date(2017, 7, 17): frozenset({'CT-17JUL-Combo-Weekday-01'}),\n # datetime.date(2017, 7, 18): frozenset({'CT-17JUL-Combo-Weekday-01'}),\n # datetime.date(2017, 7, 19): frozenset({'CT-17JUL-Combo-Weekday-01'}),\n # datetime.date(2017, 7, 20): frozenset({'CT-17JUL-Combo-Weekday-01'}),\n # datetime.date(2017, 7, 21): frozenset({'CT-17JUL-Combo-Weekday-01'}),\n # datetime.date(2017, 7, 22): frozenset({'CT-17JUL-Caltrain-Saturday-03'}),\n # datetime.date(2017, 7, 23): frozenset({'CT-17JUL-Caltrain-Sunday-01'})}\n\n\n**Dates with active service**\n\n.. code:: python\n\n service_ids_by_date = ptg.read_service_ids_by_date(path)\n\n date, service_ids = min(service_ids_by_date.items())\n # datetime.date(2017, 7, 15), frozenset({'CT-17JUL-Caltrain-Saturday-03'})\n\n date, service_ids = max(service_ids_by_date.items())\n # datetime.date(2019, 7, 20), frozenset({'CT-17JUL-Caltrain-Saturday-03'})\n\n\n**Dates with identical service**\n\n\n.. code:: python\n\n dates_by_service_ids = ptg.read_dates_by_service_ids(inpath)\n\n busiest_date, busiest_service = ptg.read_busiest_date(inpath)\n dates = dates_by_service_ids[busiest_service]\n\n min(dates), max(dates)\n # datetime.date(2017, 7, 17), datetime.date(2019, 7, 19)\n\n\nReading a feed\n~~~~~~~~~~~~~~\n\n\n.. code:: python\n\n _date, service_ids = ptg.read_busiest_date(inpath)\n\n view = {\n 'trips.txt': {'service_id': service_ids},\n 'stops.txt': {'stop_name': 'Gilroy Caltrain'},\n }\n\n feed = ptg.load_feed(path, view)\n\n\n**Read shapes and stops as GeoDataFrames**\n\n.. code:: python\n\n service_ids = ptg.read_busiest_date(inpath)[1]\n view = {'trips.txt': {'service_id': service_ids}}\n\n feed = ptg.load_geo_feed(path, view)\n\n feed.shapes.head()\n # shape_id geometry\n # 0 cal_gil_sf LINESTRING (-121.5661454200744 37.003512297983...\n # 1 cal_sf_gil LINESTRING (-122.3944115638733 37.776439059278...\n # 2 cal_sf_sj LINESTRING (-122.3944115638733 37.776439059278...\n # 3 cal_sf_tam LINESTRING (-122.3944115638733 37.776439059278...\n # 4 cal_sj_sf LINESTRING (-121.9031703472137 37.330157067882...\n\n minlon, minlat, maxlon, maxlat = feed.stops.total_bounds\n # -122.412076, 37.003485, -121.566088, 37.77639\n\n\nExtracting a new feed\n~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n outpath = 'gtfs-slim.zip'\n\n service_ids = ptg.read_busiest_date(inpath)[1]\n view = {'trips.txt': {'service_id': service_ids}}\n\n ptg.extract_feed(inpath, outpath, view)\n feed = ptg.load_feed(outpath)\n\n assert service_ids == set(feed.trips.service_id)\n\n\nFeatures\n--------\n\n- Surprisingly fast :)\n- Load only what you need into memory\n- Built-in support for resolving service dates\n- Easily extended to support fields and files outside the official spec\n (TODO: document this)\n- Handle nested folders and bad data in zips\n- Predictable type conversions\n\nThank You\n---------\n\nI hope you find this library useful. If you have suggestions for\nimproving Partridge, please open an `issue on\nGitHub <https://github.com/remix/partridge/issues>`__.\n\n\n=======\nHistory\n=======\n\n1.1.2 (2022-11-23)\n------------------\n\nCode changes:\n\n* Remove references to deprecated NumPy types (https://github.com/remix/partridge/pull/69 - thanks @BlackSpade741!)\n* Switch from `cChardet <https://github.com/PyYoshi/cChardet>`_ to `charset-normalizer <https://github.com/Ousret/charset_normalizer>`_ for Python 3.10 support (https://github.com/remix/partridge/pull/76 - thanks @brockhaywood!)\n\nOther changes:\n\n* Miscellaneous improvements to tests, code formatting, and documentation (https://github.com/remix/partridge/pull/61 - thanks @invisiblefunnel!)\n* Relocate usage examples from wiki to README (https://github.com/remix/partridge/pull/70 - thanks @landonreed!)\n* README tweaks (https://github.com/remix/partridge/pull/74 - thanks @chelsey!)\n* Use GitHub Actions for automated testing (https://github.com/remix/partridge/pull/79 - thanks @dget!). **Note:** we now test against Python versions 3.8, 3.9, 3.10, and 3.11.\n\n\n1.1.1 (2019-09-13)\n------------------\n\n* Improve file encoding sniffer, which was misidentifying some Finnish/emoji unicode. Thanks to @dyakovlev!\n\n\n1.1.0 (2019-02-21)\n------------------\n\n* Add ``partridge.load_geo_feed`` for reading stops and shapes into GeoPandas GeoDataFrames.\n\n\n1.0.0 (2018-12-18)\n------------------\n\nThis release is a combination of major internal refactorings and some minor interface changes. Overall, you should expect your upgrade from pre-1.0 versions to be relatively painless. A big thank you to @genhernandez and @csb19815 for their valuable design feedback. If you still need Python 2 support, please continue using version 0.11.0.\n\nHere is a list of interface changes:\n\n* The class ``partridge.gtfs.feed`` has been renamed to ``partridge.gtfs.Feed``.\n* The public interface for instantiating feeds is ``partridge.load_feed``. This function replaces the previously undocumented function ``partridge.get_filtered_feed``.\n* A new function has been added for identifying the busiest week in a feed: ``partridge.read_busiest_date``\n* The public function ``partridge.get_representative_feed`` has been removed in favor of using ``partridge.read_busiest_date`` directly.\n* The public function ``partridge.writers.extract_feed`` is now available via the top level module: ``partridge.extract_feed``.\n\nMiscellaneous minor changes:\n\n* Character encoding detection is now done by the ``cchardet`` package instead of ``chardet``. ``cchardet`` is faster, but may not always return the same result as ``chardet``.\n* Zip files are unpacked into a temporary directory instead of reading directly from the zip. These temporary directories are cleaned up when the feed is garbage collected or when the process exits.\n* The code base is now annotated with type hints and the build runs ``mypy`` to verify the types.\n* DataFrames are cached in a dictionary instead of the ``functools.lru_cache`` decorator.\n* The ``partridge.extract_feed`` function now writes files concurrently to improve performance.\n\n\n0.11.0 (2018-08-01)\n-------------------\n\n* Fix major performance issue related to encoding detection. Thank you to @cjer for reporting the issue and advising on a solution.\n\n\n0.10.0 (2018-04-30)\n-------------------\n\n* Improved handling of non-standard compliant file encodings\n* Only require functools32 for Python < 3\n* ``ptg.parsers.parse_date`` no longer accepts dates, only strings\n\n\n0.9.0 (2018-03-24)\n------------------\n\n* Improves read time for large feeds by adding LRU caching to ``ptg.parsers.parse_time``.\n\n\n0.8.0 (2018-03-14)\n------------------\n\n* Gracefully handle completely empty files. This change unifies the behavior of reading from a CSV with a header only (no data rows) and a completely empty (zero bytes) file in the zip.\n\n\n0.7.0 (2018-03-09)\n------------------\n\n* Fix handling of nested folders and zip containing nested folders.\n* Add ``ptg.get_filtered_feed`` for multi-file filtering.\n\n\n0.6.1 (2018-02-24)\n------------------\n\n* Fix bug in ``ptg.read_service_ids_by_date``. Reported by @cjer in #27.\n\n\n0.6.0 (2018-02-21)\n------------------\n\n* Published package no longer includes unnecessary fixtures to reduce the size.\n* Naively write a feed object to a zip file with ``ptg.write_feed_dangerously``.\n* Read the earliest, busiest date and its ``service_id``'s from a feed with ``ptg.read_busiest_date``.\n* Bug fix: Handle ``calendar.txt``/``calendar_dates.txt`` entries w/o applicable trips.\n\n\n0.6.0.dev1 (2018-01-23)\n-----------------------\n\n* Add support for reading files from a folder. Thanks again @danielsclint!\n\n\n0.5.0 (2017-12-22)\n------------------\n\n* Easily build a representative view of a zip with ``ptg.get_representative_feed``. Inspired by `peartree <https://github.com/kuanb/peartree/blob/3bfc3f49ae6986d6020913b63c8ee32582b3dcc3/peartree/paths.py#L26>`_.\n* Extract out GTFS zips by agency_id/route_id with ``ptg.extract_{agencies,routes}``.\n* Read arbitrary files from a zip with ``feed.get('myfile.txt')``.\n* Remove ``service_ids_by_date``, ``dates_by_service_ids``, and ``trip_counts_by_date`` from the feed class. Instead use ``ptg.{read_service_ids_by_date,read_dates_by_service_ids,read_trip_counts_by_date}``.\n\n\n0.4.0 (2017-12-10)\n------------------\n\n* Add support for Python 2.7. Thanks @danielsclint!\n\n\n0.3.0 (2017-10-12)\n------------------\n\n* Fix service date resolution for raw_feed. Previously raw_feed considered all days of the week from calendar.txt to be active regardless of 0/1 value.\n\n\n0.2.0 (2017-09-30)\n------------------\n\n* Add missing edge from fare_rules.txt to routes.txt in default dependency graph.\n\n\n0.1.0 (2017-09-23)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Partridge is a python library for working with GTFS feeds using pandas DataFrames.",
"version": "1.1.2",
"project_urls": {
"Homepage": "https://github.com/remix/partridge"
},
"split_keywords": [
"partridge"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5b7e78009acdcf798f821468894702d2accc23058ba35f56c7e18e42d6bf01ec",
"md5": "c73c526cad2b1687983958419d0ca3e4",
"sha256": "18e1bf451153f6f8ac74f165bf8662dae39ee1c283125f44746717461b43a55f"
},
"downloads": -1,
"filename": "partridge-1.1.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c73c526cad2b1687983958419d0ca3e4",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6, <4",
"size": 16216,
"upload_time": "2023-12-03T23:05:30",
"upload_time_iso_8601": "2023-12-03T23:05:30.021469Z",
"url": "https://files.pythonhosted.org/packages/5b/7e/78009acdcf798f821468894702d2accc23058ba35f56c7e18e42d6bf01ec/partridge-1.1.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "75764bcf12ceb495f9e1d9861ed9211e348dd15fabb86208be0491e7ab1b3a96",
"md5": "57caf9a705b1729e76e2fc2efcb6798c",
"sha256": "9d9ba044f4123a83c6419dde073c15ac71b63301ed398386d6d3101ac8381e34"
},
"downloads": -1,
"filename": "partridge-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "57caf9a705b1729e76e2fc2efcb6798c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6, <4",
"size": 27579,
"upload_time": "2023-12-03T23:05:32",
"upload_time_iso_8601": "2023-12-03T23:05:32.260645Z",
"url": "https://files.pythonhosted.org/packages/75/76/4bcf12ceb495f9e1d9861ed9211e348dd15fabb86208be0491e7ab1b3a96/partridge-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-03 23:05:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "remix",
"github_project": "partridge",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "partridge"
}