Package: clippercard
clippercardis an unofficial python client for clippercard.com, written in Python.WhyNot only is theclippercard web sitea inaccessible by API, its behind-the-scene's HTML structure and HTTP protocol is not semantically structured. This library aims to provide an unofficial but sensible interface to the official web service.Project GoalI enjoy the actual user experience of ClipperCard on buses and trains. My complaints about the service are purely isolated to its web interface. I saw a problem, and I solved it for myself, that's all.As an advocate for data accessibility, I believe our dollars, our votes, our voices and our actions can nudge institutions in the direction we'd like them to go. At Bay Area'sMetropolitan Transportation Commission, I am sure there are a lot of great people doing good work to the best of their ability, and within the context of prioritization, organizational structure and resources available to them.I encourage the staff of MTA reading this project to see this effort as a nudge for a public and official API. The moment they put up an API that obsoletes this project, I will happily direct followers to the official solution. If you'd like them to increase attention to data accessibility, you can send them an email atinfo@mtc.ca.govand tell them I sent you.FeaturesProfile DataMultiple cards' dataFor each card, multiple products and balancesI don't have access to all products loadable on the ClipperCard, so transit product variant support is limited to what I personally use for now. If you'd like me to add support for your product, send me the page source from your account home page:https://www.clippercard.com/ClipperWeb/account.htmlSecurity and PrivacyIt's important to point out that:This project does not collect your personal information or clippercard.com login credentials.This project is not a hosted service, your data is not stored or sent to any 3rd party service.For now, this project is targeted at other software developers, who are capable of assessing my source code for security implications.InstallationTo install clippercard, simply:$pipinstallclippercardUsageimportclippercardsession=clippercard.Session('username','password')print(session.profile_info)forcinsession.cards:print(c)You also get a super convenient command line binaryclippercard::$clippercard-h# see usage information$clippercardsummary
+-----------------+------------------------------------------------+|name|GoldenGateHacker||email|goldengate88@systemfu.com||mailing_address|1MainSt,SanFrancisco,CA94105||phone|415-555-5555||alt_phone|650-555-5555||primary_payment|Mastercardendingin1234||backup_payment|Amexendingin9876|+-----------------+------------------------------------------------+
+---+---------------------------+------------+-------+--------+-------------------------+|# | Name                      | Serial     | Type  | Status | Products                |+---+---------------------------+------------+-------+--------+-------------------------+|1|Primary,card#2021234134 | 2021234134 | ADULT | Active | Cash Value: $195.00     |||||||CurrentPasses:None|||||||PendingPasses:None|||||||Reload:$255-Autoload||2|Backup,card#2021234156  | 2021234156 | ADULT | Active | Cash Value: $200.00     |||||||CurrentPasses:None|||||||PendingPasses:None|||||||Reload:$200-Autoload|+---+---------------------------+------------+-------+--------+-------------------------+If you wish to use clippercard without specifying username/password on the CLI, create a file~/.clippercardrcwith this format::[default]username=goldengate88@example.compassword=superseekritYou may toggle accounts via the--accountflag on the command line to access one of several configs in the file::[default]username=<replace_with_your_email>password=<replace_with_your_password>[other]username=<replace_with_login_email>password=<replace_with_login_password>Theothercredentials can then be accessed via::$clippercardsummary--account=otherMore examplesIf you have a transit pass that isn't recognized by this tool, you can privately share a copy of your account pageview-source:with the maintainer.Contributefork the repo to your personal GitHub accountmake your changes in your repofor Python source, follow local style consistency and PEP8runpylinton your diffsadd unit tests, make sure they pass (just runpytest😎)remember to bump the version number wherever appliesadd a new line for your revision toCHANGES.txtdescribing your changesend a pull request tohttps://github.com/clippercard/clippercard-pythonw/problem or goal statement and implementation detailsrespond to all pull request code review requests in your branch and submit the requested changes in new commitscommunicate with the maintainers to merge the finalized pull request and publish your changes