-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Milestone
Description
Currently if I have a corpus named "test" and I want to access its object, I need some code like this:
from pypln.api import PyPLN
pypln = PyPLN('http://demo.pypln.org', ('username', 'myprecious'))
corpora = pypln.corpora()
test_corpus = [corpus for corpus in corpora if corpus.name == 'test']We should provide better methods of retrieving corpora (better if the API provides special methods for it).
Another possible helper method is something like "get_corpus_or_create", for example:
from pypln.api import PyPLN
pypln = PyPLN('http://demo.pypln.org', ('username', 'myprecious'))
test_corpus = pypln.get_corpus_or_create('test')We could also see other helper methods in Django's ORM to inspire us and improve library usability.