{"id":19239190,"url":"https://github.com/atomotic/bni","last_synced_at":"2026-06-23T09:31:44.951Z","repository":{"id":248367645,"uuid":"828501527","full_name":"atomotic/bni","owner":"atomotic","description":"BNI – Bibliografia Nazionale Italiana ","archived":false,"fork":false,"pushed_at":"2024-07-14T19:22:50.000Z","size":56650,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T14:17:48.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomotic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-14T10:50:56.000Z","updated_at":"2024-07-14T19:22:53.000Z","dependencies_parsed_at":"2024-11-09T16:54:05.289Z","dependency_job_id":null,"html_url":"https://github.com/atomotic/bni","commit_stats":null,"previous_names":["atomotic/bni"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atomotic/bni","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomotic%2Fbni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomotic%2Fbni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomotic%2Fbni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomotic%2Fbni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomotic","download_url":"https://codeload.github.com/atomotic/bni/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomotic%2Fbni/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34684673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T16:37:50.657Z","updated_at":"2026-06-23T09:31:44.934Z","avatar_url":"https://github.com/atomotic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BNI – Bibliografia Nazionale Italiana\n\nDownload Unimarc XML files from [BNIweb](http://bni.bncf.firenze.sbn.it/bniweb/menu.jsp) and convert to Parquet with Duckdb.\n\nThe Parquet dump is available here https://atomotic.github.io/bni/bni.parquet (70M) and can be used with\n[DuckDB Shell](https://shell.duckdb.org/#queries=v0,select-id%2Cisbn%2Ctitle-from-'https%3A%2F%2Fatomotic.github.io%2Fbni%2Fbni.parquet'-where-title-like-'%25esoteri%25'-limit-20~)\n\n## Steps\n\nThe following steps are available inside the [Justfile](https://github.com/casey/just)\n\nScrape all XML urls (tools needed: [pup](https://github.com/ericchiang/pup) and [sd](https://github.com/chmln/sd))\n\n```bash\ncurl -s \"http://bni.bncf.firenze.sbn.it/bniweb/menu.jsp\" \\\n    | pup 'a attr{href}' \\\n    | grep elenco_fasc \\\n    | sd \"\u0026amp;\" \"\u0026\" \\\n    | sd \"elenco_fasc\" \"scaricaxml\" \\\n    \u003e links.txt\n```\n\nDownload all XML files (tool needed: [wcurl](https://github.com/Debian/wcurl))\n\n```bash\nparallel wcurl --curl-options=\"--remote-header-name\" \"http://bni.bncf.firenze.sbn.it/bniweb/{}\" :::: links.txt\nmkdir xml\nmove *.xml xml/\n```\n\nLoad all XML files to DuckDB (tools needed: [Go](https://golang.org) and [gnu parallel](https://www.gnu.org/software/parallel/))\n\n```bash\ngo build\nparallel -j1 ./bni {} ::: xml/*.xml\n```\n\nExport from DuckDB to Parquet\n\n```\nduckdb bni.ddb \"copy bni to bni.parquet (format parquet);\"\n```\n\nSize comparison\n\n```\ndu -h bni.ddb bni.parquet\n1.2G    bni.ddb\n67M     bni.parquet\n```\n\n## Example query\n\n```\nduckdb\n```\n\nThe schema: `data` contains the full Unimarc record converted to JSON\n\n```\nDESCRIBE SELECT * FROM 'https://atomotic.github.io/bni/bni.parquet';\n┌─────────────┬─────────────┬─────────┬─────────┬─────────┬─────────┐\n│ column_name │ column_type │  null   │   key   │ default │  extra  │\n│   varchar   │   varchar   │ varchar │ varchar │ varchar │ varchar │\n├─────────────┼─────────────┼─────────┼─────────┼─────────┼─────────┤\n│ id          │ VARCHAR     │ YES     │         │         │         │\n│ isbn        │ VARCHAR     │ YES     │         │         │         │\n│ title       │ VARCHAR     │ YES     │         │         │         │\n│ data        │ VARCHAR     │ YES     │         │         │         │\n│ source      │ VARCHAR     │ YES     │         │         │         │\n└─────────────┴─────────────┴─────────┴─────────┴─────────┴─────────┘\n```\n\n```\nD .mode line\nD SELECT id,title,isbn,source FROM 'https://atomotic.github.io/bni/bni.parquet' WHERE title LIKE '%biblioteco%' LIMIT 5;\n\n    id = USM1959877\n title = Biblioteche e biblioteconomia\n  isbn = 9788843075294\nsource = xml/Monografie201503.xml\n\n    id = PAV0095007\n title = I fondamenti della biblioteconomia\n  isbn = 9788870758474\nsource = xml/Monografie201601.xml\n\n    id = SBT0014568\n title = Conferimento della laurea magistrale ad honorem in scienze archivistiche e biblioteconomiche a Michele Casalini\n  isbn = 9788864538822\nsource = xml/Monografie201904.xml\n\n    id = MOD1738924\n title = Guida alla biblioteconomia moderna\n  isbn = 9788893574013\nsource = xml/Monografie202204.xml\n\n    id = SBT0045209\n title = Principi, approcci e applicazioni della biblioteconomia comparata\n  isbn = 9788855186063\nsource = xml/Monografie202301.xml\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomotic%2Fbni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomotic%2Fbni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomotic%2Fbni/lists"}