Syed Ahmer ShahSyed Ahmer ShahSyed Ahmer ShahSyed Ahmer ShahSyed Ahmer Shah — home
  1. …
  2. Engineering Logs
  3. The Engineering Logs
  4. A Library That Fits on a USB Stick
Part 22 of 23

A Library That Fits on a USB Stick

Why the hardest part of taking Wikipedia offline isn't the copying, and what packing a suitcase has to do with it

Written by

Syed Ahmer Shah

Software Engineer

Nov 2, 20266 min read1,361 words—reading now▼
The OfflineShelf emblem beside an HTML bundle opened from a USB stick, with the Polio vaccine article, under the title A library that fits on a USB stick
Read this articlevoice
Markdown

Imagine a school with a computer lab and no internet. The machines work. The students are curious. But every time a question comes up, like how vaccines work, why rivers flood or who drew the first map of the world, the answer is one click away on a network that isn't there.

Now imagine a teacher walks in with a USB stick. They plug it into each computer, and a few minutes later every student can open thousands of Wikipedia articles, search them and follow the links between them. No connection, no data bill, no waiting.

That isn't science fiction. It already happens, thanks to an open-source project called Kiwix, which reads Wikipedia from a single file on a phone, a laptop or a small box that acts as a local hotspot. I spent the end of October building OfflineShelf, a tool for one small step in that story: deciding what goes on the stick.


#The suitcase problem

The whole of English Wikipedia, with pictures, is a download of roughly a hundred gigabytes. That's more than most old phones and cheap laptops can hold, and much more than a school needs. A nursing course doesn't need every football season since 1888. A geography class doesn't need every pop single.

So someone has to choose, the way you choose what goes into a suitcase. You can't take the whole wardrobe, so you pack for the trip you're actually taking.

Choosing well is harder than it sounds. Wikipedia has millions of articles in English alone. Nobody is going to pick a few thousand of them by hand, one by one, and then do it all again next year.

#Four ways to pack

OfflineShelf gives you four ways to describe what you want, because people think about lists in different ways.

By topic. Wikipedia already sorts its articles into categories, like "Vaccines" or "Rivers of Pakistan", and categories hold smaller categories inside them. You pick a category and how deep to go, the way you might say "the whole biology shelf, including the smaller sections inside it".

By facts. Wikipedia has a sister project called Wikidata, which stores facts in a form a computer can search: this is a university, it's in Pakistan, it was founded in this year. You can ask it a precise question, like every university in Pakistan, and OfflineShelf turns each answer into the matching article.

By a list you already have. A teacher's reading list, a syllabus, a list from a ministry. You paste it in, and OfflineShelf finds each article, follows old names to their current pages, and tells you which ones it couldn't find instead of quietly skipping them.

By what people actually read. The most-read articles of a given month. It's a surprisingly good starting point for a general library, because it reflects what people really look things up.

The five steps every list goes through in OfflineShelf: describe, queue, fetch, version and export
The five steps every list goes through in OfflineShelf: describe, queue, fetch, version and export

#Lists that add and subtract

Real requests are rarely one simple topic. A clinic might want everything about vaccines, but not the articles about the companies that make them. A science teacher might want physics and chemistry together.

So lists can be combined, the way you might have drawn overlapping circles in a maths class. Everything in either list. Only what's in both. Everything in the first one, minus anything in the second. "Vaccines minus Companies" is a real list you can make.

Union, intersection and difference drawn as overlapping circles
Union, intersection and difference drawn as overlapping circles

#Wikipedia doesn't stand still

Here's the part I didn't fully appreciate until I started building. Wikipedia is edited all the time. Articles are merged, renamed, split in two, deleted, and new ones appear every day. A list that was right in March can be quietly different by June.

So OfflineShelf can rebuild a list every month, and each time it keeps a note of exactly what changed: these articles are new, these ones are gone. If you're the person preparing the USB stick, that note is what tells you whether it's worth updating.

There's one more promise behind that. If a rebuild goes wrong, because Wikipedia's servers were busy or a category was renamed halfway through, the old list stays exactly as it was. It's like not throwing away last year's textbook until the new one has actually arrived.

Also readThe Discount That Knew You Were Hesitating: Rule-Based Personalisation in an Online Pharmacy
One Seat, Two Buyers: Race Conditions, IDOR and Keys in a Cinema Booking System

#Carrying it out of the room

A list on a website doesn't help a classroom. It has to leave the browser in a form that works offline, so there are three ways out:

  • A spreadsheet file, a simple list of titles that opens anywhere and works with other tools, including the ones the Kiwix project uses itself.
  • A folder of web pages, zipped. Unzip it onto a USB stick, open the first page, and every article on the list opens in any web browser, with links between them that work offline.
  • A single file for Kiwix, the format the Kiwix apps read, with search built in.
The three export formats side by side: a spreadsheet file, a bundle of web pages and a ZIM file for Kiwix
The three export formats side by side: a spreadsheet file, a bundle of web pages and a ZIM file for Kiwix

I want to be honest about one limit. For now, the offline copies carry the text but not the pictures. Pictures are linked rather than copied, so they appear when a device happens to be online and are missing when it isn't. Adding them, while keeping the files small enough to be useful, is one of the first things on the list after launch.

#Saying thank you properly

Every Wikipedia article was written by volunteers. Their work is shared under a licence called CC BY-SA, which in plain words says: you can copy this, change it and share it, as long as you say who made it and let others share your version the same way.

That's a generous deal, and it's easy to break by accident. An offline copy that strips out the credits is exactly that. So every page OfflineShelf exports ends with where it came from: the article, the exact version of it, the licence and a link to everyone who edited it. Every bundle has a page that explains this, and the spreadsheet file carries it in its first lines.

#Being a polite visitor

Wikipedia is run by a non-profit and paid for by donations. Its servers have rules for tools like mine, and the most important one is simple: don't be greedy.

OfflineShelf introduces itself by name, with a way to contact me, every time it asks Wikipedia for something. And it asks Wikipedia to tell it when the servers are under strain. When they are, it waits and tries again later. I watched that happen once while testing: Wikidata was busy, OfflineShelf stepped back, and a few minutes later the list built as if nothing had happened.

It's a small thing. But a tool that hammers a volunteer-funded website gets blocked, and then it stops working for every school that relies on it.


#What it taught me

Three ideas stayed with me after building this, and they apply far beyond Wikipedia.

Choosing is the real work. Copying information is cheap now. Deciding which information matters for a particular group of people, and being able to explain and repeat that decision, is where the value is.

Keep the old version until the new one is proven. Whether it's a reading list, a price list or a timetable, a half-finished update is worse than no update at all.

Give credit as part of the product, not as a footnote. If something is built on other people's work, the credit should travel with it automatically, so nobody has to remember to add it.

OfflineShelf is open source, and the public version goes live in February 2027, after a round of testing with many simulated users at once. If you work with a school, a library or a clinic that could use it, I'd genuinely like to hear what your list would look like.

The full build, with the architecture, the tests and the mistakes I made along the way, is in the OfflineShelf case study.

Find me across the web.

Same person, every platform

Work & code

  • ASPortfolioahmershah.dev
  • LinkedInin/syedahmershah
  • GitHub@ahmershahdev
  • AWSAWS Builder Center@syedahmershah
  • Crunchbasesyed-ahmer-shah
  • LinkedIn · Companycompany/syedahmershah

Writing

  • Dev.tosyedahmershah
  • Medium@syedahmershah
  • Hashnode@syedahmershah
  • Substack@syedahmershah
  • HackerNoonu/syedahmershah
  • CLCoderLegionuser/syedahmershah

Reviews & listings

  • Google Knowledge PanelSyed Ahmer Shah
  • Google Business Profileg.page
  • ClClutch
  • TpTrustpilot
  • DRDesignRush
  • TBTechBehemoths

Social

  • YouTube@ahmershahdev
  • Instagram@ahmershahdev
  • TikTok@ahmershahdev
  • Facebookahmershahdev
  • X@ahmershahdev
#offlineshelf#wikipedia#offline#education#openknowledge#softwaredesign#engineeringlogs
ShareXLinkedInRedditWhatsApp

← Previous in series

OfflineShelf: Choosing Which Wikipedia Goes Offline

On this page

  • The suitcase problem
  • Four ways to pack
  • Lists that add and subtract
  • Wikipedia doesn't stand still
  • Carrying it out of the room
  • Saying thank you properly
  • Being a polite visitor
  • What it taught me

The Engineering Logs

  1. 01The Edge Latency Lie: Solving Global Consistency
  2. 02Top 10 AI Tools Every Frontend Developer Should Know (2026 Guide)
  3. 03Change One Number. Take Everything.
  4. 04How Databases Work: From Tables to Query Execution
  5. 05The New Era of Software Engineering
  6. 06The Art of Object-Oriented Programming
  7. 07GleanGrid: Building a Pre-Order Marketplace for Farmers Markets
  8. 08The Last Mango Problem: Race Conditions in a Real Marketplace
  9. 09BookMyMovie: Building a Cinema Ticketing Platform
  10. 10One Seat, Two Buyers: Race Conditions, IDOR and Keys in a Cinema Booking System
  11. 11Zovita+: Building an Online Pharmacy That Adapts to Each Shopper
  12. 12The Discount That Knew You Were Hesitating: Rule-Based Personalisation in an Online Pharmacy
  13. 13RAG Retrieval Strategies on a 50k-Document Dataset: BM25 vs Dense vs Hybrid
  14. 14Inside the Database Stack
  15. 15HolidayOps: Building a Working Days API for 250 Countries
  16. 16The Weekend Is Not a Constant
  17. 17MarketClock: A Trading Calendar That Shows Its Work
  18. 17Cybersecurity Trends: Protecting Data in the Digital Age
  19. 18The Day the Money Moves
  20. 19AIT: Building a University Admissions Portal From Scratch
  21. 20I Invented 14 People to Break My University Website
  22. 21OfflineShelf: Choosing Which Wikipedia Goes Offline
  23. 22A Library That Fits on a USB Stick

Up next

Keep reading.

All 61 articles→
  1. 01

    OfflineShelf: Choosing Which Wikipedia Goes Offline

    How I built OfflineShelf on my own: a Flask and React app that helps schools, libraries and clinics without reliable internet choose which Wikipedia articles to carry offline, keep that choice up to date, and export it for a USB stick or the Kiwix apps.

    Nov 2, 202611 minThe Engineering Logs

  2. 02

    The Day the Money Moves

    When you buy a share, you don't own it the moment you click. A plain-language story of trade settlement, T+1 and T+2, why holidays in two countries can push a payment back a day, and what building MarketClock taught me about dates that have a history.

    Oct 24, 20264 minThe Engineering Logs

  3. 03

    The Weekend Is Not a Constant

    Why 'is this a working day?' breaks so much software: weekends that differ by country and change over time, holidays that follow the moon, time zones that disagree about today, and the habits that kept my own date logic honest while building HolidayOps.

    Oct 18, 20265 minThe Engineering Logs

  4. 04

    I Invented 14 People to Break My University Website

    A plain-language story about testing a university admissions website with fourteen imaginary people, from a careless applicant to a would-be hacker, and the real bugs they found that I never would have.

    Oct 30, 20267 minThe Engineering Logs

  5. 05

    AIT: Building a University Admissions Portal From Scratch

    How I turned what I learned in my XCL Technologies internship into Ahmer Institute of Technology: a university website with applicant, student, teacher, staff and admin portals, safe file uploads, Docker, and 58 end-to-end tests that found real bugs.

    Oct 30, 20268 minThe Engineering Logs

  6. 06

    RAG Retrieval Strategies on a 50k-Document Dataset: BM25 vs Dense vs Hybrid

    How BM25, dense embeddings and hybrid search (RRF) behave on a 50k-document RAG corpus: working code, honest trade-offs, and when each one actually wins.

    Oct 5, 202611 minThe Engineering Logs

Available for new work · --:--:-- PKT

Have an idea?

sales@ahmershah.dev
Book a call WhatsApp +92 370 4831994

On this site

  • 01About
  • 02Education
  • 03Certificates
  • 04Skills
  • 05Projects
  • 06Experience
  • 07Services
  • 08Testimonials
  • 09Contact

Pages

  • Projects
  • Blog
  • Saved articles
  • RSS
  • Privacy Policy
  • Terms of Service
  • llms.txt

Elsewhere · official profiles

26 links

Professional

Work history, code and credentials.

  • in/syedahmershah
  • company/syedahmershah
  • @ahmershahdev
  • syed-ahmer-shah
  • syed-ahmer-shah
  • u/syedahmershah
  • @syedahmershah
  • AWS@syedahmershah

Coding & credentials

Problem solving, verified badges.

  • u/syedahmershah
  • syedahmershah
  • users/syedahmershah
  • learner/syedahmershah

Google & business

The official listings.

  • Google Business Profileg.page
  • Syed Ahmer Shah
  • syedahmershah
  • Beaconssyedahmershah
  • syedahmershah

Social (@ahmershahdev)

Build logs, clips, threads.

  • @ahmershahdev
  • @ahmershahdev
  • @ahmershahdev
  • ahmershahdev
  • @ahmershahdev
  • @bluesky.ahmershah.dev
  • ahmershahdev

Design

Interfaces and visuals.

  • syedahmershah
  • syedahmershah

Direct

  • sales@ahmershah.dev

    New projects & quotes

  • support@ahmershah.dev

    Support & help

  • syedahmershahofficial@gmail.com

    Personal

  • +92 370 4831994

    Phone · WhatsApp

  • Hyderabad, Sindh, Pakistan

    Remote-first · Asia/Karachi (UTC+5)

Resume ↗
SYED AHMER SHAH

© 2026 Syed Ahmer Shah. All rights reserved.

PrivacyTermsRSS
ahmershah.dev