Skip to content
simon-weber edited this page Mar 27, 2012 · 2 revisions

#Codebase Overview This is a quick introduction to the existing code organization, intended for contributors and hackers. If you just want to use the api, you shouldn't need to look at this.

For more details, check the source. The internal documentation is pretty good.

Click on a directory to be taken to its explanation:

.
├── docs
│......├── Makefile
│......└── source
│..............├── conf.py
│..............├── index.rst
├── gmusicapi
│......├── api.py
│......├── gmtools
│......│......├── tools.py
│......├── metadata_pb2.py
│......├── protocol.py
│......├── test
│......│......├── no_tags.mp3
│......│......├── test_api_calls.py
│......│......├── test.mp3
│......│......├── test_regressions.py
│......│......└── utils.py
│......└── utils
│..............├── apilogging.py
│..............├── utils.py
│..............├── clientlogin.py
│..............├── tokenauth.py

## docs * Makefile: use this to build the documents locally, like ``make html``. ### source * conf.py: configuration for Sphinx. Only thing that usually gets changed here are the mocked out modules, for building on RTD. * index.rst: reStructuredText for the documentation. Note that since RTD doesn't have the ``decorator`` module, anything that's decorated should have an explicit entry with parameters. ## gmusicapi * api.py: currently the highest level of abstraction. The Api class combines a PlaySession and protocol to make requests of the GM servers. This module is what's documented on RTD, so be careful about adding new third party modules. * metadata_pb2.py: compiled python output to specifiy the music manager protobuff protocol. * protocol.py: holds the protocol specifications. Most classes here are never meant to be instantiated, just used statically. ### gmtools * tools.py: tools for manipulating data received from GM. Not used in the Api currently, but may be useful for projects building on it. ### test * no_tags.mp3: an mp3 file with no id3 tags * test_api_calls.py: test suite at the Api level. I usually run it from the root directory as a module: ``python -m gmusicapi.test.test_api_calls``. * test.mp3: an mp3 file with tags * test_regressions.py: a test suite containing fixed bugs, to ensure they don't happen again. Run it in the same way as ``test_api_calls.py``. * utils.py: utilities only used for testing. ### utils * apilogging.py: controls logging for the entire api. If you want to change how logging happens and where it's output, do it here. * utils.py: utilities used across the api. * clientlogin.py and tokenauth.py: authentication-related utilities used by api.PlaySession.
Clone this wiki locally