Type and learn drama helper.
Project description
learn-drama
|docs| |pipeline| |coverage|
A Python script and helper classes to learn the drama Faust by heart. Please be aware that this project is still in a pre-alpha phase - compare Goal_ and Usage_.
- Free software: GNU General Public License v3
Contents
- Goal_
- Usage_
- Development_
- Credits_
Goal
.. _goal:
While the project has a version < 0.1.0 the project is in pre-alpha phase and not as useful as projected. This is, what the script should do at minimum:
Version 0.1.0 will have a command line application to learn drama verses. Supported xml file format will be the one of textgridref_/-lab_ (here Faust). The plan is, that the invocation of
.. _textgridref: https://textgridrep.org/ .. _lab: https://textgridlab.org/1.0/tgcrud-public/rest/textgrid:11g9q.0/datae
::
$ learn_drama -f Faust.xml --quiz --verses 1-10
gives the following dialogue:
::
Test of verse 3
1 Habe nun, ach! Philosophie,
2 Juristerei und Medizin
3 ?
Please type the missing verse!
If the user input is
::
Durchaus studiert mit heißem Bemühn.
On the command line one will get a::
Correct!
Usage
.. _usage:
The easiest way to use this script is to install it with the Python Package Index PyPI <https:pypi.org>. For this you have to have pip3 installed. If not, have a look at the Package installation help of python.org <https://packaging.python.org/en/latest/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line>.
Installation
::
pip3 install -U -i https://test.pypi.org/simple/ learn-drama
Get help
~~~~~~~~
.. _gethelp:
| You can find help via the command line with ``--help``.
|
.. image:: docs/res/220118_learn_drama_help.png
Example
~~~~~~~
For example you can type
::
learn_drama --text_input "This is verse1\nThis is verse2" --print_drama
And the expected output is
::
-- Formatted text --
1 This is verse1
2 This is verse2
Remove learn_drama
::
pip3 uninstall learn_drama
Development
.. _development:
To contribute, you should have a look at the tickets in the repository_ to get an overview of what is planned or documented. To be able to make changes you need to clone the code from the repository_. If you can run the program using the source code and get green tests, you can start playing around! To be sure that no python configuration issues exist, in the following steps virtualenv is used. This ensures that packages will be installed isolated to those you have on you dev system to get a unperturbed test.
Repository
.. _repository:
Issue tickets, code (future), milestones are maintained at
::
https://gitlab.com/goethe_faust/learn_drama_
to clone the code use e.g.
::
git clone git@gitlab.com:goethe_faust/learn_drama.git
or follow the instructions of Gitlab.
|
.. image:: docs/res/gitlab_clone.png
Setup
~~~~~
Virtual environment
^^^^^^^^^^^^^^^^^^^
python3 with pip3 is needed (for instruction see usage_). Install virtualenv (as user with ``-U``):
::
pip3 install -U virtualenv
The easiest way to test testing and to get a clean environment for testing
is to run
::
make run-args='--help' run
once. If the output shows the help for using the script, you have a virtual environment. Its configuration and executables are in the (now) created ``venv`` folder. By activating it with
::
source venv/bin/activate
you work in the virtual environment. If you try e.g.
::
python3 main.py
The script runs using the source code in the virtual environment. If you get an output like shown in gethelp_, the script runs in principle.
Run and test
Run Cli
::
python3 main.py
Run the Tests - here you can change tests/ to whatever test you
wish. E.g.
tests/test_learn_drama_console.py::TestConsoleTextFromFile
::
python3 -m pytest tests/
Install package locally and use the package
::
make local-install
If successful, ``learn_drama --help`` is possible. Note: For this you
need ``$HOME/.local/bin`` included in your ``$PATH``. If not, change
``$PATH`` or change the desired directory in setup.py (Please do not
push this).
Upload to test.pypi.org
~~~~~~~~~~~~~~~~~~~~~~~
Change release version and do
::
make test-release-testpypi
Prerequisites
^^^^^^^^^^^^^
::
```
python3 -m pip install --upgrade twine
python3 -m twine upload --repository testpypi dist/*
```
…from
`packaging.python.org <https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives>`__
Code ownership/Maintainer
~~~~~~~~~~~~~~~~~~~~~~~~~
The software will be shipped publicly and shall be open source. However, currently
Stefan Bollmanny is the maintainer.
Credits
-------
.. _credits:
This package was created with
`Cookiecutter <https://github.com/audreyr/cookiecutter>`__ and the
`audreyr/cookiecutter-pypackage <https://github.com/audreyr/cookiecutter-pypackage>`__
project template.
Help was given by `cdesch <https://github.com/cdesch/testingonly>`__, Marijke Viveen, and Steve Wolter.
.. |docs| image:: https://readthedocs.org/projects/docs/badge/?version=latest
:alt: Documentation Status
:scale: 100%
:target: https://learn-drama.readthedocs.io/en/latest/?badge=latest
.. |pipeline| image:: https://gitlab.com/goethe_faust/learn_drama/badges/main/pipeline.svg
:target: https://gitlab.com/goethe_faust/learn_drama/commits/main
:alt: pipeline status
.. |coverage| image:: https://gitlab.com/goethe_faust/learn_drama/badges/4-badges/coverage.svg
:target: https://gitlab.com/goethe_faust/learn_drama/commits/main
:alt: coverage report
History
=======
0.0.1 (2022-01-11)
------------------
- First release on Test.PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file learn_drama-0.0.1a0.tar.gz.
File metadata
- Download URL: learn_drama-0.0.1a0.tar.gz
- Upload date:
- Size: 147.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.26.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ea3ec51597257b243fa46e1e6daf6e9ea6fcfcb7a3915689be19e3a1bd72de8
|
|
| MD5 |
bfd8cdc68468ffa116facf5e0493775f
|
|
| BLAKE2b-256 |
4010703b4532eb14bdc4aff2f2704680c6361902057ebf71dd010046d703da1c
|
File details
Details for the file learn_drama-0.0.1a0-py2.py3-none-any.whl.
File metadata
- Download URL: learn_drama-0.0.1a0-py2.py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.26.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9a5e64b71bab01c9e526d8ca11984718445a7f4e2931609524ccb271fb6d419
|
|
| MD5 |
4d8b41e26867516c6e640ef39bc4ef26
|
|
| BLAKE2b-256 |
e1b66629e8421b3dd7353d37c7d29155bc5e25bbbcc05707aaf2f0cca52d937f
|