Package: atd-mds-client-dev
atd-mds-clientA Python utility to interact data endpoints compliant with theMobility Data Specification, as designed by the Open Mobility Foundation.This client was inspired by theCity of Santa Monica MDS Provider Client.InstallationInstall the library:pipinstallatd-mds-clientOr the development branch:pipinstallatd-mds-client-devGetting started# Import standard libraies:importjsonfromdatetimeimportdatetime# Import the MDS Library:frommdsimport*# Provider Configurationprovider_configuration={# Authentication type: "OAuth", "Bearer", "Basic" or "Custom""auth_type":"Bearer",# If you have a Bearer authentication, provide the token:"token":"...secret...token...here",# Provide the URL endpoint of the provider:"mds_api_url":"https://mds.your-scooter-company.com/api/endpoint/v1",# (Optional) The Provider ID"provider_id":"...mds...provider...id",# Any additional HTTP Headers:"headers":{"App-Version":"3.0.0"},# Any additional settings:"time_format":"unix","delay":1,# Delay in seconds per http request"max_attempts":3,# Max attempts if the http request fails"paging":True,# Enable/Disable pagination"timeout":10,# Maximum time allowed for an HTTP request in seconds"version":"0.3.0",# MDS Version: "0.2.0", "0.3.0" or "0.4.0" or remove for custom driver}# Builds a time-zone aware date time rangemy_time=MDSTimeZone(date_time_now=datetime(2020,1,1,20),# Either Now or any date as specified by datetime, becomes end_timeoffset=3600,# Subtract 1 hour from date_time_now and becomes start_timetime_zone="US/Central",# US/Central)# Initialize the MDS Clientmds_client=MDSClient(config=provider_configuration,provider="amazing scooters")# Get tripstrips=mds_client.get_trips(# First the start time for the querystart_time=my_time.get_time_start(utc=True,# Transforms local time into UTCunix=True# Transforms format from ISO into Unix Epoch time),# Now the end time:end_time=my_time.get_time_end(utc=True,# Transforms local time into UTCunix=True# Transforms format from ISO into Unix Epoch time))print(json.dumps(trips))CD/CIWe make use of CircleCI for our deployments, you can see the build script in the.circlecifolder in this repo. The basic process consists of a couple steps:Generate basic variables based on the current branchChange the package name based on the current branchBuilds the packageDeploys with twineIn short, the only way to deploy a package is to change it's version number manually insetup.py.If the changes were made in the master branch, the deployment will go into production, for the dev branch, a postfix will be added to the name of the package before it is deployed to pypi.DevelopmentWe currently have two branches: master and dev. The master branch is used in production, our dev is meant for development and testing.Dev & Master PostfixFor the dev branch, the build script will attach a post fix"-dev"to the package name specified insetup.py. For example, in the dev branch filesetup.pywe see the package name isname="atd-mds-client"and the current version was0.0.X, if you were to change the version number and commit to the dev branch, the deployment script will deploy to pypi asatd-mds-client-devwith the new version.Pull Requests & Local DevelopmentPull requests are ignored by the CD/CI pipeline, meaning they do not get built. If you need a package built for dev testing:Test your script locallyCreate a PR against the dev branch, make sure you change the version number in setup.pyMerge your PR branch to the dev branchHow about local development?At the moment, local development is open-ended. You may use any python mechanism or style when including source python packages in your development and local tests.LicenseThe package is distributed under the GPL 3.0 license.