bookwyrm-social / bookwyrm

Social reading and reviewing, decentralized with ActivityPub
http://joinbookwyrm.com/
Other
2.27k stars 266 forks source link

Add anarchist library connector #1047

Open tofuwabohu opened 3 years ago

tofuwabohu commented 3 years ago

Is your feature request related to a problem? Please describe. It would be cool to get search results from the Anarchist library next to OL and inventaire.

API Here is the calibre plugin which also is in python: https://gitea.multiname.org/ibu/calibre-tal/src/branch/master/theanarchistlibrary_store/theanarchistlibrary_plugin.py An example searchstring would be https://theanarchistlibrary.org/search?fmt=json&page=0&query=Bookchin The results in json contain a field text_qualification, which is book for books (next to article and others), so they can be distinguished from the many other texts over there. Example result (shortened to 1 entry):

[{"page":null,
"author":"John Clark",
"cover_uri":null,
"text_qualification":"book",
"site_id":"en",
"blob_container":0,
"pubdate_iso":"2010-02-01",
"id":1501,"rank":1,
"pubdate_epoch":1265065435,
"uri":"john-clark-municipal-dreams-social-ecological-critique-of-bookchin-s-politics",
"teaser":"",
"full_uri":"https://theanarchistlibrary.org/library/john-clark-municipal-dreams-social-ecological-critique-of-bookchin-s-politics",
"url":"https://theanarchistlibrary.org/library/john-clark-municipal-dreams-social-ecological-critique-of-bookchin-s-politics",
"site_url":"https://theanarchistlibrary.org",
"cover_small_uri":null,
"subtitle":"",
"text_type":"book",
"lang":"en",
"feed_teaser":"<div dir=\"ltr\">\n <p> In the following discussion, Murray Bookchin\u2019s libertarian municipalist politics is analyzed from the perspective of social ecology. This analysis forms part of a much larger critique, in which I attempt to distinguish between social ecology as an evolving dialectical, holistic philosophy, and the increasingly rigid, non-dialectical, dogmatic version of that philosophy promulgated by Bookchin. An authentic social ecology is inspired by a vision of human communities achieving their fulfillment as an integral part of the larger, self-realizing earth community. Eco-communitarian politics, which I would counterpose to Bookchin\u2019s libertarian municipalism, is the project of realizing such a vision in social practice. If social ecology is an attempt to understand the dialectical movement of society within the context of the larger dialectic of society and nature, eco-communitarianism is the project of creating a way of life consonant with that understanding. Setting out from this philosophical and practical perspective, I argue that Bookchin\u2019s politics is not only riddled with theoretical inconsistencies, but also lacks the historical grounding that would make it a reliable guide for an ecological and communitarian practice. <a class=\"footnote\" href=\"#\">[1]</a></p>\n <p> One of my main contentions in this critique is that because of its ideological and dogmatic aspects, Bookchin\u2019s politics remains, to use Hegelian terms, in the sphere of morality rather than reaching the level of the ethical. That its moralism can be compelling I would be the last to deny, since I was strongly influenced by it for a number of years. Nevertheless, it is a form of abstract idealism, and tends to divert the energies of its adherents into an ideological sectarianism, and away from an active and intelligent engagement with the complex, irreducible dimensions of history, culture and psyche. The strongly voluntarist dimension of Bookchin\u2019s political thought should not be surprising. When a politics lacks historical and cultural grounding, and the real stubbornly resists the demands of ideological dogma, the will becomes the final resort. In this respect, Bookchin\u2019s politics is firmly in the tradition of Bakuninist anarchism. </p>\n <div style=\"font-weight:bold\">Democracy, Ecology and Community</div>\n <p> The idea of replacing the state with a system of local political institutions has a long history in anarchist thought. As early as the 1790\u2019s, William Godwin proposed that government should be reduced essentially to a system of local juries and assemblies, which would perform all the functions that could not be carried out voluntarily or enforced informally through public opinion and social pressure. <a class=\"footnote\" href=\"#\">[2]</a> A century later, Elis\u00e9e Reclus presented an extensive history of the forms of popular direct democracy, from the Athenian polis to modern times, and proposed that their principles be embodied in a revolutionary system of communal self-rule. <a class=\"footnote\" href=\"#\">[3]</a> Today, the most uncompromising advocate of this tradition of radical democracy is Murray Bookchin, who has launched an extensive and often inspiring defense of local direct democracy in his theory of libertarian municipalism. <a class=\"footnote\" href=\"#\">[4]</a> Bookchin\u2019s ideas have contributed significantly to the growing revival of interest in communitarian democracy. For many years, he was one of the few thinkers to carry on the tradition of serious theoretical exploration of the possibilities for decentralized, participatory democracy. Perhaps the only comparable recent work has been political theorist Benjamin Barber\u2019s defense of \u201cstrong democracy.\u201d While Barber offers a highly detailed presentation of his position, and often argues for it persuasively, he undercuts the radicality of his proposals by accepting much of the apparatus of the nation-state. <a class=\"footnote\" href=\"#\">[5]</a> Thus, no one in contemporary political theory has presented a more sustained and uncompromising case for the desirability of radical \u201cgrassroots\u201d democracy than has Bookchin. Furthermore, he has been one of the two contemporary theorists of his generation (along with Cornelius Castoriadis) to raise the most important philosophical issues concerning radical democracy. <a class=\"footnote\" href=\"#\">[6]</a> This critique recognizes the importance of Bookchin\u2019s contribution to ecological, communitarian democratic theory and investigates the issues that must be resolved if the liberatory potential in certain aspects of his thought are to be freed from the constraints of sectarian dogma. </p>\n <p> One of the strongest points in Bookchin\u2019s politics is his attempt to ground it in ethics and the philosophy of nature. In viewing politics fundamentally as a sphere of ethics his political theory carries on the Aristotelian tradition. Aristotle saw the pursuit of the good of the polis, the political community, as a branch of ethics, the pursuit of the human good as a whole. He called this ultimate goal for human beings <em>eudaimonia</em>, which is often translated as \u201cthe good life.\u201d Bookchin expands this concept of the larger good even further to encompass the natural world. Beginning with his early work, he has argued that the development of a political ethics implies \u201ca moral community, not simply an \u2018efficient\u2019 one,\u201d \u201can ecological community, not simply a contractual one,\u201d \u201ca social praxis that enhances diversity,\u201d and \u201ca political culture that invites the widest possible participation.\u201d (1968)<a class=\"footnote\" href=\"#\">[7]</a></p>\n <p class=\"amw-teaser-ellipsis\">...</p>\n</div>",
"relevance":100,
"valid_cover":"",
"title":"Municipal Dreams: Social Ecological Critique of Bookchin\u2019s Politics",
"pages_estimated":87}]

I couldn't find any doku on the API at first glance. There are up to 9 results per page, probably one can find how many pages there are in total somehow.

I think the AL doesn't store existing editions but build the ebooks by themselves from the their html, so maybe that interfers a bit with how editions are kept currently.

Additional notes There are some region-specific Anarchist libraries that are independent but look pretty similar so maybe they could be included, I'm not sure on how but it'd be pretty cool to have them too. https://www.anarchistlibraries.net/libraries

mouse-reeve commented 3 years ago

This is an interesting one! I think there are two things that are valuable about this dataset: 1) It has the full text of everything in the index (I think? are there cases where TAL has an entry but not the entire piece?) 2) It has a bunch of material that isn't in other repositories (including a lot of short-form and essays, which is interesting from a metadata perspective)

For works that are available via other connectors, the metadata is comparably poor. Looking at Anarchy in Action, we have multiple editions with covers and identifiers via OL (https://bookwyrm.social/book/106708), whereas TAL provides one edition with much less comprehensive metadata (https://theanarchistlibrary.org/library/colin-ward-anarchy-in-action). In this example, there's an isbn in the "notes" section, but it isn't exposed in the search json and I can't find any way to access it programmatically (it looks like it's part of a free text field, so even if "notes" were available, it wouldn't be viable to find meaningful data in it). This will make it impossible to deduplicate an edition that came in from TAL from the same edition via a different connector.

However, this could related to #97 and #693 in productive ways.

It looks like the search endpoint is usable for both search and for loading metadata. I can search "anarchy in action colin ward" and get a list of works: https://theanarchistlibrary.org/search?query=anarchy+in+action+colin+ward And search by uri to get just the work that's of interest: https://theanarchistlibrary.org/search?query=uri%3Acolin-ward-anarchy-in-action&fmt=json.

One thing that is challenging is that the search is full text, so it's going to produce a lot of results that aren't what you'd expect based on the other connectors. For example, a free text search of "The Lord of the Rings" produces a wholly unrelated set of search results to JRR Tolkien. With the code as it is, this would break goodreads and librarything data imports, so while that's an eminently solvable problem, it it's important to remember to solve it.

Long story short, it's totally doable, and while the metadata will be lacking, it will be an asset to have a resource with full ebook versions. At a quick look, it should be possible to use the same code for any of the different language-specific version of TAL.