Saravanan666/pypi-org huggingface dataset:
Package: gtfs
Rewrite of transitfeed>>> import gtfs
>>> sched = gtfs.load( "bart.zip" )( it takes a minute or two to load )>>> sched.stops
[<Stop POWL>, <Stop ROCK>, <Stop SANL>, <Stop SHAY>, <Stop SSAN>, <Stop UCTY>, <Stop WCRK>, <Stop WOAK>, <Stop COLM>, <Stop MLBR>, <Stop RICH>, <Stop SBRN>, <Stop SFIA>, <Stop OAK>, <Stop 12TH_N>, <Stop MCAR_S>, <Stop 12TH>, <Stop 16TH>, <Stop 19TH>, <Stop 24TH>, <Stop ASBY>, <Stop BALB>, <Stop COLS>, <Stop CONC>, <Stop DALY>, <Stop DBRK>, <Stop DELN>, <Stop DUBL>, <Stop EMBR>, <Stop FRMT>, <Stop FTVL>, <Stop GLEN>, <Stop HAYW>, <Stop LAFY>, <Stop LAKE>, <Stop MCAR>, <Stop MONT>, <Stop NBRK>, <Stop NCON>, <Stop ORIN>, <Stop PHIL>, <Stop PITT>, <Stop PLZA>, <Stop BAYF>, <Stop CAST>, <Stop CIVC>]
>>> sched.routes
[<Route AirBART>, <Route 01>, <Route 02>, <Route 03>, <Route 04>, <Route 05>, <Route 06>, <Route 07>, <Route 08>, <Route 11>, <Route 12>]
>>> sched.service_periods
[<ServicePeriod WKDY 1111100>, <ServicePeriod SAT 0000010>, <ServicePeriod SUN 0000001>, <ServicePeriod M-FSAT 1111110>, <ServicePeriod SUNAB 0000001>]
>>> # pretty much all relationships are mapped
>>> sched.stops[0].stop_times[0].trip.route.agency
<Agency BART>
>>> sched2 = gtfs.load( "bart.zip", "bart.db" ) # uses a disk-based db instead of a memory db( this takes just as long as the first time )>>> sched2  # it's very similar to the first, except ...
<gtfs.schedule.Schedule instance at 0xdeadbeef>
>>> exit()
$ python
>>> from gtfs import Schedule
>>> sched = Schedule( "bart.db" ) # this takes no time at all
>>> sched.stops
[<Stop POWL>, <Stop ROCK>, <Stop SANL>, <Stop SHAY>, <Stop SSAN>, <Stop UCTY>, <Stop WCRK>, <Stop WOAK>, <Stop COLM>, <Stop MLBR>, <Stop RICH>, <Stop SBRN>, <Stop SFIA>, <Stop OAK>, <Stop 12TH_N>, <Stop MCAR_S>, <Stop 12TH>, <Stop 16TH>, <Stop 19TH>, <Stop 24TH>, <Stop ASBY>, <Stop BALB>, <Stop COLS>, <Stop CONC>, <Stop DALY>, <Stop DBRK>, <Stop DELN>, <Stop DUBL>, <Stop EMBR>, <Stop FRMT>, <Stop FTVL>, <Stop GLEN>, <Stop HAYW>, <Stop LAFY>, <Stop LAKE>, <Stop MCAR>, <Stop MONT>, <Stop NBRK>, <Stop NCON>, <Stop ORIN>, <Stop PHIL>, <Stop PITT>, <Stop PLZA>, <Stop BAYF>, <Stop CAST>, <Stop CIVC>]
>>> sched.stops[0].stop_times[0].trip.route.agency
<Agency BART>
Package: gtfs2nx
gtfs2nxCreate routableNetworkXgraph with realistic transfer times fromGTFSfeeds. 🚌 🚆 🚡HowCleaning & preprocessingRemove trips with unrealistic travel times and speedsFix trips contradictory stop sequences and departure timesEnable routabilityEnsure each node belongs only to single routeCalculate average segment travel timesCalculate average stop headway and service frequencyAdd edges for walking transfer between routes with realistic transfer time (walking time + headway / 2)Installpipinstallgtfs2nxUsageimportgtfs2nxasgxG=gx.transit_graph('path/to/GTFS-feed.zip')Customize transit network:G=gx.transit_graph(gtfs_paths='path/to/GTFS-feed.zip',time_window=('06:00','08:00'),route_types=[700],# only buseswalk_transfer_max_distance=400,# allow transfers with long walking distance)See theAPI docsfor more details and thegetting-started notebookfor a small demo.Exemplary NetworkX analysisimportnetworkxasnx# access precomputed stop characteristicsfrequency=nx.get_node_attributes(G,'frequency')# routingroute=nx.shortest_path(G,from_stop,to_stop,weight='weight')# travel time to other stopstravel_times=nx.single_source_dijkstra_path_length(G,source=from_stop,weight='weight')# centrality analysiscentrality=nx.closeness_centrality(G,distance='weight')Further use casesUsing graph neural networks to classify missing GTFS route typesValidating NetworkX transit graph: Comparing routes and travel times to Google MapsDevelopmentBuild from source usingpoetry:poetry build
pip install dist/gtfs2nx-*.whlConfigure post-checkout hook for branch specific .gitignore files:git config --local core.hooksPath .githooks/
Package: gtfs-aggregator-checker
GTFS Aggregator CheckerThis repo is to verify that a given list of feeds is listed in feed aggregators.
Currently it checks transit.land and transitfeeds.com to verify that feeds are
listed in an aggregator.Installationpip install gtfs-aggregator-checkerConfigureThe following env variables can be set in a.envfile, set to the environment,
or inline likeTRANSITLAND_API_KEY=SECRET python -m gtfs_aggregator_checker.TRANSITLAND_API_KEYAnapi key from transitland.GTFS_CACHE_DIRFolder to save cached files to. Defaults to~/.cache/gtfs-aggregator-checkerGetting StartedCLI Usagepython -m gtfs_aggregator_checker [YAML_FILE] [OPTIONS]python -m gtfs_aggregator_checkerorpython -m gtfs_aggregator_checker /path/to/ymlwill search aCal-ITP agencies.yml filefor any urls and see
if they are present in any of the feed aggregators. Alternatively you can use a--csv-fileor--urlinstead of anagencies.ymlfile.The final line of stdout will tell how many urls were inagencies.ymland how
many of those were matched in a feed.Optionspython -m gtfs_aggregator_checker --helpprint the help--csv-file agencies.csvload a csv instead of a Cal-ITP agencies yaml file
(one url per line)--url http://example.comCheck a single url instead of a Cal-ITP agencies
yaml file--output /path/to/file.jsonSave the results as a json fileDevelopmentClone this repo andpip install -e /pat/to/feed-checkerto develop locally.By default, downloaded files (raw html files, api requsets) will be saved to~/.cache/calitp_gtfs_aggregator_checker. This greatly reduces the time
required to run the script. Delete this folder to reset the cache.
Package: gtfsdb
Supported DatabasesPostgreSQL (PostGIS for Geo tables) - preferredOracle - testedMySQL  - testedSQLite - testedGTFS (General Transit Feed Specification) DatabasePython code that will load GTFS data into a relational database, and SQLAlchemy ORM bindings to the GTFS tables in the gtfsdb. The gtfsdb project’s focus is on making GTFS data available in a programmatic context for software developers. The need for the gtfsdb project comes from the fact that a lot of developers start out a GTFS-related effort by first building some amount of code to read GTFS data (whether that’s an in-memory loader, a database loader, etc…);  GTFSDB can hopefully reduce the need for such drudgery, and give developers a starting point beyond the first step of dealing with GTFS in .csv file format.Available on pypi:https://pypi.python.org/pypi/gtfsdbInstall from source via github (if you want the latest code) :Install Python 3.xhttps://www.python.org/downloads/(code also runs on 2.7 if you are stuck on that version)pip install zc.buildout-https://pypi.org/project/zc.buildout(optinal step forpostgres users: ‘pip install psycopg2-binary’)git clonehttps://github.com/OpenTransitTools/gtfsdb.gitcd gtfsdbbuildout install prod – NOTE: if you’re using postgres, do a ‘buildout install prod postgresql’bin/gtfsdb-load –database_url <db url>  <gtfs file | url>examples:bin/gtfsdb-load –database_url sqlite:///gtfs.db gtfsdb/tests/large-sample-feed.zipbin/gtfsdb-load –database_url sqlite:///gtfs.db http://developer.trimet.org/schedule/gtfs.zipbin/gtfsdb-load –database_url postgresql://postgres@localhost:5432 –is_geospatial http://developer.trimet.org/schedule/gtfs.zipNoteadding theis_geospatialcmdline flag, when paired with a spatial-database ala PostGIS (e.g., is_spatial is meaningless with sqllite), will take longer to load…but will create geometry columns for both rendering and calculating nearest distances, etc…view db ( example:https://sqliteonline.com)The best way to get gtfsbd up and running is via the ‘zc.buildout’ tool.  Highly recommended to first install
buildout (e.g., pip install zc.buildout) before doing much of anything else.Postgres users, gtfsdb requires the psycopg2-binary database driver.  Installing that viapip install psychopg2-binarywill relieve gtfsdb from re-installing locally as part of the build.  And if after the fact, you seeexceptionsmentioningNoteif you get the message “ImportError: No module named psycopg2”, then ‘pip install psychopg2-binary’ should fix things. (Assumes you have postgres also installed on the machine you’re trying to use the pg driver).Usage with Docker:Build the image withdocker build -t gtfsdb .Run it with:dockerrungtfsdb--database_url<dburl><gtfsfile|url>NoteThe entrypoint command isbin/gtfsdb-loadso the arguments will be passed to it.Example Queries:get first stop time of each trip for route_id 1select*fromtripst,stop_timesstwheret.route_id='1'andt.trip_id=st.trip_idandst.stop_sequence=1get agency name and number of routesselecta.agency_name,a.agency_id,count(r.route_id)fromroutesr,agencyawherer.agency_id=a.agency_idgroupbya.agency_id,a.agency_nameorderby3desc
Package: gtfs_kit
GTFS Kit is a Python 3.8+ library for analyzingGeneral Transit Feed Specification (GTFS)data in memory without a database.
It uses Pandas and Shapely to do the heavy lifting.Installationpoetry add gtfs_kit.ExamplesYou can find examples in the Jupyter notebooknotebooks/examples.ipynb.AuthorsAlex Raichev (2019-09), maintainerDocumentationDocumentation is built via Sphinx from the source code in thedocsdirectory then published to Github Pages atmrcagney.github.io/gtfs_kit_docs.NotesThis project’s development status is Alpha.
I use GTFS Kit for work and change it breakingly to suit my needs.This project uses semantic versioning.I aim for GTFS Kit to handlethe current GTFS.
In particular, i avoid handlingGTFS extensions.
That is the most reasonable scope boundary i can draw at present, given this project’s tiny budget.
If you would like to fund me to expand that scope, feel free to email me.Thanks toMRCagneyfor periodically donating to this project.Constructive feedback and contributions are welcome.
Please issue pull requests from a feature branch into thedevelopbranch and include tests.GTFS time is measured relative noon minus 12 hours, which can mess things up when crossing into daylight savings time.
I don’t think this issue causes any bugs in GTFS Kit, but you and i have been warned.
Thanks to user derhuerst for bringing this to my attention inclosed Issue 8.
Package: gtfs-lite
GTFS-LiteA lightweight Pandas-driven package for analyzing static GTFS feeds.GTFS-Lite was created out of a desire to be able to quickly load static GTFS
feeds into memory and ask specific questions about the dataset in the form of
various metrics and manipulation. Examples include:Basic Summaries:Trip counts, spans, feed validity, distributions of tripsFrequency Metrics:Frequency by time of day, route, or stopCounting Unique Trips at StopsTrip counts for a subset of stopsComprehensive date validationthat takes into account calendar and calendar datesYou can find the docshere.To get started:Install this package usingpip install gtfs-lite.Load a feed directly from a zipfile withfrom gtfslite import GTFSandgtfs = GTFS.load_zip('path/to/file.zip')Access the various attributes, for exampleprint(gtfs.summary())
Package: gtfs-marey
gtfs-mareyGenerate a Marey Chart for the given GTFS route, inspired bythis explanation(in italian). Beware that the program is not bullet proof and was developed just out of curiosity.Installpip install gtfs-mareyUsageusage: gtfs-marey [-h] --feed FEED --route_names ROUTE_NAMES [ROUTE_NAMES ...] --outputs
                  {html,svg,png} [{html,svg,png} ...] --days DAYS [DAYS ...] [--verbose]

Generate a Marey Chart for the given GTFS route

options:
  -h, --help            show this help message and exit
  --feed FEED           feed path or url
  --route_names ROUTE_NAMES [ROUTE_NAMES ...]
                        route name referencing 'route_short_name' value in GTFS
  --outputs {html,svg,png} [{html,svg,png} ...]
                        output type
  --days DAYS [DAYS ...]
                        day of the week to consider in the chart creation
  --verbose             Turn on verbose modeExamplegtfs-marey --feed https://www.trentinotrasporti.it/opendata/google_transit_extraurbano_tte.zip --route_names R35 --output html,png --day mondayThings to improveBetter handling of the calendar schedulePosition stops based on their distanceSize of the generated pictureMore meaningful color schemaSimilar toolsgtfs-to-charthas a similar scope and is much more production-ready. The major difference is that our tool  shows stops on the opposite axis, and also allows to directly generate a picture out of the elaboration.
Package: gtfsni
A python application that generates GTFS (Google Transit Feed Specification)
files for Translink (N.I.) transport routes. This is a basic proof of concept
that derives its data from scraping the Translink web site. The only
coordinate data available is for Belfast Citybus stops and so other services
such as Ulsterbus and NIRail aren’t supported at the moment.Requirementsrequestspython-geohashsvn+http://googletransitdatafeed.googlecode.com/svn/trunk/python/Install(Tested on linux only).Install from pypi with easy_install:$ easy_install gtfsnior pip:$ pip install gtfsniScriptsThis this will install a number of scripts, some of which are from the
googletransitdatafeed library. The gtfsni-specific scripts are:gtfs_generategtfs_validate [GTFS_ZIP_FILE]gtfs_view [GTFS_ZIP_FILE]Runninggtfs_generatewill create a zipped file (google_transit.zip) in
adata/distsubdirectory of the current working directory.
Package: gtfs-parser
gtfs_parserLICENSEMIT LicenseInstallationpipinstallgtfs-parserAPITODOCLIusage: gtfs-parser [-h] [--parse_ignoreshapes] [--parse_ignorenoroute]
                   [--aggregate_yyyymmdd AGGREGATE_YYYYMMDD]
                   [--aggregate_nounifystops]
                   [--aggregate_delimiter AGGREGATE_DELIMITER]
                   [--aggregate_begintime AGGREGATE_BEGINTIME]
                   [--aggregate_endtime AGGREGATE_ENDTIME]
                   mode src dst

positional arguments:
  mode
  src
  dst

optional arguments:
  -h, --help            show this help message and exit
  --parse_ignoreshapes
  --parse_ignorenoroute
  --aggregate_yyyymmdd AGGREGATE_YYYYMMDD
  --aggregate_nounifystops
  --aggregate_delimiter AGGREGATE_DELIMITER
  --aggregate_begintime AGGREGATE_BEGINTIME
  --aggregate_endtime AGGREGATE_ENDTIMEExamplegtfs-parserparsegtfs.zipoutput
gtfs-parserparsegtfs_diroutput--parse_ignoreshapes
gtfs-parseraggregategtfs.zipoutput
gtfs-parseraggregategtfs_diroutput--aggregate_nounifystops
Package: gtfs.py
gtfs.pyA simple python library for parsing, editing and writing GTFS files.GTFS (General Transit Feed Specification) is a format which determined by google in order to defines a common format for public transportation static data (schedules, stops location, etc.). For more information about the format you can readhereandhere.Getting StartedInstallingYou can install this package with pip.pip install gtfs.pyIf you want to contribute to the library code, you have to clone if from github and install it as a developer.git clone https://github.com/WYishai/gtfs.py.git
cd gtfs.py
cd src
python setup.py developUsageAll examples are intended for writing in a python shell (or python code file).Creating a new TransitData object:from gtfspy import TransitData

td = TransitData()
...Loading existing GTFS file:from gtfspy import TransitData

gtfs_file_path = "/path/to/file"
td = TransitData(gtfs_file_path)
...Additional examples are in theexamples folderin theGIT repository.Running the testsThis project contains unit tests that covers most of the source code. In order to run the tests, you must first install the project as a developer (as mentioned at theInstallingsection. After the installation you can run them by typing the following commands in your shell:cd [PROJECT_DIR]\tests
python -m unittest discover gtfspyOf course,[PROJECT_DIR]must be replaced by the path you cloned the GIT repository into it.LicenseThis project is licensed under the Apache-2.0 License - see theLICENSEfile for details
Package: gtfs-station-stop
GTFS Station StopA project for organizing GTFS Real-Time data for use as a homeassistant sensor.UsageThis is designed for use with Home Assistant GTFS Realtime Custom Component.Feed Subjects and Station StopsAll updates go through the Feed Subject which is setup to call updates from one or more feed URLS.Create a feed subject like so, then pass it in the constructor for a Station Stopfrom gtfs_station_stop.feed_subject import FeedSubject
from gtfs_station_stop.station_stop import StationStop

# Obtain the API keep from your GTFS provider if needed, otherwise leave blank.
api_key = "YOUR_API_KEY_HERE"
urls = ["https://gtfs.example.com/feed1", "https://gtfs.example.com/feed2"]
feed_subject = FeedSubject(api_key, urls)

# Obtain the Stop ID from GTFS static data from your provider.
# This must match those provided by the realtime feed.
station_stop_nb = StationStop("STOP_ID_NORTHBOUND", feed_subject)
station_stop_sb = StationStop("STOP_ID_SOUTHBOUND", feed_subject)Callingfeed_subject.update()will update all registered listeners.feed_subject.update()

for arrival in station_stop_nb.arrivals:
    minutes_to = (arrival.time - time.time()) / 60.0
    print(f"{arrival.route} in {minutes_to}")Active service alerts are also supported for station stops and for routes.route_status = RouteStatus("Line 1", feed_subject)

feed_subject.update()

for alert in route_status.alerts:
    print(f"{route_status.id} alert {alert.header_text['en']}")

for alert in station_stop_nb.alerts:
    print(f"{station_stop_nb.id} alert {alert.header_text['en']}")GTFS Static InfoStatic data can be loaded into a database for convenient lookup to use alongside GTFS Realtime data.from gtfs_station_stop.station_stop_info import StationStopInfoDatabase

station_stop_info_db = StationStopInfoDatabase("gtfs_static.zip")
print(f"{station_stop_info_db['STOP_ID']}")Development SetupInstall all development dependencies with:$ pip install -r requirements-dev.txtRun tests with:$ pytest
Package: gtfstools
Python GTFS ToolsGTFS Tools is a Python 3.8+ library to loadGTFSdata into memory. This library is fully build on the standard library and no
external dependencies are required. Note that development is still in Alpha
phase and changes may not be backwards compatible!InstallpipinstallgtfstoolsLicenseCopyright © 2023 Kevin NobelThis project is available under theMIT License.
Package: gtfsutils
gtfsutilsGTFS command-line tool and Python GTFS utility libraryInstallationTo install the package from PyPi:pipinstallgtfsutilsTo install the development version from GitHub:gitclonegit@github.com:triply-at/gtfsutils.gitcdgtfsutils
pipinstall-e.# Install in editable modeUsagePython packageThe usage of the Python package is illustrated inquickstart.ipynb.Command-line toolThe package can be also used as a command-line tool. There are three sub-tools available.FilterThe filter tool applies a spatial filter to a GTFS file. You can either filter based on stop locations or on trip shapes. The filter can be specified either as a bounding box (xmin, ymin, xmax, ymax) or as a file path (e.g. to a GeoJSON or GPKG file).Here is how to spatially filter a GTFS file based on stop locations, using a bounding box:gtfsutilsfilter-tstopsdata/vienna.gtfs.zipdata/vienna-filtered.gtfs.zip"[16.197, 47.999, 16.549, 48.301]"Here is how to spatially filter a GTFS file based on trip shapes, using a GeoJSON file:gtfsutilsfilter-tshapesdata/vienna.gtfs.zipdata/vienna-filtered.gtfs.zipdata/area.geojsonFor more information, type:gtfsutilsfilter--helpusage: gtfsutils filter [-h] [-t TARGET] [-o OPERATION] [--overwrite] [-v] src dst bounds

positional arguments:
  src                   Input GTFS filepath
  dst                   Output GTFS filepath
  bounds                Filter boundary

optional arguments:
  -h, --help            show this help message and exit
  -t TARGET, --target TARGET
                        Filter target (stops, shapes)
  -o OPERATION, --operation OPERATION
                        Filter operation (within, intersects)
  --overwrite           Overwrite if exists
  -v, --verbose         Verbose outputBoundsThe bounds tool computes the bounding box (based on stop locations) of a GTFS file:gtfsutilsboundsdata/vienna.gtfs.zip[16.1977025532707,47.9995020902886,16.5494019702052,48.3011051975429]For more information, type:gtfsutilsbounds--helpusage: gtfsutils bounds [-h] src

positional arguments:
  src         Input GTFS filepath

optional arguments:
  -h, --help  show this help message and exitInfoThe info tool print general information about a GTFS file:gtfsutilsinfodata/vienna.gtfs.zipGTFSfiles:agency.txt2rowscalendar.txt186rowscalendar_dates.txt9,575rowsroutes.txt441rowsshapes.txt401,371rowsstop_times.txt3,733,781rowsstops.txt4,510rowstrips.txt201,042rows

Calenderdaterange:11.12.2022-09.12.2023

Boundingbox:[16.1977025532707,47.9995020902886,16.5494019702052,48.3011051975429]For more information, type:gtfsutilsinfo--helpusage: gtfsutils info [-h] src

positional arguments:
  src         Input GTFS filepath

optional arguments:
  -h, --help  show this help message and exitTestingPrepare dev environment with:# Create virtual environementpython-mvenv./venv# Install dependenciespipinstall-rrequirements-dev.txt
pipinstall-rrequirements.txt# Activate virtual environmentsourcevenv/bin/activateTo run unit tests, type:pytest-vLicenseThis project is licensed under the MIT license. See theLICENSEfor details.
Package: gtf_to_genes
***************************************Overview***************************************We want an extremely fast, lightweight way to access gene data stored in GTF format.The parsed data is held in an intuitiveGene-> transcript-> transcriptwith exons being stored as intervalsOur aim is to* cache data in binary format, which can be* re-read in < 10s for even the largest genomesCurrently initial parsing Ensembl Homo sapiens release 56 takes around 4.5 minutes.The binary data can be reloaded in < 10s.This contains *all* of the data structure in the original GTF fileNote that we sacrifice memory usage for speed. This is seldom a problem for modern computersand genome sizes (There are around ~400,000 exons but there are stored as intervals / int pairs)***************************************A Simple example***************************************::gene_structures = t_parse_gtf("Mus musculus")##   used cached data for speed#ignore_cache = False##   get all protein coding genes only#genes_by_type = gene_structures.get_genes(gtf_file, logger, ["protein_coding"], ignore_cache = ignore_cache)##   print out gene counts#t_parse_gtf.log_gene_types (logger, genes_by_type)return genes_by_type
Package: gtfu
gtfu日本語|EnglishCommand line tool to Get pageTitle From Url.InstallationIt supports Python 3.7+.pipinstallgtfuUsageAfter installation, type the following command into your terminal application.Standard modegtfuhttps://example.com/The page title will be copied to the clipboard.Example DomainMarkdown modegtfu-mhttps://example.com/The page title will be copied to the clipboard in markdown format.[Example Domain](https://example.com/)Prompt modegtfuAn interactive prompt will begin. You will be asked for the URL to be retrieved and whether you want it in Markdown format.
Package: gtimeit
gtimeitTimer, benchmark and ressource usage tracker.
A tool for python functions. Time and compare your functions inside or outside a program.BenchmarkAllows to run multiple python functions a certain amount of times and to compare there respective execution times.
Similar totimeitDisplay curves of all the execution times.
Prototype : benchmarking for complexity tests up to one variable parameter. The variable take all the values of a given range and the benchmarck keeps track of the executions times.TrackerAllow to keep track of the execution time of some functions in a program. Useful to know which part of your program take the more time to execute.Read the README athttps://github.com/Chthi/gtimeitfor more information.