Package: minet
minetis a webmining command line tool & library for python (>= 3.7) that can be used to collect and extract data from a large variety of web sources such as raw webpages, Facebook, CrowdTangle, YouTube, Twitter, Media Cloud etc.It adopts a very simple approach to various webmining problems by letting you perform a wide array of tasks from the comfort of the command line. No database needed: raw CSV files should be sufficient to do most of the work.In addition,minetalso exposes its high-level programmatic interface as a python library so you remain free to use its utilities to suit your use-cases better.minetis developed bymédialab SciencesPoresearch engineers and is the consolidation of more than a decade of webmining practices targeted at social sciences.As such, it has been designed to be:low-tech, as it requires minimal resources such as memory, CPUs or hard drive space and should be able to work on any low-cost PC.fault-tolerant, as it is able to recover when network is bad and retry HTTP calls when suitable. What's more, most of minet commands can be resumed if aborted and are designed to run for a long time (think days or months) without leaking memory.unix-compliant, as it can be piped easily and know how to work with the usual streams.Shortcuts:Command line documentation,Python library documentation.How to cite?minetis published onZenodoas10.5281/zenodo.4564399.You can cite it thusly:Guillaume Plique, Pauline Breteau, Jules Farjas, Héloïse Théro, Jean Descamps, Amélie Pellé, Laura Miguel, & César Pichon. (2019, October 14). Minet, a webmining CLI tool & library for python. Zenodo.http://doi.org/10.5281/zenodo.4564399Whirlwind tour# Downloading large amount of urls as fast as possibleminetfetchurl-iurls.csv>report.csv# Extracting raw text from the downloaded HTML filesminetextract-ireport.csv-Idownloaded>extracted.csv# Scraping the urls found in the downloaded HTML filesminetscrapeurls-ireport.csv-Idownloaded>scraped_urls.csv# Parsing & normalizing the scraped urlsmineturl-parsescraped_url-iscraped_urls.csv>parsed_urls.csv# Scraping data from Twitterminettwitterscrapetweets"from:medialab_ScPo">tweets.csv# Printing a command's helpminettwitterscrape-h# Searching videos on YouTubeminetyoutubesearch-k"MY-YT-API-KEY""médialab">videos.csvSummaryWhat it doesDocumented use casesFeatures (from a technical standpoint)InstallationUpgradingUninstallationDocumentationContributingWhat it doesMinet can single-handedly:Extract URLs from a text file (or a table)Parse URLs (get useful information, with Facebook- and Youtube-specific stuff)Join two CSV files by matching the columns containing URLsFrom a list of URLs, resolve their redirections...and check their HTTP status...and download the HTML...and extract hyperlinks...and extract the text content and other metadata (title...)...and scrape structured data (using a declarative language to define your heuristics)Crawl (using a declarative language to define a browsing behavior, and what to harvest)Mine or search:Buzzsumo(requires API access)Crowdtangle(requires API access)Mediacloud(requires free API access)Twitter(requires free API access)WikipediaYoutube(requires free API access)Scrape (without requiring special access, often just a user account):FacebookInstagramTelegramTikTokTwitterGoogle Drive(spreadsheets etc.)Grab & dump cookies from your browserDumpHyphedataDocumented use casesFetching a large amount of urlsJoining 2 CSV files by urlsUsing minet from a Jupyter notebook(very useful to experiment with the tool or teach students)Downloading images associated with a given hashtag on TwitterScraping DSL TutorialFeatures (from a technical standpoint)Multithreaded, memory-efficient fetching from the web.Multithreaded, scalable crawling.Multiprocessed raw text content extraction from HTML pages.Multiprocessed scraping from HTML pages.URL-related heuristics utilities such as extraction, normalization and matching.Data collection from various APIs such asCrowdTangle.Installationminetcan be installed as a standalone CLI tool (currently only on mac >= 10.14, ubuntu & similar) by running the following command in your terminal:curl-sSLhttps://raw.githubusercontent.com/medialab/minet/master/scripts/install.sh|bashDon't trust us enough to pipe the result of a HTTP request intobash? We wouldn't either, so feel free to read the installation scripthereand run it on your end if you prefer.On ubuntu & similar you might need to installcurlandunzipbefore running the installation script if you don't already have it:sudoapt-getinstallcurlunzipElse,minetcan be installed directly as a python CLI tool and library using pip:pipinstallminetFinally if you want to install the standalone binaries by yourself (even for windows) you can find them in each releasehere.UpgradingTo upgrade the standalone version, simply run the install script once again:curl-sSLhttps://raw.githubusercontent.com/medialab/minet/master/scripts/install.sh|bashTo upgrade the python version you can use pip thusly:pipinstall-UminetUninstallationTo uninstall the standalone version:curl-sSLhttps://raw.githubusercontent.com/medialab/minet/master/scripts/uninstall.sh|bashTo uninstall the python version:pipuninstallminetDocumentationminet as a command line toolminet as a python libraryContributingTo contribute tominetyou can check outthisdocumentation.