27
Library Carpentry Week One: Basics This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Exceptions: logos, embeds to and from external sources and direct quotations

Library Carpentry. Week One: Basics

Embed Size (px)

Citation preview

Page 1: Library Carpentry. Week One: Basics

Library CarpentryWeek One: Basics

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Exceptions: logos, embeds to and from external sources and direct quotations

Page 2: Library Carpentry. Week One: Basics

ScheduleWeek 1: Some BasicsWeek 2: Controlling Data (with the Shell)

Week 3: Versioning Data (with Git)

Week 4: Cleaning Data (with Open Refine)

@j_w_baker

Page 3: Library Carpentry. Week One: Basics

Where to go for helpStickersHelpersSticky notesgithub.com/LibraryCarpentry

@j_w_baker

Page 4: Library Carpentry. Week One: Basics

Final adminSame place, same timeWorksheetsTea, coffee, snacks, foodRoam aroundWifi

@j_w_baker

Page 5: Library Carpentry. Week One: Basics

Week 1: Some Basics18:00-18:45 Jargon Busting18:45-19:30 Foundations19:30-20:15 Regular Expressions

@j_w_baker

Page 6: Library Carpentry. Week One: Basics

Jargon BustingTeams of 5 or 6Write terms you want busting on stickiesCluster (retaining duplicates)Discuss and explainNote resolved termsNote unresolved termsReport back

@j_w_baker

Page 7: Library Carpentry. Week One: Basics

FoundationsThe Computer is StupidWhy automateKeyboard shortcuts are your friendPlain text formats are your friendStructuring files and folders

@j_w_baker

Page 8: Library Carpentry. Week One: Basics

FoundationsThe Computer is Stupid

ERROR

@j_w_baker

Page 9: Library Carpentry. Week One: Basics

FoundationsWhy automate?

Borrow, borrow, borrowThere is no correct languageProfessional developmentKnowing some code ~ evaluating softwareMaking time to do fun stuff!

Andromeda Yelton, "Coding for Librarians: Learning by Example", Library Technology Reports 51:3 (April 2015), doi: 10.5860/ltr.51n3

@j_w_baker

Page 11: Library Carpentry. Week One: Basics

FoundationsKeyboard shortcuts are your friend

Efficiency and control

@j_w_baker

Page 12: Library Carpentry. Week One: Basics

FoundationsPlain text formats are your friend

Computers process them betterPlatform agnosticDisplay orientated files aren't your friendMarkdown

@j_w_baker

Page 13: Library Carpentry. Week One: Basics

FoundationsStructuring files and folders

Consistent and predictable data structureSemantic-data hybrid directory namesYour own system is fineLinks files and directories with names

You are the most likely person to forget what you once did!

@j_w_baker

Page 14: Library Carpentry. Week One: Basics

Regular ExpressionsMatch on types of characterMatch patternsCapture the parts that match your pattern

@j_w_baker

Page 15: Library Carpentry. Week One: Basics

Regular Expressions

organi[sz]eorganise (match)organize (match)reorganise (match part so will also find)reorganize (match part so will also find)

@j_w_baker

Page 16: Library Carpentry. Week One: Basics

Regular Expressions[ABC] matches A or B or C.[A-Z] matches any upper case letter.[A-Za-z0-9] matches any upper or lower

case letter or any digit.

@j_w_baker

Page 17: Library Carpentry. Week One: Basics

Regular Expressions. matches any character at all.\d matches any single digit.\w matches any part of word character.\s matches any space, tab, or newline.\b matches a word boundary.^ defines the start of the string.$ defines the end of the string (starting with ^

and ending with $ will effectively find lines/cells that only

contain your expression).

@j_w_baker

Page 18: Library Carpentry. Week One: Basics

Regular Expressions

^[Oo]rgani.e$

@j_w_baker

Page 19: Library Carpentry. Week One: Basics

Regular Expressions* matches proceeding character any

number of times including zero.+ matches proceeding character any

number of times excluding zero.? matches the proceeding character one

or zero times.{VALUE,VALUE} matches proceeding

character a defined number of times.| simply means or.

@j_w_baker

Page 20: Library Carpentry. Week One: Basics

Regular Expressions

^[Oo]rgani.e\w*

@j_w_baker

Page 21: Library Carpentry. Week One: Basics

Regular Expressions

[Oo]rgani.e\w+$

@j_w_baker

Page 22: Library Carpentry. Week One: Basics

Regular Expressions

^[Oo]rgani.e\w?\b

@j_w_baker

Page 23: Library Carpentry. Week One: Basics

Regular Expressions

\b[Oo]rgani.e\w{2}\b

@j_w_baker

Page 24: Library Carpentry. Week One: Basics

Regular Expressions

\b[Oo]rgani.e\b|\b[Oo]rgani.e\w{1}\b

@j_w_baker

Page 25: Library Carpentry. Week One: Basics

Regular ExpressionsExercise

Teams of 5 or 6Work through handoutSplit into two teams and write:

- strings that need regex- regex that need outputs

Test each other!

@j_w_baker

Page 26: Library Carpentry. Week One: Basics

Next WeekWeek 2: Controlling Data (with the Shell)

You will need a computerSet-up instructions on GithubLog an issue if you have trouble

See you next week!

@j_w_baker

Page 27: Library Carpentry. Week One: Basics

Library CarpentryWeek One: Basics

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Exceptions: logos, embeds to and from external sources and direct quotations

------------------------------------------------------------------------------------------------------------------------------------------------------------