Skip to content

Instantly share code, notes, and snippets.

@cortical-iv
cortical-iv / endpoint_classes.py
Last active January 5, 2018 03:49
Endpoint class example for Destiny 2 api
class Endpoint:
"""
Abstract end point class: this is never used directly. Concrete
endpoints inherit from this.
"""
def __init__(self, headers, request_parameters = None, url_arguments = None):
self.url_arguments = url_arguments
self.url_initial = self.make_url()
self.request_params = request_parameters
self.headers = headers
@cortical-iv
cortical-iv / bobp-python.md
Last active May 16, 2022 08:38 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@cortical-iv
cortical-iv / destiny2_api_intro.py
Last active June 27, 2025 05:53
Highly annotated introduction to the destiny2 api (Python)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Getting Started using the Destiny 2 Api
An annotated guide to some of the public endpoints available for examining a user's
characters, items, and clan using the Destiny 2 API. You will need to use your api key for
this to work. Just insert it as a string where it says <my_api_key> in the beginning.
It is broken into four parts:
0: Imports, variables, and fixed parameters defined
@cortical-iv
cortical-iv / destiny2_stats.txt
Created November 1, 2017 12:28
all raid, pve, and pvp stats available for a single user (json-formatted, slightly modified)
RAID STATS : {
"allTime": {
"activitiesCleared": {
"statId": "activitiesCleared",
"basic": {
"value": 3.0,
"displayValue": "3"
}
},
"activitiesEntered": {
@cortical-iv
cortical-iv / destiny_api_basics.py
Created August 7, 2017 06:01
Basics of using public api for exploring characters, bungie account, and clan.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Some simple examples of the public endpoints available for examining users,
characters, and clans using the Destiny API.
You will need to put in your own api key to run it. To learn how go to:
http://destinydevs.github.io/BungieNetPlatform/docs/API-Key
"""
import requests