GithubHelp home page GithubHelp logo

andybak / codebase-python-api-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from igniteflow/codebase-python-api-client

0.0 2.0 0.0 114 KB

Unofficial CodeBase Python API client wrapper

License: MIT License

Python 100.00%

codebase-python-api-client's Introduction

Codebase API Python Client

A Python client providing read/write access to the Codebase API with a small, but powerful, CLI.

Install

pip install -U git+git://github.com/igniteflow/codebase-python-api-client

CLI

  • After pip install the codebase command is availably globally

To use the command-line interface, create a file called .codebase in your home directory and add your Codebase username and apikey (found in your Codebase settings page) in the following JSON format:

{
    "CODEBASE_USERNAME": "foo/bar",
    "CODEBASE_APIKEY": "4ofh783o4hf78o4fh4o"
}

You can now explore the API. To see the available methods:

codebase

To view all categories for a project and see the response in the terminal:

codebase [project] categories

Or search:

codebase [project] search [search term]

The CLI can call any function in the CodeBaseAPI class using the syntax:

codebase [project] [function name] *[args]

Use the client in your code

from codebase.client import CodeBaseAPI

codebase = CodeBaseAPI(username='walter-white', apikey='84gf6479gf674gf', project='MyProject')

# get all notes for a ticket
notes = codebase.notes(ticket_id=1) # notes returned as a Python dict

# update the status of a ticket (see http://support.codebasehq.com/kb/tickets-and-milestones/updating-tickets)
note_data = {
    'ticket_note': {
        u'content': u'This is the note comment',
        u'changes': {
            u'status_id': u'1631923',
        },
    },
}
codebase.add_note(ticket_id=1, data=note_data)

Debugging

By default, data is given and returned as Python dicts. To get the raw requests.Response object, just set CodeBaseAPI.DEBUG to True.

codebase-python-api-client's People

Contributors

andybak avatar igniteflow avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.