{"id":20822153,"url":"https://github.com/internetarchive/bookserver","last_synced_at":"2025-05-07T16:42:23.710Z","repository":{"id":672247,"uuid":"315649","full_name":"internetarchive/bookserver","owner":"internetarchive","description":"Archive.org OPDS Bookserver - A standard for digital book distribution","archived":false,"fork":false,"pushed_at":"2018-11-01T02:30:00.000Z","size":296,"stargazers_count":126,"open_issues_count":28,"forks_count":16,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-31T12:01:32.609Z","etag":null,"topics":["aldiko","atom-feed","books","opds","simplye"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/internetarchive.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-09-23T19:02:19.000Z","updated_at":"2025-02-17T11:55:48.000Z","dependencies_parsed_at":"2022-08-16T10:40:10.392Z","dependency_job_id":null,"html_url":"https://github.com/internetarchive/bookserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fbookserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fbookserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fbookserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fbookserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/internetarchive","download_url":"https://codeload.github.com/internetarchive/bookserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252916363,"owners_count":21824756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aldiko","atom-feed","books","opds","simplye"],"created_at":"2024-11-17T22:14:05.324Z","updated_at":"2025-05-07T16:42:23.689Z","avatar_url":"https://github.com/internetarchive.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Internet Archive Bookserver\n===========================\n\nThis repository contains the ``bookserver`` package, which is useful for\nworking with OPDS catalog feeds. It also contains the source for the\nhttp://bookserver.archive.org site.\n\nTo create a Catalog instance from scratch, you can use this code:\n\n    \u003e\u003e\u003e from bookserver import catalog\n    \u003e\u003e\u003e urn = 'urn:x-internet-archive:bookserver:catalog'\n    \u003e\u003e\u003e c = catalog.Catalog(title='Internet Archive OPDS', urn=urn)\n\nTo create a link to a free PDF:\n\n    \u003e\u003e\u003e l = catalog.Link(url   = 'http://archive.org/download/itemid/itemid.pdf',\n    ...                  type  = 'application/pdf',\n    ...                  rel   = 'http://opds-spec.org/acquisition')\n\nTo create a link to an html shopping cart that sells drm-ed books:\n\n    \u003e\u003e\u003e l2 = catalog.Link(url   = 'http://archive.org/download/drmbook/shoppingcart',\n    ...                   type  = 'text/html',\n    ...                   rel   = 'http://opds-spec.org/acquisition/buying',\n    ...                   price = '10.00',\n    ...                   currencycode = 'USD',\n    ...                   formats = ('application/pdf;drm=acs', 'application/epub+zip;drm=acs'))\n\nTo create an entry for a book:\n\n    \u003e\u003e\u003e e = catalog.Entry({'urn'     : 'x-internet-archive:item:itemid',\n    ...                    'title'   : u'test item',\n    ...                    'updated' : '2009-01-01T00:00:00Z'}, links=[l])\n    \u003e\u003e\u003e c.addEntry(e)\n\n    \u003e\u003e\u003e e = catalog.Entry({'urn'     : 'x-internet-archive:item:drmbook',\n    ...                    'title'   : u'A book with DRM',\n    ...                    'updated' : '2009-01-01T00:00:00Z'}, links=[l2])\n    \u003e\u003e\u003e c.addEntry(e)\n\nThe catalog.Navigation class can help with creating prev and next rel links,\nalthough you can just pass these in as args to __init__\n\n    \u003e\u003e\u003e start    = 0\n    \u003e\u003e\u003e numFound = 2\n    \u003e\u003e\u003e numRows  = 1\n    \u003e\u003e\u003e urlBase  = '/alpha/a/'\n    \u003e\u003e\u003e n = catalog.Navigation.initWithBaseUrl(start, numRows, numFound, urlBase)\n    \u003e\u003e\u003e c.addNavigation(n)\n\nThe catalog.OpenSearch class just holds OpenSearch Description Document for now:\n    \n    \u003e\u003e\u003e osDescription = 'http://bookserver.archive.org/opensearch.xml'\n    \u003e\u003e\u003e o = catalog.OpenSearch(osDescription)\n    \u003e\u003e\u003e c.addOpenSearch(o)\n\nFrom our Catalog instance, we can now create an OPDS feed in Atom format:\n    \n    \u003e\u003e\u003e r = catalog.output.CatalogToAtom(c)\n    \u003e\u003e\u003e str = r.toString()\n\nDifferent version of lxml will print xmlns differently (use ellipsis in doctest):\n\n    \u003e\u003e\u003e print str.rstrip() #doctest: +ELLIPSIS\n    \u003cfeed ...\n      \u003ctitle\u003eInternet Archive OPDS\u003c/title\u003e\n      \u003cid\u003eurn:x-internet-archive:bookserver:catalog\u003c/id\u003e\n      \u003cupdated\u003e1970-01-01T00:00:00Z\u003c/updated\u003e\n      \u003clink rel=\"self\" type=\"application/atom+xml\" href=\"http://bookserver.archive.org/catalog/\"/\u003e\n      \u003cauthor\u003e\n        \u003cname\u003eInternet Archive\u003c/name\u003e\n        \u003curi\u003ehttp://www.archive.org\u003c/uri\u003e\n      \u003c/author\u003e\n      \u003clink rel=\"search\" type=\"application/opensearchdescription+xml\" href=\"http://bookserver.archive.org/opensearch.xml\"/\u003e\n      \u003clink rel=\"next\" type=\"application/atom+xml\" href=\"/alpha/a/1\" title=\"Next results\"/\u003e\n      \u003centry\u003e\n        \u003ctitle\u003etest item\u003c/title\u003e\n        \u003cid\u003ex-internet-archive:item:itemid\u003c/id\u003e\n        \u003cupdated\u003e2009-01-01T00:00:00Z\u003c/updated\u003e\n        \u003clink href=\"http://archive.org/download/itemid/itemid.pdf\" type=\"application/pdf\" rel=\"http://opds-spec.org/acquisition\"/\u003e\n      \u003c/entry\u003e\n      \u003centry\u003e\n        \u003ctitle\u003eA book with DRM\u003c/title\u003e\n        \u003cid\u003ex-internet-archive:item:drmbook\u003c/id\u003e\n        \u003cupdated\u003e2009-01-01T00:00:00Z\u003c/updated\u003e\n        \u003clink href=\"http://archive.org/download/drmbook/shoppingcart\" type=\"text/html\" rel=\"http://opds-spec.org/acquisition/buying\"\u003e\n          \u003copds:price currencycode=\"USD\"\u003e10.00\u003c/opds:price\u003e\n          \u003cdcterms:hasFormat\u003eapplication/pdf;drm=acs\u003c/dcterms:hasFormat\u003e\n          \u003cdcterms:hasFormat\u003eapplication/epub+zip;drm=acs\u003c/dcterms:hasFormat\u003e\n        \u003c/link\u003e\n      \u003c/entry\u003e\n    \u003c/feed\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternetarchive%2Fbookserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finternetarchive%2Fbookserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternetarchive%2Fbookserver/lists"}