Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Python implementation of the Campfire API

Project description


Camplight is a Python implementation of the Campfire API.

The project comes with a Python module that can be imported via import camplight and a simple command-line tool named camplight to utilize it.


The easiest way to install Camplight and its dependencies:

$ pip install camplight

Alternatively, you can install it from source:

$ git clone git://
$ cd camplight/
$ python install

(Note that Camplight requires Requests.)

API Usage

from camplight import Request, Campfire

request = Request('', 'your_token')
campfire = Campfire(request)

account = campfire.account()
rooms = campfire.rooms()

room ='Danger')

Client Usage

Usage: camplight [options] <command> [args]

  -h, --help            show this help message and exit
  -u URL, --url=URL     set Campfire URL
  -t TOKEN, --token=TOKEN
                        set API token for authentication
  -r ROOM, --room=ROOM  set Campfire room
  -v, --verbose         be more verbose

Global commands:
  account               get account information
  rooms                 list available rooms
  user [id]             get user information
  presence              list rooms the user is present in
  search <term>         search transcripts for term

Room commands (require --room to be set):
  status                get general room information
  recent                list recent messages in the room
  transcript            list all messages sent today to the room
  uploads               list recently uploaded files in the room
  join                  join the room
  leave                 leave the room
  lock                  lock the room
  unlock                unlock the room
  speak <message>       send a regular chat message
  paste <message>       paste a message
  play <sound>          play a sound
  set-name <name>       change the room's name
  set-topic <topic>     change the room's topic

Environment variables:
  CAMPFIRE_URL          same as --url
  CAMPFIRE_TOKEN        same as --token
  CAMPFIRE_ROOM         same as --room
  CAMPFIRE_VERBOSE      same as --verbose


Build Status

After cloning the repository, run the test suite using:

$ python test

You can generate a coverage report using First, install the coverage package:

$ pip install coverage

Now gather the data by running:

$ coverage run test

And create a report:

$ coverage report

You can also create a much nicer HTML report:

$ coverage html

Now open htmlcov/index.html in your browser.


Camplight is licensed under the terms of the MIT License. See LICENSE file.


v0.9.6 (Aug 12 2013)

  • Add optional date parameter to Room.transcript(). Format must be YYYY/MM/DD. Contributed by @luchux.

v0.9.5 (Jul 16 2013)

  • Generate reStructuredText from markdown using python doc. I want to keep using markdown.

v0.9.4 (Jul 16 2013)

  • Convert documentation to reStructuredText for PyPI.
  • Recommend using pip install camplight in README.
  • Define one file per line in

v0.9.3 (Jul 10 2013)

  • Add for PyPI.

v0.9.2 (Jul 10 2013)

  • Fix for PyPI.

v0.9.1 (Feb 18 2013)

  • Use HTTPretty as mock library for unit tests.
  • Add Travis build status to README.
  • Update classifiers in

v0.9 (Feb 15 2013)

  • Fix exit status of python test.
  • Update copyright year in LICENSE file.

v0.8 (Feb 8 2013)

  • Fix JSON decoding in case no text is returned. Reported by @astiam.
  • Travis: run tests against Python 3.3.

v0.7 (Dec 19 2012)

  • Fix path to Camplight module in unit tests.
  • Update to Requests version 1.0.3.

v0.6 (Nov 6 2012)

  • Use pytest for unit testing.

v0.5 (Oct 30 2012)

  • Add test coverage using (@keimlink)
  • Properly set tests_require and extras_require in (@keimlink)
  • Work around dependency error returned by pip install by hardcoding the current Camplight version in (@jwilder)

v0.4 (Aug 8 2012)

  • Add unit tests; run them via python test.
  • Add Travis CI config.
  • Python 3 compatibility.

v0.3 (Aug 6 2012)

  • Rewrite command-line interface from scratch.
  • Add dedicated Camplight exceptions.
  • Make use of Response.json from Requests v0.12.1.
  • Add verbose mode.
  • More sounds.
  • Tweak per-file docstrings.
  • Add
  • Add much more documentation.

v0.2 (Oct 25 2011)

  • Use requests as HTTP library.
  • Move all HTTP/JSON handling to separate class.
  • Split up code into camplight package and runner script.
  • More pythonic coding style. Fix PEP8 errors.
  • Add ability to get account information (account.json).
  • More (undocumented) sounds.
  • Add MIT license text.

v0.1 (May 30 2011)

  • First tagged version.

Project details

Download files

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

Files for camplight, version 0.9.6
Filename, size File type Python version Upload date Hashes
Filename, size camplight-0.9.6.tar.gz (10.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page