# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['etherpump', 'etherpump.api', 'etherpump.commands']

package_data = \
{'': ['*'], 'etherpump': ['data/templates/*']}

install_requires = \
['asks>=2.4.10,<3.0.0',
 'html5lib>=1.1,<2.0',
 'jinja2>=2.11.2,<3.0.0',
 'pypandoc>=1.5,<2.0',
 'python-dateutil>=2.8.1,<3.0.0',
 'requests>=2.24.0,<3.0.0',
 'trio>=0.17.0,<0.18.0']

entry_points = \
{'console_scripts': ['etherpump = etherpump:main']}

setup_kwargs = {
    'name': 'etherpump',
    'version': '0.0.20',
    'description': 'Pumping text from etherpads into publications',
    'long_description': '# etherpump\n\n[![PyPI version](https://badge.fury.io/py/etherpump.svg)](https://badge.fury.io/py/etherpump)\n[![GPL license](https://img.shields.io/badge/license-GPL-brightgreen.svg)](https://git.vvvvvvaria.org/varia/etherpump/src/branch/master/LICENSE.txt)\n\n_Pumping text from etherpads into publications_\n\nA command-line utility that extends the multi writing and publishing functionalities of the [etherpad](http://etherpad.org/) by exporting the pads in multiple formats.\n\n## Many pads, many networks\n\n_Etherpump_ is a friendly fork of [_etherdump_](https://gitlab.constantvzw.org/aa/etherdump), a command line tool written by [Michael Murtaugh](http://automatist.org/) that converts etherpad pages to files. This fork is made out of curiosities in the tool, a wish to study it and shared sparks of enthusiasm to use it in different situations within Varia.\n\nEtherpump is a stretched version of etherdump. It is a playground in which we would like to add features to the initial tool that diffuse actions of _dumping_ into _pumping_. So most of all, etherpump is a work-in-progress, exploring potential uses of etherpads to edit, structure and publish various types of content.\n\nAdded features are:\n\n- opt-in publishing with the `__PUBLISH__` magic word\n- the `publication` command, that listens to custom magic words such as `__RELEARN__`\n\nSee the [Change log / notes ](#change-log--notes) section for further changes.\n\nEtherpump is a tool that is used from the command line. It pumps all pads of one etherpad installation to a folder, saving them as different text files, such as plain text and HTML. It also creates an index file, that allows one to easily navigate through the list of pads. Etherpump follows a document-driven idea of publishing, which means that it converts pads as database entries into pads as files. This seems to be a redundant act of copying, but is actually an important in-between step that allows for many different publishing projects and experiments.\n\nWe started to get to know etherpump through various editions of Relearn and/or the worksessions organized by Constant. Collaborative writing on an etherpad has been an important ingredient for these situations. The habit of using pads branched into the day-to-day practice of Varia, where we use etherpads for all sorts of things, ranging from organising remote-meetings with 10+ people, to writing and designing PDF documents collaboratively.\n\nAfter installing etherpump on the Varia server, we collectively decided to not want to publish pads by default. Discussions in the group around the use of etherpads, privacy and ideas of what publishing means, led to a need to have etherpump only start the indexing work after it recognizes a `__PUBLISH__` marker on a pad. We decided to work on a `__PUBLISH__ vs. __NOPUBLISH__` branch of etherdump, which we now fork into **etherpump**.\n\n# Change log / notes\n\n**December 2020**\n\nAdded the `--magicwords` flag. Parsing and indexing of magic words is now\nsupported. See [etherpump.vvvvvvaria.org](https://etherpump.vvvvvvaria.org) for\nmore. This is still a work in progress.\n\nChange `--connection` default setting to 50 to avoid overpowering modestly\npowered servers.\n\n**November 2020**\n\nReleasing Etherpump 0.0.18!\n\nHandled a bug that saved the same HTML content in multiple files. Disclaimer: resolved in a hacky way.\n\n---\n\n**October 2020**\n\nUse the more friendly packaging tool [Poetry](https://python-poetry.org/) for publishing.\n\nFurther performance tweaks, informative logging and miscellaneous bug fixing.\n\nDecolonize our Git praxis and use the `main` branch.\n\n---\n\n**January 2020**\n\nAdded experimental [trio](trio.readthedocs.io) and\n[asks](https://asks.readthedocs.io/en/latest/index.html) support for the `pull`\ncommand which enables pads to be processed concurrently. The default\n`--connection` option is set to 20 which may overpower the target server. If in\ndoubt, set this to a lower number (like 5). This functionality is experimental,\nbe cautious and please report bugs!\n\nRemoved fancy progress bars for pulling because concurrent processing makes\nthat hard to track. For now, we simply output whichever padid we\'re finished\nwith.\n\n---\n\n**October 2019**\n\nImprove `etherpump --help` handling to make it easier for new users.\n\nAdded the `python-dateutil` and `pypandoc` dependencies\n\nAdded a fancy progress bar with `tqdm` for long running `etherpump pull --all` calls\n\nStarted with the [experimental library API](#library-api-example).\n\n---\n\n**September 2019**\n\nForking _etherpump_ into _etherpump_.\n\n<https://git.vvvvvvaria.org/varia/etherpump>\n\nMigrating the source code to Python 3.\n\nIntegrate PyPi publishing with setuptools.\n\n---\n\n**May - September 2019**\n\netherpump is used to produce the _Ruminating Relearn_ section of the Network Of One\'s Own 2 (NOOO2) publication.\n\nA new command is added to make a web publication, based on the custom magic word `__RELEARN__`.\n\n---\n\n**June 2019**\n\nMultiple conversations around etherpump emerged during Relearn Curved in Varia, Rotterdam.\n\nIncluding the idea of executable pads (_etherhooks_), custom magic words, a federated snippet protocol (_etherstekje_) and more.\n\n<https://varia.zone/relearn-2019.html>\n\n---\n\n**April 2019**\n\nInstallation of etherpump on the Varia server.\n\n<https://etherpump.vvvvvvaria.org/>\n\n---\n\n**March 2019**\n\nThe `__PUBLISH__ vs. __NOPUBLISH__` was added to the etherpump repository by _decentral1se_.\n\n<https://gitlab.constantvzw.org/aa/etherpump/issues/3>\n\n---\n\nOriginally designed for use at: [Constant](http://etherdump.constantvzw.org/).\n\nMore notes can be found in the [git repository of etherdump](https://gitlab.constantvzw.org/aa/etherdump).\n\n# Install etherpump\n\n`$ pip install etherpump`\n\nEtherpump only supports Python >= 3.6.\n\n## Command-line example\n\n```\n$ mkdir mydump\n$ cd myddump\n$ etherpump init\n```\n\nThe program then interactively asks some questions:\n\n> Please type the URL of the etherpad (e.g. https://pad.vvvvvvaria.org):\n>\n> https://pad.vvvvvvaria.org/\n\nThe APIKEY is the contents of the file APIKEY.txt in the etherpad folder.\n\n> Please paste the APIKEY:\n>\n> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\nThe settings are placed in a file called `.etherpump/settings.json` and are used (by default) by future commands.\n\n## Common Workflows\n\n### Text+Meta performance wrangling\n\nIf you have a lot of pads, you might want to try the following to speed things\nup. This example is something we do at Varia. Firstly, you download all the\npads text + metadata as the only formats. This is likely what you want when\nyou\'re trying to work directly with the text. You can do that like so:\n\n```bash\n$ etherpump pull --text --meta --publish-opt-in\n```\n\nThe key here is to get the `--meta` so that etherpump is able to read quickly\nskip it on the following run if there are no new revisions. So, in practice,\nyou get a slower first run and faster following runs as more pads are skipped\nfrom actually doing a file system write to save the contents which we already\nhave.\n\n## Library API Example\n\nEtherpump can be used as a library.\n\nAll commands can be imported and run programmatically.\n\n```python\n>>> from etherpump.api import pull\n>>> pull([\'--text\', \'--meta\', \'--publish-opt-in\'])\n```\n\nThere is also a Magic Word interface. It supports the following API:\n\n> magic_word(word, fresh)\n\n- **word**: The magic word to match pad text against (e.g. `__PUB_CLUB__`)\n- **fresh** (default: `True`): Whether or not run a `etherpump pull` each time\n\nHere is an example:\n\n```python\nfrom etherpump.api import magic_word\n\n@magic_word("__PUB_CLUB__", fresh=False)\ndef pub_club_texts(pads):\n    for name in pads:\n        print(pads[name]["txt"])\n\n\npub_club_texts()\n```\n\n`pads` is a dictionary which contains pad names as keys and pad text as values.\nNormally, the `fresh=False` is useful when you\'re hacking away and want to read\npad contents from the local file system and not over the network each time.\n\n## Subcommands\n\nTo see all available subcommands, run:\n\n`$ etherpump --help`\n\nFor help on each individual subcommand, run:\n\n`$ etherpump revisionscount --help`\n\n## Publishing\n\nPlease use ["semver"](https://semver.org/) conventions for versions.\n\nHere are the steps to follow (e.g. for a `0.1.3` release):\n\n- Change the version number in the `etherpump/__init__.py` `__VERSION__` to `0.1.3`\n- Change the version number in the `pyproject.toml` `version` field to `0.1.3`\n- `git add . && git commit -m "Publish new 0.1.3 version" && git tag 0.1.3 && git push --tags`\n- Run `poetry publish --build`\n\nYou should have a [PyPi](https://pypi.org/) account and be added as an owner/maintainer on the [etherpump package](https://pypi.org/project/etherpump/).\n\n## Testing\n\nIt can be quite handy to run a very temporary local Etherpad instance to test against. This is possible with [Docker](https://docs.docker.com/get-docker/).\n\n```bash\n$ docker run -d --name etherpad -p 9001:9001 etherpad/etherpad\n$ docker exec -ti etherpad cat APIKEY.txt;echo\n```\n\nThen you can `etherpump init` to that local Etherpad for experimentation and testing. You use `http://localhost:9001` as the pad URL.\n\nLater on, you can remove the Etherpad with:\n\n```bash\n$ docker rm -f --volumes etherpad\n```\n\n## Maintenance utilities\n\nTools to help things stay tidy over time.\n\n```bash\n$ make\n```\n\nPlease see the following links for further reading:\n\n- [flake8](http://flake8.pycqa.org)\n- [isort](https://isort.readthedocs.io)\n- [black](https://black.readthedocs.io)\n\n### Server Systers Situation\n\n```\n$ sudo -su systers\n$ cd /var/www/etherpump\n$ sh cron.sh\n```\n\nServed from `/etc/nginx/sites-enabled/etherpump.vvvvvvaria.conf`.\n\n## Keeping track of Etherpad-lite\n\n- [Etherpad-lite API documentation](https://etherpad.org/doc/v1.7.5/)\n- [Etherpad-lite releases](https://github.com/ether/etherpad-lite/releases)\n\n# License\n\nGNU AFFERO GENERAL PUBLIC LICENSE, Version 3.\n\nSee [LICENSE](./LICENSE).\n',
    'author': 'Varia, Center for Everyday Technology',
    'author_email': None,
    'maintainer': 'Varia, Center for Everyday Technology',
    'maintainer_email': 'info@varia.zone',
    'url': 'https://git.vvvvvvaria.org/varia/etherpump',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
