diff --git a/README.md b/README.md index bbd78ffbf86f4f27766db8c041a6097ec367672c..f1cf0bbc57716690b123bddd7c9151589ca42577 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,26 @@ where this file resides. Afterwards adjust the data model, the data and the crawler implementation in `example_cfood.py` as you like. +## Practice your crawling +After executing `crawl.py` you'll notice that two new experiment records with a +date and a result have been created. However, they are lacking the information +about their project. As an excercise on your way towards developing your own +crawler module, try to implement an project cfood that collects the project +information from the directory name(s) within `data` and creates or updates a +corresponding project record. Afterwards, extend `example_cfood.py` and +`crawl.py` such that the project information is attached to the experiment +records. + ## Contributing -Thank you very much to all contributers—[past, present](https://gitlab.com/caosdb/caosdb/-/blob/dev/HUMANS.md), and prospective ones. +Thank you very much to all contributers—[past, +present](https://gitlab.com/caosdb/caosdb/-/blob/dev/HUMANS.md), and prospective +ones. ### Code of Conduct -By participating, you are expected to uphold our [Code of Conduct](https://gitlab.com/caosdb/caosdb/-/blob/dev/CODE_OF_CONDUCT.md). +By participating, you are expected to uphold our [Code of +Conduct](https://gitlab.com/caosdb/caosdb/-/blob/dev/CODE_OF_CONDUCT.md). ## License diff --git a/example_cfood.py b/example_cfood.py index e131e7d74d5869f3cc26b761ba94b871502e07d7..3256645d9f8abdbab783a379ab40576570326fd5 100644 --- a/example_cfood.py +++ b/example_cfood.py @@ -36,12 +36,15 @@ except ImportError: class ExampleCFood(AbstractFileCFood): @classmethod def get_re(cls): - # matches for example `data/2010_TestProject/2019-02-03/README.md` + # matches for example `data/2010_TestProject/2019-02-03/result.yml` # The following groups are created (values for the above example): # - project_identifier: 2010_TestProject # - project_year: 2010 # - project_name: TestProject # - date: 2019-02-03 + # + # Note that the project is not used in the following example (see + # excercise in the README.md). return (r".*/(?P<project_identifier>" r"(?P<project_year>\d{4})_?(?P<project_name>((?!/).)*))/"