Skip to main content

A package to interface with Trailforks.com

Project description

PyForks

PyForks Tests GitHub PyPI

Python Trailforks Library for interacting with Trailforks.com. Help support this project and more.

About

PyForks has been designed to help me automate much of the manual data aggregation I was doing in order to build metrics for my local city and state trail systems. For example: wlmt.mn-mtb.com. The end goal of this project is the ability to make it much easier to pull data down that people are interested in and analyze it in a way that non-technical individuals can digest and understand impact in hopes of additional funding and interest.

Installation & Documentation

Quick Start

Currently, PyForks can interact with Users and Regions to obtain data that either requires Authentication or No Authentication. Functions that require Auth contain tha @authorization decorator which, can be seen in the Documentation.

Get Information on a User

from PyForks.trailforks_user import TrailforksUser
from pprint import pprint

# Get Basic information about a user
tf_u = TrailforksUser()
user_info = tf_u.get_user_info("mnmtb")
pprint(user_info)

# Get the User's Gear
tf_u.username = "<your_username>"
tf_u.password = "<your_password>"
tf_u.login()
user_gear = tf_u.get_user_gear("mnmtb")
pprint(user_gear)

"""
EXAMPLE OUTPUT:
{
  'admin_region': 
    {
    'region_link': 'https://www.trailforks.com/region/minnesota/',
    'region_name': 'Minnesota'
    },
 'city': 'Lakeville',
 'country': 'USA',
 'is_regional_admin': True,
 'profile_link': 'https://www.trailforks.com/profile/mnmtb',
 'recent_ride_locations': ['West Lake Marion Park',
                           'Murphy-Hanrehan Park',
                           'Lebanon Hills',
                           'Spirit Mountain Bike Park',
                           'Battle Creek',
                           'Cottage Grove Bike Park',
                           'Lakeville'],
 'state': 'Minnesota',
 'username': 'mnmtb'}
 """

Get Information on a region

from PyForks.trailforks_region import TrailforksRegion
tf_r = TrailforksRegion(username=<username>, password=<password>)
tf_r.login()

# Download All of a regions trails in CSV:
tf_r.download_all_region_trails(region, region_id)

# Download all region ridelogs in csv
tf_r.download_all_region_ridelogs(region)

# Download all region ridecounts in CSV
tf_r.download_region_ridecounts(region)

Contribute

Send all the pull requests you want!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyForks-0.0.11.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

PyForks-0.0.11-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file PyForks-0.0.11.tar.gz.

File metadata

  • Download URL: PyForks-0.0.11.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for PyForks-0.0.11.tar.gz
Algorithm Hash digest
SHA256 7016109e1f6a92f9b7088c0f02a65916a23601e7d2e6eaa0c37b2e2bddae079f
MD5 68f6289b15209feedd0132b466785621
BLAKE2b-256 a255b1b6f1933961893c362770749ace42c80e9fea26a53e29b5e008502a8af6

See more details on using hashes here.

Provenance

File details

Details for the file PyForks-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: PyForks-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for PyForks-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 40e5f5be89aae2c5d5e377a378dd730e95e70a8aea070adb331516b4d03e9182
MD5 55e4d31b3798deffa6200f91f11753be
BLAKE2b-256 c530d87e8c28c5b2fd3504542cc1930b2fe3a8a3b9b23c89aee8579c84415dd5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page