Created
March 29, 2013 13:48
-
-
Save cholin/5270970 to your computer and use it in GitHub Desktop.
pygit2 api reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Basic API (low-level) | |
* public libgit2 structs should be python objects (classes) - Example: git_repository => Repository() | |
* nameing convention: strip git_`struct_name`_* - Example: git_repository_config() => Repository.config() | |
* iterations should be implemented as a generator, if this is not possible we | |
need to change libgit2 (other bindings will benefit from this as well) | |
* every method should map to one libgit2 function (exceptions are iterations) | |
* return values of methods | |
* no lists use generators instead | |
* no dictionaries use tuples or objects instead | |
* no instantiation of objects use strings instead (important for generators) | |
like sha1-hash for objects or names for references. | |
### High-Level API | |
* inheritance for every object | |
* no return value restrictions | |
* *pythonic* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment