https://github.com/anenadic/extract-exercises
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 1 committers (100.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (5.4%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: anenadic
- License: mit
- Language: Python
- Default Branch: main
- Size: 18.6 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
extract-exercises
Python code provided by Toby Hodges from The Carpentries ⭐ (and slightly modified by myself) to extract exercises for lessons in the Carpentries Workbench format from episode text.
The code writes the result to stdout.
Original code by Toby:
```python from sys import argv, stdout
episode_files = argv[:]
for episode in episode_files: title = '' exercise = False with open(episode, 'r') as infh: for line in infh.readlines(): if line.startswith('title: '): _, title = line.split(': ') stdout.write(f'# {title}') elif line.strip().endswith('::: challenge'): exercise = True else: if line.strip().endswith(':::') or line.strip().endswith('::: solution'): exercise = False elif exercise: stdout.write(line) ```
Execution
Copy the Python script into the episodes folder of the lesson and then run it as:
$ python3 extract_exercises.py *.md > exercises.md
to get one big file with all exercises from all the episodes.
Alternatively, you can write a small bash script like the one below to extract episodes into separate files:
bash
for file in *.md; do
if [ -f "$file" ]; then
echo "Converting $file"
python3 extract_exercises.py $file > exercises-$file
fi
done
Owner
- Name: Aleksandra Nenadic
- Login: anenadic
- Kind: user
- Location: Manchester, UK
- Company: Software Sustainability Institute
- Website: https://github.com/anenadic/professional-cv
- Twitter: aleks_nenadic
- Repositories: 108
- Profile: https://github.com/anenadic
GitHub Events
Total
- Watch event: 1
- Push event: 5
Last Year
- Watch event: 1
- Push event: 5
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Aleksandra Nenadic | a****c@m****k | 13 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0